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

CN122556077APending Publication Date: 2026-08-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

When the prior art corrects the chromaticity prediction value based on the luminance reconstruction value, it is impossible to obtain a better correction effect, resulting in a decrease in the accuracy of chromaticity prediction and affecting the encoding and decoding performance.

Method used

In the process of determining the model parameters of the inter-component prediction model, the brightness sampling points are filtered based on the residual value of the brightness component of the current block, and when applying the inter-component prediction model, whether to use the brightness prediction sample is determined based on the accuracy of the brightness prediction sample, so as to more accurately reflect the relationship between the brightness prediction sample and the chromaticity prediction sample and improve the accuracy of the chromaticity prediction.

Benefits of technology

Improve the accuracy of chromaticity prediction and further improve the encoding and codec performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122556077A_ABST
    Figure CN122556077A_ABST
Patent Text Reader

Abstract

This application discloses an encoding / decoding method, which includes: determining a prediction reference block for the current block based on the prediction parameters of the current block; determining the reconstructed value of the luminance component of the current block based on the residual value of the luminance component and the luminance prediction reference block; determining a set of model reference luminance sampling points corresponding to the chrominance sampling points in the chrominance prediction reference block; determining the model parameters of the inter-component prediction model based on the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block; determining the set of prediction reference luminance sampling points corresponding to the chrominance sampling points in the chrominance prediction reference block; and determining the predicted value of the chrominance component of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.
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 image processing technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] The Inter Convolutional Cross Component Model (InterCCCM) is used in both inter-prediction and intra-prediction modes. The InterCCCM technique is primarily used to filter the luminance reconstruction values, thereby modifying the chrominance prediction values.

[0003] However, when the related technology corrects the chrominance prediction value based on the luminance reconstruction value, it cannot obtain a good correction effect, which reduces the accuracy of the chrominance prediction and thus affects the encoding and decoding performance.

[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 improve the accuracy of chrominance prediction, 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, applied to a decoder, the method comprising:

[0008] Decoding a bitstream to determine a prediction parameter of a current block and a residual value of a luminance component of the current block;

[0009] Determining a prediction reference block for the current block according to the prediction parameter of the current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, a size of the luma prediction reference block is the same as a size of a luma block of the current block, and a size of the chroma prediction reference block is the same as a size of a chroma block of the current block;

[0010] Determining a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block;

[0011] Determining, according to the chroma sampling points in the chroma prediction reference block, a set of model reference luminance sampling points corresponding to the chroma sampling points;

[0012] Determining model parameters of an inter-component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block;

[0013] Determining, according to the chroma sampling points in the chroma prediction reference block, a set of prediction reference luminance sampling points corresponding to the chroma sampling points;

[0014] Determine a predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the prediction reference luminance sampling point set, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0015] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0016] Determining, based on prediction parameters of a current block, a residual value between a prediction reference block of the current block and a luminance component of the current block, and writing the prediction parameters of the current block and the residual value of the luminance component of the current block into a bitstream; wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block;

[0017] Determining a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block;

[0018] Determining, according to the chroma sampling points in the chroma prediction reference block, a set of model reference luminance sampling points corresponding to the chroma sampling points;

[0019] Determining model parameters of an inter-component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block;

[0020] Determining, according to the chroma sampling points in the chroma prediction reference block, a set of prediction reference luminance sampling points corresponding to the chroma sampling points;

[0021] Determine a predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the prediction reference luminance sampling point set, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0022] In a third aspect, an embodiment of the present application provides 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:

[0023] The prediction parameters of the current block, the residual value of the luminance component of the current block, and the chroma format parameters.

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

[0025] The first determining unit is configured to determine, based on prediction parameters of a current block, a residual value between a prediction reference block of the current block and a luminance component of the current block, and write the prediction parameters of the current block and the residual value of the luminance component of the current block into a bitstream; The prediction reference block includes a luma prediction reference block and a chroma prediction reference block, the size of the luma prediction reference block is the same as the size of the luma block of the current block, and the size of the chroma prediction reference block is the same as the size of the chroma block of the current block; a reconstructed value of the luma component of the current block is determined based on the residual value of the luma component of the current block and the luma prediction reference block; a set of model reference luma sampling points corresponding to the chroma sampling points is determined based on the chroma sampling points in the chroma prediction reference block; model parameters of an inter-component prediction model are determined based on the model reference luma sampling point set, the residual value of the luma component of the current block, and the prediction reference block of the current block; a set of prediction reference luma sampling points corresponding to the chroma sampling points is determined based on the chroma sampling points in the chroma prediction reference block; and a prediction value of the chroma component of the current block is determined based on the model parameters of the inter-component prediction model, the prediction reference luma sampling point set, the residual value of the luma component of the current block, and the reconstructed value of the luma component 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] The first memory is used to store a computer program that can be run on the first processor;

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

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

[0030] The second determining unit is configured to decode the code stream, determine the prediction parameters of the current block and the residual value of the luminance component of the current block; determine the prediction reference block of the current block according to the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; determine the reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; determine the reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; The method comprises the steps of: determining a set of model reference luminance sampling points corresponding to the chroma sampling points of the current block; determining model parameters of an inter-component prediction model according to the set of model reference luminance sampling points, a residual value of the luminance component of the current block, and a prediction reference block of the current block; determining a set of prediction reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block; and determining a prediction value of the chroma component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and a reconstructed value of the luminance component of the current block.

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

[0032] The second memory is used to store a computer program that can be run on the second processor;

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

[0034] In an eighth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed, the method of the first aspect or the second aspect is implemented.

[0035] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. The methods include determining a prediction reference block for a current block based on prediction parameters of a current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, wherein the luma prediction reference block has the same size as the luma block of the current block, and the chroma prediction reference block has the same size as the chroma block of the current block. Determining a reconstructed value of the luma component of the current block based on a residual value of the luma component of the current block and the luma prediction reference block. Determining a set of model reference luma sampling points corresponding to the chroma sampling points based on chroma sampling points in the chroma prediction reference block. Determining model parameters of an inter-component prediction model based on the set of model reference luma sampling points, the residual value of the luma component of the current block, and the prediction reference block of the current block. Determining a set of prediction reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block. Determining a prediction value of the chroma component of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luma sampling points, the residual value of the luma component of the current block, and the reconstructed value of the luma component of the current block. That is to say, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample based on the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a schematic diagram of the common InterCCCM framework;

[0037] Figure 2 is a schematic diagram of the prediction process of InterCCCM technology;

[0038] FIG3 is a first schematic diagram of the positional relationship between luma prediction samples and chroma prediction samples proposed in an embodiment of the present application;

[0039] FIG4 is a second schematic diagram of the positional relationship between luma prediction samples and chroma prediction samples proposed in an embodiment of the present application;

[0040] FIG5 is a third schematic diagram of the positional relationship between luma prediction samples and chroma prediction samples proposed in an embodiment of the present application;

[0041] FIG6 is a first schematic diagram of the positional relationship between luma reconstruction samples and chroma prediction samples proposed in an embodiment of the present application;

[0042] FIG7 is a second schematic diagram of the positional relationship between luma reconstruction samples and chroma prediction samples proposed in an embodiment of the present application;

[0043] FIG8 is a third schematic diagram of the positional relationship between luma reconstruction samples and chroma prediction samples proposed in an embodiment of the present application;

[0044] FIG9 is a schematic block diagram of the composition of an encoder proposed in an embodiment of the present application;

[0045] FIG10 is a schematic block diagram of the composition of a decoder proposed in an embodiment of the present application;

[0046] FIG11 is a schematic diagram of the network architecture of the encoding and decoding system proposed in an embodiment of the present application;

[0047] FIG12 is a schematic diagram of a flow chart of a decoding method proposed in an embodiment of the present application;

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

[0049] FIG14 is a schematic diagram of the first structure of the encoder proposed in an embodiment of the present application;

[0050] FIG15 is a second schematic diagram of the structure of the encoder proposed in an embodiment of the present application;

[0051] FIG16 is a schematic diagram of the first structure of a decoder according to an embodiment of the present application;

[0052] FIG17 is a second schematic diagram of the composition structure of the decoder proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the related applications and are not intended to limit the applications. It should also be noted that for ease of description, only the parts relevant to the related applications are shown in the drawings.

[0054] 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.

[0055] It can be understood that 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. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. 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, a video image can be represented in either the YCbCr format or the YUV format.

[0056] Common video codec standards all use a block-based hybrid coding framework. Each frame is divided into square Largest Coding Units (LCUs) or Coding Tree Units (CTUs) of the same size (e.g., 128×128, 64×64, etc.). Each LCU or CTU can be further divided into rectangular Coding Units (CUs) based on rules. Coding Units may also be further divided into smaller Prediction Units (PUs) and Transform Units (TUs), etc.

[0057] The inter-frame cross-component convolution model InterCCCM is used for inter-frame prediction mode and intra-frame prediction mode. If the current block is encoded using inter-frame prediction or intra-frame prediction (such as Intra Block Copy (IBC) mode) and InterCCCM mode encoding is selected, both the encoder and decoder apply the cross-component convolution model (CCCM) to the block to correct the chrominance samples from the reconstructed luminance samples. The parameters of the cross-component convolution model are derived from the luminance prediction value and the first chrominance prediction value. Using the derived model and the luminance reconstruction value, a second chrominance prediction value is obtained. The second chrominance prediction value is weighted with the first chrominance prediction value to produce a third chrominance prediction value.

[0058] Figure 1 is a schematic diagram of the common InterCCCM framework. As shown in Figure 1, InputData1, InputData2, and InputData3 can be PredY, PredCb, PredCr, PredR, PredG, PredGB, PredX, PredY, PredZ, or other representations in different color spaces. ResData1, ResData2, and ResData3 are the prediction residuals corresponding to InputData1, InputData2, and InputData3. OutputData1, OutputData2, and OutputData3 are the reconstructed values ​​corresponding to InputData1, InputData2, and InputData3.

[0059] In the weighting module (Weighting), the second chroma prediction value (predCbVal for the Cb component and predCrVal for the Cr component) and the first chroma prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) can be weighted at a ratio of 0.75:0.25 to generate a third chroma prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in the following formulas: predSamplesCb′=(3×predCbVal+predSamplesCb+2)>>2 (1) predSamplesCr′=(3×predCrVal+predSamplesCr+2)>>2 (2)

[0060] Among them, the input of InterCCCM can include the luminance prediction value predSamplesY[x][y] of the current block, the luminance reconstruction value recSamplesY[x][y], and the first chrominance prediction value (predSamplesCb[x1][y1] for the Cb component and predSamplesCr[x1][y1] for the Cr component), where x=0..nTbW-1, y=0..nTbH-1, x1=0..nTbWC-1, y1=0..nTbHC-1.

[0061] Among them, the output of InterCCCM can include the final chrominance prediction value of the current block (predSamplesCb′[x][y] for the Cb component and predSamplesCr′[x][y] for the Cr component), where x=0..nTbWC-1, y=0..nTbHC-1.

[0062] 2 is a schematic diagram of the prediction process of the InterCCCM technology. As shown in FIG2 , the specific prediction process of the InterCCCM technology is divided into two steps: S1, solving the model parameters; S2, generating the third chrominance prediction value of the current block.

[0063] Furthermore, in the process of solving the model parameters, the model used in the InterCCCM technology is an 8-tap filter composed of 6 spatial luminance samples, a nonlinear term, and a bias term. As shown in the formula: predChromaVal = c0L0′+c1L1′+c2L2′+c3L3′+c4L4′+c5L5′+c6nonlinear((L0′+L3′+1)>>1)+c7B (3)

[0064] The nonlinear term nonlinear and the bias term B are determined by the following formulas: nonlinear(val)=(val×val+(1<<(bitdepth-1)))>>bitdepth (4) B=1<<(bitdepth-1) (5)

[0065] The model parameters c0-c7 are obtained by solving equations, for example using a division-free Gaussian elimination method.

[0066] To reduce the number of luma and chroma prediction samples used in model parameter calculation, InterCCCM first downsamples the chroma prediction block by determining the x- and y-sampling steps dsX and dsY based on the chroma prediction block width and height. The predChromaVal in the above formula is the chroma prediction value after downsampling.

[0067] According to different image color formats, the luma prediction samples and the chroma prediction samples may have different positional relationships.

[0068] FIG3 is a first schematic diagram illustrating the positional relationship between luma prediction samples and chroma prediction samples according to an embodiment of the present application. As shown in FIG3 , if the image color format is a 4:4:4 color format, each Y component corresponds to a pair of Cb and Cr components. In this case, the luma prediction value L0 corresponding to the position of the first chroma prediction value C is obtained, and the values ​​of L1 through L5 are 0.

[0069] Figure 4 is a second schematic diagram of the positional relationship between the luminance prediction sample and the chrominance prediction sample proposed in an embodiment of the present application. As shown in Figure 4, if the image color format is 4:2:2 color format, every two Y components share a set of Cb and Cr components. If the chrominance sample position is at C0, the luminance samples closest to the chrominance sample position are at L0 and L2. Obtain L0 to L2. When applied to the calculation formula, the value of L1 is considered to be equal to L0, and the values ​​of L3 to L5 are 0. If the chrominance sample position is at Cm (m≠0), obtain L0 and the luminance prediction values ​​L1 and L2 on the left and right sides of L0, and the values ​​of L3 to L5 are 0. It can be understood that between the adjacent chrominance sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point.

[0070] Figure 5 is a third schematic diagram of the positional relationship between the luminance prediction sample and the chrominance prediction sample proposed in an embodiment of the present application. As shown in Figure 5, if the image color format is 4:2:0 color format, every four Y components share a set of Cb and Cr components. If the chrominance sample position is at C0, the luminance samples closest to the chrominance sample position are at L0, L2, L3, and L5. L0 to L5 are obtained. When applied to the calculation formula, the value of L1 is considered equal to L0, and the value of L4 is considered equal to L3. If the chrominance sample position is at Cm (m≠0), L0 to L5 are obtained. It can be understood that between the adjacent chrominance sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point, and the L5 position of the left sampling point corresponds to the L4 position corresponding to the right sampling point.

[0071] During CCCM model parameter calculation, luma and chroma offsets are introduced to reduce the dynamic range of the data and the required bit depth. These offsets are subtracted from the luma and chroma predictions used in the model parameter calculation. In InterCCCM, the luma offset (offsetY) and chroma offset (offsetCb for the Cb component and offsetCr for the Cr component) can be simply represented by the average of the four vertex pixel values ​​in the luma and chroma prediction blocks.

[0072] Therefore, L0′-L5′ in the above formula is the difference between L0′-L5 (non-zero) and offsetY. By establishing equations involving predChromaVal, L0′-L5′, the nonlinear term, and the bias term, the model parameters are calculated using, for example, the division-free Gaussian elimination method in ECM10.0. OffsetCb and offsetCr also contribute to the model parameter calculation.

[0073] Furthermore, after solving the model parameters, the InterCCCM technique generates the second chrominance prediction value edChromaVal of the current block using the following formula: predChromaVal = c0L0′ + c1L1′ + c2L2′ + c3L3′ + c4L4′ + c5L5′ + c6nonlinear((L0′ + L3′ + 1) >> 1) + c7B (3)

[0074] The nonlinear term nonlinear and the bias term B are determined by the following formulas: nonlinear(val)=(val×val+(1<<(bitdepth-1)))>>bitdepth (4) B=1<<(bitdepth-1) (5)

[0075] Model parameters c0 to c7 are the model parameters solved in the previous step. L0′ to L5′ are the differences between the brightness reconstruction values ​​L0" to L5" (non-zero values) and the brightness offset value (offsetY).

[0076] It should be noted that in the embodiment of the present application, when the model is applied, the InterCCCM technology does not downsample the chroma prediction block. All luma reconstructed samples corresponding to the first chroma prediction value in the chroma prediction block participate in the model application.

[0077] According to different image color formats, the luminance reconstruction samples and the chrominance prediction samples may have different positional relationships.

[0078] Figure 6 is a first schematic diagram illustrating the positional relationship between luma reconstruction samples and chroma prediction samples, as proposed in an embodiment of the present application. As shown in Figure 6 , if the image color format is 4:4:4, each Y component corresponds to a pair of Cb and Cr components. In this case, the luma reconstruction value L0" corresponding to the position of the first chroma prediction value C is obtained, and the values ​​of L1" to L5" are 0.

[0079] FIG7 is a second schematic diagram of the positional relationship between the luminance reconstruction sample and the chrominance prediction sample proposed in an embodiment of the present application. As shown in FIG7 , if the image color format is a 4:2:2 color format, every two Y components share a set of Cb and Cr components. If the chrominance sample position is at C0, the luminance samples closest to the chrominance sample position are at L0" and L2". L0" to L2" are obtained. When applied to the calculation formula, the value of L1" is considered to be equal to L0", and the values ​​of L3" to L5" are 0. If the chrominance sample position is at Cm (m≠0), L0" and the luminance reconstruction values ​​L1" and L2" on the left and right sides of L0" are obtained, and the values ​​of L3" to L5" are 0. It can be understood that between adjacent chrominance sampling positions on the left and right, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point.

[0080] FIG8 is a third schematic diagram of the positional relationship between the luminance reconstruction samples and the chrominance prediction samples proposed in an embodiment of the present application. As shown in FIG8 , if the image color format is a 4:2:0 color format, every four Y components share a set of Cb and Cr components. If the chrominance sample position is at C0, the luminance reconstruction samples closest to the chrominance sample position are at L0", L2", L3", and L5". L0" to L5" are obtained. When applied to the calculation formula, the value of L1" is considered to be equal to L0", and the value of L4" is considered to be equal to L3". If the chrominance sample position is at Cm (m≠0), L0" to L5" are obtained. It can be understood that between the adjacent chrominance sampling positions on the left and right, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point, and the L5" position of the left sampling point corresponds to the L4" position corresponding to the right sampling point.

[0081] When applying the CCCM model, a luma offset is introduced to reduce the dynamic range of the data and the required bit depth. The luma offset is subtracted from the luma reconstruction values ​​used in the model. The luma offset (offsetY) is simply represented by the average of the four vertex pixel values ​​in the luma prediction block.

[0082] The second chroma prediction value obtained by the above formula (predCbVal for the Cb component and predCrVal for the Cr component) and the first chroma prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) are weighted according to the following formula to generate a third chroma prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (6) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (7)

[0083] Where w is the weighted value. For example, w is 0.75.

[0084] It can be seen that the InterCCCM technology is mainly used to filter the luminance reconstruction value, thereby correcting the first chrominance prediction value.

[0085] However, after inter-frame or intra-frame prediction, if the residuals of some luma samples in the current block are zero, it means that the predictions of some luma samples and the corresponding chroma samples in the current block are sufficiently accurate. If these luma prediction samples with zero residuals are used in the model parameter calculation, it is equivalent to using these sufficiently accurately predicted samples to derive model parameters for the less accurately predicted samples. The derived model will not accurately reflect the relationship between the less accurately predicted luma prediction samples and the chroma prediction samples. When applying the model, correcting these accurately predicted chroma samples will actually increase the prediction residuals of these chroma samples.

[0086] That is, the common InterCCCM technology does not accurately distinguish and filter the use of luminance reconstruction values, thereby reducing the accuracy of chrominance prediction when correcting chrominance prediction values ​​by filtering the luminance reconstruction values, thereby reducing encoding and decoding performance.

[0087] In order to solve the above problems, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample according to the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

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

[0089] Referring to Figure 9, which shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 9, the encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing 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 101, 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 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block; specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction 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 105 is the process of generating motion vectors, The motion vector can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra-frame prediction mode, the intra-frame prediction unit 103 is also used to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated and determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is controlled by the filter. The analysis unit 107 and the filtering unit 108 remove blocking artifacts and then add the reconstructed residual block to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode and output the bitstream of the video signal. The decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding progresses, new reconstructed video coding blocks are continuously generated and stored in the decoded image buffer unit 110.

[0090] Referring to Figure 10 , which shows a schematic block diagram of a decoder provided in an embodiment of the present application, as shown in Figure 10 , the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is coded as shown in FIG8 , a code stream of the video signal is output; the code stream is input to the decoder 30 and first passes through the decoding unit 201 to obtain decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 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 motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the prediction data for the current video decoding block. The prediction information is used to generate a predictive block of 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 202 and the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove blocking artifacts, thereby improving the video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, that is, the restored original video signal is obtained.

[0091] Furthermore, the embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein Figure 11 shows a schematic diagram of the network architecture of a coding and decoding system provided by the embodiment of the present application. As shown in Figure 11, 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 coding and decoding 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., and the embodiment of the present application is not specifically limited. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0092] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 and the motion compensation unit 104 shown in Figure 9, and the intra-frame prediction unit 203 and the motion compensation unit 204 shown in Figure 10. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder simultaneously, but the embodiment of the present application is not specifically limited thereto.

[0093] It should also be noted that the “current block” specifically refers to the coding block currently to be predicted; or, it may refer to the decoding block currently to be predicted.

[0094] An embodiment of the present application provides a decoding method, which is applied to a decoder. FIG12 is a flowchart of the decoding method provided in the embodiment of the present application. As shown in FIG12 , the decoding method performed by the decoder may include the following steps:

[0095] Step 101: Decode the code stream to determine the prediction parameters of the current block and the residual value of the luminance component of the current block.

[0096] In an embodiment of the present application, the code stream may be decoded first to determine the prediction parameters corresponding to the current block, and the residual value of the luminance component of the current block may also be determined.

[0097] It should be noted that the decoding method in the embodiment of the present application is applied to a decoder. Furthermore, the decoding method may include a prediction method, more specifically, an image component prediction method. A video image may be divided into multiple decoding blocks, each of which may include a first color component, a second color component, and a third color component. The current block in the embodiment of the present application refers to the decoding block in the video image that is currently to be predicted.

[0098] Here, when a prediction is required for a first color component, the component to be predicted is the first color component; when a prediction is required for a second color component, the component to be predicted is the second color component; and when a prediction is required for a third color component, the component to be predicted is the third color component. Furthermore, assuming that a prediction is performed for the first color component of the current block, and the first color component is the luminance component, i.e., the component to be predicted is the luminance component, then the current block may also be referred to as a luminance block; or, assuming that a prediction is performed for the second color component of the current block, and the second color component is the chrominance component, i.e., the component to be predicted is the chrominance component, then the current block may also be referred to as a chrominance block.

[0099] It should be noted that, in the embodiment of the present application, the prediction parameters corresponding to the current block can be used to determine the prediction block of the luminance component and the prediction block of the chrominance component corresponding to the current block.

[0100] It can be understood that, in the embodiment of the present application, the prediction parameters of the current block can be used to determine the parameters of the prediction method used when predicting the current block.

[0101] Exemplarily, in some embodiments, the prediction parameter of the current block may include at least one of the following parameters: an inter-frame prediction parameter, an intra-frame block copy (IBC) parameter, an inter-frame template matching parameter, and an intra-frame template matching parameter.

[0102] It should be noted that, in the embodiments of the present application, the prediction parameters of the current block may also include any other types of parameters and information, and the present application does not specifically limit the prediction parameters of the current block.

[0103] Step 102: Determine a prediction reference block for the current block based on the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block. The size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block.

[0104] In an embodiment of the present application, after decoding the code stream and determining the prediction parameters of the current block, a prediction reference block of the current block may be further determined based on the prediction parameters of the current block.

[0105] It should be noted that, in the embodiment of the present application, the prediction reference block of the current block may include a luminance prediction reference block corresponding to the luminance component and a chrominance prediction reference block corresponding to the chrominance component.

[0106] That is to say, in an embodiment of the present application, the luminance component and chrominance component of the current block can be predicted respectively based on the prediction parameters, so that the corresponding luminance prediction reference block and chrominance prediction reference block can be determined, that is, the prediction reference block of the current block can be determined.

[0107] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, it is possible to select an inter-frame prediction parameter based on which the prediction reference block for the current block is determined through inter-frame prediction. That is, it is possible to select an inter-frame prediction for the luminance component and the chrominance component of the current block based on the inter-frame prediction parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0108] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, the prediction reference block for the current block can be determined based on the IBC parameters. That is, IBC prediction can be performed on the luma component and chroma component of the current block based on the IBC parameters, thereby determining the corresponding luma prediction reference block and chroma prediction reference block.

[0109] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, it is possible to select inter-frame template matching parameters to determine the prediction reference block for the current block through inter-frame template matching. That is, inter-frame template matching prediction can be performed on the luminance component and chrominance component of the current block based on the inter-frame template matching parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0110] It should be noted that in the embodiments of the present application, when determining the prediction reference block of the current block based on the prediction parameters of the current block, it is possible to select intra-frame template matching parameters to determine the prediction reference block of the current block through intra-frame template matching. That is, it is possible to select intra-frame template matching prediction for the luminance component and chrominance component of the current block based on the intra-frame template matching parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0111] Exemplarily, in some embodiments, based on the prediction parameters of the current block, the prediction reference block can also be obtained in any of the following ways: the inter-frame / BV-based prediction part in GPM, the inter-frame / BV-based prediction block in CIIP, etc.

[0112] Furthermore, in an embodiment of the present application, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block.

[0113] That is to say, in the embodiment of the present application, the prediction reference block determined by the prediction parameters is the same size as the current block.

[0114] Step 103: Determine a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block.

[0115] In an embodiment of the present application, after the prediction parameters of the current block and the residual value of the luminance component of the current block are determined by decoding the code stream, and the luminance prediction reference block of the current block is determined based on the prediction parameters, the reconstructed value of the luminance component of the current block can be further determined based on the residual value of the luminance component of the current block and the luminance prediction reference block.

[0116] It should be noted that, in an embodiment of the present application, when determining the reconstructed value of the luminance component of the current block based on the residual value of the luminance component of the current block and the luminance prediction reference block, the sum of the residual value of the luminance component of the current block and the predicted value corresponding to the luminance prediction reference block can be determined as the reconstructed value of the luminance component of the current block.

[0117] Step 104: Determine a set of model reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block.

[0118] In an embodiment of the present application, after the prediction parameters of the current block are determined based on the decoded code stream, and the prediction reference block of the current block including the luma prediction reference block and the chroma prediction reference block of the current block is determined based on the prediction parameters, the model reference luma sampling point set corresponding to the chroma sampling point can be further determined based on the chroma sampling point in the chroma prediction reference block.

[0119] It should be noted that, in the embodiments of the present application, when selecting chroma sampling points in the chroma prediction reference block, all sampling points in the chroma prediction reference block can be selected as chroma sampling points, or some of the sampling points can be selected as chroma sampling points by downsampling.

[0120] It can be understood that in the embodiments of the present application, in order to reduce the number of luminance and chrominance prediction samples involved in the calculation of model parameters (i.e., the number of chrominance sampling points and luminance sampling points), the chrominance prediction block can be downsampled first, thereby determining the chrominance sampling points in the chrominance prediction block.

[0121] Furthermore, in an embodiment of the present application, the downsampling step size may be first determined based on the size parameter of the chroma prediction reference block; and then the chroma prediction reference block may be downsampled based on the downsampling step size to determine the chroma sampling points.

[0122] It should be noted that in the embodiments of the present application, the downsampling step sizes dsX and dsY in the x-direction and y-direction are first determined based on the width and height of the chroma prediction reference block, so that the chroma prediction reference block can be downsampled using the downsampling step size, and finally the downsampled chroma prediction value, i.e., the chroma sampling point, is obtained.

[0123] It can be understood that, in the embodiments of the present application, the model reference luminance sampling point set determined based on the chrominance sampling points may include luminance sampling points used for model parameter derivation.

[0124] It should be noted that, in the embodiments of the present application, since the chroma sampling points may be some or all of the sampling points in the chroma prediction reference block, correspondingly, the luma sampling points may also be some or all of the sampling points in the luma prediction reference block that correspond to the chroma sampling points. The correspondence between the chroma sampling points and the luma sampling points may be determined based on the chroma format parameters of the current block.

[0125] That is to say, in the embodiments of the present application, the chrominance sampling points used to determine the model parameters of the inter-component prediction model can be all the sampling points in the chrominance prediction reference block, or can be part of the sampling points in the chrominance prediction reference block, and the present application does not make specific limitations.

[0126] Furthermore, in an embodiment of the present application, when determining a set of model reference luminance sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block, the chroma format parameters can be determined first; then, based on the chroma format parameters and the chroma sampling points in the chroma prediction reference block, the luminance sampling points corresponding to the chroma sampling points can be determined in the luminance prediction reference block; finally, the model reference luminance sampling point set can be determined based on the luminance sampling points.

[0127] It should be noted that, in the embodiment of the present application, the code stream can be decoded to determine the chroma format parameters, and then the chroma format of the current block can be determined according to the chroma format parameters.

[0128] It is understood that, in the embodiment of the present application, the chroma format parameter may be used to indicate the chroma format corresponding to the current block, wherein the chroma format may be an image color format, including 4:4:4, 4:2:2, and 4:2:0.

[0129] For example, in some embodiments, the chroma format parameter may be represented by sps_chroma_format_idc. When the chroma format parameter takes a first value, the current block is determined to be in the first chroma format; when the chroma format parameter takes a second value, the current block is determined to be in the second chroma format; and when the chroma format parameter takes a third value, the current block is determined to be in the third chroma format.

[0130] It should be noted that in the embodiments of the present application, the first value, the second value, and the third value are different, and the first value, the second value, and the third value can be in parameter form or in digital form. Specifically, the chroma format parameter can be a parameter written in a parameter set or a flag value, and is not specifically limited here.

[0131] In addition, for the first value, the second value, and the third value, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2; or the first value can be set to 2, the second value can be set to 1, and the third value can be set to 0. In the embodiment of the present application, the first value is set to 0, the second value is set to 1, and the third value is set to 2, but this is not specifically limited.

[0132] It should be noted that, in the embodiment of the present application, the first chroma format may be 4:4:4, the second chroma format may be 4:2:2, and the third chroma format may be 4:2:0.

[0133] Furthermore, in an embodiment of the present application, when determining the luma sampling point corresponding to the chroma sampling point in the luma block of the current block based on the chroma format parameters and the chroma sampling point in the chroma block of the current block, the relevant luma coordinates can be first determined in the luma prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block; and then the sampling point corresponding to the relevant luma coordinates can be determined as the luma sampling point corresponding to the chroma sampling point.

[0134] It is understood that in the embodiment of the present application, the relevant luma coordinates may be coordinate positions in the luma prediction reference block that correspond to the coordinate positions of the chroma sampling points. The corresponding relationship of the coordinate positions may be determined by chroma format parameters. Depending on the chroma format parameters, the ultimately determined relevant luma coordinates may be different.

[0135] Exemplarily, in some embodiments, the chroma sampling point coordinates of the chroma sampling point may be (xC, yC).

[0136] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include the first coordinates L0 (xC, yC) when the current block is in the first chroma format.

[0137] It is understood that in the embodiment of the present application, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinate can be obtained in the luma prediction reference block as the related luma coordinate, that is, the sampling point of the first coordinate L0 (xC, yC) in the luma prediction reference block is the corresponding luma sampling point.

[0138] That is, in an embodiment of the present application, when the current block is in the first chroma format, the determined model reference luminance sampling point set includes a luminance sampling point of the first coordinate L0 (xC, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0139] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, when the current block is in the second chroma format, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) include: a second coordinate L1 (xC<<1, yC), a third coordinate L2 (xC<<1-1, yC), and a fourth coordinate L3 (xC<<1+1, yC).

[0140] It can be understood that in the embodiment of the present application, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC), that is, the sampling points with the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) in the luminance prediction reference block are the corresponding luminance sampling points.

[0141] That is, in an embodiment of the present application, when the current block is in the second chroma format, the determined model reference luminance sampling point set includes luminance sampling points of the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0142] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include, when the current block is in the third chroma format, a fifth coordinate L4 (xC<<1, yC<<1), a sixth coordinate L5 (xC<<1-1, yC<<1), a seventh coordinate L6 (xC<<1+1, yC<<1), an eighth coordinate L7 (xC<<1, yC<<1+1), a ninth coordinate L8 (xC<<1-1, yC<<1+1), and a tenth coordinate L9 (xC<<1+1, yC<<1+1).

[0143] It can be understood that, in the embodiments of the present application, for the third chrominance format 4:2:0, every four Y components share a set of Cb and Cr components. If the chrominance sampling point coordinates of the chrominance sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chrominance sampling point coordinates in the luminance prediction reference block are the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1), that is, the sampling points of the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1) in the luminance prediction reference block are the corresponding luminance sampling points.

[0144] That is to say, in the embodiments of the present application, when the current block is in the third chrominance format, the determined set of model reference luminance sampling points includes the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1) corresponding to the chrominance sampling point coordinates (xC, yC).

[0145] It should be noted that, in the embodiments of the present application, << is the left shift operator; where m << n represents the operation of shifting the binary number of m to the left by n bits, and the result of m << n is m × 2 n , where m and n are integers greater than 0.

[0146] That is to say, in the embodiments of the present application, the luminance sampling points include the sampling points at the same position of the chrominance sampling point in the luminance prediction reference block, and / or, the sampling points adjacent to the sampling points at the same position.

[0147] Exemplarily, in some embodiments, the luminance sampling points may include the sampling points at the same position of the chrominance sampling point in the luminance prediction reference block, such as the sampling point with coordinates (xY, yY), and / or, the sampling points adjacent to the sampling points at the same position, such as the sampling points with coordinates (xY - 1, yY), (xY + 1, yY), (xY, yY + 1), (xY - 1, yY + 1), (xY + 1, yY + 1).

[0148] Step 105 : Determine model parameters of the inter-component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block.

[0149] In an embodiment of the present application, after determining the model reference luminance sampling point set corresponding to the chroma sampling point based on the chroma sampling point in the chroma prediction reference block, the model parameters of the inter-component prediction model can be further determined based on the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block.

[0150] It should be noted that in an embodiment of the present application, after determining the chrominance sampling points and the corresponding model reference luminance sampling point set used to derive the model parameters of the inter-component prediction model, the luminance sampling points and the chrominance sampling points can be further screened in combination with the residual value of the luminance component of the current block, and the filtered sampling points whose residual values ​​meet the requirements can be further used to determine the model parameters of the inter-component prediction model.

[0151] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the predicted reference block of the current block, the first availability parameter of the luminance sampling point in the model reference luminance sampling point set can be first determined based on the residual value of the luminance component of the current block; and then the model parameters of the inter-component prediction model can be determined based on the first availability parameter and the predicted reference block of the current block.

[0152] It should be noted that, in the embodiments of the present application, the first availability parameter can be used to indicate whether to use the luminance sampling value of the luminance sampling point. For a luminance sampling point, if the corresponding first availability parameter indicates "available," it can be understood that the luminance sampling value of the luminance sampling point is used; if the corresponding first availability parameter indicates "unavailable," it can be understood that the luminance sampling value of the luminance sampling point is not used.

[0153] Further, in an embodiment of the present application, when determining the first availability parameter of a luma sampling point in a model reference luma sampling point set based on the residual value of the luma component of the current block, it is possible to determine that the first availability parameter of the luma sampling point indicates not to use the luma sampling value of the luma sampling point when the residual value of the luma component of the current block corresponding to the value of the luma sampling point satisfies a first condition; and determine that the first availability parameter of the luma sampling point indicates to use the luma sampling value of the luma sampling point when the residual value of the luma component of the current block corresponding to the value of the luma sampling point does not satisfy the first condition.

[0154] It should be noted that, in an embodiment of the present application, for a luma sampling point, the residual value of the luma component of the current block at the luma sampling coordinates of the luma sampling point may be first determined, that is, the value corresponding to the luma sampling point. Then, it is determined whether the residual value of the luma sampling coordinates satisfies the first condition. If so, the first availability parameter of the luma sampling point is determined to be "unavailable", indicating that the luma sampling value of the luma sampling point is not used; otherwise, it is determined to be "available", indicating that the luma sampling value of the luma sampling point is used.

[0155] It is understood that in the embodiment of the present application, the first condition can be used to distinguish and filter the residual values ​​in combination with a pre-set first residual threshold. The first condition may include: the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to the first residual threshold.

[0156] It should be noted that, in the embodiment of the present application, the value of the first residual threshold may be any preset value. For example, the first residual threshold may be 0 or 4.

[0157] That is, in an embodiment of the present application, when determining the first availability parameter for a luminance reference point, the value of the residual value of the luminance component corresponding to the luminance sampling point may be compared with the first residual threshold. If the comparison result shows that the value of the residual value of the luminance component corresponding to the luminance sampling point is less than or equal to the first residual threshold, then it can be determined that the accuracy of the luminance prediction for the luminance sampling point is relatively high, and it can be considered that the model parameters derived using the luminance sampling value of the luminance sampling point are not applicable to sampling points with low prediction accuracy. Therefore, the luminance sampling value of the luminance sampling point may be selected not to be used, that is, the first availability parameter for determining the luminance sampling point may indicate not to use the luminance sampling value of the luminance sampling point.

[0158] Accordingly, in an embodiment of the present application, if the comparison result is that the residual value of the luminance component corresponding to the value of the luminance sampling point is greater than the first residual threshold, then it can be determined that the accuracy of the luminance prediction of the luminance sampling point is relatively low, and it can be considered that the model parameters derived using the luminance sampling value of the luminance sampling point can be applicable to the sampling point with low prediction accuracy. Therefore, the luminance sampling value of the luminance sampling point can be selected, that is, the first availability parameter of the luminance sampling point can be determined to indicate the use of the luminance sampling value of the luminance sampling point.

[0159] It should be noted that, in an embodiment of the present application, the first availability parameter can be determined by comparing the residual value of the luminance component corresponding to the value of the luminance sampling point with the first residual threshold, or the first availability parameter can be determined in any other manner, for example, the residual value of the luminance component corresponding to the value of the luminance sampling point is right-shifted by 2 bits and then compared with the first residual threshold.

[0160] Exemplarily, in some embodiments, assuming that the first residual threshold is 0, then when the luminance sampling points are screened according to the residual value of the luminance component of the current block, if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is 0, that is, less than or equal to the first residual threshold, then the luminance sampling value of the luminance sampling point will not be used to derive the model parameters; if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is not 0, that is, greater than the first residual threshold, then the luminance sampling value of the luminance sampling point will be used to derive the model parameters.

[0161] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, the luma sampling value corresponding to the luma sampling point can be determined based on the luma prediction reference block, and the chroma sampling value corresponding to the chroma sampling point can be determined based on the chroma prediction reference block when the first availability parameter indicates the use of the luma sampling value of the luma sampling point; and the model parameters of the inter-component prediction model can be determined based on the luma sampling value, the chroma sampling value, the nonlinear term and / or the bias term.

[0162] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples, a nonlinear term and a bias term, as shown in the above formula (3).

[0163] Exemplarily, in some embodiments, for a chroma sampling point, if the residual value of the luma sampling point corresponding to the chroma sampling point (i.e., the luma residual of the luma component of the current block corresponds to the value of the luma sampling point) is greater than the first residual threshold, that is, the first availability parameter corresponding to the luma sampling point indicates that the model parameters can be derived using the luma sampling value of the luma sampling point, then the luma sampling value corresponding to the luma sampling point can be determined based on the luma prediction reference block, and the chroma sampling value corresponding to the chroma sampling point can be determined based on the chroma prediction reference block, and then based on the above formulas (4) and (5), combined with the nonlinear term and / or the bias term, the model parameters c0 to c7 are determined, wherein the model parameters c0 to c7 can be obtained by solving equations, for example, using the division-free Gaussian elimination method.

[0164] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value, the chroma sample value, and the bias term. That is, in the process of determining the model parameters, nonlinear terms can also be omitted.

[0165] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter composed of 6 spatial luminance samples and a bias term, as follows: predChromaVal = c0L0′ + c1L1′ + c2L2′ + c3L3′ + c4L4′ + c5L5′ + c6((L0′ + L3′ + 1) >> 1) + c7B (8)

[0166] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value, the chroma sample value, and the nonlinear term. That is, the bias term can be omitted during the process of determining the model parameters.

[0167] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in the following formula: predChromaVal=c0L0′+c1L1′+c2L2′+c3L3′+c4L4′+c5L5′+c6nonlinear((L0′+L3′+1)>>1)+c7 (9)

[0168] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value and the chroma sample value. That is, in the process of determining the model parameters, the bias term and the nonlinear term can also be omitted.

[0169] That is, in the embodiment of the present application, it is possible to choose not to use the bias term and the nonlinear term to determine the model parameters of the inter-component prediction model.

[0170] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in the following formula: predChromaVal=c0L0′+c1L1′+c2L2′+c3L3′+c4L4′+c5L5′+c6((L0′+L3′+1)>>1)+c7 (10)

[0171] Furthermore, in an embodiment of the present application, when determining the luminance sampling value corresponding to the luminance sampling point based on the luminance prediction reference block, the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point can be selected as the luminance sampling value; or, when the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point is not 0, the luminance sampling value can be determined based on the luminance offset value and the luminance prediction value.

[0172] Furthermore, in an embodiment of the present application, when determining the chroma sampling value corresponding to the chroma sampling point based on the chroma prediction reference block, the chroma prediction value of the chroma prediction reference block corresponding to the chroma sampling point can be selected as the chroma sampling value; or the chroma sampling value can be determined based on the chroma offset value and the chroma prediction value of the chroma prediction reference block corresponding to the chroma sampling point.

[0173] It can be understood that in the embodiments of the present application, during the calculation of the model parameters, in order to reduce the dynamic range of the data and the bit depth required for derivation, a luminance offset value and a chrominance offset value may be introduced.

[0174] For example, in some embodiments, the brightness prediction value involved in the model parameter calculation may be subtracted from the brightness offset value to obtain the corresponding brightness sampling value, and then the model parameters may be calculated using the brightness sampling value.

[0175] For example, in some embodiments, the chroma prediction value involved in the model parameter calculation may be subtracted from the chroma offset value to obtain the corresponding chroma sampling value, and then the model parameters may be calculated using the chroma sampling value.

[0176] It should be noted that, in the embodiments of the present application, the luminance offset value (offsetY) and the chrominance offset value (offsetCb for the Cb component and offsetCr for the Cr component) can be simply represented by the average value of the four vertex pixel values ​​of the luminance prediction block and the chrominance prediction block.

[0177] It is understandable that in the embodiments of the present application, the offset value may not be applied in the calculation process of the model parameters, that is, the brightness offset value (offsetY) and the chrominance offset value (offsetCb for the Cb component and offsetCr for the Cr component) may not be introduced.

[0178] That is to say, in the embodiment of the present application, in the process of calculating the model parameters, the luminance sampling values ​​L0′~L5′ finally used are the differences between the luminance prediction values ​​L0~L5 (the values ​​are not 0) corresponding to the luminance sampling points and the luminance offset value offsetY. Finally, the model parameters c0~c7 can be obtained by establishing an equation of the chrominance sampling value predChromaVal and L0′~L5′, the nonlinear term and the bias term, using, for example, the division-free Gaussian elimination method in ECM10.0.

[0179] It should be noted that in the embodiments of the present application, for different chroma formats indicated by different chroma format parameters, the chroma sampling point may correspond to a different number of luma sampling points. For example, for the first chroma format 4:4:4, one chroma sampling point corresponds to one luma sampling point, for the second chroma format 4:2:2, one chroma sampling point corresponds to three luma sampling points, and for the second chroma format 4:2:0, one chroma sampling point corresponds to six luma sampling points. In other words, a chroma sampling point corresponds to at least one luma sampling point, and in the process of determining the first availability parameter of the luma sampling point, the corresponding first availability parameter may be determined based on some or all of the at least one luma sampling point, which is not specifically limited in the present application.

[0180] That is, in an embodiment of the present application, for at least one luminance sampling point, it can be selected that when the residual value corresponding to any one of the luminance sampling points is less than or equal to the first residual threshold, it is determined that the first availability parameters corresponding to all luminance sampling points indicate "unavailable".

[0181] Accordingly, in an embodiment of the present application, for at least one luminance sampling point, it may be selected to determine that the first availability parameters corresponding to all luminance sampling points indicate "unavailable" when the residual values ​​corresponding to all luminance sampling points are less than or equal to the first residual threshold.

[0182] For example, in some embodiments, assuming that the first residual threshold is 0, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the sampling point at the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling point. If the residual value of the luma component of the current block corresponding to the luma sampling point L0 (xC, yC) is 0, it can be considered that the first availability parameter corresponding to the luma sampling point indicates "unavailable", and therefore, the chroma sampling value at the position (xC, yC) and the corresponding luma sampling value at the first coordinate L0 (xC, yC) position do not participate in the model parameter calculation.

[0183] For example, in some embodiments, assuming the first residual threshold is 0, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, the sampling points at the same positions as the chroma sampling points in the luma prediction reference block, corresponding to the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC), can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponding to the luma sampling point L1 (xC<<1, yC) is 0, the first availability parameters corresponding to all luma sampling points can be considered to indicate "unavailable". Therefore, the chroma sampling value at the position (xC, yC) and the corresponding luma sampling values ​​at the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) are not included in the model parameter calculation.

[0184] For example, in some embodiments, assuming that the first residual threshold is 0, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, the sampling points corresponding to the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) at the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponds to the luma sampling point L4 (xC<<1, yC<<1) and the value is 0, it can be considered that the first availability parameters corresponding to all luma sampling points indicate "unavailable". Therefore, the chroma sampling value at the position (xC, yC) and the corresponding fifth coordinate L4 (xC<<1, yC<<1), sixth coordinate L5 (xC<<1-1, yC<<1), seventh coordinate L6 (xC<<1+1, yC<<1), eighth coordinate L7 (xC<<1, yC<<1+1), ninth coordinate L8 (xC<<1-1, yC<<1+1), and tenth coordinate L9 (xC<<1+1, yC<<1+1) do not participate in the model parameter calculation.

[0185] It is understood that in the embodiments of the present application, when determining samples that do not participate in model parameter calculation and / or model application, it is also possible to determine not only based on the luma residual value corresponding to the L0 position, but also based on multiple residual values ​​in L0 to L5. For example, L0 and L1, L0 and L3, L0 to L2, etc. Alternatively, it can be determined based on the chroma residual value of the corresponding position of the chroma sample being 0.

[0186] It should be noted that in an embodiment of the present application, if the first availability parameters corresponding to all luma sampling points in the model reference luma sampling point set indicate "unavailable", then the luma sampling points and chroma sampling points may no longer be screened and distinguished, but the chroma sampling values ​​of the chroma sampling points and the luma sampling values ​​of the luma sampling points may continue to be used to derive the model parameters.

[0187] Step 106: Determine a set of prediction reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block.

[0188] In an embodiment of the present application, after the prediction parameters of the current block are determined based on the decoded code stream, and the prediction reference block of the current block including the luma prediction reference block and the chroma prediction reference block of the current block is determined based on the prediction parameters, a set of prediction reference luma sampling points corresponding to the chroma sampling points can be further determined based on the chroma sampling points in the chroma prediction reference block.

[0189] It should be noted that, in the embodiment of the present application, during the application of the inter-component prediction model, when selecting chroma sampling points in the chroma prediction reference block, all sampling points in the chroma prediction reference block can be selected as chroma sampling points.

[0190] That is to say, in the implementation of the present application, when determining the model parameters of the inter-component prediction model, you can choose to downsample the chroma prediction reference block, and when applying the inter-component prediction model, you need to use all the sampling points in the chroma prediction reference block as chroma sampling points.

[0191] Furthermore, in an embodiment of the present application, when determining a set of predicted reference luma sampling points corresponding to a chroma sampling point based on a chroma sampling point in a chroma prediction reference block, a chroma format parameter may be determined first; then, based on the chroma format parameter and the chroma sampling point in the chroma prediction reference block, a luma sampling point corresponding to the chroma sampling point may be determined in the luma prediction reference block; finally, a set of predicted reference luma sampling points may be determined based on the luma sampling point.

[0192] It should be noted that, in the embodiment of the present application, the code stream can be decoded to determine the chroma format parameters, and then the chroma format of the current block can be determined according to the chroma format parameters.

[0193] It is understood that, in the embodiment of the present application, the chroma format parameter may be used to indicate the chroma format corresponding to the current block, wherein the chroma format may be an image color format, including 4:4:4, 4:2:2, and 4:2:0.

[0194] Furthermore, in an embodiment of the present application, when determining the luma sampling point corresponding to the chroma sampling point in the luma block of the current block based on the chroma format parameters and the chroma sampling point in the chroma block of the current block, the relevant luma coordinates can be first determined in the luma prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block; and then the sampling point corresponding to the relevant luma coordinates can be determined as the luma sampling point corresponding to the chroma sampling point.

[0195] It is understood that in the embodiment of the present application, the relevant luma coordinates may be coordinate positions in the luma prediction reference block that correspond to the coordinate positions of the chroma sampling points. The corresponding relationship of the coordinate positions may be determined by chroma format parameters. Depending on the chroma format parameters, the ultimately determined relevant luma coordinates may be different.

[0196] Exemplarily, in some embodiments, the chroma sampling point coordinates of the chroma sampling point may be (xC, yC).

[0197] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include the first coordinates L0 (xC, yC) when the current block is in the first chroma format.

[0198] It is understood that in the embodiment of the present application, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinate can be obtained in the luma prediction reference block as the related luma coordinate, that is, the sampling point of the first coordinate L0 (xC, yC) in the luma prediction reference block is the corresponding luma sampling point.

[0199] That is, in an embodiment of the present application, when the current block is in the first chroma format, the determined set of predicted reference luminance sampling points includes a luminance sampling point with the first coordinate L0 (xC, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0200] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, when the current block is in the second chroma format, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) include: a second coordinate L1 (xC<<1, yC), a third coordinate L2 (xC<<1-1, yC), and a fourth coordinate L3 (xC<<1+1, yC).

[0201] It can be understood that in the embodiment of the present application, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC), that is, the sampling points with the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) in the luminance prediction reference block are the corresponding luminance sampling points.

[0202] That is, in an embodiment of the present application, when the current block is in the second chroma format, the determined set of predicted reference luminance sampling points includes luminance sampling points of the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0203] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include, when the current block is in the third chroma format, a fifth coordinate L4 (xC<<1, yC<<1), a sixth coordinate L5 (xC<<1-1, yC<<1), a seventh coordinate L6 (xC<<1+1, yC<<1), an eighth coordinate L7 (xC<<1, yC<<1+1), a ninth coordinate L8 (xC<<1-1, yC<<1+1), and a tenth coordinate L9 (xC<<1+1, yC<<1+1).

[0204] It can be understood that, in the embodiment of the present application, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), the tenth coordinate L9 (xC<<1-1, yC<<1+1), and the ninth coordinate L10 (xC<<1-1, yC<<1+1). <<1+1,yC<<1+1), that is, the sampling points of the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) in the brightness prediction reference block are the corresponding brightness sampling points.

[0205] That is, in the embodiments of the present application, when the current block is in the third chrominance format, the determined set of predicted reference luminance sampling points includes luminance sampling points corresponding to the chrominance sampling point coordinates (xC, yC), namely, the fifth coordinate L4 (xC << 1, yC << 1), the sixth coordinate L5 (xC << 1 - 1, yC << 1), the seventh coordinate L6 (xC << 1 + 1, yC << 1), the eighth coordinate L7 (xC << 1, yC << 1 + 1), the ninth coordinate L8 (xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9 (xC << 1 + 1, yC << 1 + 1).

[0206] It should be noted that in the embodiments of the present application, << is the left shift operator; where m << n represents the operation of shifting the binary number of m to the left by n bits, and the result of m << n is m × 2 n , where m and n are integers greater than 0.

[0207] That is, in the embodiments of the present application, the luminance sampling points include the sampling points at the same position of the chrominance sampling points in the luminance prediction reference block, and / or the sampling points adjacent to the sampling points at the same position.

[0208] Exemplarily, in some embodiments, the luminance sampling points may include the sampling points at the same position of the chrominance sampling points in the luminance prediction reference block, such as the sampling point with coordinates (xY, yY), and / or the sampling points adjacent to the sampling points at the same position, such as the sampling points with coordinates (xY - 1, yY), (xY + 1, yY), (xY, yY + 1), (xY - 1, yY + 1), (xY + 1, yY + 1).

[0209] Step 107: Determine the predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of predicted reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0210] In the embodiments of the present application, after determining the set of predicted reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block, and after determining the model parameters of the inter-component prediction model according to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block, the predicted value of the chrominance component of the current block can be further determined according to the model parameters of the inter-component prediction model, the set of predicted reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0211] It should be noted that, in an embodiment of the present application, after determining the set of prediction reference luminance sampling points using the inter-component prediction model, the luminance sampling points and chrominance sampling points can be further screened in combination with the residual value of the luminance component of the current block, and the modified chrominance prediction value of the inter-component prediction model can be used for the screened sampling points whose residual values ​​meet the requirements.

[0212] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the model parameters of the inter-component prediction model, the predicted reference luminance sampling point set, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block, the second availability parameter of the luminance sampling point in the predicted reference luminance sampling point set can be first determined based on the residual value of the luminance component of the current block; and then the predicted value of the chrominance component of the current block can be determined based on the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block.

[0213] It should be noted that, in the embodiments of the present application, the second availability parameter can be used to indicate whether to use the luminance reconstruction value of the luminance sampling point. For a luminance sampling point, if the corresponding second availability parameter indicates "available," it can be understood that the luminance reconstruction value of the luminance sampling point is used; if the corresponding second availability parameter indicates "unavailable," it can be understood that the luminance reconstruction value of the luminance sampling point is not used.

[0214] Furthermore, in an embodiment of the present application, when determining the second availability parameter of a luma sampling point in a set of predicted reference luma sampling points based on the residual value of the luma component of the current block, it is possible to determine, when the residual value of the luma component of the current block corresponding to the value of the luma sampling point satisfies a second condition, that the second availability parameter of the luma sampling point indicates not to use the luma reconstruction value of the luma sampling point; and when the residual value of the luma component of the current block corresponding to the value of the luma sampling point does not satisfy the second condition, determine that the second availability parameter of the luma sampling point indicates to use the luma reconstruction value of the luma sampling point.

[0215] It should be noted that, in an embodiment of the present application, for a luma sampling point, the residual value of the luma component of the current block at the luma sampling coordinates of the luma sampling point may be first determined, that is, the value corresponding to the luma sampling point. Then, it is determined whether the residual value of the luma sampling coordinates satisfies the second condition. If so, the second availability parameter of the luma sampling point is determined to be "unavailable", indicating that the luma reconstruction value of the luma sampling point is not used; otherwise, it is determined to be "available", indicating that the luma reconstruction value of the luma sampling point is used.

[0216] It is understood that in the embodiment of the present application, the second condition can be used to distinguish and filter the residual values ​​in combination with a pre-set second residual threshold. The second condition may include: the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to the second residual threshold.

[0217] It should be noted that in the embodiments of the present application, the first residual threshold and the second residual threshold may be the same or different, and this application does not specifically limit this. The value of the second residual threshold may be any pre-set value. For example, the second residual threshold may be 0 or 4.

[0218] That is, in an embodiment of the present application, when determining the second availability parameter for a luma reference point, the value of the residual value of the luma component corresponding to the luma sampling point may be compared with the second residual threshold. If the comparison result shows that the value of the residual value of the luma component corresponding to the luma sampling point is less than or equal to the second residual threshold, then it can be determined that the accuracy of the luma prediction for the luma sampling point is relatively high, and it can be considered that the luma reconstructed value of the luma sampling point is not suitable for correcting the chroma prediction value of a sampling point with low prediction accuracy. Therefore, the luma reconstructed value of the luma sampling point may be selected not to be used, that is, it can be determined that the second availability parameter for the luma sampling point indicates that the luma reconstructed value of the luma sampling point is not to be used.

[0219] Accordingly, in an embodiment of the present application, if the comparison result is that the residual value of the luma component corresponding to the luma sampling point is greater than the second residual threshold, then it can be determined that the accuracy of the luma prediction of the luma sampling point is relatively low, and it can be considered that the luma reconstructed value of the luma sampling point can be applicable to the correction of the chroma prediction value of the sampling point with low prediction accuracy. Therefore, the luma reconstructed value of the luma sampling point can be selected for use, that is, the first availability parameter for determining the luma sampling point indicates the use of the luma reconstructed value of the luma sampling point.

[0220] It should be noted that, in an embodiment of the present application, the second availability parameter can be determined by comparing the residual value of the luminance component corresponding to the value of the luminance sampling point with the second residual threshold, or the second availability parameter can be determined in any other manner, for example, the residual value of the luminance component corresponding to the value of the luminance sampling point is right-shifted by 2 bits and then compared with the second residual threshold.

[0221] Exemplarily, in some embodiments, assuming that the second residual threshold is 0, then when the luminance sampling points are screened according to the residual value of the luminance component of the current block, if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is 0, that is, less than or equal to the second residual threshold, then the luminance reconstruction value of the luminance sampling point will not be used; if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is not 0, that is, greater than the second residual threshold, then the luminance reconstruction value of the luminance sampling point will be used.

[0222] Further, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the second availability parameter, the model parameters of the inter-component prediction model and the reconstruction value of the luminance component of the current block, it is possible to determine that the reconstruction value of the luminance component of the current block corresponds to the luminance reconstruction value of the luminance sampling point when the second availability parameter indicates the use of the luminance reconstruction value of the luminance sampling point; and then the predicted value of the chrominance component of the current block can be determined based on the luminance reconstruction value, the model parameters, the nonlinear term and / or the bias term.

[0223] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples, a nonlinear term and a bias term, as shown in the above formula (3).

[0224] Exemplarily, in some embodiments, for a chroma sampling point, if the residual value of the luma sampling point corresponding to the chroma sampling point (i.e., the luma residual of the luma component of the current block corresponds to the value of the luma sampling point) is greater than the second residual threshold, that is, the second availability parameter corresponding to the luma sampling point indicates that the luma reconstruction value of the luma sampling point can be used, then the luma reconstruction value corresponding to the luma sampling point is determined based on the reconstruction value of the luma component of the current block, and then based on the above formulas (4) and (5), combined with the nonlinear term and / or bias term, and the derived model parameters c0~c7, the chroma prediction value is further corrected, the corrected chroma prediction value of the corresponding chroma sampling point is determined, and then the prediction value of the chroma component of the current block can be determined.

[0225] Bitmap

[0226] Furthermore, in an embodiment of the present application, when determining the luminance sampling value corresponding to the luminance sampling point based on the luminance prediction reference block, it is possible to choose to determine the value of the luminance prediction reference block corresponding to the luminance sampling point as the luminance reconstruction value; it is also possible to choose to determine the luminance reconstruction value based on the luminance offset value and the value corresponding to the luminance sampling point when the value of the luminance prediction reference block corresponding to the luminance sampling point is not 0.

[0227] It can be understood that in the embodiments of the present application, during the use of the model parameters, a brightness offset value can be introduced in order to reduce the dynamic range of the data and the bit depth required for derivation.

[0228] For example, in some embodiments, the luminance reconstruction value applied to the participating model may be subtracted from the luminance offset value to obtain a corresponding luminance reconstruction value, and the chrominance prediction value may be corrected using the luminance reconstruction value.

[0229] It should be noted that, in the embodiment of the present application, the brightness offset value (offsetY) can be simply represented by the average value of the four vertex pixel values ​​of the brightness prediction block.

[0230] That is to say, in the embodiment of the present application, the brightness reconstruction value L0 finally used in the model application process is ′ ~L5 ′ It is the difference between the reconstructed value L0"~L5" (the value is not 0) corresponding to the brightness sampling point and the brightness offset value offsetY.

[0231] It should be noted that in the embodiments of the present application, for different chroma formats indicated by different chroma format parameters, the chroma sampling point may correspond to a different number of luma sampling points. For example, for the first chroma format 4:4:4, one chroma sampling point corresponds to one luma sampling point, for the second chroma format 4:2:2, one chroma sampling point corresponds to three luma sampling points, and for the second chroma format 4:2:0, one chroma sampling point corresponds to six luma sampling points. In other words, a chroma sampling point corresponds to at least one luma sampling point, and in the process of determining the first availability parameter of the luma sampling point, the corresponding first availability parameter may be determined based on some or all of the at least one luma sampling point, which is not specifically limited in the present application.

[0232] That is, in an embodiment of the present application, for at least one luminance sampling point, it can be selected that when the residual value corresponding to any one of the luminance sampling points is less than or equal to the second residual threshold, it is determined that the second availability parameters corresponding to all luminance sampling points indicate "unavailable".

[0233] Accordingly, in an embodiment of the present application, for at least one luminance sampling point, it may be selected to determine that the second availability parameters corresponding to all luminance sampling points indicate "unavailable" when the residual values ​​corresponding to all luminance sampling points are less than or equal to the second residual threshold.

[0234] For example, in some embodiments, assuming that the second residual threshold is 0, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the sampling point at the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling point. If the residual value of the luma component of the current block corresponding to the luma sampling point L0 (xC, yC) is 0, it can be considered that the second availability parameter corresponding to the luma sampling point indicates "unavailable", and therefore, the luma reconstruction value at the corresponding first coordinate L0 (xC, yC) position does not participate in the model application.

[0235] For example, in some embodiments, assuming the second residual threshold is 0, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, the sampling points at the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) corresponding to the same positions as the chroma sampling points in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponding to the luma sampling point L1 (xC<<1, yC) is 0, the second availability parameters corresponding to all luma sampling points can be considered to indicate "unavailable". Therefore, the luma reconstruction values ​​at the corresponding second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) are not used in the model application.

[0236] For example, in some embodiments, assuming that the second residual threshold is 0, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, the sampling points corresponding to the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) at the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luminance component of the current block corresponds to the luminance sampling point L4 (xC<<1, yC<<1) and the value is 0, it can be considered that the second availability parameters corresponding to all luminance sampling points indicate "unavailable". Therefore, the corresponding luminance reconstruction values ​​at the fifth coordinate L4 (xC<<1, yC<<1), sixth coordinate L5 (xC<<1-1, yC<<1), seventh coordinate L6 (xC<<1+1, yC<<1), eighth coordinate L7 (xC<<1, yC<<1+1), ninth coordinate L8 (xC<<1-1, yC<<1+1), and tenth coordinate L9 (xC<<1+1, yC<<1+1) positions do not participate in the model application.

[0237] It should be noted that in an embodiment of the present application, if the second availability parameters corresponding to all luma sampling points in the predicted reference luma sampling point set indicate "unavailable", then the luma sampling points and chroma sampling points may no longer be screened and distinguished, but the luma reconstruction values ​​of the luma sampling points may continue to be used to execute the model application.

[0238] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; and then the predicted value of the chrominance component of the current block can be determined according to the preset weights, the chrominance prediction reference block and the chrominance prediction correction block.

[0239] It should be noted that, in an embodiment of the present application, after the chroma components of the current block are corrected using the inter-component prediction model, a chroma prediction correction block of the current block corresponding to the chroma prediction reference block of the current block can be determined, and then a weighted operation of the prediction values ​​of the chroma prediction reference block and the chroma prediction correction block can be performed using preset weights to ultimately obtain the prediction value of the chroma component of the current block. In other words, the prediction value of the chroma component of the current block can be obtained by weighting the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the corrected prediction value of the chroma component of the current block (chroma prediction correction block).

[0240] Exemplarily, in some embodiments, based on the above formula (3), according to the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block, that is, the corrected prediction value of the chrominance component of the current block (predCbVal for the Cb component and predCrVal for the Cr component) can be determined, and then it can be further weighted with the chrominance prediction reference block, that is, the initial prediction value of the chrominance component of the current block (predSamplesCb for the Cb component and predSamplesCr for the Cr component). For example, the weighted operation can be performed using the above formulas (6) and (7), so that the final prediction value of the chrominance component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component) can be obtained.

[0241] It should be noted that, in the embodiment of the present application, the preset weight may be a pre-set value, wherein the preset weight may be greater than or equal to 0 and less than or equal to 1, for example, the preset weight w is 0.75.

[0242] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; at the same time, a first weight can be determined based on the residual value of the luminance component of the current block; and then the predicted value of the chrominance component of the current block can be determined based on the first weight, the chrominance prediction reference block and the chrominance prediction correction block.

[0243] It should be noted that, in the embodiment of the present application, the weight value used to perform a weighted calculation on the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the revised prediction value of the chroma component of the current block (chroma prediction revised block) may be a first weight. The first weight may be determined by the residual value of the luminance component of the current block.

[0244] It can be understood that in the embodiment of the present application, when the first weight is determined based on the residual value of the luminance component of the current block, for the luminance sampling point, the smaller the residual value corresponding to the luminance sampling point, the more accurate the prediction effect of the position corresponding to the luminance sampling point can be considered. Then, the first weight determined at this time can assign a higher weight value to the initial prediction value of the corresponding chrominance sampling point.

[0245] That is, in an embodiment of the present application, when performing a weighted calculation on the chroma prediction reference block and the chroma prediction correction block, the residual value of the luma sampling point corresponding to the chroma sampling point can be used to determine the weight value, that is, the first weight is determined according to the residual value of the luma component of the current block. The smaller the residual value of the corresponding luma sampling point, the more accurate the prediction value of the chroma sampling point at the corresponding position, and thus the corresponding chroma prediction reference block has a larger weight.

[0246] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then, if AbsResLuma<5, the prediction value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.75:0.25, so as to obtain the final prediction value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in the following formulas: predSamplesCb′=(3×predSamplesCb+predCbVal+2)>>2 (11) predSamplesCr′=(3×predSamplesCr+predCbVal+2)>>2 (12)

[0247] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then if 5≤AbsResLuma<20, the prediction value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.5:0.5, so as to obtain the final prediction value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in the following formulas: predSamplesCb′=(predSamplesCb+predCbVal+1)>>1 (13) predSamplesCr′=(predSamplesCr+predCrVal+1)>>1 (14)

[0248] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then if 20≤AbsResLuma, the prediction value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.25:0.75, so as to obtain the final prediction value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in the following formulas: predSamplesCb′=(predSamplesCb+3×predCbVal+2)>>2 (15) predSamplesCr′=(predSamplesCr+3×predCrVal+2)>>2 (16)

[0249] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; at the same time, the nonlinear weighting coefficient can be determined; and then the predicted value of the chrominance component of the current block can be determined based on the first weight, the chrominance prediction reference block and the chrominance prediction correction block.

[0250] It should be noted that, in the embodiments of the present application, a nonlinear weighting method can be used to perform a weighted operation on the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the revised prediction value of the chroma component of the current block (chroma prediction revised block). That is, when performing a weighted operation on the chroma prediction reference block and the chroma prediction revised block, a predetermined nonlinear weighting coefficient can be used to perform nonlinear weighting on the two.

[0251] For example, in some embodiments, when determining the final predicted value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), the predicted value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the predicted value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) may be nonlinearly weighted according to the following formula: predSamplesCb′=a0predSamplesCb+a1predCbVal+a2nonlinear((predSamplesCb+predCbVal+1)>>1)+a3B (17)

[0252] predSamplesCr′=a4predSamplesCr+a5predCrVal+a6nonlinear((predSamplesCr+predCrVal+1)>>1)+a7B (18)

[0253] The nonlinear term nonlinear and the bias term B are determined by the above formulas (4) and (5). a0 to a7 are nonlinear weighting coefficients, which can be derived from the reference template of the current chroma prediction block (the previous row and the left column of the current chroma prediction block).

[0254] For example, in some embodiments, assuming that the first chroma prediction value (predRefCb for the Cb component and predRefCr for the Cr component) of the reference template, the second chroma prediction value (predRefCbVal for the Cb component and predRefCrVal for the Cr component), and the chroma reconstruction value (recRefCb for the Cb component and recRefCr for the Cr component) are used, equations can be established according to the following formulas, and the model coefficients a0 to a7 can be solved using, for example, the division-free Gaussian elimination method in ECM-10.0: recRefCb=a0predRefCb+a1predRefCbVal+a2nonlinear((predRefCb+predRefCbVal+1)>>1)+a3B (19) recRefCr=a4predRefCr+a5predRefCrVal+a6nonlinear((predRefCr+predRefCrVal+1)>>1)+a7B (20)

[0255] Among them, the nonlinear term nonlinear and the bias term B are determined by the above formula (4) and formula (5).

[0256] It should be noted that, in the embodiment of the present application, for luma sampling points whose second availability parameters all indicate "unavailable", it is not necessary to screen and distinguish the luma sampling points from the chroma sampling points.

[0257] In summary, the decoding method proposed by the above steps 101 to 107 mainly includes a method for screening the luminance samples (luminance sampling points) involved in the calculation and application of model parameters, which can filter the luminance reconstruction value, thereby correcting the chrominance prediction value and further reducing the prediction residual. On the one hand, when calculating the model parameters, it can be determined whether the luminance sample residual of the luminance sampling point satisfies less than or equal to the first residual threshold. If so, the chrominance prediction sample at the corresponding position and the luminance prediction sample closest to the chrominance prediction sample will not participate in the calculation of the model parameters. On the other hand, when applying the model, it can be determined whether the luminance sample residual of the luminance sampling point satisfies less than or equal to the second residual threshold. If so, the chrominance prediction sample at the corresponding position will not be corrected.

[0258] It can be seen that the decoding method proposed in the embodiment of the present application, during the process of calculating and applying the model parameters, chooses not to correct the chrominance prediction values ​​corresponding to the luma sampling points with higher prediction accuracy. For example, the chrominance prediction samples corresponding to the luma sample residual of 0 at L0" are not corrected, thereby improving the prediction accuracy to a certain extent and ensuring the coding complexity.

[0259] An embodiment of the present application proposes a decoding method, which determines a prediction reference block of the current block based on prediction parameters of the current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, the size of the luma prediction reference block being the same as the size of the luma block of the current block, and the size of the chroma prediction reference block being the same as the size of the chroma block of the current block; determines a reconstructed value of the luma component of the current block based on the residual value of the luma component of the current block and the luma prediction reference block; determines a set of model reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; determines model parameters of an inter-component prediction model based on the set of model reference luma sampling points, the residual value of the luma component of the current block, and the prediction reference block of the current block; determines a set of prediction reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; and determines the prediction value of the chroma component of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luma sampling points, the residual value of the luma component of the current block, and the reconstructed value of the luma component of the current block. That is to say, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample based on the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

[0260] Based on the above embodiments, another embodiment of the present application proposes a prediction method, wherein the prediction method may include an encoding method and a decoding method, and may be applied to both an encoder and a decoder.

[0261] For example, in some embodiments, the prediction method proposed in the embodiments of the present application can be improved with respect to determining model parameters of an inter-component prediction model and applying the inter-component prediction model. The inter-component prediction model can include InterCCCM, for example, InterCCCM-LumaResi based on InterCCCM.

[0262] Exemplarily, in some embodiments, the input of InterCCCM-LumaResi is: the luminance prediction value predSamplesY[x][y] of the current block, that is, the luminance prediction reference block; the luminance reconstruction value recSamplesY[x][y], that is, the reconstruction value of the luminance component of the current block; the luminance prediction residual resSamplesY[x][y], that is, the residual value of the luminance component of the current block; the first chrominance prediction value (predSamplesCb[x1][y1] for the Cb component and predSamplesCr[x1][y1] for the Cr component), that is, the chrominance prediction reference block, where x = 0..nTbW-1, y = 0..nTbH-1, x1 = 0..nTbWC-1, y1 = 0..nTbHC-1.

[0263] It is understood that in the embodiments of the present application, the luma prediction value, the luma reconstruction value, the luma residual value, and the chroma prediction value can be selected as four different inputs. Alternatively, only the luma prediction value, the luma reconstruction value, and the chroma prediction value can be input, and then the luma residual value can be obtained by calculating the difference between the luma reconstruction value and the luma prediction value.

[0264] It is understood that in the embodiments of the present application, the luminance prediction value, the luminance reconstruction value, the luminance residual value, and the chrominance prediction value can be selected as four different inputs. Alternatively, only the luminance prediction value, the luminance residual value, and the chrominance prediction value can be input, and the luminance reconstruction value can be obtained by calculating the sum of the luminance prediction value and the luminance residual value.

[0265] It is understood that in the embodiments of the present application, the luma prediction value, the luma reconstruction value, the luma residual value, and the chroma prediction value can be selected as four different inputs. Alternatively, only the luma reconstruction value, the luma residual value, and the chroma prediction value can be input, and the luma prediction value can be obtained by calculating the difference between the luma reconstruction value and the luma residual value.

[0266] It should be noted that, in the embodiments of the present application, the input of InterCCCM-LumaResi can be an inter-frame prediction value or a prediction value of an intra-frame prediction mode (such as an IBC mode). For example, the luma prediction value can be an inter-frame mode prediction value, and the chroma prediction value can be an intra-frame mode prediction value; or, the luma prediction value can be an intra-frame mode prediction value, and the chroma prediction value can be an inter-frame mode prediction value; or, the luma prediction value and the chroma prediction value can be a prediction value generated by a weighted mixture of intra-frame and inter-frame mode prediction values.

[0267] Exemplarily, in some embodiments, the output of InterCCCM-LumaResi is: the third chrominance prediction value of the current block (predSamplesCb′[x][y] for the Cb component, predSamplesCr′[x][y] for the Cr component), that is, the predicted value of the chrominance component of the current block, where x = 0..nTbWC-1, y = 0..nTbHC-1.

[0268] Exemplarily, in some embodiments, the specific process of InterCCCM-LumaResi is divided into two steps: solving the model parameters and generating the third chrominance prediction value of the current block. In the calculation of the model parameters, after obtaining the chrominance prediction sample position (chrominance sampling coordinates of the chrominance sampling point), it is determined whether the residual of one (for example, at L0) or more luminance samples at the corresponding position is 0 (such as the first residual threshold). If it is 0, the chrominance prediction sample at the corresponding position and the luminance prediction sample closest to the chrominance prediction sample do not participate in the model parameter calculation. When applying the model, after obtaining the chrominance prediction sample position, it is determined whether the residual of one (for example, at L0") or more luminance samples at the corresponding position is 0 (such as the second residual threshold). If it is 0, the chrominance prediction sample at the corresponding position is not corrected.

[0269] For example, in some embodiments, the inter-component prediction model can be an 8-tap filter consisting of 6 spatial luminance samples, a nonlinear term, and a bias term, as shown in the above formula (3). The nonlinear term and the bias term B are determined by the above formulas (4) and (5), and the model parameters c0 to c7 can be obtained by solving the equations, for example, using a Gaussian elimination method without division.

[0270] For example, in some embodiments, to reduce the number of luma and chroma prediction samples used in model parameter calculation, the chroma prediction block (chroma prediction reference block) is first downsampled by determining the downsampling step sizes dsX and dsY in the x and y directions based on the width and height of the chroma prediction block. The predChromaVal in the above formula is the chroma prediction value (chroma sampling point) after downsampling.

[0271] It is understandable that in the embodiments of the present application, all samples may be directly used to calculate the model parameters without performing downsampling processing.

[0272] For example, in some embodiments, according to different image color formats (chroma formats), the luma prediction samples (luma sampling points) and the chroma prediction samples (chroma sampling points) may have different positional relationships.

[0273] For example, in some embodiments, assuming the first residual threshold is 0, as shown in FIG3 , for the first 4:4:4 chroma format, each Y component corresponds to a set of Cb and Cr components. In this case, the luma prediction value L0 corresponding to the position of the first chroma prediction value C is obtained. A determination is made as to whether the luma sample residual at L0 is 0. If so, the chroma prediction sample at that position and the nearest luma prediction sample are not included in the model parameter calculation. Otherwise, L0 is obtained, and the values ​​of L1 to L5 are 0.

[0274] Exemplarily, in some embodiments, assuming that the first residual threshold is 0, as shown in FIG4 , for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, if the chroma sample position is at C0, the luma sample closest to the chroma sample position is at L0 and L2. Determine whether the luma sample residual at L0 is 0. If it is 0, the chroma prediction sample at this position and the nearest luma prediction sample do not participate in the model parameter calculation. Otherwise, obtain L0 to L2. When applied to the calculation formula, the value of L1 is considered equal to L0, and the values ​​of L3 to L5 are 0. If the chroma sample position is at Cm (m≠0), determine whether the luma sample residual at L0 is 0. If it is 0, the chroma prediction sample at this position and the nearest luma prediction sample do not participate in the model parameter calculation. Otherwise, obtain L0 and the luma prediction values ​​L1 and L2 on the left and right sides of L0, and the values ​​of L3 to L5 are 0. It can be understood that between adjacent chroma sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point. Among them, L0, L1, and L2 in Figure 4 can correspond to the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) determined in the second chroma format 4:2:2.

[0275] Exemplarily, in some embodiments, assuming that the first residual threshold is 0, as shown in FIG5 , for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, if the chroma sample position is at C0, the luminance samples closest to the chroma sample position are at L0, L2, L3, and L5. Determine whether the luminance sample residual at L0 is 0. If it is 0, the chroma prediction sample at this position and the luminance prediction sample closest to it do not participate in the model parameter calculation. Otherwise, obtain L0 to L5. When applied to the calculation formula, the value of L1 is considered to be equal to L0, and the value of L4 is considered to be equal to L3. If the chroma sample position is at Cm (m≠0), determine whether the luminance sample residual at L0 is 0. If it is 0, the chroma prediction sample at this position and the luminance prediction sample closest to it do not participate in the model parameter calculation. Otherwise, obtain L0 to L5. It can be understood that between the adjacent chroma sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point, and the L5 position of the left sampling point corresponds to the L4 position corresponding to the right sampling point. Among them, L0-L5 in Figure 5 can correspond to the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) determined under the third chroma format 4:2:0.

[0276] It is understood that in the embodiments of the present application, when determining samples that do not participate in model parameter calculation and / or model application, it is also possible to determine not only based on the luma residual value corresponding to the L0 position, but also based on multiple residual values ​​in L0 to L5. For example, L0 and L1, L0 and L3, L0 to L2, etc. Alternatively, it can be determined based on the chroma residual value of the corresponding position of the chroma sample being 0.

[0277] For example, in some embodiments, luma and chroma offset values ​​are introduced during the model parameter calculation process to reduce the dynamic range of the data and the bit depth required for derivation. The luma prediction value and chroma prediction value involved in the model parameter calculation are subtracted from the luma offset value and chroma offset value. In the InterCCCM technology, the luma offset value (offsetY) and chroma offset value (offsetCb for the Cb component and offsetCr for the Cr component) can be simply represented by the average value of the four vertex pixel values ​​of the luma prediction block and the chroma prediction block.

[0278] For example, in some embodiments, the final luminance sample values ​​L0′-L5′ used are the differences between L0′-L5 (non-zero values) and offsetY. The model parameters are calculated by establishing an equation involving predChromaVal, L0′-L5′, the nonlinear term, and the bias term, using, for example, the division-free Gaussian elimination method in ECM10.0. offsetCb and offsetCr also participate in the model parameter calculation.

[0279] It should be noted that in an embodiment of the present application, the average value of the four vertex pixel values ​​of the luminance prediction block and the chrominance prediction block can also be calculated first, and used as offsetY, offsetCb and offsetCr. After constructing the prediction block with the mean removed, the chrominance prediction block with the mean removed is downsampled to determine the position of the first chrominance prediction value participating in the model parameter calculation.

[0280] It should be noted that, in the embodiment of the present application, L0′~L5′ involved in the calculation of model parameters is L0~L5 before removing the mean, rather than the difference between L0~L5 and offsetY, and offsetCb and offsetCr are not used to calculate the model parameters; L0′~L5′ involved in the application model is L0"~L5" before removing the mean, rather than the difference between L0"~L5" and offsetY.

[0281] For example, in some embodiments, if the luma sample residual at L0 corresponding to all downsampled sample positions of the chroma prediction block is 0, then for the 4:4:4 color format, each Y component corresponds to a set of Cb and Cr components. In this case, the luma prediction value L0 corresponding to the position of the first chroma prediction value C is obtained, and the values ​​of L1 to L5 are 0. For the 4:2:2 color format, every two Y components share a set of Cb and Cr components. If the chroma sample position is at C0, the luma samples closest to the chroma sample position are at L0 and L2, and L0 to L2 are obtained (corresponding to the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) determined in the second chroma format 4:2:2). When applied to the calculation formula, the value of L1 is considered equal to L0, and the values ​​of L3 to L5 are 0. If the chroma sample position is at Cm (m≠0), L0 and the brightness prediction values ​​L1 and L2 on the left and right sides of L0 are obtained, and the values ​​of L3 to L5 are 0. It can be understood that between the adjacent chroma sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point. For 4:2:0 color format, every four Y components share a set of Cb and Cr components. If the chroma sample position is at C0, the luminance samples closest to the chroma sample position are at L0, L2, L3, and L5, and L0 to L5 are obtained (corresponding to the fifth coordinate L4 (xC<<1, yC<<1) determined under the third chroma format 4:2:0, the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), and the eighth coordinate L7 (xC<<1, yC<<1+1). The ninth coordinate L8 (xC<<1-1, yC<<1+1), the tenth coordinate L9 (xC<<1+1, yC<<1+1)), when applied to the calculation formula, the value of L1 is regarded as equal to L0, and the value of L4 is regarded as equal to L3. If the chroma sample position is at Cm (m≠0), L0~L5 are obtained. It can be understood that between the adjacent chroma sampling positions on the left and right, the L2 position corresponding to the left sampling point corresponds to the L1 position corresponding to the right sampling point, and the L5 position of the left sampling point corresponds to the L4 position corresponding to the right sampling point.

[0282] For example, in some embodiments, based on the above formula (3), the determined model parameters can be used to generate a second chroma prediction value predChromaVal for the current block, i.e., a chroma prediction correction block. Model parameters c0-c7 are the model parameters solved in the previous step. L0′-L5′ are the differences between the luminance reconstruction values ​​L0"-L5" (non-zero) and the luminance offset value (offsetY).

[0283] It should be noted that, in the embodiment of the present application, if the average value of the 6 spatial luminance sample values ​​is 0, it may be possible to choose not to correct the chrominance prediction sample at the corresponding position.

[0284] For example, in some embodiments, when the model is applied, the chroma prediction block is not downsampled, and all luma reconstructed samples corresponding to the first chroma prediction value in the chroma prediction block participate in the model application.

[0285] Exemplarily, in some embodiments, assuming that the second residual threshold is 0, as shown in FIG6 , for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the luminance reconstruction value L0" corresponding to the position of the first chroma prediction value C is obtained. It is determined whether the luminance sample residual at L0" is 0. If it is 0, the chroma prediction sample at this position and the nearest luminance reconstruction sample do not participate in the model application. Otherwise, L0" is obtained, and the values ​​of L1" to L5" are 0.

[0286] Exemplarily, in some embodiments, assuming that the second residual threshold is 0, as shown in FIG7 , for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, if the chroma sample position is at C0, the luminance samples closest to the chroma sample position are at L0" and L2". Determine whether the luminance sample residual at L0" is 0. If it is 0, the chroma prediction sample at this position and the nearest luminance reconstruction sample do not participate in the model application. Otherwise, when applied to the calculation formula, the value of L1" is deemed to be equal to L0", and the values ​​of L3"~L5" are 0. If the chroma sample position is at Cm (m≠0), determine whether the luminance sample residual at L0" is 0. If it is 0, the chroma prediction sample at this position and the nearest luminance reconstruction sample do not participate in the model application. Otherwise, obtain L0", and the luminance reconstruction values ​​L1" and L2" on the left and right sides of L0", and the values ​​of L3"~L5" are 0. It can be understood that between the adjacent left and right chroma sampling positions, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point.

[0287] Exemplarily, in some embodiments, assuming that the second residual threshold is 0, as shown in FIG8 , for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, if the chroma sample position is at C0, the luminance reconstruction samples closest to the chroma sample position are at L0", L2", L3", and L5". Determine whether the luminance sample residual at L0" is 0. If it is 0, the chroma prediction sample at this position and the nearest luminance reconstruction sample do not participate in the model application. Otherwise, when applied to the calculation formula, the value of L1" is considered to be equal to L0", and the value of L4" is considered to be equal to L3". If the chroma sample position is at Cm (m≠0), determine whether the luminance sample residual at L0" is 0. If it is 0, the chroma prediction sample at this position and the nearest luminance reconstruction sample do not participate in the model application. Otherwise, obtain L0" to L5". It can be understood that between adjacent chroma sampling positions on the left and right, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point, and the L5" position of the left sampling point corresponds to the L4" position corresponding to the right sampling point.

[0288] For example, in some embodiments, a luma offset is introduced during model application to reduce the dynamic range of the data and the bit depth required for derivation. Luma reconstructed values ​​used in the model application are subtracted from the luma offset. The luma offset (offsetY) is simply represented by the average of the four vertex pixel values ​​of the luma prediction block.

[0289] Exemplarily, in some embodiments, the obtained second chrominance prediction value (predCbVal for the Cb component and predCrVal for the Cr component) and the first chrominance prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) are weightedly added according to the above formulas (6) and (7) to generate a third chrominance prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component).

[0290] Exemplarily, in some embodiments, when the second chroma prediction value and the first chroma prediction value are weighted, the weighting weight is determined according to the residual value of the luma sample at L0" corresponding to the first chroma prediction value. The smaller the residual, the more accurate the prediction of the chroma sample at the corresponding position is considered, and the greater the weighting weight of the first chroma prediction value.

[0291] Exemplarily, in some embodiments, the absolute value of the prediction residual of the luma sample at L0" is assumed to be AbsResLuma. If AbsResLuma<5, the first chroma prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the second chroma prediction value (predCbVal for the Cb component and predCrVal for the Cr component) are weighted by 0.75:0.25 to generate a third chroma prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component).

[0292] Exemplarily, in some embodiments, the absolute value of the prediction residual of the luma sample at L0" is assumed to be AbsResLuma. If 5≤AbsResLuma<20, the first chroma prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the second chroma prediction value (predCbVal for the Cb component and predCrVal for the Cr component) are weighted by 0.5:0.5 to generate a third chroma prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component).

[0293] Exemplarily, in some embodiments, the absolute value of the prediction residual of the luma sample at L0" is assumed to be AbsResLuma. If 20≤AbsResLuma, the first chroma prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the second chroma prediction value (predCbVal for the Cb component and predCrVal for the Cr component) are weighted by 0.25:0.75 to generate a third chroma prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component).

[0294] Exemplarily, in some embodiments, the first chrominance prediction value (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the second chrominance prediction value (predCbVal for the Cb component and predCrVal for the Cr component) can be nonlinearly weighted to generate a third chrominance prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component).

[0295] Exemplarily, in some embodiments, if the luma sample residual at L0" corresponding to all sample positions of the chroma prediction block is 0, then for the 4:4:4 color format, each Y component corresponds to a set of Cb and Cr components. In this case, the luma reconstruction value L0" corresponding to the position of the first chroma prediction value C is obtained, and the values ​​of L1" to L5" are 0. For the 4:2:2 color format, every two Y components share a set of Cb and Cr components. If the chroma sample position is at C0, the luma sample closest to the chroma sample position is at L0" and L2", and L0" to L2" are obtained (corresponding to the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) determined under the second chroma format 4:2:2). When applied to the calculation formula, the value of L1" is considered to be equal to L0", and the values ​​of L3" to L5" are 0. If the chroma sample position is at Cm (m≠0), L0" and the luma reconstruction values ​​L1" and L2" on the left and right sides of L0" are obtained, and the values ​​of L3" to L5" are 0. It can be understood that between the adjacent chroma sample positions on the left and right, the L2" position corresponding to the left sample point corresponds to the L1" position corresponding to the right sample point. For 4:2:0 color format, every four Y components share a set of Cb and Cr components. If the chroma sample position is at C0, the luminance reconstruction samples closest to the chroma sample position are at L0", L2", L3", and L5", and L0" to L5" are obtained (corresponding to the fifth coordinate L4 (xC<<1, yC<<1) determined under the third chroma format 4:2:0, the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the The ninth coordinate L8 (xC<<1-1, yC<<1+1) and the tenth coordinate L9 (xC<<1+1, yC<<1+1)) are applied to the calculation formula. The value of L1" is considered to be equal to L0", and the value of L4" is considered to be equal to L3". If the chroma sample position is at Cm (m≠0), L0"~L5" are obtained. It can be understood that between the adjacent chroma sampling positions on the left and right, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point, and the L5" position of the left sampling point corresponds to the L4" position corresponding to the right sampling point.

[0296] It can be seen that the prediction method proposed in the embodiment of the present application filters the luminance reconstruction value, so that the first chrominance prediction value can be corrected, further reducing the prediction residual. This main scheme proposes a method for screening luminance samples involved in model parameter calculation and application. When calculating the model parameters, it is determined whether the luminance sample residual at L0 is 0. If it is 0, the chrominance prediction sample at the corresponding position and the luminance prediction sample closest to the chrominance prediction sample do not participate in the model parameter calculation. When applying the model, it is determined whether the luminance sample residual at L0" is 0. If it is 0, the chrominance prediction sample at the corresponding position is not corrected. To a certain extent, the prediction accuracy is improved and the coding complexity is guaranteed.

[0297] In other words, the prediction method proposed in the embodiments of this application provides a method for selecting luma samples for use in model parameter calculation and application. By not correcting the chroma prediction samples corresponding to luma sample residuals of zero at L0", the algorithm maintains algorithmic effectiveness while also taking complexity into account, effectively improving coding efficiency.

[0298] It should be noted that in the embodiment of the present application, it is possible to choose not to use luma samples and chroma samples whose residuals at corresponding positions are 0 only in the process of calculating model parameters. In the application process, all samples in the chroma prediction block are corrected.

[0299] It should be noted that, in the embodiments of the present application, if no brightness samples are involved in the calculation or application of the model parameters, the prediction method proposed in the embodiments of the present application may not be applied.

[0300] An embodiment of the present application proposes a prediction method, which determines a prediction reference block of the current block based on prediction parameters of the current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, the size of the luma prediction reference block being the same as the size of the luma block of the current block, and the size of the chroma prediction reference block being the same as the size of the chroma block of the current block; determines a reconstructed value of the luma component of the current block based on the residual value of the luma component of the current block and the luma prediction reference block; determines a set of model reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; determines model parameters of an inter-component prediction model based on the set of model reference luma sampling points, the residual value of the luma component of the current block, and the prediction reference block of the current block; determines a set of prediction reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; and determines the prediction values ​​of the chroma components of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luma sampling points, the residual value of the luma component of the current block, and the reconstructed value of the luma component of the current block. That is to say, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample based on the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

[0301] Another embodiment of the present application provides an encoding method, which is applied to an encoder. FIG13 is a flow chart of the encoding method provided in the embodiment of the present application. As shown in FIG13 , the encoding method performed by the encoder may include the following steps:

[0302] Step 201: Determine the residual value between the prediction reference block of the current block and the luminance component of the current block based on the prediction parameters of the current block, and write the prediction parameters of the current block and the residual value of the luminance component of the current block into the bitstream; wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block.

[0303] In an embodiment of the present application, the residual value of the prediction reference block of the current block and the brightness component of the current block can be determined based on the prediction parameters of the current block. The prediction parameters of the current block and the residual value of the brightness component of the current block can also be written into the code stream and transmitted to the decoding end.

[0304] It should be noted that the encoding method in the embodiment of the present application is applied to an encoder. In addition, the encoding method may include a prediction method, more specifically, an image component prediction method. The video image may 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 currently to be predicted in the video image.

[0305] Here, when the first color component needs to be predicted, the component to be predicted is the first color component; when the second color component needs to be predicted, the component to be predicted is the second color component; when the third color component needs to be predicted, the component to be predicted is the third color component. In addition, assuming that the current block predicts the first color component and the first color component is the luminance component, that is, the component to be predicted is the luminance component, then the current block can also be called a luminance block; or assuming that the current block predicts the second color component and the second color component is the chrominance component, that is, the component to be predicted is the chrominance component, then the current block can also be called a chrominance block.

[0306] It should be noted that, in the embodiment of the present application, the prediction parameters corresponding to the current block can be used to determine the prediction block of the luminance component and the prediction block of the chrominance component corresponding to the current block.

[0307] It can be understood that, in the embodiment of the present application, the prediction parameters of the current block can be used to determine the parameters of the prediction method used when predicting the current block.

[0308] Exemplarily, in some embodiments, the prediction parameter of the current block may include at least one of the following parameters: an inter-frame prediction parameter, an intra-frame block copy (IBC) parameter, an inter-frame template matching parameter, and an intra-frame template matching parameter.

[0309] It should be noted that, in the embodiments of the present application, the prediction parameters of the current block may also include any other types of parameters and information, and the present application does not specifically limit the prediction parameters of the current block.

[0310] In the embodiment of the present application, a prediction reference block of the current block may be determined according to the prediction parameters of the current block.

[0311] It should be noted that, in the embodiment of the present application, the prediction reference block of the current block may include a luminance prediction reference block corresponding to the luminance component and a chrominance prediction reference block corresponding to the chrominance component.

[0312] That is to say, in an embodiment of the present application, the luminance component and chrominance component of the current block can be predicted respectively based on the prediction parameters, so that the corresponding luminance prediction reference block and chrominance prediction reference block can be determined, that is, the prediction reference block of the current block can be determined.

[0313] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, it is possible to select an inter-frame prediction parameter based on which the prediction reference block for the current block is determined through inter-frame prediction. That is, it is possible to select an inter-frame prediction for the luminance component and the chrominance component of the current block based on the inter-frame prediction parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0314] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, the prediction reference block for the current block can be determined based on the IBC parameters. That is, IBC prediction can be performed on the luma component and chroma component of the current block based on the IBC parameters, thereby determining the corresponding luma prediction reference block and chroma prediction reference block.

[0315] It should be noted that in the embodiments of the present application, when determining the prediction reference block for the current block based on the prediction parameters of the current block, it is possible to select inter-frame template matching parameters to determine the prediction reference block for the current block through inter-frame template matching. That is, inter-frame template matching prediction can be performed on the luminance component and chrominance component of the current block based on the inter-frame template matching parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0316] It should be noted that in the embodiments of the present application, when determining the prediction reference block of the current block based on the prediction parameters of the current block, it is possible to select intra-frame template matching parameters to determine the prediction reference block of the current block through intra-frame template matching. That is, it is possible to select intra-frame template matching prediction for the luminance component and chrominance component of the current block based on the intra-frame template matching parameters, thereby determining the corresponding luminance prediction reference block and chrominance prediction reference block.

[0317] Exemplarily, in some embodiments, based on the prediction parameters of the current block, the prediction reference block can also be obtained in any of the following ways: the inter-frame / BV-based prediction part in GPM, the inter-frame / BV-based prediction block in CIIP, etc.

[0318] Furthermore, in an embodiment of the present application, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block.

[0319] That is to say, in the embodiment of the present application, the prediction reference block determined by the prediction parameters is the same size as the current block.

[0320] Step 202: Determine a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block.

[0321] In an embodiment of the present application, after determining the residual value of the luminance component of the current block and the luminance prediction reference block of the current block, the reconstructed value of the luminance component of the current block can be further determined based on the residual value of the luminance component of the current block and the luminance prediction reference block.

[0322] It should be noted that, in an embodiment of the present application, when determining the reconstructed value of the luminance component of the current block based on the residual value of the luminance component of the current block and the luminance prediction reference block, the sum of the residual value of the luminance component of the current block and the predicted value corresponding to the luminance prediction reference block can be determined as the reconstructed value of the luminance component of the current block.

[0323] Step 203: Determine a set of model reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block.

[0324] In an embodiment of the present application, after determining the prediction reference block of the current block including the luminance prediction reference block and the chrominance prediction reference block based on the prediction parameters, the model reference luminance sampling point set corresponding to the chrominance sampling point can be further determined based on the chrominance sampling point in the chrominance prediction reference block.

[0325] It should be noted that, in an embodiment of the present application, when selecting chroma sampling points in a chroma prediction reference block, all sampling points in the chroma prediction reference block may be selected as chroma sampling points, or some of the sampling points may be selected as chroma sampling points by downsampling.

[0326] It can be understood that in the embodiments of the present application, in order to reduce the number of luminance and chrominance prediction samples involved in the calculation of model parameters (i.e., the number of chrominance sampling points and luminance sampling points), the chrominance prediction block can be downsampled first, thereby determining the chrominance sampling points in the chrominance prediction block.

[0327] Furthermore, in an embodiment of the present application, the downsampling step size may be first determined based on the size parameter of the chroma prediction reference block; and then the chroma prediction reference block may be downsampled based on the downsampling step size to determine the chroma sampling points.

[0328] It should be noted that in the embodiments of the present application, the downsampling step sizes dsX and dsY in the x-direction and y-direction are first determined based on the width and height of the chroma prediction reference block, so that the chroma prediction reference block can be downsampled using the downsampling step size, and finally the downsampled chroma prediction value, i.e., the chroma sampling point, is obtained.

[0329] It can be understood that, in the embodiments of the present application, the model reference luminance sampling point set determined based on the chrominance sampling points may include luminance sampling points used for model parameter derivation.

[0330] It should be noted that, in the embodiments of the present application, since the chroma sampling points may be some or all of the sampling points in the chroma prediction reference block, correspondingly, the luma sampling points may also be some or all of the sampling points in the luma prediction reference block that correspond to the chroma sampling points. The correspondence between the chroma sampling points and the luma sampling points may be determined based on the chroma format parameters of the current block.

[0331] That is to say, in the embodiments of the present application, the chrominance sampling points used to determine the model parameters of the inter-component prediction model can be all the sampling points in the chrominance prediction reference block, or can be part of the sampling points in the chrominance prediction reference block, and the present application does not make specific limitations.

[0332] Furthermore, in an embodiment of the present application, when determining a set of model reference luminance sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block, the chroma format parameters can be determined first; then, based on the chroma format parameters and the chroma sampling points in the chroma prediction reference block, the luminance sampling points corresponding to the chroma sampling points can be determined in the luminance prediction reference block; finally, the model reference luminance sampling point set can be determined based on the luminance sampling points.

[0333] It should be noted that, in the embodiment of the present application, the chroma format of the current block can be determined according to the chroma format parameters, and the chroma format parameters can be written into the code stream.

[0334] It is understood that, in the embodiment of the present application, the chroma format parameter may be used to indicate the chroma format corresponding to the current block, wherein the chroma format may be an image color format, including 4:4:4, 4:2:2, and 4:2:0.

[0335] For example, in some embodiments, the chroma format parameter may be represented by sps_chroma_format_idc. When the chroma format parameter takes a first value, the current block is determined to be in the first chroma format; when the chroma format parameter takes a second value, the current block is determined to be in the second chroma format; and when the chroma format parameter takes a third value, the current block is determined to be in the third chroma format.

[0336] It should be noted that in the embodiments of the present application, the first value, the second value, and the third value are different, and the first value, the second value, and the third value can be in parameter form or in digital form. Specifically, the chroma format parameter can be a parameter written in a parameter set or a flag value, and is not specifically limited here.

[0337] In addition, for the first value, the second value, and the third value, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2; or the first value can be set to 2, the second value can be set to 1, and the third value can be set to 0. In the embodiment of the present application, the first value is set to 0, the second value is set to 1, and the third value is set to 2, but this is not specifically limited.

[0338] It should be noted that, in the embodiment of the present application, the first chroma format may be 4:4:4, the second chroma format may be 4:2:2, and the third chroma format may be 4:2:0.

[0339] Furthermore, in an embodiment of the present application, when determining the luma sampling point corresponding to the chroma sampling point in the luma block of the current block based on the chroma format parameters and the chroma sampling point in the chroma block of the current block, the relevant luma coordinates can be first determined in the luma prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block; and then the sampling point corresponding to the relevant luma coordinates can be determined as the luma sampling point corresponding to the chroma sampling point.

[0340] It is understood that in the embodiment of the present application, the relevant luma coordinates may be coordinate positions in the luma prediction reference block that correspond to the coordinate positions of the chroma sampling points. The corresponding relationship of the coordinate positions may be determined by chroma format parameters. Depending on the chroma format parameters, the ultimately determined relevant luma coordinates may be different.

[0341] Exemplarily, in some embodiments, the chroma sampling point coordinates of the chroma sampling point may be (xC, yC).

[0342] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include the first coordinates L0 (xC, yC) when the current block is in the first chroma format.

[0343] It is understood that in the embodiment of the present application, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinate can be obtained in the luma prediction reference block as the related luma coordinate, that is, the sampling point of the first coordinate L0 (xC, yC) in the luma prediction reference block is the corresponding luma sampling point.

[0344] That is, in an embodiment of the present application, when the current block is in the first chroma format, the determined model reference luminance sampling point set includes a luminance sampling point of the first coordinate L0 (xC, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0345] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, when the current block is in the second chroma format, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) include: a second coordinate L1 (xC<<1, yC), a third coordinate L2 (xC<<1-1, yC), and a fourth coordinate L3 (xC<<1+1, yC).

[0346] It can be understood that in the embodiment of the present application, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC), that is, the sampling points with the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) in the luminance prediction reference block are the corresponding luminance sampling points.

[0347] That is, in an embodiment of the present application, when the current block is in the second chroma format, the determined model reference luminance sampling point set includes luminance sampling points of the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0348] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include, when the current block is in the third chroma format, a fifth coordinate L4 (xC<<1, yC<<1), a sixth coordinate L5 (xC<<1-1, yC<<1), a seventh coordinate L6 (xC<<1+1, yC<<1), an eighth coordinate L7 (xC<<1, yC<<1+1), a ninth coordinate L8 (xC<<1-1, yC<<1+1), and a tenth coordinate L9 (xC<<1+1, yC<<1+1).

[0349] It can be understood that in the embodiments of the present application, for the third chrominance format 4:2:0, every four Y components share a set of Cb and Cr components. If the chrominance sampling point coordinates of the chrominance sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chrominance sampling point coordinates in the luminance prediction reference block are the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1), that is, the sampling points of the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1) in the luminance prediction reference block are the corresponding luminance sampling points.

[0350] That is to say, in the embodiments of the present application, in the case where the current block is in the third chrominance format, the determined set of model reference luminance sampling points includes the fifth coordinate L4(xC << 1, yC << 1), the sixth coordinate L5(xC << 1 - 1, yC << 1), the seventh coordinate L6(xC << 1 + 1, yC << 1), the eighth coordinate L7(xC << 1, yC << 1 + 1), the ninth coordinate L8(xC << 1 - 1, yC << 1 + 1), and the tenth coordinate L9(xC << 1 + 1, yC << 1 + 1) corresponding to the chrominance sampling point coordinates (xC, yC).

[0351] It should be noted that in the embodiments of the present application, << is the left shift operator; where m << n represents the operation of shifting the binary number of m to the left by n bits, and the result of m << n is m × 2 n , where m and n are integers greater than 0.

[0352] That is to say, in the embodiments of the present application, the luminance sampling points include the sampling points at the same position of the chrominance sampling point in the luminance prediction reference block, and / or, the sampling points adjacent to the sampling points at the same position.

[0353] Exemplarily, in some embodiments, the luma sampling point may include a sampling point at the same position as the chroma sampling point in the luma prediction reference block, such as a sampling point at coordinates (xY, yY), and / or a sampling point adjacent to the same position as the sampling point, such as a sampling point at coordinates (xY-1, yY), (xY+1, yY), (xY, yY+1), (xY-1, yY+1), and (xY+1, yY+1).

[0354] Step 204: Determine model parameters of the inter-component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block.

[0355] In an embodiment of the present application, after determining the model reference luminance sampling point set corresponding to the chroma sampling point based on the chroma sampling point in the chroma prediction reference block, the model parameters of the inter-component prediction model can be further determined based on the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block.

[0356] It should be noted that in an embodiment of the present application, after determining the chrominance sampling points and the corresponding model reference luminance sampling point set used to derive the model parameters of the inter-component prediction model, the luminance sampling points and the chrominance sampling points can be further screened in combination with the residual value of the luminance component of the current block, and the filtered sampling points whose residual values ​​meet the requirements can be further used to determine the model parameters of the inter-component prediction model.

[0357] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the predicted reference block of the current block, the first availability parameter of the luminance sampling point in the model reference luminance sampling point set can be first determined based on the residual value of the luminance component of the current block; and then the model parameters of the inter-component prediction model can be determined based on the first availability parameter and the predicted reference block of the current block.

[0358] It should be noted that, in the embodiments of the present application, the first availability parameter can be used to indicate whether to use the luminance sampling value of the luminance sampling point. For a luminance sampling point, if the corresponding first availability parameter indicates "available," it can be understood that the luminance sampling value of the luminance sampling point is used; if the corresponding first availability parameter indicates "unavailable," it can be understood that the luminance sampling value of the luminance sampling point is not used.

[0359] Further, in an embodiment of the present application, when determining the first availability parameter of a luma sampling point in a model reference luma sampling point set based on the residual value of the luma component of the current block, it is possible to determine that the first availability parameter of the luma sampling point indicates not to use the luma sampling value of the luma sampling point when the residual value of the luma component of the current block corresponding to the value of the luma sampling point satisfies a first condition; and determine that the first availability parameter of the luma sampling point indicates to use the luma sampling value of the luma sampling point when the residual value of the luma component of the current block corresponding to the value of the luma sampling point does not satisfy the first condition.

[0360] It should be noted that, in an embodiment of the present application, for a luma sampling point, the residual value of the luma component of the current block at the luma sampling coordinates of the luma sampling point may be first determined, that is, the value corresponding to the luma sampling point. Then, it is determined whether the residual value of the luma sampling coordinates satisfies the first condition. If so, the first availability parameter of the luma sampling point is determined to be "unavailable", indicating that the luma sampling value of the luma sampling point is not used; otherwise, it is determined to be "available", indicating that the luma sampling value of the luma sampling point is used.

[0361] It is understood that in the embodiment of the present application, the first condition can be used to distinguish and filter the residual values ​​in combination with a pre-set first residual threshold. The first condition may include: the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to the first residual threshold.

[0362] It should be noted that, in the embodiment of the present application, the value of the first residual threshold may be any preset value. For example, the first residual threshold may be 0 or 4.

[0363] That is, in an embodiment of the present application, when determining the first availability parameter for a luminance reference point, the value of the residual value of the luminance component corresponding to the luminance sampling point may be compared with the first residual threshold. If the comparison result shows that the value of the residual value of the luminance component corresponding to the luminance sampling point is less than or equal to the first residual threshold, then it can be determined that the accuracy of the luminance prediction for the luminance sampling point is relatively high, and it can be considered that the model parameters derived using the luminance sampling value of the luminance sampling point are not applicable to sampling points with low prediction accuracy. Therefore, the luminance sampling value of the luminance sampling point may be selected not to be used, that is, the first availability parameter for determining the luminance sampling point may indicate not to use the luminance sampling value of the luminance sampling point.

[0364] Accordingly, in an embodiment of the present application, if the comparison result is that the residual value of the luminance component corresponding to the value of the luminance sampling point is greater than the first residual threshold, then it can be determined that the accuracy of the luminance prediction of the luminance sampling point is relatively low, and it can be considered that the model parameters derived using the luminance sampling value of the luminance sampling point can be applicable to the sampling point with low prediction accuracy. Therefore, the luminance sampling value of the luminance sampling point can be selected, that is, the first availability parameter of the luminance sampling point can be determined to indicate the use of the luminance sampling value of the luminance sampling point.

[0365] It should be noted that, in an embodiment of the present application, the first availability parameter can be determined by comparing the residual value of the luminance component corresponding to the value of the luminance sampling point with the first residual threshold, or the first availability parameter can be determined in any other manner, for example, the residual value of the luminance component corresponding to the value of the luminance sampling point is right-shifted by 2 bits and then compared with the first residual threshold.

[0366] Exemplarily, in some embodiments, assuming that the first residual threshold is 0, then when the luminance sampling points are screened according to the residual value of the luminance component of the current block, if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is 0, that is, less than or equal to the first residual threshold, then the luminance sampling value of the luminance sampling point will not be used to derive the model parameters; if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is not 0, that is, greater than the first residual threshold, then the luminance sampling value of the luminance sampling point will be used to derive the model parameters.

[0367] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, the luma sampling value corresponding to the luma sampling point can be determined based on the luma prediction reference block, and the chroma sampling value corresponding to the chroma sampling point can be determined based on the chroma prediction reference block when the first availability parameter indicates the use of the luma sampling value of the luma sampling point; and the model parameters of the inter-component prediction model can be determined based on the luma sampling value, the chroma sampling value, the nonlinear term and / or the bias term.

[0368] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples, a nonlinear term and a bias term, as shown in the above formula (3).

[0369] Exemplarily, in some embodiments, for a chroma sampling point, if the residual value of the luma sampling point corresponding to the chroma sampling point (i.e., the luma residual of the luma component of the current block corresponds to the value of the luma sampling point) is greater than the first residual threshold, that is, the first availability parameter corresponding to the luma sampling point indicates that the model parameters can be derived using the luma sampling value of the luma sampling point, then the luma sampling value corresponding to the luma sampling point can be determined based on the luma prediction reference block, and the chroma sampling value corresponding to the chroma sampling point can be determined based on the chroma prediction reference block, and then based on the above formulas (4) and (5), combined with the nonlinear term and / or the bias term, the model parameters c0 to c7 are determined, wherein the model parameters c0 to c7 can be obtained by solving equations, for example, using the division-free Gaussian elimination method.

[0370] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value, the chroma sample value, and the bias term. That is, in the process of determining the model parameters, nonlinear terms can also be omitted.

[0371] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (8).

[0372] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value, the chroma sample value, and the nonlinear term. That is, the bias term can be omitted during the process of determining the model parameters.

[0373] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (9).

[0374] Furthermore, in an embodiment of the present application, when determining the model parameters of the inter-component prediction model based on the first availability parameter and the prediction reference block of the current block, if the first availability parameter indicates the use of the luma sample value of the luma sample point, the luma sample value corresponding to the luma sample point can be determined based on the luma prediction reference block, and the chroma sample value corresponding to the chroma sample point can be determined based on the chroma prediction reference block; and then the model parameters of the inter-component prediction model can be determined based on the luma sample value and the chroma sample value. That is, in the process of determining the model parameters, the bias term and the nonlinear term can also be omitted.

[0375] That is, in the embodiment of the present application, it is possible to choose not to use the bias term and the nonlinear term to determine the model parameters of the inter-component prediction model.

[0376] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (10).

[0377] Furthermore, in an embodiment of the present application, when determining the luminance sampling value corresponding to the luminance sampling point based on the luminance prediction reference block, the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point can be selected as the luminance sampling value; or, when the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point is not 0, the luminance sampling value can be determined based on the luminance offset value and the luminance prediction value.

[0378] Furthermore, in an embodiment of the present application, when determining the chroma sampling value corresponding to the chroma sampling point based on the chroma prediction reference block, the chroma prediction value of the chroma prediction reference block corresponding to the chroma sampling point can be selected as the chroma sampling value; or the chroma sampling value can be determined based on the chroma offset value and the chroma prediction value of the chroma prediction reference block corresponding to the chroma sampling point.

[0379] It can be understood that in the embodiments of the present application, during the calculation of the model parameters, in order to reduce the dynamic range of the data and the bit depth required for derivation, a luminance offset value and a chrominance offset value may be introduced.

[0380] For example, in some embodiments, the brightness prediction value involved in the model parameter calculation may be subtracted from the brightness offset value to obtain the corresponding brightness sampling value, and then the model parameters may be calculated using the brightness sampling value.

[0381] For example, in some embodiments, the chroma prediction value involved in the model parameter calculation may be subtracted from the chroma offset value to obtain the corresponding chroma sampling value, and then the model parameters may be calculated using the chroma sampling value.

[0382] It should be noted that, in the embodiments of the present application, the luminance offset value (offsetY) and the chrominance offset value (offsetCb for the Cb component and offsetCr for the Cr component) can be simply represented by the average value of the four vertex pixel values ​​of the luminance prediction block and the chrominance prediction block.

[0383] It is understandable that in the embodiments of the present application, the offset value may not be applied in the calculation process of the model parameters, that is, the brightness offset value (offsetY) and the chrominance offset value (offsetCb for the Cb component and offsetCr for the Cr component) may not be introduced.

[0384] That is to say, in the embodiment of the present application, in the process of calculating the model parameters, the luminance sampling values ​​L0′~L5′ finally used are the differences between the luminance prediction values ​​L0~L5 (the values ​​are not 0) corresponding to the luminance sampling points and the luminance offset value offsetY. Finally, the model parameters c0~c7 can be obtained by establishing an equation of the chrominance sampling value predChromaVal and L0′~L5′, the nonlinear term and the bias term, using, for example, the division-free Gaussian elimination method in ECM10.0.

[0385] It should be noted that in the embodiments of the present application, for different chroma formats indicated by different chroma format parameters, the chroma sampling point may correspond to a different number of luma sampling points. For example, for the first chroma format 4:4:4, one chroma sampling point corresponds to one luma sampling point, for the second chroma format 4:2:2, one chroma sampling point corresponds to three luma sampling points, and for the second chroma format 4:2:0, one chroma sampling point corresponds to six luma sampling points. In other words, a chroma sampling point corresponds to at least one luma sampling point, and in the process of determining the first availability parameter of the luma sampling point, the corresponding first availability parameter may be determined based on some or all of the at least one luma sampling point, which is not specifically limited in the present application.

[0386] That is, in an embodiment of the present application, for at least one luminance sampling point, it can be selected that when the residual value corresponding to any one of the luminance sampling points is less than or equal to the first residual threshold, it is determined that the first availability parameters corresponding to all luminance sampling points indicate "unavailable".

[0387] Accordingly, in an embodiment of the present application, for at least one luminance sampling point, it may be selected to determine that the first availability parameters corresponding to all luminance sampling points indicate "unavailable" when the residual values ​​corresponding to all luminance sampling points are less than or equal to the first residual threshold.

[0388] For example, in some embodiments, assuming that the first residual threshold is 0, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the sampling point at the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling point. If the residual value of the luma component of the current block corresponding to the luma sampling point L0 (xC, yC) is 0, it can be considered that the first availability parameter corresponding to the luma sampling point indicates "unavailable", and therefore, the chroma sampling value at the position (xC, yC) and the corresponding luma sampling value at the first coordinate L0 (xC, yC) position do not participate in the model parameter calculation.

[0389] For example, in some embodiments, assuming the first residual threshold is 0, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, the sampling points at the same positions as the chroma sampling points in the luma prediction reference block, corresponding to the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC), can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponding to the luma sampling point (xC<<1, yC) is 0, the first availability parameters corresponding to all luma sampling points can be considered to indicate "unavailable". Therefore, the chroma sampling value at the position (xC, yC) and the corresponding luma sampling values ​​at the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) are not included in the model parameter calculation.

[0390] For example, in some embodiments, assuming that the first residual threshold is 0, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, the sampling points corresponding to the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) at the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponds to the luma sampling point L4 (xC<<1, yC<<1) and the value is 0, it can be considered that the first availability parameters corresponding to all luma sampling points indicate "unavailable". Therefore, the chroma sampling value at the position (xC, yC) and the corresponding fifth coordinate L4 (xC<<1, yC<<1), sixth coordinate L5 (xC<<1-1, yC<<1), seventh coordinate L6 (xC<<1+1, yC<<1), eighth coordinate L7 (xC<<1, yC<<1+1), ninth coordinate L8 (xC<<1-1, yC<<1+1), and tenth coordinate L9 (xC<<1+1, yC<<1+1) do not participate in the model parameter calculation.

[0391] It is understood that in the embodiments of the present application, when determining samples that do not participate in model parameter calculation and / or model application, it is also possible to determine not only based on the luma residual value corresponding to the L0 position, but also based on multiple residual values ​​in L0 to L5. For example, L0 and L1, L0 and L3, L0 to L2, etc. Alternatively, it can be determined based on the chroma residual value of the corresponding position of the chroma sample being 0.

[0392] It should be noted that in an embodiment of the present application, if the first availability parameters corresponding to all luma sampling points in the model reference luma sampling point set indicate "unavailable", then the luma sampling points and chroma sampling points may no longer be screened and distinguished, but the chroma sampling values ​​of the chroma sampling points and the luma sampling values ​​of the luma sampling points may continue to be used to derive the model parameters.

[0393] Step 205: Determine a set of prediction reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block.

[0394] In an embodiment of the present application, after determining the prediction reference block of the current block including the luminance prediction reference block and the chrominance prediction reference block based on the prediction parameters, the set of prediction reference luminance sampling points corresponding to the chrominance sampling points can be further determined based on the chrominance sampling points in the chrominance prediction reference block.

[0395] It should be noted that, in the embodiment of the present application, during the application of the inter-component prediction model, when selecting chroma sampling points in the chroma prediction reference block, all sampling points in the chroma prediction reference block can be selected as chroma sampling points.

[0396] That is to say, in the implementation of the present application, when determining the model parameters of the inter-component prediction model, you can choose to downsample the chroma prediction reference block, and when applying the inter-component prediction model, you need to use all the sampling points in the chroma prediction reference block as chroma sampling points.

[0397] Furthermore, in an embodiment of the present application, when determining a set of predicted reference luma sampling points corresponding to a chroma sampling point based on a chroma sampling point in a chroma prediction reference block, a chroma format parameter may be determined first; then, based on the chroma format parameter and the chroma sampling point in the chroma prediction reference block, a luma sampling point corresponding to the chroma sampling point may be determined in the luma prediction reference block; finally, a set of predicted reference luma sampling points may be determined based on the luma sampling point.

[0398] It should be noted that, in the embodiment of the present application, the chroma format of the current block may be determined according to the chroma format parameters.

[0399] It is understood that, in the embodiment of the present application, the chroma format parameter may be used to indicate the chroma format corresponding to the current block, wherein the chroma format may be an image color format, including 4:4:4, 4:2:2, and 4:2:0.

[0400] Furthermore, in an embodiment of the present application, when determining the luma sampling point corresponding to the chroma sampling point in the luma block of the current block based on the chroma format parameters and the chroma sampling point in the chroma block of the current block, the relevant luma coordinates can be first determined in the luma prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block; and then the sampling point corresponding to the relevant luma coordinates can be determined as the luma sampling point corresponding to the chroma sampling point.

[0401] It is understood that in the embodiment of the present application, the relevant luma coordinates may be coordinate positions in the luma prediction reference block that correspond to the coordinate positions of the chroma sampling points. The corresponding relationship of the coordinate positions may be determined by chroma format parameters. Depending on the chroma format parameters, the ultimately determined relevant luma coordinates may be different.

[0402] Exemplarily, in some embodiments, the chroma sampling point coordinates of the chroma sampling point may be (xC, yC).

[0403] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include the first coordinates L0 (xC, yC) when the current block is in the first chroma format.

[0404] It is understood that in the embodiment of the present application, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinate can be obtained in the luma prediction reference block as the related luma coordinate, that is, the sampling point of the first coordinate L0 (xC, yC) in the luma prediction reference block is the corresponding luma sampling point.

[0405] That is, in an embodiment of the present application, when the current block is in the first chroma format, the determined set of predicted reference luminance sampling points includes a luminance sampling point with the first coordinate L0 (xC, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0406] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, when the current block is in the second chroma format, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) include: a second coordinate L1 (xC<<1, yC), a third coordinate L2 (xC<<1-1, yC), and a fourth coordinate L3 (xC<<1+1, yC).

[0407] It can be understood that in the embodiment of the present application, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), then the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC), that is, the sampling points with the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) in the luminance prediction reference block are the corresponding luminance sampling points.

[0408] That is, in an embodiment of the present application, when the current block is in the second chroma format, the determined set of predicted reference luminance sampling points includes luminance sampling points of the second coordinate L1 (xC<<1, yC), the third coordinate L2 (xC<<1-1, yC), and the fourth coordinate L3 (xC<<1+1, yC) corresponding to the chroma sampling point coordinate (xC, yC).

[0409] Accordingly, in an embodiment of the present application, when determining relevant luminance coordinates in a luminance prediction reference block based on the chroma format parameters and the chroma sampling point coordinates of the chroma sampling point in the chroma prediction reference block, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block based on the chroma sampling point coordinates (xC, yC) may include, when the current block is in the third chroma format, a fifth coordinate L4 (xC<<1, yC<<1), a sixth coordinate L5 (xC<<1-1, yC<<1), a seventh coordinate L6 (xC<<1+1, yC<<1), an eighth coordinate L7 (xC<<1, yC<<1+1), a ninth coordinate L8 (xC<<1-1, yC<<1+1), and a tenth coordinate L9 (xC<<1+1, yC<<1+1).

[0410] It can be understood that, in the embodiment of the present application, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. If the chroma sampling point coordinates of the chroma sampling point are at (xC, yC), the relevant luminance coordinates corresponding to the chroma sampling point coordinates in the luminance prediction reference block are the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), the tenth coordinate L9 (xC<<1-1, yC<<1+1), and the ninth coordinate L10 (xC<<1-1, yC<<1+1). <<1+1,yC<<1+1), that is, the sampling points of the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) in the brightness prediction reference block are the corresponding brightness sampling points.

[0411] That is to say, in the embodiments of the present application, when the current block is in the third chrominance format, the determined set of predicted reference luminance sampling points includes the fifth coordinate L4(xC<<1, yC<<1), the sixth coordinate L5(xC<<1 - 1, yC<<1), the seventh coordinate L6(xC<<1 + 1, yC<<1), the eighth coordinate L7(xC<<1, yC<<1 + 1), the ninth coordinate L8(xC<<1 - 1, yC<<1 + 1), and the tenth coordinate L9(xC<<1 + 1, yC<<1 + 1) of the luminance sampling points corresponding to the chrominance sampling point coordinates (xC, yC).

[0412] It should be noted that in the embodiments of the present application, << is the left shift operator; where m<<n represents the operation of shifting the binary number of m to the left by n bits, and the result of m<<n is m×2 n , where m and n are integers greater than 0.

[0413] That is to say, in the embodiments of the present application, the luminance sampling points include the sampling points at the same position of the chrominance sampling points in the luminance prediction reference block, such as the sampling points of the first coordinate L0(xC, yC), and / or the sampling points adjacent to the sampling points at the same position.

[0414] Exemplarily, in some embodiments, the luminance sampling points may include the sampling points at the same position of the chrominance sampling points in the luminance prediction reference block, such as the sampling points of the coordinate (xY, yY), and / or the sampling points adjacent to the sampling points at the same position, such as the sampling points of the coordinates (xY - 1, yY), (xY + 1, yY), (xY, yY + 1), (xY - 1, yY + 1), (xY + 1, yY + 1).

[0415] Step 206: Determine the predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of predicted reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0416] In the embodiments of the present application, after determining the set of predicted reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block, and after determining the model parameters of the inter-component prediction model according to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block, the predicted value of the chrominance component of the current block can be further determined according to the model parameters of the inter-component prediction model, the set of predicted reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

[0417] It should be noted that, in an embodiment of the present application, after determining the set of prediction reference luminance sampling points using the inter-component prediction model, the luminance sampling points and chrominance sampling points can be further screened in combination with the residual value of the luminance component of the current block, and the modified chrominance prediction value of the inter-component prediction model can be used for the screened sampling points whose residual values ​​meet the requirements.

[0418] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the model parameters of the inter-component prediction model, the predicted reference luminance sampling point set, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block, the second availability parameter of the luminance sampling point in the predicted reference luminance sampling point set can be first determined based on the residual value of the luminance component of the current block; and then the predicted value of the chrominance component of the current block can be determined based on the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block.

[0419] It should be noted that, in the embodiments of the present application, the second availability parameter can be used to indicate whether to use the luminance reconstruction value of the luminance sampling point. For a luminance sampling point, if the corresponding second availability parameter indicates "available," it can be understood that the luminance reconstruction value of the luminance sampling point is used; if the corresponding second availability parameter indicates "unavailable," it can be understood that the luminance reconstruction value of the luminance sampling point is not used.

[0420] Furthermore, in an embodiment of the present application, when determining the second availability parameter of a luma sampling point in a set of predicted reference luma sampling points based on the residual value of the luma component of the current block, it is possible to determine, when the residual value of the luma component of the current block corresponding to the value of the luma sampling point satisfies a second condition, that the second availability parameter of the luma sampling point indicates not to use the luma reconstruction value of the luma sampling point; and when the residual value of the luma component of the current block corresponding to the value of the luma sampling point does not satisfy the second condition, determine that the second availability parameter of the luma sampling point indicates to use the luma reconstruction value of the luma sampling point.

[0421] It should be noted that, in an embodiment of the present application, for a luma sampling point, the residual value of the luma component of the current block at the luma sampling coordinates of the luma sampling point may be first determined, that is, the value corresponding to the luma sampling point. Then, it is determined whether the residual value of the luma sampling coordinates satisfies the second condition. If so, the second availability parameter of the luma sampling point is determined to be "unavailable", indicating that the luma reconstruction value of the luma sampling point is not used; otherwise, it is determined to be "available", indicating that the luma reconstruction value of the luma sampling point is used.

[0422] It is understood that in the embodiment of the present application, the second condition can be used to distinguish and filter the residual values ​​in combination with a pre-set second residual threshold. The second condition may include: the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to the second residual threshold.

[0423] It should be noted that in the embodiments of the present application, the first residual threshold and the second residual threshold may be the same or different, and this application does not specifically limit this. The value of the second residual threshold may be any pre-set value. For example, the second residual threshold may be 0 or 4.

[0424] That is, in an embodiment of the present application, when determining the second availability parameter for a luma reference point, the value of the residual value of the luma component corresponding to the luma sampling point may be compared with the second residual threshold. If the comparison result shows that the value of the residual value of the luma component corresponding to the luma sampling point is less than or equal to the second residual threshold, then it can be determined that the accuracy of the luma prediction for the luma sampling point is relatively high, and it can be considered that the luma reconstructed value of the luma sampling point is not suitable for correcting the chroma prediction value of a sampling point with low prediction accuracy. Therefore, the luma reconstructed value of the luma sampling point may be selected not to be used, that is, it can be determined that the second availability parameter for the luma sampling point indicates that the luma reconstructed value of the luma sampling point is not to be used.

[0425] Accordingly, in an embodiment of the present application, if the comparison result is that the residual value of the luma component corresponding to the luma sampling point is greater than the second residual threshold, then it can be determined that the accuracy of the luma prediction of the luma sampling point is relatively low, and it can be considered that the luma reconstructed value of the luma sampling point can be applicable to the correction of the chroma prediction value of the sampling point with low prediction accuracy. Therefore, the luma reconstructed value of the luma sampling point can be selected for use, that is, the first availability parameter for determining the luma sampling point indicates the use of the luma reconstructed value of the luma sampling point.

[0426] It should be noted that, in an embodiment of the present application, the second availability parameter can be determined by comparing the residual value of the luminance component corresponding to the value of the luminance sampling point with the second residual threshold, or the second availability parameter can be determined in any other manner, for example, the residual value of the luminance component corresponding to the value of the luminance sampling point is right-shifted by 2 bits and then compared with the second residual threshold.

[0427] Exemplarily, in some embodiments, assuming that the second residual threshold is 0, then when the luminance sampling points are screened according to the residual value of the luminance component of the current block, if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is 0, that is, less than or equal to the second residual threshold, then the luminance reconstruction value of the luminance sampling point will not be used; if the residual value of the luminance component of the current block corresponds to the value of the luminance sampling point is not 0, that is, greater than the second residual threshold, then the luminance reconstruction value of the luminance sampling point will be used.

[0428] Further, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the second availability parameter, the model parameters of the inter-component prediction model and the reconstruction value of the luminance component of the current block, it is possible to determine that the reconstruction value of the luminance component of the current block corresponds to the luminance reconstruction value of the luminance sampling point when the second availability parameter indicates the use of the luminance reconstruction value of the luminance sampling point; and then the predicted value of the chrominance component of the current block can be determined based on the luminance reconstruction value, the model parameters, the nonlinear term and / or the bias term.

[0429] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples, a nonlinear term and a bias term, as shown in the above formula (3).

[0430] Exemplarily, in some embodiments, for a chroma sampling point, if the residual value of the luma sampling point corresponding to the chroma sampling point (i.e., the luma residual of the luma component of the current block corresponds to the value of the luma sampling point) is greater than the second residual threshold, that is, the second availability parameter corresponding to the luma sampling point indicates that the luma reconstruction value of the luma sampling point can be used, then the luma reconstruction value corresponding to the luma sampling point is determined based on the reconstruction value of the luma component of the current block, and then based on the above formulas (4) and (5), combined with the nonlinear term and / or bias term, and the derived model parameters c0~c7, the chroma prediction value is further corrected, the corrected chroma prediction value of the corresponding chroma sampling point is determined, and then the prediction value of the chroma component of the current block can be determined.

[0431] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luma component of the current block, if the second availability parameter indicates the use of the luma reconstruction value of the luma sampling point, the reconstructed value of the luma component of the current block can be determined to correspond to the luma reconstruction value of the luma sampling point; then, the predicted value of the chrominance component of the current block can be determined based on the luma reconstruction value, the model parameters, and the bias term. That is, nonlinear terms can also be omitted during model application.

[0432] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (8).

[0433] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luma component of the current block, if the second availability parameter indicates the use of the luma reconstruction value of the luma sampling point, the reconstructed value of the luma component of the current block may be determined to correspond to the luma reconstruction value of the luma sampling point; then, the predicted value of the chrominance component of the current block may be determined based on the luma reconstruction value, the model parameters, and the nonlinear term. That is, the bias term may not be used during model application.

[0434] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (9).

[0435] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luma component of the current block, if the second availability parameter indicates the use of the luma reconstruction value of the luma sampling point, the reconstructed value of the luma component of the current block can be determined to correspond to the luma reconstruction value of the luma sampling point; then, the predicted value of the chrominance component of the current block can be determined based on the luma reconstruction value and the model parameters. That is, during the model application process, the bias term and the nonlinear term can also be omitted.

[0436] That is, in the embodiment of the present application, it is possible to choose not to use the bias term and the nonlinear term when applying the model.

[0437] It should be noted that, in an embodiment of the present application, the inter-component prediction model may include InterCCCM, wherein the inter-component prediction model may be an 8-tap filter consisting of 6 spatial luminance samples and a bias term, as shown in formula (10).

[0438] Furthermore, in an embodiment of the present application, when determining the luminance sampling value corresponding to the luminance sampling point based on the luminance prediction reference block, it is possible to choose to determine the value of the luminance prediction reference block corresponding to the luminance sampling point as the luminance reconstruction value; it is also possible to choose to determine the luminance reconstruction value based on the luminance offset value and the value corresponding to the luminance sampling point when the value of the luminance prediction reference block corresponding to the luminance sampling point is not 0.

[0439] It can be understood that in the embodiments of the present application, during the use of the model parameters, a brightness offset value can be introduced in order to reduce the dynamic range of the data and the bit depth required for derivation.

[0440] For example, in some embodiments, the luminance reconstruction value applied to the participating model may be subtracted from the luminance offset value to obtain a corresponding luminance reconstruction value, and the chrominance prediction value may be corrected using the luminance reconstruction value.

[0441] It should be noted that, in the embodiment of the present application, the brightness offset value (offsetY) can be simply represented by the average value of the four vertex pixel values ​​of the brightness prediction block.

[0442] That is to say, in the embodiment of the present application, during the model application process, the brightness reconstruction value L0′~L5′ finally used is the difference between the reconstruction value L0"~L5" (the value is not 0) corresponding to the brightness sampling point and the brightness offset value offsetY.

[0443] It should be noted that in the embodiments of the present application, for different chroma formats indicated by different chroma format parameters, the chroma sampling point may correspond to a different number of luma sampling points. For example, for the first chroma format 4:4:4, one chroma sampling point corresponds to one luma sampling point, for the second chroma format 4:2:2, one chroma sampling point corresponds to three luma sampling points, and for the second chroma format 4:2:0, one chroma sampling point corresponds to six luma sampling points. In other words, a chroma sampling point corresponds to at least one luma sampling point, and in the process of determining the first availability parameter of the luma sampling point, the corresponding first availability parameter may be determined based on some or all of the at least one luma sampling point, which is not specifically limited in the present application.

[0444] That is, in an embodiment of the present application, for at least one luminance sampling point, it can be selected that when the residual value corresponding to any one of the luminance sampling points is less than or equal to the second residual threshold, it is determined that the second availability parameters corresponding to all luminance sampling points indicate "unavailable".

[0445] Accordingly, in an embodiment of the present application, for at least one luminance sampling point, it may be selected to determine that the second availability parameters corresponding to all luminance sampling points indicate "unavailable" when the residual values ​​corresponding to all luminance sampling points are less than or equal to the second residual threshold.

[0446] For example, in some embodiments, assuming that the second residual threshold is 0, for the first chroma format 4:4:4, each Y component corresponds to a set of Cb and Cr components. In this case, the sampling point at the first coordinate L0 (xC, yC) corresponding to the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling point. If the residual value of the luma component of the current block corresponding to the luma sampling point L0 (xC, yC) is 0, it can be considered that the second availability parameter corresponding to the luma sampling point indicates "unavailable", and therefore, the luma reconstruction value at the corresponding first coordinate L0 (xC, yC) position does not participate in the model application.

[0447] For example, in some embodiments, assuming the second residual threshold is 0, for the second chroma format 4:2:2, every two Y components share a set of Cb and Cr components. In this case, the sampling points at the second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) corresponding to the same positions as the chroma sampling points in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luma component of the current block corresponding to the luma sampling point L1 (xC<<1, yC) is 0, the second availability parameters corresponding to all luma sampling points can be considered to indicate "unavailable". Therefore, the luma reconstruction values ​​at the corresponding second coordinates L1 (xC<<1, yC), third coordinates L2 (xC<<1-1, yC), and fourth coordinates L3 (xC<<1+1, yC) are not used in the model application.

[0448] For example, in some embodiments, assuming that the second residual threshold is 0, for the third chroma format 4:2:0, every four Y components share a set of Cb and Cr components. In this case, the sampling points corresponding to the fifth coordinate L4 (xC<<1, yC<<1), the sixth coordinate L5 (xC<<1-1, yC<<1), the seventh coordinate L6 (xC<<1+1, yC<<1), the eighth coordinate L7 (xC<<1, yC<<1+1), the ninth coordinate L8 (xC<<1-1, yC<<1+1), and the tenth coordinate L9 (xC<<1+1, yC<<1+1) at the same position as the chroma sampling point coordinates in the luma prediction reference block can be used as the corresponding luma sampling points. If the residual value of the luminance component of the current block corresponds to the luminance sampling point L4 (xC<<1, yC<<1) and the value is 0, it can be considered that the second availability parameters corresponding to all luminance sampling points indicate "unavailable". Therefore, the corresponding luminance reconstruction values ​​at the fifth coordinate L4 (xC<<1, yC<<1), sixth coordinate L5 (xC<<1-1, yC<<1), seventh coordinate L6 (xC<<1+1, yC<<1), eighth coordinate L7 (xC<<1, yC<<1+1), ninth coordinate L8 (xC<<1-1, yC<<1+1), and tenth coordinate L9 (xC<<1+1, yC<<1+1) positions do not participate in the model application.

[0449] It should be noted that in an embodiment of the present application, if the second availability parameters corresponding to all luma sampling points in the predicted reference luma sampling point set indicate "unavailable", then the luma sampling points and chroma sampling points may no longer be screened and distinguished, but the luma reconstruction values ​​of the luma sampling points may continue to be used to execute the model application.

[0450] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; and then the predicted value of the chrominance component of the current block can be determined according to the preset weights, the chrominance prediction reference block and the chrominance prediction correction block.

[0451] It should be noted that, in an embodiment of the present application, after the chroma components of the current block are corrected using the inter-component prediction model, a chroma prediction correction block of the current block corresponding to the chroma prediction reference block of the current block can be determined, and then a weighted operation of the prediction values ​​of the chroma prediction reference block and the chroma prediction correction block can be performed using preset weights to ultimately obtain the prediction value of the chroma component of the current block. In other words, the prediction value of the chroma component of the current block can be obtained by weighting the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the corrected prediction value of the chroma component of the current block (chroma prediction correction block).

[0452] Exemplarily, in some embodiments, based on the above formula (3), according to the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block, that is, the corrected prediction value of the chrominance component of the current block (predCbVal for the Cb component and predCrVal for the Cr component) can be determined, and then it can be further weighted with the chrominance prediction reference block, that is, the initial prediction value of the chrominance component of the current block (predSamplesCb for the Cb component and predSamplesCr for the Cr component). For example, the weighted operation can be performed using the above formulas (6) and (7), so that the final prediction value of the chrominance component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component) can be obtained.

[0453] It should be noted that, in the embodiment of the present application, the preset weight may be a pre-set value, wherein the preset weight may be greater than or equal to 0 and less than or equal to 1, for example, the preset weight w is 0.75.

[0454] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; at the same time, a first weight can be determined based on the residual value of the luminance component of the current block; and then the predicted value of the chrominance component of the current block can be determined based on the first weight, the chrominance prediction reference block and the chrominance prediction correction block.

[0455] It should be noted that, in the embodiment of the present application, the weight value used to perform a weighted calculation on the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the revised prediction value of the chroma component of the current block (chroma prediction revised block) may be a first weight. The first weight may be determined by the residual value of the luminance component of the current block.

[0456] It can be understood that in the embodiment of the present application, when the first weight is determined based on the residual value of the luminance component of the current block, for the luminance sampling point, the smaller the residual value corresponding to the luminance sampling point, the more accurate the prediction effect of the position corresponding to the luminance sampling point can be considered. Then, the first weight determined at this time can assign a higher weight value to the initial prediction value of the corresponding chrominance sampling point.

[0457] That is, in an embodiment of the present application, when performing a weighted calculation on the chroma prediction reference block and the chroma prediction correction block, the residual value of the luma sampling point corresponding to the chroma sampling point can be used to determine the weight value, that is, the first weight is determined according to the residual value of the luma component of the current block. The smaller the residual value of the corresponding luma sampling point, the more accurate the prediction value of the chroma sampling point at the corresponding position, and thus the corresponding chroma prediction reference block has a larger weight.

[0458] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then if AbsResLuma<5, the predicted value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the predicted value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.75:0.25, so as to obtain the final predicted value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in formulas (11) and (12).

[0459] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then if 5≤AbsResLuma<20, the prediction value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.5:0.5, so as to obtain the final prediction value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in (13) and (14).

[0460] For example, in some embodiments, assuming that the absolute value of the prediction residual of the luma sample at L0" is AbsResLuma, then if 20≤AbsResLuma, the prediction value of the chroma sampling point in the chroma prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chroma prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be weighted by 0.25:0.75, so as to obtain the final prediction value of the chroma component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), as shown in (15) and (16).

[0461] Furthermore, in an embodiment of the present application, when determining the predicted value of the chrominance component of the current block based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms, the chrominance prediction correction block of the current block can be determined first based on the luminance reconstruction value, model parameters, nonlinear terms and / or bias terms; at the same time, the nonlinear weighting coefficient can be determined; and then the predicted value of the chrominance component of the current block can be determined based on the first weight, the chrominance prediction reference block and the chrominance prediction correction block.

[0462] It should be noted that, in the embodiments of the present application, a nonlinear weighting method can be used to perform a weighted operation on the initial prediction value of the chroma component of the current block (chroma prediction reference block) and the revised prediction value of the chroma component of the current block (chroma prediction revised block). That is, when performing a weighted operation on the chroma prediction reference block and the chroma prediction revised block, a predetermined nonlinear weighting coefficient can be used to perform nonlinear weighting on the two.

[0463] Exemplarily, in some embodiments, when determining the final prediction value of the chrominance component (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component), the prediction value of the chrominance sampling point in the chrominance prediction reference block (predSamplesCb for the Cb component and predSamplesCr for the Cr component) and the prediction value of the corresponding position in the chrominance prediction correction block (predCbVal for the Cb component and predCrVal for the Cr component) can be nonlinearly weighted according to the above formulas (17) and (18).

[0464] The nonlinear term nonlinear and the bias term B are determined by the above formulas (4) and (5). a0 to a7 are nonlinear weighting coefficients, which can be derived from the reference template of the current chroma prediction block (the previous row and the left column of the current chroma prediction block).

[0465] For example, in some embodiments, assuming the first chroma prediction value (predRefCb for the Cb component and predRefCr for the Cr component) of the reference template, the second chroma prediction value (predRefCbVal for the Cb component and predRefCrVal for the Cr component), and the chroma reconstruction value (recRefCb for the Cb component and recRefCr for the Cr component) of the reference template, equations can be established according to the above formulas (19) and (20), and the model coefficients a0 to a7 can be solved using, for example, the division-free Gaussian elimination method in ECM-10.0.

[0466] Among them, the nonlinear term nonlinear and the bias term B are determined by the above formula (4) and formula (5).

[0467] It should be noted that, in the embodiment of the present application, for luma sampling points whose second availability parameters all indicate "unavailable", it is not necessary to screen and distinguish the luma sampling points from the chroma sampling points.

[0468] In summary, the encoding method proposed by the above steps 201 to 206 mainly includes a method for screening the luma samples (luminance sampling points) involved in the calculation and application of model parameters, which can filter the luma reconstruction value, thereby correcting the chroma prediction value and further reducing the prediction residual. On the one hand, when calculating the model parameters, it can be determined whether the luma sample residual of the luma sampling point satisfies less than or equal to the first residual threshold. If so, the chroma prediction sample at the corresponding position and the luma prediction sample closest to the chroma prediction sample will not participate in the calculation of the model parameters. On the other hand, when applying the model, it can be determined whether the luma sample residual of the luma sampling point satisfies less than or equal to the second residual threshold. If so, the chroma prediction sample at the corresponding position will not be corrected.

[0469] It can be seen that the decoding method proposed in the embodiment of the present application, during the process of calculating and applying the model parameters, chooses not to correct the chrominance prediction values ​​corresponding to the luma sampling points with higher prediction accuracy. For example, the chrominance prediction samples corresponding to the luma sample residual of 0 at L0" are not corrected, thereby improving the prediction accuracy to a certain extent and ensuring the coding complexity.

[0470] An embodiment of the present application proposes a coding method, which determines a prediction reference block of the current block based on prediction parameters of the current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, the size of the luma prediction reference block being the same as the size of the luma block of the current block, and the size of the chroma prediction reference block being the same as the size of the chroma block of the current block; determines a reconstructed value of the luma component of the current block based on the residual value of the luma component of the current block and the luma prediction reference block; determines a set of model reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; determines model parameters of an inter-component prediction model based on the set of model reference luma sampling points, the residual value of the luma component of the current block, and the prediction reference block of the current block; determines a set of prediction reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block; and determines the prediction values ​​of the chroma components of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luma sampling points, the residual value of the luma component of the current block, and the reconstructed value of the luma component of the current block. That is to say, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample based on the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

[0471] In yet another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, FIG14 is a schematic diagram of the first structure of an encoder proposed in an embodiment of the present application. As shown in FIG14 , the encoder 100 may include: a first determining unit 111; wherein,

[0472] The first determining unit 111 is configured to determine the residual value of the prediction reference block of the current block and the luminance component of the current block according to the prediction parameters of the current block, and write the prediction parameters of the current block and the residual value of the luminance component of the current block into the code stream; wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; determine the reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; according to the The method comprises the steps of: determining a set of model reference luminance sampling points corresponding to the chroma sampling points in the chroma prediction reference block; determining model parameters of an inter-component prediction model according to the model reference luminance sampling point set, a residual value of the luminance component of the current block, and a prediction reference block of the current block; determining a set of prediction reference luminance sampling points corresponding to the chroma sampling points in the chroma prediction reference block; and determining a prediction value of the chroma component of the current block according to the model parameters of the inter-component prediction model, the prediction reference luminance sampling point set, the residual value of the luminance component of the current block, and a reconstructed value of the luminance component of the current block.

[0473] It should be noted that, in the embodiment of the present application, the encoder 100 can also be regarded as a data processing mode (or "entropy encoder"), which is used to encode the values ​​of the syntax elements to be encoded.

[0474] It is understood 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 can also be a module or a non-modular device. 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.

[0475] 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.

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

[0477] Based on the composition of the above-mentioned encoder 100 and the computer-readable storage medium, Figure 15 is a second schematic diagram of the composition structure of the encoder proposed in an embodiment of the present application. As shown in Figure 15, the encoder 100 may include: a first memory 121 and a first processor 122, a first communication interface 123 and a first bus system 124. The first memory 121, the first processor 122, and the first communication interface 123 are coupled together through the first bus system 124. It can be understood that the first bus system 124 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 124 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 124 in the figure. Among them,

[0478] The first communication interface 123 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0479] The first memory 121 is used to store computer programs that can be run on the first processor;

[0480] The first processor 122 is configured to, when running the computer program, determine, based on prediction parameters of the current block, a residual value between a prediction reference block of the current block and a luma component of the current block, and write the prediction parameters of the current block and the residual value of the luma component of the current block into a bitstream; wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, the luma prediction reference block having the same size as the luma block of the current block, and the chroma prediction reference block having the same size as the chroma block of the current block; determine, based on the residual value of the luma component of the current block and the luma prediction reference block, a reconstructed value of the luma component of the current block; and determine, based on chroma sampling points in the chroma prediction reference block, a set of model reference luma sampling points corresponding to the chroma sampling points.

[0481] Determine, based on the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block, the model parameters of the inter-component prediction model; determine, based on the chroma sampling points in the chroma prediction reference block, the prediction reference luminance sampling point set corresponding to the chroma sampling points; and determine, based on the model parameters of the inter-component prediction model, the prediction reference luminance sampling point set, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block, the prediction value of the chroma component of the current block.

[0482] It is understood that the first memory 121 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 121 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0483] The first processor 122 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 122. The above-mentioned first processor 122 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic 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 121 , and the first processor 122 reads the information in the first memory 121 and completes the steps of the above method in combination with its hardware.

[0484] 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.

[0485] Optionally, as another embodiment, the first processor 122 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.

[0486] This embodiment provides an encoder that, in the process of determining the model parameters of the inter-component prediction model, can screen the luminance sampling points involved in the derivation of the model parameters according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, during the derivation and application of the model, it can be determined whether to use the luminance prediction samples based on the prediction accuracy of the luminance prediction samples, thereby obtaining model parameters that can more accurately reflect the relationship between the luminance prediction samples and the chrominance prediction samples. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

[0487] In yet another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, FIG16 is a schematic diagram of the first structure of a decoder proposed in an embodiment of the present application. As shown in FIG16 , the decoder 200 may include: a second determining unit 211; wherein,

[0488] The second determining unit 211 is configured to decode the code stream, determine the prediction parameters of the current block and the residual value of the luminance component of the current block; determine the prediction reference block of the current block according to the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; determine the reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; determine the reconstructed value of the luminance component of the current block according to the chrominance prediction reference block; The method comprises the steps of: determining a set of model reference luminance sampling points corresponding to the chroma sampling points in the current block; determining model parameters of an inter-component prediction model according to the set of model reference luminance sampling points, a residual value of the luminance component of the current block, and a prediction reference block of the current block; determining a set of prediction reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block; and determining a prediction value of the chroma component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and a reconstructed value of the luminance component of the current block.

[0489] It should be noted that, in the embodiment of the present application, the decoder 200 can also be regarded as a data processing mode (or "entropy decoder"), which is used to decode the values ​​of the syntax elements to be decoded.

[0490] 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.

[0491] 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, which is applied to the decoder 200 and stores a computer program. When the computer program is executed by the second processor, it implements any of the methods in the aforementioned embodiments.

[0492] Based on the composition of the above-mentioned decoder 200 and the computer-readable storage medium, Figure 17 is a second schematic diagram of the composition structure of the decoder proposed in an embodiment of the present application. As shown in Figure 17, the decoder 200 may include: a second memory 221 and a second processor 222, a second communication interface 223 and a second bus system 224. The second memory 221 and the second processor 222, and the second communication interface 223 are coupled together through the second bus system 224. It can be understood that the second bus system 224 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 224 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 224 in the figure. Among them,

[0493] The second communication interface 223 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0494] The second memory 221 is used to store computer programs that can be run on the second processor;

[0495] The second processor 222 is configured to, when running the computer program, decode the code stream, determine the prediction parameters of the current block and the residual value of the luminance component of the current block; determine the prediction reference block of the current block according to the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; determine the reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; and determine the reconstructed value of the luminance component of the current block according to the chrominance prediction reference block. The method comprises the steps of: determining a set of model reference luminance sampling points corresponding to the chroma sampling points in a chroma prediction reference block; determining model parameters of an inter-component prediction model according to the model reference luminance sampling point set, a residual value of the luminance component of the current block, and a prediction reference block of the current block; determining a set of prediction reference luminance sampling points corresponding to the chroma sampling points according to the chroma sampling points in the chroma prediction reference block; and determining a prediction value of the chroma component of the current block according to the model parameters of the inter-component prediction model, the prediction reference luminance sampling point set, the residual value of the luminance component of the current block, and a reconstructed value of the luminance component of the current block.

[0496] It is understood that the second memory 221 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 second memory 221 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0497] The second processor 222 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 second processor 222. The above-mentioned second processor 222 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may 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 second memory 221 , and the second processor 222 reads the information in the second memory 221 and completes the steps of the above method in combination with its hardware.

[0498] 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.

[0499] Optionally, as another embodiment, the second processor 222 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.

[0500] This embodiment provides a decoder, which, in the process of determining the model parameters of the inter-component prediction model, can screen the luminance sampling points involved in the derivation of the model parameters according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, during the derivation and application of the model, it can be determined whether to use the luminance prediction samples according to the prediction accuracy of the luminance prediction samples, thereby obtaining model parameters that can more accurately reflect the relationship between the luminance prediction samples and the chrominance prediction samples. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

[0501] Furthermore, an embodiment of the present application also proposes a code stream, wherein the code stream is generated by bit encoding based on the information to be encoded; wherein the information to be encoded includes at least: prediction parameters of the current block, residual values ​​of the luminance component of the current block, and chroma format parameters.

[0502] 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.

[0503] 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.

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

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

[0506] 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.

[0507] 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

[0508] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. The methods include determining a prediction reference block for a current block based on prediction parameters of a current block, wherein the prediction reference block includes a luma prediction reference block and a chroma prediction reference block, wherein the luma prediction reference block has the same size as the luma block of the current block, and the chroma prediction reference block has the same size as the chroma block of the current block. Determining a reconstructed value of the luma component of the current block based on a residual value of the luma component of the current block and the luma prediction reference block. Determining a set of model reference luma sampling points corresponding to the chroma sampling points based on chroma sampling points in the chroma prediction reference block. Determining model parameters of an inter-component prediction model based on the set of model reference luma sampling points, the residual value of the luma component of the current block, and the prediction reference block of the current block. Determining a set of prediction reference luma sampling points corresponding to the chroma sampling points based on the chroma sampling points in the chroma prediction reference block. Determining a prediction value of the chroma component of the current block based on the model parameters of the inter-component prediction model, the set of prediction reference luma sampling points, the residual value of the luma component of the current block, and the reconstructed value of the luma component of the current block. That is to say, in an embodiment of the present application, in the process of determining the model parameters of the inter-component prediction model, the luminance sampling points participating in the derivation of the model parameters can be screened according to the residual value of the luminance component of the current block. At the same time, in the process of applying the inter-component prediction model, the luminance sampling points can also be screened according to the residual value of the luminance component of the current block. Therefore, in the process of derivation and application of the model, it can be determined whether to use the luminance prediction sample based on the prediction accuracy of the luminance prediction sample, so that model parameters that can more accurately reflect the relationship between the luminance prediction sample and the chrominance prediction sample can be obtained. At the same time, a better correction effect can also be obtained, thereby improving the accuracy of the chrominance prediction and further improving the encoding and decoding performance.

Claims

1. A decoding method, applied to a decoder, the method comprising: Decoding a bitstream to determine prediction parameters of a current block and a residual value of a luminance component of the current block; Determining a prediction reference block of the current block according to the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; Determining a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; Determining a set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; Determining model parameters of an inter-component prediction model according to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block; Determining a set of prediction reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; Determining a predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

2. The method according to claim 1, wherein The prediction parameters include at least one of the following parameters: an inter-frame prediction parameter, an intra-block copy (IBC) parameter, an inter-frame template matching parameter, and an intra-frame template matching parameter.

3. The method according to claim 2, wherein, The determining the prediction reference block of the current block according to the prediction parameters of the current block includes: Determining the prediction reference block of the current block through inter-frame prediction based on the inter-frame prediction parameter; and / or, Determining the prediction reference block of the current block through IBC based on the IBC parameter; and / or, Determining the prediction reference block of the current block through inter-frame template matching based on the inter-frame template matching parameter; and / or, Determining the prediction reference block of the current block through intra-frame template matching based on the intra-frame template matching parameter.

4. The method according to claim 1, wherein The determining the set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block includes: Determining a chrominance format parameter; Determining a luminance sampling point corresponding to the chrominance sampling point in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling points in the chrominance prediction reference block; Determining the set of model reference luminance sampling points according to the luminance sampling points.

5. The method according to claim 4, wherein, The determining the chrominance format parameter includes: Decoding the bitstream to determine the chrominance format parameter.

6. The method according to claim 5, wherein When the value of the chrominance format parameter is a first value, determining that the current block is a first chrominance format; When the value of the chrominance format parameter is a second value, determining that the current block is a second chrominance format; When the value of the chrominance format parameter is a third value, determining that the current block is a third chrominance format.

7. The method according to claim 6, wherein, Determining, in the luminance block of the current block, the luminance sample points corresponding to the chrominance sample points according to the chrominance format parameter and the chrominance sample points in the chrominance block of the current block includes: Determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sample point coordinates of the chrominance sample points in the chrominance prediction reference block; Determining the sample points corresponding to the relevant luminance coordinates as the luminance sample points corresponding to the chrominance sample points.

8. The method according to claim 7, wherein The chrominance sample point coordinates are (xC, yC).

9. The method according to claim 8, wherein Determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sample point coordinates of the chrominance sample points in the chrominance prediction reference block includes: When the current block is in the first chrominance format, the relevant luminance coordinates (xY, yY) determined according to the chrominance sample point coordinates (xC, yC) in the luminance prediction reference block include the first coordinate L0(xC, yC).

10. The method according to claim 8, wherein, Determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sample point coordinates of the chrominance sample points in the chrominance prediction reference block includes: When the current block is in the second chrominance format, the relevant luminance coordinates (xY, yY) determined according to the chrominance sample point coordinates (xC, yC) in the luminance prediction reference block include: the second coordinate L0(xC<<1, yC), the third coordinate L1(xC<<1 - 1, yC), and the fourth coordinate L2(xC<<1 + 1, yC).

11. The method according to claim 8, wherein, Determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sample point coordinates of the chrominance sample points in the chrominance prediction reference block includes: When the current block is in the third chrominance format, the relevant luminance coordinates (xY, yY) determined according to the chrominance sample point coordinates (xC, yC) in the luminance prediction reference block include: the fifth coordinate L0(xC<<1, yC<<1), the sixth coordinate L1(xC<<1 - 1, yC<<1), the seventh coordinate L2(xC<<1 + 1, yC<<1), the eighth coordinate L3(xC<<1, yC<<1 + 1), the ninth coordinate L4(xC<<1 - 1, yC<<1 + 1), and the tenth coordinate L5(xC<<1 + 1, yC<<1 + 1).

12. The method according to claim 10 or 11, wherein << is the left shift operator; where m << n represents the operation of shifting the binary number of m to the left by n bits, and the result of m << n is m × 2 n , where m and n are integers greater than 0.

13. The method according to any one of claims 9 - 11, wherein The luminance sample points include the co - located sample points of the chrominance sample points in the luminance prediction reference block, and / or the sample points adjacent to the co - located sample points.

14. The method according to claim 4, wherein, The method further includes: Determining a down - sampling step according to the size parameter of the chrominance prediction reference block; Performing down - sampling on the chrominance prediction reference block according to the down - sampling step to determine the chrominance sample points.

15. The method according to claim 4, wherein, The method further includes: Determine all the sampling points in the chrominance prediction reference block as the chrominance sampling points.

16. The method according to claim 1, wherein, Determining the model parameters of the inter-component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block includes: Determining a first availability parameter of the luminance sampling points in the model reference luminance sampling point set according to the residual value of the luminance component of the current block; wherein, the first availability parameter is used to indicate whether to use the luminance sampling value of the luminance sampling point. Determining the model parameters of the inter-component prediction model according to the first availability parameter and the prediction reference block of the current block.

17. The method according to claim 16, wherein Determining the first availability parameter of the luminance sampling points in the model reference luminance sampling point set according to the residual value of the luminance component of the current block includes: When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point satisfies a first condition, determining that the first availability parameter of the luminance sampling point indicates not to use the luminance sampling value of the luminance sampling point. When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point does not satisfy the first condition, determining that the first availability parameter of the luminance sampling point indicates to use the luminance sampling value of the luminance sampling point.

18. The method according to claim 17, wherein, The first condition includes: the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to a first residual threshold.

19. The method according to any one of claims 16 - 18, wherein, Determining the model parameters of the inter-component prediction model according to the first availability parameter and the prediction reference block of the current block includes: When the first availability parameter indicates to use the luminance sampling value of the luminance sampling point, determining the luminance sampling value corresponding to the luminance sampling point according to the luminance prediction reference block, and determining the chrominance sampling value corresponding to the chrominance sampling point according to the chrominance prediction reference block. Determining the model parameters of the inter-component prediction model according to the luminance sampling value, the chrominance sampling value, the non-linear term, and / or the bias term.

20. The method according to claim 19, wherein Determining the luminance sampling value corresponding to the luminance sampling point according to the luminance prediction reference block includes: Determining the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point as the luminance sampling value; or, When the luminance prediction value of the luminance prediction reference block corresponding to the luminance sampling point is not 0, determining the luminance sampling value according to the luminance offset value and the luminance prediction value.

21. The method according to claim 19, wherein, Determining the chrominance sampling value corresponding to the chrominance sampling point according to the chrominance prediction reference block includes: Determining the chrominance prediction value of the chrominance prediction reference block corresponding to the chrominance sampling point as the chrominance sampling value; or, Determining the chrominance sampling value according to the chrominance offset value and the chrominance prediction value of the chrominance prediction reference block corresponding to the chrominance sampling point.

22. The method according to any one of claims 4-12, wherein, Determining the prediction reference luminance sampling point set corresponding to the chrominance sampling point according to the chrominance sampling points in the chrominance block of the current block includes: Determining the chrominance format parameter. Determine the luminance sampling points corresponding to the chrominance sampling points in the chrominance block of the current block according to the chrominance format parameter and the chrominance sampling points in the chrominance block of the current block; Determine a set of model reference luminance sampling points according to the luminance sampling points.

23. The method according to claim 22, wherein, The determining the predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of predicted reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block includes: Determine a second availability parameter of the luminance sampling points in the set of predicted reference luminance sampling points according to the residual value of the luminance component of the current block; wherein, the second availability parameter is used to indicate whether to use the luminance reconstruction value of the luminance sampling point; Determine the predicted value of the chrominance component of the current block according to the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block.

24. The method according to claim 23, wherein The determining the second availability parameter of the luminance sampling points in the set of predicted reference luminance sampling points according to the residual value of the luminance component of the current block includes: When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point satisfies a second condition, determine that the second availability parameter of the luminance sampling point indicates not to use the luminance reconstruction value of the luminance sampling point; When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point does not satisfy the second condition, determine that the second availability parameter of the luminance sampling point indicates to use the luminance reconstruction value of the luminance sampling point.

25. The method according to claim 24, wherein, The second condition includes: the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to a second residual threshold.

26. The method according to any one of claims 23 - 25, wherein, The determining the predicted value of the chrominance component of the current block according to the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block includes: When the second availability parameter indicates to use the luminance reconstruction value of the luminance sampling point, determine that the reconstructed value of the luminance component of the current block corresponding to the luminance sampling point is the luminance reconstruction value; Determine the predicted value of the chrominance component of the current block according to the luminance reconstruction value, the model parameters, the non-linear term, and / or the bias term.

27. The method according to claim 26, wherein, The determining that the reconstructed value of the luminance component of the current block corresponding to the luminance sampling point is the luminance reconstruction value includes: Determine the value of the reconstructed value of the luminance component corresponding to the luminance sampling point as the luminance reconstruction value; or, When the value of the reconstructed value of the luminance component corresponding to the luminance sampling point is not 0, determine the luminance reconstruction value according to the luminance offset value and the value of the reconstructed value of the luminance component corresponding to the luminance sampling point.

28. The method according to claim 26, wherein The determining the predicted value of the chrominance component of the current block according to the luminance reconstruction value, the model parameters, the non-linear term, and / or the bias term includes: Determine the chrominance prediction correction block of the current block according to the luminance reconstruction value, the model parameters, the non-linear term, and / or the bias term; Determine the predicted value of the chrominance component of the current block according to the preset weight, the chrominance prediction reference block, and the chrominance prediction correction block.

29. The method according to claim 26, wherein The determining the predicted value of the chrominance component of the current block according to the luminance reconstruction value, the model parameter, the non - linear term, and / or the bias term includes: Determine the chrominance prediction correction block of the current block according to the luminance reconstruction value, the model parameter, the non - linear term, and / or the bias term; Determine the first weight according to the residual value of the luminance component of the current block; Determine the predicted value of the chrominance component of the current block according to the first weight, the chrominance prediction reference block, and the chrominance prediction correction block.

30. The method according to claim 26, wherein, The determining the predicted value of the chrominance component of the current block according to the luminance reconstruction value, the model parameter, the non - linear term, and / or the bias term includes: Determine the chrominance prediction correction block of the current block according to the luminance reconstruction value, the model parameter, the non - linear term, and / or the bias term; Determine the non - linear weighting coefficient; Determine the predicted value of the chrominance component of the current block according to the non - linear weighting coefficient, the chrominance prediction reference block, and the chrominance prediction correction block.

31. An encoding method, applied to an encoder, the method includes: Determine the prediction reference block of the current block and the residual value of the luminance component of the current block according to the prediction parameter of the current block, and write the prediction parameter of the current block and the residual value of the luminance component of the current block into the code stream; wherein, the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, the size of the luminance prediction reference block is the same as the size of the luminance block of the current block, and the size of the chrominance prediction reference block is the same as the size of the chrominance block of the current block; Determine the reconstruction value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; Determine the set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; According to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block, Determine the model parameters of the inter - component prediction model; Determine the set of prediction reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; Determine the predicted value of the chrominance component of the current block according to the model parameters of the inter - component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstruction value of the luminance component of the current block.

32. According to the method of claim 31, wherein, The prediction parameter includes at least one of the following parameters: inter - frame prediction parameter, intra - block copy IBC parameter, inter - frame template matching parameter, intra - frame template matching parameter.

33. The method according to claim 32, wherein The determining the prediction reference block of the current block according to the prediction parameter of the current block includes: Based on the inter - frame prediction parameter, determine the prediction reference block of the current block through inter - frame prediction; and / or, Based on the IBC parameter, determine the prediction reference block of the current block through IBC; and / or, Determine a prediction reference block of the current block through inter-frame template matching based on the inter-frame template matching parameter; and / or, Determine a prediction reference block of the current block through intra-frame template matching based on the intra-frame template matching parameter.

34. The method according to claim 31, wherein The determining a set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block includes: Determine a chrominance format parameter; Determine a luminance sampling point corresponding to the chrominance sampling point in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling points in the chrominance prediction reference block; Determine a set of model reference luminance sampling points according to the luminance sampling points.

35. The method according to claim 34, wherein, The determining the chrominance format parameter includes: Write the chrominance format parameter into a bitstream.

36. The method according to claim 35, wherein, When the value of the chrominance format parameter is a first value, determine that the current block is in a first chrominance format; When the value of the chrominance format parameter is a second value, determine that the current block is in a second chrominance format; When the value of the chrominance format parameter is a third value, determine that the current block is in a third chrominance format.

37. The method according to claim 36, wherein, The determining a luminance sampling point corresponding to the chrominance sampling point in the luminance block of the current block according to the chrominance format parameter and the chrominance sampling points in the chrominance block of the current block includes: Determine relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling point coordinates of the chrominance sampling points in the chrominance prediction reference block; Determine the sampling point corresponding to the relevant luminance coordinates as the luminance sampling point corresponding to the chrominance sampling point.

38. The method according to claim 37, wherein, The chrominance sampling point coordinates are (xC, yC).

39. The method according to claim 38, wherein, The determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling point coordinates of the chrominance sampling points in the chrominance prediction reference block includes: When the current block is in the first chrominance format, the relevant luminance coordinates (xY, yY) determined according to the chrominance sampling point coordinates (xC, yC) in the luminance prediction reference block include a first coordinate L0(xC, yC).

40. The method according to claim 38, wherein, The determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling point coordinates of the chrominance sampling points in the chrominance prediction reference block includes: When the current block is in the second chrominance format, the relevant luminance coordinates (xY, yY) determined according to the chrominance sampling point coordinates (xC, yC) in the luminance prediction reference block include: a second coordinate L1(xC<<1, yC), a third coordinate L2(xC<<1 - 1, yC), and a fourth coordinate L3(xC<<1 + 1, yC).

41. The method according to claim 8, wherein The determining relevant luminance coordinates in the luminance prediction reference block according to the chrominance format parameter and the chrominance sampling point coordinates of the chrominance sampling points in the chrominance prediction reference block includes: When the current block is in the third chrominance format, the relevant luminance coordinates (xY, yY) determined in the luminance prediction reference block according to the chrominance sampling point coordinates (xC, yC) include: a fifth coordinate L4 (xC<<1, yC<<1), a sixth coordinate L5 (xC<<1 - 1, yC<<1), a seventh coordinate L6 (xC<<1 + 1, yC<<1), an eighth coordinate L7 (xC<<1, yC<<1 + 1), a ninth coordinate L8 (xC<<1 - 1, yC<<1 + 1), and a tenth coordinate L9 (xC<<1 + 1, yC<<1 + 1).

42. The method according to claim 40 or 41, wherein << is the left shift operator; where m << n represents the operation of shifting the binary number of m to the left by n bits, and the result of m << n is m × 2 n , where m and n are integers greater than 0.

43. The method according to any one of claims 39 - 41, wherein the luminance sampling points include the co - located sampling points of the chrominance sampling points in the luminance prediction reference block, and / or the sampling points adjacent to the co - located sampling points.

44. The method according to claim 34, wherein The method further includes: determining a downsampling step according to the size parameter of the chrominance prediction reference block; downsampling the chrominance prediction reference block according to the downsampling step to determine the chrominance sampling points.

45. The method according to claim 34, wherein, The method further includes: determining all the sampling points in the chrominance prediction reference block as the chrominance sampling points.

46. The method according to claim 31, wherein, The determining the model parameters of the inter - component prediction model according to the model reference luminance sampling point set, the residual value of the luminance component of the current block, and the prediction reference block of the current block includes: determining a first availability parameter of the luminance sampling points in the model reference luminance sampling point set according to the residual value of the luminance component of the current block; wherein the first availability parameter is used to indicate whether to use the luminance sampling value of the luminance sampling point; determining the model parameters of the inter - component prediction model according to the first availability parameter and the prediction reference block of the current block.

47. The method according to claim 46, wherein, The determining the first availability parameter of the luminance sampling points in the model reference luminance sampling point set according to the residual value of the luminance component of the current block includes: when the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point satisfies a first condition, determining that the first availability parameter of the luminance sampling point indicates not using the luminance sampling value of the luminance sampling point; when the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point does not satisfy the first condition, determining that the first availability parameter of the luminance sampling point indicates using the luminance sampling value of the luminance sampling point.

48. The method according to claim 47, wherein the first condition includes: the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to a first residual threshold.

49. The method according to any one of claims 46 - 48, wherein, The determining the model parameters of the inter - component prediction model according to the first availability parameter and the prediction reference block of the current block includes: When the first availability parameter indicates using the luminance sampling value of the luminance sampling point, determine the luminance sampling value corresponding to the luminance sampling point according to the luminance prediction reference block, and determine the chrominance sampling value corresponding to the chrominance sampling point according to the chrominance prediction reference block; Determine the model parameters of the inter-component prediction model according to the luminance sampling value, the chrominance sampling value, the non-linear term, and / or the bias term.

50. The method according to claim 49, wherein, The determining the luminance sampling value corresponding to the luminance sampling point according to the luminance prediction reference block includes: Determine the luminance prediction value corresponding to the luminance sampling point in the luminance prediction reference block as the luminance sampling value; or, When the luminance prediction value corresponding to the luminance sampling point in the luminance prediction reference block is not 0, determine the luminance sampling value according to the luminance offset value and the luminance prediction value.

51. The method according to claim 49, wherein, The determining the chrominance sampling value corresponding to the chrominance sampling point according to the chrominance prediction reference block includes: Determine the chrominance prediction value corresponding to the chrominance sampling point in the chrominance prediction reference block as the chrominance sampling value; or, Determine the chrominance sampling value according to the chrominance offset value and the chrominance prediction value corresponding to the chrominance sampling point in the chrominance prediction reference block.

52. The method according to any one of claims 34 - 42, wherein, The determining the set of prediction reference luminance sampling points corresponding to the chrominance sampling point according to the chrominance sampling points in the chrominance block of the current block includes: Determine the chrominance format parameter; According to the chrominance format parameter and the chrominance sampling points in the chrominance block of the current block, determine the luminance sampling points corresponding to the chrominance sampling points in the luminance block of the current block; Determine the set of model reference luminance sampling points according to the luminance sampling points.

53. The method according to claim 52, wherein, The determining the predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block includes: Determine the second availability parameter of the luminance sampling points in the set of prediction reference luminance sampling points according to the residual value of the luminance component of the current block; wherein, the second availability parameter is used to indicate whether to use the luminance reconstructed value of the luminance sampling point; Determine the predicted value of the chrominance component of the current block according to the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block.

54. The method according to claim 53, wherein, The determining the second availability parameter of the luminance sampling points in the set of prediction reference luminance sampling points according to the residual value of the luminance component of the current block includes: When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point satisfies the second condition, determine that the second availability parameter of the luminance sampling point indicates not using the luminance reconstructed value of the luminance sampling point; When the value of the residual value of the luminance component of the current block corresponding to the luminance sampling point does not satisfy the second condition, determine that the second availability parameter of the luminance sampling point indicates using the luminance reconstructed value of the luminance sampling point.

55. The method according to claim 54, wherein, The second condition includes: the residual value of the luminance component of the current block corresponding to the luminance sampling point is less than or equal to a second residual threshold value.

56. The method according to any one of claims 53-55, wherein, Determining the predicted value of the chrominance component of the current block according to the second availability parameter, the model parameters of the inter-component prediction model, and the reconstructed value of the luminance component of the current block includes: When the second availability parameter indicates using the luminance reconstructed value of the luminance sampling point, determining that the reconstructed value of the luminance component of the current block corresponds to the luminance reconstructed value of the luminance sampling point; Determining the predicted value of the chrominance component of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term.

57. The method according to claim 56, wherein Determining that the reconstructed value of the luminance component of the current block corresponds to the luminance reconstructed value of the luminance sampling point includes: Determining the value of the reconstructed value of the luminance component corresponding to the luminance sampling point as the luminance reconstructed value; or, When the value of the reconstructed value of the luminance component corresponding to the luminance sampling point is not 0, determining the luminance reconstructed value according to the luminance offset value and the value of the reconstructed value of the luminance component corresponding to the luminance sampling point.

58. The method according to claim 56, wherein, Determining the predicted value of the chrominance component of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term includes: Determining the chrominance prediction correction block of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term; Determining the predicted value of the chrominance component of the current block according to a preset weight, the chrominance prediction reference block, and the chrominance prediction correction block.

59. The method according to claim 56, wherein, Determining the predicted value of the chrominance component of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term includes: Determining the chrominance prediction correction block of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term; Determining a first weight according to the residual value of the luminance component of the current block; Determining the predicted value of the chrominance component of the current block according to the first weight, the chrominance prediction reference block, and the chrominance prediction correction block.

60. The method according to claim 56, wherein, Determining the predicted value of the chrominance component of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term includes: Determining the chrominance prediction correction block of the current block according to the luminance reconstructed value, the model parameters, the non-linear term, and / or the bias term; Determining a non-linear weighting coefficient; Determining the predicted value of the chrominance component of the current block according to the non-linear weighting coefficient, the chrominance prediction reference block, and the chrominance prediction correction block.

61. A bitstream, which is generated by performing bit encoding according to information to be encoded; wherein, The information to be encoded includes at least one of the following: The prediction parameters of the current block, the residual value of the luminance component of the current block, and the chrominance format parameter.

62. An encoder, the encoder comprising: The first determination unit; wherein, The first determination unit is configured to determine a prediction reference block of the current block and a residual value of a luminance component of the current block according to prediction parameters of the current block, and write the prediction parameters of the current block and the residual value of the luminance component of the current block into a bitstream; wherein, the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, a size of the luminance prediction reference block is the same as a size of a luminance block of the current block, and a size of the chrominance prediction reference block is the same as a size of a chrominance block of the current block; determine a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; determine a set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; determine model parameters of an inter-component prediction model according to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block; determine a set of prediction reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; and determine a predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

63. An encoder, the encoder includes a first memory and a first processor; wherein, The first memory is configured to store a computer program capable of running on the first processor; The first processor is configured to execute the method according to any one of claims 31 to 60 when running the computer program.

64. A decoder, the decoder comprising: A second determination unit; wherein, The second determination unit is configured to decode the bitstream to determine prediction parameters of the current block and a residual value of the luminance component of the current block; determine the prediction reference block of the current block according to the prediction parameters of the current block, wherein the prediction reference block includes a luminance prediction reference block and a chrominance prediction reference block, a size of the luminance prediction reference block is the same as a size of a luminance block of the current block, and a size of the chrominance prediction reference block is the same as a size of a chrominance block of the current block; determine a reconstructed value of the luminance component of the current block according to the residual value of the luminance component of the current block and the luminance prediction reference block; determine a set of model reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; determine model parameters of an inter-component prediction model according to the set of model reference luminance sampling points, the residual value of the luminance component of the current block, and the prediction reference block of the current block; determine a set of prediction reference luminance sampling points corresponding to the chrominance sampling points according to the chrominance sampling points in the chrominance prediction reference block; and determine a predicted value of the chrominance component of the current block according to the model parameters of the inter-component prediction model, the set of prediction reference luminance sampling points, the residual value of the luminance component of the current block, and the reconstructed value of the luminance component of the current block.

65. A decoder, the decoder comprising a second memory and a second processor; wherein, the second memory is configured to store a computer program capable of running on the second processor; the second processor is configured to execute the method according to any one of claims 1 to 30 when running the computer program.

66. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 30, or implements the method according to any one of claims 31 to 60.