Coding method and apparatus, encoding device, decoding device, and storage medium

By determining reference sample values and performing filtering on color components, the method improves prediction accuracy and coding performance in H.266/VVC, addressing low prediction accuracy and quality issues.

JP7875986B2Active Publication Date: 2026-06-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2022-04-12
Publication Date
2026-06-18

AI Technical Summary

Technical Problem

The H.266/VVC standard's cross-color component prediction technology results in low prediction accuracy and deteriorated video quality due to discrepancies between predicted and original values, leading to decreased coding performance.

Method used

A method and apparatus that determine a reference sample value for a first color component, calculate weighting coefficients, and perform filtering to improve prediction accuracy for a second color component, utilizing luminance information correlation and reducing complexity through upsampling filtering.

Benefits of technology

Enhances saturation prediction accuracy and coding performance by improving prediction accuracy and reducing bitrate, while maintaining subjective and objective video quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007875986000099
    Figure 0007875986000099
  • Figure 0007875986000100
    Figure 0007875986000100
  • Figure 0007875986000101
    Figure 0007875986000101
Patent Text Reader

Abstract

The embodiments of the present application disclose a coding method and apparatus, an encoding device, a decoding device, and a storage medium. The method includes: determining a reference sample value of a first color component of a current block; determining a weighting factor according to the reference sample value of the first color component of the current block; determining a first predicted block of a second color component of the current block according to the weighting factor and the reference sample value of a second color component of the current block; performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; the second predicted block includes predicted values ​​of all second color component samples in the current block; determining a reconstructed value of a second color component sample of the current block according to the second predicted block. Thereby, the accuracy of chroma prediction can be improved, bit rate can be saved, and coding performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] Embodiments of this application relate to the video coding technology, and more particularly to coding methods and apparatus, encoding devices, decoding devices, and storage media. [Background technology]

[0002] As people's demands for higher video display quality increased, new forms of video applications such as high-resolution video and ultra-high-resolution video emerged. The International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) and the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T)'s Joint Video Exploration Team (JVET) proposed H.266 / versatile video coding (VVC) as the next-generation video coding standard.

[0003] H.266 / VVC includes cross-color component prediction technology. However, there is a significant discrepancy between the predicted values ​​of coding blocks obtained by the cross-color component prediction technology in H.266 / VVC and the original values. As a result, prediction accuracy is low, the quality of the decoded video deteriorates, and coding performance decreases. [Overview of the Initiative]

[0004] Embodiments of this application provide a coding method and apparatus, an encoding device, a decoding device, and a storage medium. These embodiments not only improve the accuracy of saturation prediction and save bitrate, but also improve coding performance.

[0005] The technical invention of the embodiment of this application can be realized as follows.

[0006] In a first embodiment, the embodiment of the present application provides a decoding method, which includes: determining a reference sample value for the first color component of the current block; determining weighting coefficients based on the reference sample value for the first color component of the current block; determining a first predicted block for the second color component of the current block based on the weighting coefficients and the reference sample value for the second color component of the current block; determining a second predicted block for the second color component of the current block by performing a first filtering on the first predicted block; the second predicted block containing predicted values ​​for all second color component samples in the current block; and determining reconstructed values ​​for the second color component samples of the current block based on the second predicted block.

[0007] In a second embodiment, the embodiment of the present application provides an encoding method, which includes: determining a reference sample value for the first color component of the current block; determining weighting coefficients based on the reference sample value for the first color component of the current block; determining a first predicted block for the second color component of the current block based on the weighting coefficients and the reference sample value for the second color component of the current block; determining a second predicted block for the second color component of the current block by performing a first filtering on the first predicted block; the second predicted block containing predicted values ​​for all second color component samples in the current block; and determining residual values ​​for the second color component samples of the current block based on the second predicted block.

[0008] In a third aspect, an embodiment of the present application provides an encoding apparatus comprising a first determination unit, a first prediction unit, and a first filtering unit. The first determination unit is configured to determine a reference sample value for the first color component of the current block and to determine a weighting coefficient based on the reference sample value for the first color component of the current block. The first prediction unit is configured to determine a first prediction block for the second color component of the current block based on the weighting coefficient and a reference sample value for the second color component of the current block. The first filtering unit is configured to perform a first filtering on the first prediction block to determine a second prediction block for the second color component of the current block. The second prediction block contains the prediction values ​​for all second color component samples in the current block. The first determination unit is further configured to determine the residual values ​​for the second color component samples of the current block based on the second prediction block.

[0009] In a fourth embodiment, an embodiment of the present application provides an encoding device comprising a first memory and a first processor. The first memory is configured to store a computer program executable by the first processor. The first processor is configured to perform the method described in the second embodiment when executing the computer program.

[0010] In a fifth aspect, an embodiment of the present application provides a decoding apparatus comprising a second determination unit, a second prediction unit, and a second filtering unit. The second determination unit is configured to determine a reference sample value for the first color component of the current block and to determine a weighting coefficient based on the reference sample value for the first color component of the current block. The second prediction unit is configured to determine a first prediction block for the second color component of the current block based on the weighting coefficient and the reference sample value for the second color component of the current block. The second filtering unit is configured to perform a first filtering on the first prediction block to determine a second prediction block for the second color component of the current block. The second prediction block contains the predicted values ​​for all second color component samples in the current block. The second determination unit is further configured to determine the reconstructed values ​​for the second color component samples of the current block based on the second prediction block.

[0011] In a sixth embodiment, an embodiment of the present application provides a decoding device comprising a second memory and a second processor. The second memory is configured to store a computer program executable by the second processor. The second processor is configured to perform the method described in the first embodiment when executing the computer program.

[0012] In a seventh embodiment, the embodiments of the present application provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to the first embodiment or the method according to the second embodiment is realized.

[0013] Embodiments of this application provide a coding method and apparatus, an encoding device, a decoding device, and a storage medium. On either the encoding or decoding side, a reference sample value for the first color component of the current block is determined. Based on the reference sample value for the first color component of the current block, a weighting coefficient is determined. Based on the weighting coefficient and the reference sample value for the second color component of the current block, a first prediction block for the second color component of the current block is determined. A first filtering is performed on the first prediction block to determine a second prediction block for the second color component of the current block. The second prediction block contains the predicted values ​​of all second color component samples in the current block. In this way, on the encoding side, the residual value of the second color component sample of the current block can be determined based on the second prediction block, and on the decoding side, the reconstructed value of the second color component sample of the current block can be determined based on the second prediction block. In this way, by calculating weighting coefficients using the color component information of the current block and the reference samples adjacent to the current block, the correlation in luminance information between the current block and adjacent regions can be fully utilized, and by using this correlation in predicting the saturation of the current block, the accuracy of saturation prediction can be improved. Furthermore, taking advantage of the fact that the human eye is not very sensitive to saturation, upsampling filtering is performed on the first predicted block if the size of the first predicted block is smaller than the size of the current block, in order to reduce the complexity of calculating the weighting coefficients. In addition, filtering enhancement can be performed to account for the instability of the predicted value of the first predicted block, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance. [Brief explanation of the drawing]

[0014] [Figure 1] Figure 1 is a schematic diagram showing the distribution of effective adjacent regions. [Figure 2]FIG. 2 is a schematic diagram showing the distribution of the selection area under different prediction modes. [Figure 3] FIG. 3 is a flowchart showing a model parameter derivation scheme. [Figure 4A] FIG. 4A is a block diagram showing the structure of an encoder according to an embodiment of the present application. [Figure 4B] FIG. 4B is a block diagram showing the structure of a decoder according to an embodiment of the present application. [Figure 5] FIG. 5 is a flowchart 1 showing a decoding method according to an embodiment of the present application. [Figure 6A] FIG. 6A is a schematic diagram showing the reference area of the current block according to an embodiment of the present application. [Figure 6B] FIG. 6B is a schematic diagram showing upsampling interpolation for the reference chroma information according to an embodiment of the present application. [Figure 7] FIG. 7 is a schematic diagram showing the filter position according to an embodiment of the present application. [Figure 8] FIG. 8 is a schematic diagram showing weighted prediction based on the weight-based chroma prediction (WCP) mode and other prediction modes according to an embodiment of the present application. [Figure 9] FIG. 9 is a schematic diagram showing the framework of WCP according to an embodiment of the present application. [Figure 10] FIG. 10 is a flowchart 2 showing a decoding method according to an embodiment of the present application. [Figure 11] FIG. 11 is a flowchart 3 showing a decoding method according to an embodiment of the present application. [Figure 12] FIG. 12 is a flowchart 4 showing a decoding method according to an embodiment of the present application. [Figure 13] FIG. 13 is a schematic diagram 1 showing the process of upsampling interpolation according to an embodiment of the present application. [Figure 14] FIG. 14 is a schematic diagram 2 showing the process of upsampling interpolation according to an embodiment of the present application. [Figure 15]FIG. 15 is a schematic diagram showing weight values in upsampling interpolation according to an embodiment of the present application. [Figure 16] FIG. 16 is a schematic diagram 3 showing the process of upsampling interpolation according to an embodiment of the present application. [Figure 17] FIG. 17 is a schematic diagram 1 showing the process of another upsampling interpolation according to an embodiment of the present application. [Figure 18] FIG. 18 is a schematic diagram showing weight values in another upsampling interpolation according to an embodiment of the present application. [Figure 19] FIG. 19 is a schematic diagram 2 showing the process of another upsampling interpolation according to an embodiment of the present application. [Figure 20] FIG. 20 is a flowchart 1 showing an encoding method according to an embodiment of the present application. [Figure 21] FIG. 21 is a flowchart 2 showing an encoding method according to an embodiment of the present application. [Figure 22] FIG. 22 is a schematic diagram showing the structure of an encoding device according to an embodiment of the present application. [Figure 23] FIG. 23 is a schematic diagram showing the specific hardware structure of an encoding device according to an embodiment of the present application. [Figure 24] FIG. 24 is a schematic diagram showing the structure of a decoding device according to an embodiment of the present application. [Figure 25] FIG. 25 is a schematic diagram showing the specific hardware structure of a decoding device according to an embodiment of the present application. [Figure 26] FIG. 26 is a schematic diagram showing the structure of a coding system according to an embodiment of the present application.

Embodiments for Carrying Out the Invention

[0015] To gain a more detailed understanding of the features and technical content of the embodiments of this application, the realization of the embodiments of this application will be described in detail below with reference to the drawings. The attached drawings are for illustrative purposes only and are not intended to limit the embodiments of this application.

[0016] All technical and scientific terms used herein have the same meanings as those generally understood by those skilled in the art, unless otherwise defined. The terms used herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0017] In the following description, “several embodiments” describe a subset of all possible embodiments, but it should be understood that “several embodiments” may be the same subset or different subsets of all possible embodiments, and they may be combined with each other as long as they do not contradict each other. Also note that the terms “first / second / third” in the embodiments of this application merely distinguish similar objects and do not imply a particular order of objects. “First / second / third” may be replaced with a specific order or priority, where permitted, so that the embodiments of this application described herein may be carried out in an order other than that illustrated or described herein.

[0018] In video images, a coding block (CB) is typically represented using a first color component, a second color component, and a third color component, where these three color components are, respectively, one lumen component, one blue chroma component, and one red chroma component. Exemplarily, the lumen component is typically represented by the symbol Y, the blue chroma component by the symbol Cb or U, and the red chroma component by the symbol Cr or V. Thus, a video image can be represented in YCbCr format, or in YUV format. In addition, a video image may be represented in RGB format, YCgCo format, etc. No limitations are imposed in the embodiments of this application.

[0019] To make it clear, in current video image or video coding processes, cross-component prediction techniques primarily include cross-component linear model (CCLM) prediction modes and multi-directional linear model (MDLM) prediction modes. Regardless of whether the model parameters are derived based on the CCLM prediction mode or the MDLM prediction mode, the corresponding prediction model can achieve cross-color component prediction such as from the first color component to the second color component, from the second color component to the first color component, from the first color component to the third color component, from the third color component to the first color component, from the second color component to the third color component, or from the third color component to the second color component.

[0020] JPEG0007875986000001.jpg38152

[0021] JPEG0007875986000002.jpg37152

[0022] The adjacent region of a coding block can be divided into five parts: the left adjacent region, the upper adjacent region, the lower left adjacent region, the upper left adjacent region, and the upper right adjacent region. H.266 / VVC includes three cross-component linear model prediction modes: the left and upper adjacent intra-CCLM prediction mode (which can be represented as INTRA_LT_CCLM), the left and lower left adjacent intra-CCLM prediction mode (which can be represented as INTRA_L_CCLM), and the upper and upper right adjacent intra-CCLM prediction mode (which can be represented as INTRA_T_CCLM). For each of these three prediction modes, a predetermined number of reference samples (e.g., four) can be selected and used to derive the model parameters α and β. The main difference between these three prediction modes is that the selection regions corresponding to the reference samples used to derive the model parameters α and β are different.

[0023] Specifically, for a coding block of size W×H corresponding to the saturation component, assume that the upper selection region corresponding to the reference sample is W', and the left selection region corresponding to the reference sample is H'. In this way, In INTRA_LT_CCLM mode, the reference sample can be selected from the upper adjacent region and the left adjacent region. That is, W'=W and H'=H. In INTRA_L_CCLM mode, the reference sample can be selected from the left adjacent region and the lower left adjacent region. That is, H' = W + H, and W' is set to 0. In INTRA_T_CCLM mode, the reference sample can be selected from the upper adjacent region and the upper right adjacent region. That is, W' = W + H, and H' is set to 0.

[0024] JPEG0007875986000003.jpg63152

[0025] Referring to Figure 1, which is a schematic diagram showing the distribution of valid adjacent regions, the left adjacent region, the lower left adjacent region, the upper adjacent region, and the upper right adjacent region are all valid. Furthermore, the blocks colored gray are samples awaiting prediction with position coordinates (i, j) within the coding block.

[0026] Thus, based on Figure 1, the selection regions for the three prediction modes are shown in Figure 2. In Figure 2, (a) represents the selection region for the INTRA_LT_CCLM mode, including the left adjacent region and the upper adjacent region; (b) represents the selection region for the INTRA_L_CCLM mode, including the left adjacent region and the lower left adjacent region; and (c) represents the selection region for the INTRA_T_CCLM mode, including the upper adjacent region and the upper right adjacent region. After determining the selection regions for the three prediction modes in this way, samples for deriving model parameters can be selected from the selection regions. The samples selected in this way are called reference samples, and there are usually four reference samples. Furthermore, the positions of the reference samples are generally determined for coding blocks with a determined size W×H.

[0027] After obtaining a predetermined number of reference samples, saturation prediction is performed according to the flowchart of the model parameter derivation scheme shown in Figure 3. According to the process shown in Figure 3, assuming that the predetermined number is 4, the process may include the following:

[0028] S301: Retrieve a reference sample from the selected area.

[0029] S302: Determine the number of valid reference samples.

[0030] S303: If the number of valid reference samples is 0, set the model parameter α to 0 and β to its default value.

[0031] S304: Set the saturation prediction value to the default value.

[0032] S305: If the number of valid reference samples is 4, the comparison yields two reference samples with relatively large luminance component values ​​and two reference samples with relatively small luminance component values.

[0033] S306: Calculate the mean point for relatively large values ​​and the mean point for relatively small values.

[0034] S307: Derive the model parameters α and β based on the two mean scores.

[0035] S308: Perform saturation prediction using a prediction model constructed with α and β.

[0036] In VVC, the step where the number of valid reference samples is 0 is determined based on the validity of adjacent regions.

[0037] Furthermore, a predictive model is constructed according to the principle of "determining a straight line from two points." These two points can be called fitting points. In the current technical proposal, after obtaining four reference samples, two reference samples with relatively large luminance component values ​​and two reference samples with relatively small luminance component values ​​are obtained by comparison. A single mean point is obtained based on the two reference samples with relatively large values. max We find another mean (which can be expressed as) based on two reference samples with relatively small values. min We find the mean (which can be expressed as) and then the two mean points max and mean min You can obtain the mean. max and mean min By using these as two fitting points, the model parameters (represented by α and β) can be derived. Finally, a prediction model is constructed based on α and β, and the saturation component is predicted based on this prediction model.

[0038] JPEG0007875986000004.jpg133152

[0039] Based on the above, embodiments of this application provide an encoding method. A reference sample value for the first color component of the current block is determined. Based on the reference sample value for the first color component of the current block, a weighting coefficient is determined. Based on the weighting coefficient and the reference sample value for the second color component of the current block, a first predicted block for the second color component of the current block is determined. A first filtering is performed on the first predicted block to determine a second predicted block for the second color component of the current block. The second predicted block contains the predicted values ​​for all second color component samples in the current block. Based on the second predicted block, the residual values ​​for the second color component samples of the current block are determined.

[0040] Embodiments of this application further provide a decoding method. A reference sample value for the first color component of the current block is determined. Based on the reference sample value for the first color component of the current block, a weighting coefficient is determined. Based on the weighting coefficient and the reference sample value for the second color component of the current block, a first predicted block for the second color component of the current block is determined. A first filtering is performed on the first predicted block to determine a second predicted block for the second color component of the current block. The second predicted block contains the predicted values ​​for all second color component samples within the current block. Based on the second predicted block, the reconstructed values ​​for the second color component samples of the current block are determined.

[0041] In this way, by calculating weighting coefficients using the color component information of the current block and the reference sample adjacent to the current block, the correlation in luminance information between the current block and adjacent regions can be fully utilized, and by using this correlation in predicting the saturation of the current block, the accuracy of saturation prediction can be improved. Furthermore, taking advantage of the fact that the human eye is not very sensitive to saturation, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block, in order to reduce the complexity of calculating the weighting coefficients. In addition, considering the instability of the predicted value of the first predicted block, filtering augmentation can also be performed for it, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, improving coding efficiency, and further improving coding performance.

[0042] The embodiments of this application will be described in detail below with reference to the drawings.

[0043] Referring to Figure 4A, Figure 4A is a block diagram showing the structure of an encoder according to an embodiment of this application. As shown in Figure 4A, the encoder (specifically, the "video encoder") 100 may include a conversion / quantization unit 101, an intra-estimation unit 102, an intra-prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse conversion / inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, a coding unit 109, and a decoding image buffer unit 110, etc. The filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering. The coding unit 109 can implement header information coding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, one video coding block can be obtained by dividing the coding tree block (CTU). Next, the residual sample information obtained through intra-prediction or inter-prediction is transformed for the video coding block by the transformation / quantization unit 101, which includes, for example, transforming the residual information from the sample region to the transformation region, and further reducing the bitrate by quantizing the acquired transformation coefficients. The intra-estimation unit 102 and the intra-prediction unit 103 are used to perform intra-prediction for the video coding block. Specifically, the intra-estimation unit 102 and the intra-prediction unit 103 are used to identify the intra-prediction mode for coding the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-prediction coding of the received video coding block for one or more blocks in one or more reference images to provide time prediction information.Motion estimation, performed by the motion estimation unit 105, is a process that generates motion vectors, which can be used to estimate the motion of the video coding block. Then, the motion compensation unit 104 performs motion compensation based on the motion vectors identified by the motion estimation unit 105. After the intra-prediction mode is identified, the intra-prediction unit 103 is further used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 transmits the computationally identified motion vector data to the coding unit 109. Furthermore, the inverse transform / inverse quantization unit 106 is used to reconstruct the video coding block and reconstruct the residual block within the sample region. The reconstructed residual block is filtered by the filter control analysis unit 107 and the filtering unit 108 to remove blocking effect artifacts, and then the reconstructed residual block is added to one prediction block in the image of the decoding image buffer unit 110 to generate a reconstructed video coding block. The coding unit 109 is used to code various coding parameters and quantized transformation coefficients. In a CABAC-based coding algorithm, contextual content can be used to code information indicating a specified intra-prediction mode based on adjacent coding blocks and to output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding blocks for prediction reference. As video image coding is performed, new reconstructed video coding blocks are continuously generated, and all of these reconstructed video coding blocks are stored in the decoding image buffer unit 110.

[0044] Referring to Figure 4B, Figure 4B is a block diagram showing the structure of a decoder according to an embodiment of this application. As shown in Figure 4B, the decoder (specifically, the "video decoder") 200 includes a decoding unit 201, an inverse transform / inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoding image buffer unit 206, etc. The decoding unit 201 can perform header information decoding and CABAC decoding. The filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal is coded as shown in Figure 4A, the bitstream of the video signal is output. The bitstream is input to the decoder 200, where the conversion coefficients obtained after decoding by the decoding unit 201 are first processed by the inverse transform / inverse quantization unit 202 to generate residual blocks in the sample region. The intra-prediction unit 203 can be used to generate prediction data for the current video decoding block based on the identified intra-prediction mode and data from a previously decoded block of the current frame or image. The motion compensation unit 204 identifies prediction information for the video decoding block by analyzing the motion vector and other relevant syntax elements, and uses this prediction information to generate a prediction block for the video decoding block being decoded. The decoded video block is formed by adding the residual block from the inverse transform / inverse quantization unit 202 with the corresponding prediction block generated by the intra-prediction unit 203 or the motion compensation unit 204. The decoded video signal can be filtered by the filtering unit 205 to remove block effect artifacts, thereby improving video quality.Next, the decoded video block is stored in the decoding image buffer unit 206, which stores a reference image for subsequent intra-prediction or motion compensation, and is used to output the video signal and obtain the restored original video signal.

[0045] The method in the embodiment of this application is mainly applied to the intra-prediction unit 103 shown in Figure 4A and the intra-prediction unit 203 shown in Figure 4B. That is, this embodiment may be applied to an encoder, or to a decoder, or to both an encoder and a decoder. It is not particularly limited to the embodiment of this application.

[0046] When applied to intra-prediction unit 103, "current block" specifically refers to the encoding block on which intra-prediction is currently being performed. When applied to intra-prediction unit 203, "current block" specifically refers to the decoding block on which intra-prediction is currently being performed.

[0047] Referring to Figure 5 in one embodiment of this application, Figure 5 is a flowchart 1 showing a decoding method according to an embodiment of this application. As shown in Figure 5, the method may include the following:

[0048] S501: Determine the reference sample value for the first color component of the current block.

[0049] The decoding method of the embodiment of this application is applied to a decoding device or a decoding device (also referred to as a "decoder") that integrates such a decoding device. More specifically, the decoding method of the embodiment of this application refers to an intra-prediction method, and more specifically, to a post-processing method based on weight-based chroma prediction (WCP).

[0050] In embodiments of this application, a video image may be divided into a plurality of decoding blocks, each decoding block may include a first color component, a second color component, and a third color component. Here, the current block refers to the decoding block in the video image on which intraprediction is currently being performed. The current block may also be called a luminance prediction block if a prediction is performed on the first color component of the current block, and it is assumed that the first color component is the luminance component, i.e., the component awaiting prediction is the luminance component. Alternatively, the current block may also be called a chroma prediction block if a prediction is performed on the second color component of the current block, and it is assumed that the second color component is the chroma component, i.e., the component awaiting prediction is the chroma component.

[0051] Furthermore, in embodiments of this application, the reference information for the current block may include the values ​​of a first color component sample in the adjacent region of the current block and the values ​​of a second color component sample in the adjacent region of the current block. These samples can be determined based on decoded samples in the adjacent region of the current block. In some embodiments, the adjacent region of the current block may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0052] Here, the upper adjacent region and the upper right adjacent region can be considered as a whole as the upper region, and the left adjacent region and the lower left adjacent region can be considered as a whole as the left region. In addition to these, as shown in detail in Figure 6A, the adjacent region can further include the upper left region. When making predictions for the second color component of the current block, the upper region, left region, and upper left region of the current block are considered adjacent regions, and may also be called the reference region of the current block, and all samples within the reference region are decoded reference samples.

[0053] Furthermore, in embodiments of this application, the adjacent region of the current block may include multiple rows or columns adjacent to the current block. For example, the left region may include one or more columns, the upper region may include one or more rows, and the number of rows or columns may increase or decrease. No limitations are imposed in embodiments of this application.

[0054] In some embodiments, determining the reference sample value of the first color component of the current block may include determining the reference sample value of the first color component of the current block based on the value of the first color component sample in the adjacent region of the current block.

[0055] In the embodiments of this application, the reference sample of the current block may refer to a reference sample adjacent to the current block, and may also be called the first color component sample, the second color component sample, within the adjacent region of the current block, and is represented as a Neighboring Sample or Reference Sample. Here, adjacent may be spatially adjacent, but is not limited to this. For example, adjacent may be temporally adjacent, or both spatially and temporally adjacent. Furthermore, the reference sample of the current block may be a spatially adjacent reference sample, a temporally adjacent reference sample, or a reference sample obtained after some processing of a spatially and temporally adjacent reference sample. No limitations are imposed in the embodiments of this application.

[0056] Furthermore, in the embodiments of this application, the first color component is the luminance component, and the second color component is the chroma component. In this case, the value of the first color component sample in the adjacent region of the current block is represented as reference luminance information corresponding to the reference sample of the current block, and the value of the second color component sample in the adjacent region of the current block is represented as reference chroma information corresponding to the reference sample of the current block.

[0057] Furthermore, in the embodiments of this application, the value of the first color component sample is determined from the adjacent region of the current block. This adjacent region may include only the upper adjacent region, or only the left adjacent region, or the upper adjacent region and the upper right adjacent region, or the left adjacent region and the lower left adjacent region, or the upper adjacent region and the left adjacent region, or the upper adjacent region, the upper right adjacent region and the left adjacent region. No limitations are imposed in the embodiments of this application.

[0058] Furthermore, in embodiments of this application, adjacent regions may be determined based on the prediction mode of the current block. In specific embodiments, this may include the following: If the prediction mode of the current block is horizontal mode, the reference sample is determined based on the sample in the upper adjacent region and / or the upper right adjacent region. If the prediction mode of the current block is vertical mode, the reference sample is determined based on the sample in the left adjacent region and / or the lower left adjacent region.

[0059] For example, if the prediction mode for the current block is horizontal mode, only the upper adjacent region and / or the upper right adjacent region can be selected as the adjacent region for saturation component prediction. If the prediction mode for the current block is vertical mode, only the left adjacent region and / or the lower left adjacent region can be selected as the adjacent region for saturation component prediction.

[0060] Furthermore, in some embodiments, determining the value of a first color component sample may further include determining the value of a first color component sample by selecting from first color component samples within an adjacent region.

[0061] Furthermore, the first color component samples within adjacent regions may contain some unimportant samples (e.g., samples with poor correlation) or abnormal samples. To ensure prediction accuracy, these samples must be removed, thereby obtaining valid values ​​for the first color component samples. That is, in the embodiments of this application, a first sample set is formed based on the first color component samples within adjacent regions of the current block. In this case, the values ​​for the first color component samples can be determined by selecting from the first sample set.

[0062] In a specific embodiment, determining the value of a first color component sample by selecting it from a first color component sample within an adjacent region may include the following: Determining the position of a sample awaiting selection based on the position and / or color component intensity of the first color component sample within the adjacent region. Determining the value of the first color component sample from the adjacent region based on the position of the sample awaiting selection.

[0063] In the embodiments of this application, the color component intensity can be represented by color component information such as reference luminance information and reference chroma information. A larger value of the color component information indicates a higher color component intensity. Thus, a sample can be selected from the first color component samples within an adjacent region based on the sample's position or based on its color component intensity. Based on the selected sample, a valid first color component sample is determined, and then the value of the first color component sample is determined.

[0064] In some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a second filtering on the first color component sample value to obtain the filtered adjacent sample value of the first color component of the current block; and determining the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block.

[0065] In the embodiments of this application, the number of filtered adjacent sample values ​​for the first color component of the current block is smaller than the number of values ​​for the first color component sample.

[0066] In embodiments of this application, the second filtering may be downsampling filtering. The first color component is the luminance component. In this case, by performing downsampling filtering on the reference luminance information, the spatial resolution of the filtered reference luminance information and the spatial resolution of the reference chroma information can be made the same. For example, if the current block size is 2M × 2N and the number of reference luminance information items is 2M + 2N, after downsampling filtering, it can be converted to M + N items.

[0067] In some embodiments, determining the reference sample value of the first color component of the current block may further include determining the reference sample value of the first color component of the current block based on the reconstructed value of the first reference color component sample within the current block.

[0068] In the embodiments of this application, the first reference color component may be a luminance component. In this case, the reconstructed value of the first reference color component sample in the current block is the reconstructed luminance information of the current block.

[0069] Furthermore, in some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a third filtering on the reconstructed value of the first reference color component sample in the current block to obtain the filtered sample value of the first reference color component sample in the current block; and determining the reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.

[0070] In the embodiments of this application, the number of filtered sample values ​​for the first reference color component sample in the current block is smaller than the number of reconstructed values ​​for the first reference color component sample in the current block.

[0071] In embodiments of this application, the third filtering may be downsampling filtering. The first reference color component is the luminance component. In this case, downsampling filtering may be performed on the reconstructed luminance information in the current block. For example, if the number of reconstructed luminance information points in the current block is 2M × 2N, it can be converted to M × N after downsampling filtering.

[0072] In the embodiments of this application, the filtering of the reference information before weighted prediction may be filtering of reference luminance information only, filtering of reconstructed luminance information only, or filtering of both reference luminance information and reconstructed luminance information. No limitations are imposed in this specification. As for the calculation of the luminance difference, the luminance difference may be the absolute value of the difference between the reference luminance information and the reconstructed luminance information, the absolute value of the difference between the filtered reference luminance information and the reconstructed luminance information, the absolute value of the difference between the reference luminance information and the filtered reconstructed luminance information, or the absolute value of the difference between the filtered reference luminance information and the filtered reconstructed luminance information.

[0073] Furthermore, in embodiments of this application, the reference sample value of the first color component of the current block can also be set to luminance difference information. Thus, in one possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.

[0074] In another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.

[0075] In yet another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.

[0076] In further possible embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.

[0077] In other words, it is possible to choose to perform filtering before weighted prediction based on known reference information of the current block, such as reference luminance information in the adjacent region of the current block and reconstructed luminance information within the current block. Specifically, downsampling filtering may be performed on the reference luminance information in the adjacent region of the current block, downsampling filtering may be performed on the reconstructed luminance information within the current block, downsampling filtering may be performed on both the reference luminance information and the reconstructed luminance information, or downsampling filtering may not be performed on either the reference luminance information or the reconstructed luminance information. Next, luminance difference information is determined according to different combinations, and this luminance difference information can be used as the reference sample value for the first color component of the current block.

[0078] S502: Determine the weighting coefficients based on the reference sample value of the first color component of the current block.

[0079] In the embodiments of this application, determining the weighting coefficients based on the reference sample value of the first color component of the current block may include the following: determining the value corresponding to the reference sample value of the first color component in a pre-set mapping; and setting the weighting coefficients to be equal to that value.

[0080] To make it clear, in the embodiments of this application, the reference sample value of the first color component may be the absolute difference between the filtered adjacent sample value of the first color component in the current block and the filtered sample value of the first reference color component sample in the current block. Here, the first reference color component is the first color component, which is a different color component from the predicted second color component in the embodiments of this application.

[0081] JPEG0007875986000005.jpg83157

number

[0082] JPEG0007875986000008.jpg37152

[0083] JPEG0007875986000009.jpg63152

number

[0084] JPEG0007875986000011.jpg32152

number

[0085] JPEG0007875986000013.jpg19156

number

[0086] According to Equation 4, in some embodiments, determining the value corresponding to the reference sample value of the first color component in a pre-configured mapping may include the following: Determining the first factor. Determining the first product value based on the first factor and the reference sample value of the first color component. Determining the value corresponding to the first product value in a pre-configured mapping.

[0087] JPEG0007875986000015.jpg32156

[0088] In a specific embodiment, determining the first factor may include the first factor being a predetermined constant value.

[0089] JPEG0007875986000016.jpg63152

[0090] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the size parameter of the current block.

[0091] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a pre-defined mapping look-up table of the current block size parameter and the value of the first factor.

[0092] Here, the size parameter of the current block may include at least one of the following parameters: the width of the current block or the height of the current block.

[0093] In the embodiments of this application, the value of the first factor can be determined by employing a classification method. For example, the current block's size parameters can be classified into three categories according to the current block's size parameters, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiments of this application, a mapping lookup table between the current block's size parameters and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on this lookup table. Table 1 illustrates the correspondence between the first factor and the current block's size parameters according to the embodiments of this application. Note that Table 1 is merely an illustrative lookup table and is not intended to be limiting.

[0094] [Table 1]

[0095] In yet another specific embodiment, determining the first factor may include determining the value of the first factor based on the number of reference samples in the current block.

[0096] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a pre-configured mapping lookup table of the number of reference samples in the current block and the value of the first factor.

[0097] In the embodiments of this application, the number of reference samples can be classified into three categories, and the value of the first factor can still be determined by employing a classification method. For example, the number of reference samples in the current block can be classified into three categories according to the number of reference samples in the current block, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiments of this application, a mapping lookup table between the number of reference samples in the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on this lookup table. Exemplarily, Table 2 shows the correspondence between the first factor and the number of reference samples in the current block according to the embodiments of this application. Note that Table 2 is merely an exemplary lookup table and is not intended to be limiting.

[0098] [Table 2]

[0099] Furthermore, determining the first product value based on the first factor and the reference sample value of the first color component may include the following: The first product value is set to be equal to the product of the first factor and the reference sample value of the first color component. Alternatively, the first product value is set to be equal to the value obtained by bitwise right-shifting the reference sample value of the first color component, with the number of bits right-shifted being equal to the first factor. Alternatively, the first product value is set to the value obtained by performing addition and bit-shift operations on the reference sample value of the first color component based on the first factor.

[0100] For example, assuming the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref, the first product is equal to 0.25 × Ref, which can also be expressed as Ref / 4, i.e., Ref >> 2. Furthermore, it is possible to convert floating-point numbers into addition and shift operations during fixed-point calculation. In other words, there are no restrictions on how the first product is calculated.

[0101] JPEG0007875986000019.jpg51152

[0102] JPEG0007875986000020.jpg43153

[0103] JPEG0007875986000021.jpg26153

[0104] Furthermore, with respect to the second factor, in a specific embodiment, the method may further include determining the second factor by performing a least-squares calculation based on the first color component value and the second color component value of the reference sample.

[0105] That is, assuming that the number of reference samples is N, the first color component value of a reference sample is the reference luminance information of the current block, and the second color component value of a reference sample is the reference saturation information of the current block, the second factor can be obtained by performing a least-squares calculation on the saturation and luminance component values ​​of the N reference samples. For example, the least-squares regression calculation is as follows.

number

[0106] Furthermore, regarding pre-configured mappings, these may be pre-configured functional relationships. In some embodiments, the pre-configured mapping may be a Softmax function. The Softmax function is a normalized exponential function, but in the embodiments of this application, normalization is not required, and its range of value is not limited to [0,1].

[0107] JPEG0007875986000023.jpg20153

number

number

[0108] Exemplary, the value of S is related to the size parameter of the current block. The size parameter of the current block includes the width and height of the current block. In one possible embodiment, if the minimum of the width and height is 4 or less, the value of S is equal to 8. If the minimum of the width and height is greater than 4 and 16 or less, the value of S is equal to 12. If the minimum of the width and height is greater than 16, the value of S is equal to 16. In another possible embodiment, if the minimum of the width and height is 4 or less, the value of S is equal to 7. If the minimum of the width and height is greater than 4 and 16 or less, the value of S is equal to 11. If the minimum of the width and height is greater than 16, the value of S is equal to 15. Alternatively, the value of S is related to the number of reference samples (R) of the current block. In one possible embodiment, if R is less than 16, the value of S is equal to 8. If R is 16 or greater and less than 32, the value of S is equal to 12. If R is 16 or greater, the value of S is equal to 16. No limitations are placed on this in the embodiments of this application.

[0109] In addition to the Softmax function, in other embodiments, the pre-configured mapping may be a weighting function inversely proportional to the reference sample value of the first color component.

[0110] JPEG0007875986000027.jpg13153

number

number

[0111] Thus, when a pre-defined mapping is a pre-defined functional relationship, the pre-defined mapping may be as shown in Equation 4, as shown in Equation 6 or 7, as shown in Equation 8 or 9, or it may be another functional model of weighting coefficients constructed by fitting a tendency that the stronger the similarity between the reference luminance value of the reference sample and the reconstructed luminance value of the sample awaiting prediction in the current block, the greater the importance of the reference saturation value of the reference sample to the sample awaiting prediction in the current block. The embodiments of this application are not particularly limited.

[0112] Furthermore, in some embodiments, the pre-configured mapping may be in the form of a pre-configured lookup table. That is, in embodiments of this application, the operation can be simplified, for example, by adopting the array element look-up table method, part of the calculation operation can be simplified. For a pre-configured mapping, the array element value can be determined based on the reference sample value of the first color component, the first factor, and a pre-configured mapping lookup table of array elements, then the value corresponding to the array element value in the pre-configured mapping can be determined, and then the weighting coefficient can be set to be equal to that value.

[0113] JPEG0007875986000030.jpg56152

[0114] In the embodiments of this application, the memory can be divided into complete memory or partial memory.

[0115] JPEG0007875986000031.jpg42152

[0116] JPEG0007875986000032.jpg29152

number

[0117] In this case, the calculation of the weighting coefficients in equation 7 can be simplified as follows.

number

[0118] Table 3 shows the elements in the two-dimensional array storMole[index1][index2].

[0119] [Table 3]

[0120] JPEG0007875986000036.jpg25152

number

[0121] In this case, the calculation of the weighting coefficients in equation 7 can be simplified as follows.

number

[0122] As shown above, the elements in the one-dimensional array ostorMole[index] are shown in Table 4.

[0123] [Table 4]

[0124] JPEG0007875986000040.jpg45152

[0125] JPEG0007875986000041.jpg43152

number

[0126] In this case, the calculation of the weighting coefficients in equation 7 can be simplified as follows.

number

[0127] As shown above, the elements in the two-dimensional array partsorMole[index1][index2] are shown in Table 5.

[0128] [Table 5]

[0129] JPEG0007875986000045.jpg50152

[0130] JPEG0007875986000046.jpg48152

[0131] S503: Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block for the second color component of the current block is determined.

[0132] In the embodiments of this application, the first prediction block includes predicted values ​​for at least some of the second color component samples within the current block.

[0133] Furthermore, in embodiments of this application, the method for determining the reference sample value of the second color component of the current block may further include determining the reference sample value of the second color component of the current block based on the value of the second color component sample in an adjacent region of the current block.

[0134] Here, the adjacent region may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0135] In specific embodiments, the method may further include the following: a fourth filtering is performed on the values ​​of the second color component samples in the adjacent region of the current block to obtain filtered adjacent sample values ​​for the second color component of the current block; and a reference sample value for the second color component of the current block is determined based on the filtered adjacent sample values ​​for the second color component of the current block.

[0136] In the embodiments of this application, the number of filtered adjacent sample values ​​for the second color component of the current block is greater than the number of second color component sample values ​​in the adjacent region of the current block.

[0137] In the embodiments of this application, the fourth filtering is upsampling filtering. The upsampling rate is a positive integer multiple of 2.

[0138] That is, the first color component is the luminance component, and the second color component is the chroma component. In the embodiments of this application, by performing upsampling filtering on the reference chroma information, the spatial resolution of the filtered reference chroma information and the spatial resolution of the reference luminance information can be made the same. For example, if the number of reference luminance information is 2M+2N and the number of reference chroma information is M+N, the number of reference chroma information can be converted to 2M+2N after upsampling filtering is performed on the reference chroma information.

[0139] Furthermore, in the embodiments of this application, both the second filtering performed on the value of the first color component sample in an adjacent region, and the third filtering performed on the reconstructed value of the first reference color component sample in the current block, may be downsampling filters. The second filtering may be performed using the first filter, and the third filtering may be performed using the second filter. Both the first and second filters may be downsampling filters. The downsampling rates of these filters may differ because the data being processed is different. Therefore, the first and second filters may be the same or different. A fourth filtering is also performed on the value of the second color component sample in an adjacent region. The fourth filtering may be performed using the third filter. If the fourth filtering is an upsampling filter, then the third filter may be an upsampling filter. Furthermore, the first, second, and third filters may all be neural network filters. No restrictions are placed on this.

[0140] To make it easier to understand, assuming that the first color component is the luminance component and the second color component is the chroma component, the spatial resolution of the value of the first color component sample in the adjacent region (i.e., reference luminance information), the spatial resolution of the value of the second color component sample in the adjacent region (i.e., reference chroma information), and the spatial resolution of the reconstructed value of the first reference color component sample in the current block (i.e., reconstructed luminance information) are all influenced by the color format information. Therefore, a second, third, or fourth filtering can also be performed based on the current color format information. Hereinafter, taking the fourth filtering as an example, in some embodiments, the method further includes performing a fourth filtering on the value of the second color component sample in the adjacent region of the current block based on the color format information to obtain the filtered adjacent sample value of the second color component of the current block.

[0141] In specific embodiments, the fourth filtering may further include the following: If the color format information indicates 4:2:0 sampling, upsampling filtering is performed on the value of the second color component sample in the adjacent region of the current block. The upsampling rate is a positive integer multiple of 2.

[0142] In the embodiments of this application, the color format information may include 4:4:4 sampling, 4:2:2 sampling, 4:1:1 sampling, 4:2:0 sampling, etc. When the color format information represents a video having 4:4:4 sampling (which may also be represented as YUV444), i.e., when the spatial resolution of luminance and the spatial resolution of saturation are equal, no processing is required on the reference saturation information. When the color format information represents a video having saturation subsampling characteristics such as 4:2:2 sampling (which may also be represented as YUV422), 4:1:1 sampling (which may also be represented as YUV411), or 4:2:0 sampling (which may also be represented as YUV420), i.e., when the spatial resolution of luminance and the spatial resolution of saturation do not match, and the spatial resolution of the saturation component is smaller than the spatial resolution of the luminance component, it is necessary to perform upsampling filtering on the reference saturation information obtained from the adjacent region.

[0143] Thus, for upsampling filtering of reference saturation information, the upsampling filtering method may be any one of the linear interpolation methods, such as nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, mean interpolation, median interpolation, and copy interpolation. Alternatively, the above upsampling filtering method may be any one of the nonlinear interpolation methods, such as a wavelet transform-based interpolation algorithm or an edge information-based interpolation algorithm. Alternatively, upsampling filtering may be performed based on a convolutional neural network. No limitations are imposed in the embodiments of this application. Exemplarily, with reference to Figure 6B, the YUV420 video format and copy interpolation will be described as examples. Here, an example of 4×1 reference saturation information and 8×2 reference luminance information is shown. The 8x2 diagonally colored blocks represent reference luminance information, and the 4x1 grid-colored blocks represent collocated reference chroma information. Each sample within the 4x1 grid-colored block corresponds to the top-left corner sample of each 2x2 subblock within the 8x2 chroma block after upsampling filtering; that is, the sample values ​​of each chroma sample within the 2x2 subblock after copy interpolation are the same. Specifically, for each 2x2 subblock, the other three chroma samples (blocks colored with dots) are all obtained by copying the top-left corner sample (block colored with a grid).

[0144] Furthermore, after determining the reference sample value of the second color component of the current block, in some embodiments, for S503, determining the first prediction block of the second color component of the current block based on the weighting factor and the reference sample value of the second color component of the current block may include the following. Determine a weighting value obtained by multiplying a weighting factor corresponding to the reference sample value of the second color component. Set the predicted value of the second color component sample in the first prediction block to be equal to the sum of the N weighting values. N indicates the number of reference sample values of the second color component, and N is a positive integer.

[0145] That is, when the number of reference sample values of the second color component is N, first, a weighting value (w k C k ) obtained by multiplying the weighting factor corresponding to each reference sample value of the second color component is determined, and then the sum of these N weighting values is used as the predicted value of the second color component sample in the prediction block. Specifically, the calculation formula is as follows. [Number]

[0146] Exemplarily, first, an absolute luma difference is calculated based on the reconstructed luma information at the position (i, j) in the current block and the reference luma information in the adjacent region, then a weighting factor is calculated according to the Softmax function, and further, the predicted value of the chroma component at the position (i, j) in the prediction block can be obtained using Equation 16. In particular, this method is advantageous for parallel processing and can increase the calculation speed.

[0147] In the embodiments of this application, assuming that the width of the first prediction block is predSizeW, the height of the first prediction block is predSize H, the width of the current block is nTbW, and the height of the current block is nTbH, then predSizeH is less than or equal to nTbH, or predSizeW is less than or equal to nTbW. That is, the first prediction block contains the predicted values ​​of at least a portion of the second color component samples within the current block.

[0148] S504: Perform the first filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0149] S505: Based on the second prediction block, determine the reconstruction value of the second color component sample of the current block.

[0150] In the embodiments of this application, if the first prediction block includes predicted values ​​for some of the second color component samples within the current block, it is necessary to perform upsampling filtering on the first prediction block in order to obtain the final second prediction block. Therefore, in some embodiments, performing a first filter on the first prediction block to determine the second prediction block for the second color component of the current block includes performing upsampling filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0151] Furthermore, in embodiments of this application, if the number of predicted values ​​for the second color component included in the second prediction block is the same as the number of second color component samples included in the current block, but the second prediction block does not include predicted values ​​for the second color component samples of the current block, then it is necessary to perform filtering augmentation on the predicted values ​​in order to obtain the final second prediction block. Accordingly, in some embodiments, performing a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block includes performing filtering augmentation on the first prediction block to determine the second prediction block for the second color component of the current block.

[0152] Furthermore, in the embodiments of this application, if the first prediction block contains the predicted values ​​of all second color component samples in the current block, there is no need to process the first prediction block, and the first prediction block can be directly made the final second prediction block.

[0153] To ensure clarity, in the embodiments of this application, the first filtering may be upsampling filtering, filtering augmentation, or the like. No limitations are imposed here. However, for a second prediction block on which the first filtering has been performed, the second prediction block contains the predicted values ​​of all second color component samples in the current block.

[0154] Here, if the first filter is an upsampling filter, the fourth filter can perform upsampling filtering on the first prediction block. The fourth filter may also be an upsampling filter. The fourth filter may be the same as or different from the third filter described above. The fourth filter here may also be a neural network filter. No limitations are placed on this in the embodiments of this application.

[0155] In some embodiments, performing a first filtering on a first prediction block to determine the second prediction block for the second color component of the current block may include the following: The first filtering includes upsampling filtering. The input to the upsampling filtering is a first upsampling input block, and the output to the upsampling filtering is a first upsampling output block.

[0156] Furthermore, in some embodiments, upsampling filtering may include the following: determining the upsampling factor; the upsampling factor including at least one of a horizontal upsampling factor and a vertical upsampling factor; and performing upsampling filtering on a first upsampling input block based on the upsampling factor to obtain a first upsampling output block.

[0157] In one possible embodiment, obtaining a first upsampling output block by performing upsampling filtering on a first upsampling input block based on an upsampling factor may include the following: If the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1, perform upsampling filtering on the first upsampling input block to obtain a first upsampling output block.

[0158] In the embodiments of this application, performing upsampling filtering on the first upsampling input block is: Performing horizontal upsampling filtering on the first upsampling input block, Perform vertical upsampling filtering on the first upsampling input block, The first upsampling input block is subjected to horizontal upsampling filtering followed by vertical upsampling filtering, The first upsampling input block is subjected to vertical upsampling filtering followed by horizontal upsampling filtering, It may include at least one of the following.

[0159] Here, first, a horizontal upsampling factor can be calculated based on the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated based on the height of the first upsampling input block and the height of the first upsampling output block. Next, upsampling filtering can be performed on the first upsampling input block based on the horizontal and vertical upsampling factors. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, upsampling should be performed only horizontally on the first upsampling input block. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, upsampling should be performed only vertically on the first upsampling input block. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, upsampling should be performed both horizontally and vertically on the first upsampling input block. Upsampling may be performed horizontally first and then vertically, or vertically first and then horizontally. Furthermore, the upsampling filtering operation here can be replaced by a convolutional operation in a neural network structure. No limitations are imposed on the embodiments of this application.

[0160] In another possible embodiment, the first prediction block is upsampled and filtered to determine the second prediction block. In this case, the method may further include the following: the first prediction block is the first upsampled input block, and the first upsampled output block is the second prediction block for the second color component of the current block.

[0161] In another possible embodiment, the first prediction block is subjected to enhancement filtering, followed by upsampling filtering, to determine the second prediction block. In this case, the method may further include: filtering enhancement is performed on the first prediction block to determine the first enhanced prediction block; the first enhanced prediction block is set as the first upsampling input block; and the first upsampling output block is set as the second prediction block for the second color component of the current block.

[0162] In yet another possible embodiment, the first prediction block is subjected to upsampling filtering and then augmentation filtering to determine the second prediction block. In this case, the method may further include the following: the first prediction block is the first upsampling input block; the first upsampling output block is the first upsampling-filtered prediction block; and filtering augmentation is performed on the first upsampling-filtered prediction block to determine the second prediction block for the second color component of the current block.

[0163] In a further possible embodiment, the second prediction block is determined by first performing augmented filtering on the first prediction block, then upsampling filtering, and then augmented filtering again. In this case, the method may further include the following: A first filtering augmentation is performed on the first prediction block to determine the second augmented prediction block. The second augmented prediction block is made the first upsampling input block. The first upsampling output block is made the second upsampling filtered prediction block. A second filtering augmentation is performed on the second upsampling filtered prediction block to determine the second prediction block for the second color component of the current block.

[0164] Furthermore, if the first filtering is upsampling filtering, upsampling filtering can be performed on the first predicted block using horizontal upsampling factors and vertical upsampling factors. Specifically, in some embodiments, performing upsampling filtering on the first predicted block to determine the second predicted block for the second color component of the current block may include the following: Determining the horizontal upsampling factors and vertical upsampling factors. Performing upsampling filtering on the first predicted block based on the horizontal upsampling factors and vertical upsampling factors to obtain the second predicted block for the second color component of the current block.

[0165] In a specific embodiment, performing upsampling filtering on a first prediction block based on a horizontal upsampling factor and a vertical upsampling factor to obtain a second prediction block of the second color component of the current block may include the following: If the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1, perform upsampling filtering on the first prediction block to obtain a second prediction block.

[0166] In the embodiments of this application, performing upsampling filtering on the first prediction block is: Perform horizontal upsampling filtering on the first prediction block, Perform vertical upsampling filtering on the first prediction block, Perform horizontal upsampling filtering on the first prediction block, followed by vertical upsampling filtering. Perform vertical upsampling filtering on the first prediction block, followed by horizontal upsampling filtering. It includes at least one of the following.

[0167] Here, first, a horizontal upsampling factor can be calculated based on the width of the first predicted block and the width of the current block, and a vertical upsampling factor can be calculated based on the height of the first predicted block and the height of the current block. Next, upsampling filtering is performed on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, upsampling should be performed only horizontally on the first predicted block. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, upsampling should be performed only vertically on the first predicted block. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, upsampling should be performed both horizontally and vertically on the first predicted block. Upsampling may be performed horizontally and then vertically, or vertically and then horizontally, and furthermore, these upsampling operations can be replaced by convolutional operations in the neural network structure. No limitations are imposed in the embodiments of this application.

[0168] In some embodiments, upsampling filtering is implemented by at least one of the following methods: linear interpolation or convolutional operations based on a pre-configured neural network. That is, upsampling filtering can be implemented with different filters, such as two-dimensional filters and one-dimensional filters. In the case of a one-dimensional filter, there are two possible filtering orders: "first vertical, then horizontal" and "first horizontal, then vertical." These two orders may be fixed filtering orders or flexible filtering orders determined by certain parameters (e.g., an order directly indicated by identification information, an implicit order associated with elements such as prediction mode or block size). No limitations are placed on this in the embodiments of this application.

[0169] In yet another possible embodiment, if the first filtering is filtering augmentation, the filtering augmentation can be achieved by bilateral filtering. Specifically, performing the first filtering on a first prediction block to determine the second prediction block for the second color component of the current block may include: determining the first weight value of the first prediction block under bilateral filtering mode; and performing bilateral filtering on the first prediction block based on the first weight value to obtain the second prediction block.

[0170] Bilateral filtering is a nonlinear filtering method used for edge preservation and noise reduction. This filtering method considers both spatial proximity information and color similarity information to remove noise and smooth the image while simultaneously preserving the image's edges. Bilateral filtering uses a combination of two Gaussian filters. One is for calculating spatial proximity weights, i.e., the principle of a commonly used Gaussian filter, and the other is for calculating pixel value similarity weights. Bilateral filtering is implemented with two Gaussian filters. During bilateral filtering, the optimized weights are convolved with the image to achieve edge preservation and noise reduction. Referring to Figure 7, which is a schematic diagram showing the filter positions according to an embodiment of this application. The current center position of the filter is (i, j), and the neighboring points of the center are (k, l), and their weights are colored gray. Thus, the weights of the two Gaussian filters are determined as follows.

number

number

number

[0171] Furthermore, the optimized weight values ​​w(i,j,k,l) ​​are convolved with the image to obtain the following filtered predictions.

number

[0172] Furthermore, in the embodiments of this application, the filtering augmentation may include, in addition to bilateral filtering, median filtering, Gaussian filtering, normalized filtering, etc. That is, the filtering augmentation may include, but is not particularly limited to, at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.

[0173] Furthermore, in some embodiments, the method may further include the following: Filtering augmentation is performed on the first prediction block before upsampling filtering is performed on the first prediction block. The first prediction block obtained after augmentation is designated as the first prediction block.

[0174] Furthermore, in some embodiments, the method may further include the following: Upsampling filtering is performed on the first prediction block, and then filtering enhancement is performed on the first prediction block obtained after upsampling filtering to obtain a second prediction block of the second color component of the current block.

[0175] That is, in embodiments of this application, the first filtering may be upsampling filtering, filtering augmentation, or both upsampling filtering and filtering augmentation. If both are included, upsampling filtering may be performed first on the first prediction block, followed by filtering augmentation, or filtering augmentation may be performed first on the first prediction block, followed by upsampling filtering. No limitations are placed on this in embodiments of this application.

[0176] Thus, the predSamples(i,j) obtained in equation 20 is not necessarily the final predicted value; it may be the filtered and augmented predicted value before upsampling (in this case, predSamples(i,j) is not the final predicted value), the filtered and augmented predicted value after upsampling, or even the filtered and augmented predicted value that does not require upsampling.

[0177] Furthermore, with respect to filtering enhancement, in some embodiments, the method further includes the following: determining the compensation value of the second color component sample of the first prediction block based on the reference sample value in the adjacent region of the current block; and determining the second prediction block by refining the prediction value of the second color component sample of the first prediction block based on the compensation value.

[0178] Furthermore, to further improve the prediction accuracy of WCP mode, position-related refinement can be performed on the first prediction block. For example, a reference sample with a nearby spatial position can be used to calculate the saturation compensation value for each second color component sample awaiting prediction. This saturation compensation value can then be used to refine the second color component samples within the second prediction block. Based on the refined prediction values, the final predicted values ​​(predSamples) for the second color component samples can be determined, and the final second prediction block can be obtained.

[0179] Furthermore, with respect to filtering enhancement, in some embodiments, the method further includes the following: predicting the second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value for the second color component sample of the first prediction block; and determining the second prediction block by performing weighted fusion on at least one initial predicted value and the predicted value of the second color component sample in the first prediction block.

[0180] Furthermore, to further improve the prediction accuracy of the WCP mode, weighted fusion can be performed on the saturation prediction values ​​calculated under other prediction modes and the saturation prediction values ​​calculated under the WCP mode, and the final saturation prediction value can be determined based on the fusion result. For example, as shown in Figure 8, other prediction modes may include Planar mode, direct current (DC) mode, vertical mode, horizontal mode, and CCLM mode, and each prediction mode corresponds to one switch, which is used to control whether or not the saturation prediction values ​​under that prediction mode are involved in weighted fusion. Assume that the weight value for Planar mode is W_Planar, the weight value for DC mode is W_DC, the weight value for vertical mode is W_Ver, the weight value for horizontal mode is W_Hor, the weight value for CCLM mode is W_CCLM, and the weight value for WCP mode is W_Wcp. For the saturation prediction values ​​under Planar mode, DC mode, Vertical mode, Horizontal mode, and CCLM mode, if only the switch corresponding to CCLM mode is ON, weighted fusion can be performed on the saturation prediction values ​​under CCLM mode and WCP mode based on W_CCLM and W_Wcp. Depending on the values ​​of W_CCLM and W_Wcp, it can be determined whether the weighted fusion is performed evenly or unevenly. The result of the weighting becomes the final saturation prediction value of the second color component sample, thereby obtaining the final second prediction block.

[0181] In some embodiments, determining the reconstruction value of the second color component sample of the current block based on the second prediction block after determining the second prediction block may include the following: determining the residual value of the second color component sample of the current block; determining the predicted value of the second color component sample of the current block based on the second prediction block; and determining the reconstruction value of the second color component sample of the current block based on the residual value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.

[0182] In the embodiments of this application, determining the residual value of the second color component sample of the current block may be done by analyzing the bitstream.

[0183] Furthermore, in the embodiments of this application, determining the predicted value of the second color component sample of the current block based on the second prediction block may involve setting the predicted value of the second color component sample of the current block to be equal to the value of the second prediction block, or it may involve performing upsampling filtering on the value of the second prediction block and setting the predicted value of the second color component sample of the current block to be equal to the output value after upsampling filtering.

[0184] Thus, by analyzing the bitstream using the saturation component as an example, the saturation residual value of the current block can be determined. Next, based on the second predicted block, the saturation predicted value of the current block can be determined. Furthermore, by adding the saturation predicted value and the saturation residual value, the saturation reconstructed value of the current block can be obtained.

[0185] To facilitate understanding, the embodiments of this application describe in detail the post-processing process after WCP prediction during WCP mode prediction in the following four aspects. First, the calculation of the saturation weighting coefficient of the reference sample is realized by making full use of the luminance information of the reference sample and the current block. Second, the core parameters of the WCP mode are given full consideration to reduce the complexity of saturation weighting calculation by taking advantage of the low sensitivity of the human eye to saturation. That is, if predSizeW × predSizeH is less than or equal to nTbW × nTbH, upsampling is performed on the saturation prediction block. Third, when upsampling is performed, the reference saturation information is made full use and characteristics in different directions are considered. During linear interpolation, the spatial correlation between the points awaiting interpolation and existing points is given full consideration by assigning different weight values ​​to different points awaiting interpolation between existing neighboring points, thereby improving the accuracy of upsampling filtering. Fourthly, taking into full consideration the possibility that the saturation prediction block output by WCP prediction may result in unstable and inaccurate prediction values, and the possibility that the upsampling filtering of the embodiment of this application may result in inaccurate prediction values, in such cases, the saturation prediction block below is enhanced with bilateral filtering that enables edge preservation and noise reduction to further improve the accuracy and subjective and objective quality of the saturation prediction block. Note that there is no sequential relationship between the four modes described here, and they can be used individually or in combination.

[0186] JPEG0007875986000053.jpg55152

[0187] This embodiment provides a decoding method. The reference sample value of the first color component of the current block is determined. Based on the reference sample value of the first color component of the current block, a weighting coefficient is determined. Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block of the second color component of the current block is determined. A first filtering is performed on the first predicted block to determine the second predicted block of the second color component of the current block. The second predicted block contains the predicted values ​​of all second color component samples in the current block. Based on the second predicted block, the reconstructed value of the second color component sample of the current block is determined. In this way, by calculating the weighting coefficient using the color component information of the current block and the reference samples adjacent to the current block, the correlation in luminance information between the current block and adjacent regions can be fully utilized, and by using this correlation in the saturation prediction of the current block, the accuracy of saturation prediction can be improved. Furthermore, taking advantage of the characteristic that the human eye is not very sensitive to saturation, in order to reduce the complexity of calculating the weighting coefficient, if the size of the first predicted block is smaller than the size of the current block, upsampling filtering is performed on the first predicted block. Furthermore, considering the instability of the predicted values ​​in the first prediction block, filtering enhancement can be applied to address this, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, improving coding efficiency, and further enhancing coding performance.

[0188] In another embodiment of this application, as an example, saturation prediction is performed for the current block based on the decoding method described in the above embodiment. In this embodiment, the reconstructed luminance information of the current block, the reference luminance information in the adjacent region, and the reference saturation information are all decoded reference information. Therefore, in this embodiment, a WCP technology utilizing the above information is proposed, and based on this, post-processing is performed on the saturation prediction block obtained by WCP to further improve the accuracy of saturation prediction. Hereinafter, the detailed steps of the saturation prediction process using WCP mode are as follows.

[0189] WCP mode input: Current block position (xTbCmp, yTbCmp), current block width nTbW, and current block height nTbH.

[0190] The output in WCP mode is the predicted values ​​for the current block, predSamples[x][y]. The top-left corner of the current block is considered the coordinate origin, with x=0, ..., nTbW-1 and y=0, ..., nTbH-1.

[0191] The prediction process using WCP mode may include steps such as determining core parameters, acquiring target information, WCP, and post-processing. After these steps, the saturation prediction value for the current block can be obtained.

[0192] In one specific embodiment, referring to Figure 10, Figure 10 is a flowchart 2 showing a decoding method according to an embodiment of the present application. As shown in Figure 10, the method may include the following:

[0193] S1001: Confirm the core parameters for WCP mode.

[0194] Furthermore, regarding S1001, the core parameters related to WCP mode can be determined by settings or by some method, and the core parameters of WCP mode can be obtained or estimated. For example, the core parameters can be obtained from the bitstream on the decoding side.

[0195] Here, the core parameters of WCP mode include, but are not limited to, the control parameter (S), the number of WCP inputs (inSize), and the number of WCP outputs (arranged in predSizeW × predSizeH). The first prediction block output based on WCP can be represented as predWcp. The number of WCP outputs is the same value (for example, predSizeW = predSizeH = SIt can be set to / 4) or related to the size parameter of the current block (e.g., predSizeW=nTbW, predSizeH=nTbH). The control parameter (S) can be used to adjust a nonlinear function in a subsequent operation or to adjust data related to a subsequent operation.

[0196] The determination of core parameters is influenced, under certain conditions, by block size, block content, or the number of samples within a block. For example, if the block sizes to which WCP mode applies are diverse, or if there are large differences between block sizes, large differences in block content, or large differences in the number of samples within a block, the current block can be classified according to its block size, block content, or the number of samples within a block, and the same or different core parameters can be determined according to the different categories. That is, the control parameters (S) corresponding to different categories, or the number of WCP inputs inSize, or the number of WCP outputs (arranged in predSizeW × predSizeH) may be the same or different. Note that predSizeW and the height predSizeH may be the same or different.

[0197] Below, to make the determination of core parameters easier to understand, we will explain two simple classifications as examples.

[0198] Classification Example 1: In WCP mode, the current block can be classified according to its width and height, and the block category is represented by wcpSizeId. The control parameters (S), the number of WCP inputs (inSize), and the number of WCP outputs (arranged in predSizeW × predSizeH) corresponding to blocks of different categories may be the same or different. Here, we will explain with an example of classification into three categories.

[0199] The current block is classified into three categories according to the current block width and height. The control parameter(s) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arrayed in predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and the block category wcpSizeId is defined as follows.

[0200] wcpSizeId = 0 represents the current block where min(nTbW, nTbH) <= 4. The control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.

[0201] wcpSizeId = 1 represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter(s) is 12, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.

[0202] wcpSizeId = 2 represents the current block where min(nTbW, nTbH) > 16. The control parameter(s) is 16, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.

[0203] The numerical relationships among the above core parameters are represented in a table, for example, as shown in Table 6.

[0204] [Table 6]

[0205] Another example of classification into three categories can also be described.

[0206] The current block is classified into three categories according to the current block's width and height. The control parameter(s) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arranged in predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and the block category wcpSizeId is defined as follows.

[0207] wcpSizeId = 0 represents the current block where min(nTbW, nTbH) <= 4. The control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.

[0208] wcpSizeId = 1 represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter(s) is 12, inSize is (1.5×nTbH + 1.5×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH / 2×nTbW / 2.

[0209] wcpSizeId = 2 represents the current block where min(nTbW, nTbH) > 16. The control parameter(s) of WCP is 16, inSize is (nTbH + nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH / 4×nTbW / 4.

[0210] The numerical relationships among the above core parameters are represented in a table, for example, as shown in Table 7.

[0211]

Table 7

[0212] Classification Example 2: In WCP mode, the current block can also be classified according to its width and height, with wcpSizeId representing the block's category. The control parameters (S), the number of WCP inputs (inSize), and the number of WCP outputs (arranged in predSizeW × predSizeH) corresponding to blocks of different categories may be the same or different. Here, we will explain with an example of classification into three categories.

[0213] The current block is classified into three categories based on its current width and height. The control parameter (S) corresponding to each category can be set differently, while the inSize and the number of WCP outputs (arranged in predSizeW × predSizeH) corresponding to each category can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW × nTbH represents the number of samples in the current block. The block category wcpSizeId is defined as follows:

[0214] wcpSizeId=0: Represents the current block where (nTbWnTbH)<128. The control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH×nTbW.

[0215] This represents the current block where wcpSizeId=1:128<=(nTbWnTbH)<=256. The control parameter (S) is 8, inSize is (2×nTbH+2×nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH×nTbW.

[0216] This represents the current block where wcpSizeId=2:(nTbWnTbH) > 256. The control parameter (S) is 1, inSize is (2×nTbH+2×nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH×nTbW.

[0217] The numerical relationships between the above core parameters are shown in a table, for example, as shown in Table 8.

[0218] [Table 8]

[0219] This can also be illustrated with another example that falls into three categories.

[0220] The current block is classified into three categories based on its current width and height. The control parameter (S) corresponding to each category can be set differently, while the inSize and the number of WCP outputs (arranged in predSizeW × predSizeH) corresponding to each category can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW × nTbH represents the number of samples in the current block. The block category wcpSizeId is defined as follows:

[0221] wcpSizeId=0: Represents the current block where (nTbWnTbH)<64. The control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH×nTbW.

[0222] This represents the current block where wcpSizeId=1:64<=(nTbWnTbH)<=512. The control parameter (S) is 4, inSize is (1.5×nTbH+1.5×nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH / 2×nTbW / 2.

[0223] This represents the current block where wcpSizeId=2:(nTbWnTbH)>512. The control parameter (S) is 1, inSize is (nTbH+nTbW), and the number of saturation prediction values ​​is the number of WCP outputs nTbH / 4 × nTbW / 4.

[0224] The numerical relationship between the above core parameters is represented in a table, for example, as shown in Table 9.

[0225] [Table 9]

[0226] S1002: Determine the target information of the current block based on the core parameters.

[0227] Note that when predicting the current block for S1002, the upper region, upper-left region, and left region of the current block are regarded as the adjacent regions of the current block (which can also be called "reference regions"). As shown in FIG. 6A above, all samples in the adjacent regions are decoded reference samples.

[0228] Here, reference chroma information refC and reference luminance information refY are obtained from the adjacent regions. The obtained reference chroma information includes, but is not limited to, the reference reconstruction chroma values selected from the upper region of the current block and / or the reference reconstruction chroma values selected from the left region of the current block. The obtained reference luminance information includes, but is not limited to, the corresponding reference luminance information obtained based on the position of the reference chroma information.

[0229] Obtain the reconstructed luminance information recY of the current prediction block. The acquisition method includes, but is not limited to, obtaining the corresponding reconstructed luminance information based on the position of the chroma information in the current block and using it as the reconstructed luminance information of the current block.

[0230] Also, in the embodiments of the present application, refC, refY, or recY can be used as the target information for the WCP input after being preprocessed under certain conditions.

[0231] Exemplarily, in order to reduce the computational complexity of WCP prediction, extraction or downsampling filtering can be performed on refC, refY, or recY.

[0232] For example, different filtering can be applied to refC, refY, or recY for current blocks of different sizes.

[0233] For example, if the spatial resolution of the saturation component of a video does not match the spatial resolution of the luminance component, upsampling filtering or downsampling filtering can be applied to refC, refY, or recY to facilitate subsequent saturation prediction calculations.

[0234] For example, if the spatial resolution of the saturation component and the luminance component of a video are the same, multiple row / column reference samples can be used. In this case, upsampling filtering or downsampling filtering can be performed on refC, refY, or recY to facilitate subsequent saturation prediction calculations.

[0235] For example, if the number of refC or refY obtained differs from the number of inSize in the core parameters, extraction, upsampling filtering, or downsampling filtering can be performed on refC or refY.

[0236] In other words, obtaining target information may include the following: obtaining reference saturation information refC, where the value is inSize (if preprocessing is required, refC is obtained after preprocessing); obtaining reference luminance information refY, where the value is inSize (if preprocessing is required, refY is obtained after preprocessing); and obtaining reconstructed luminance information recY within the current block (if preprocessing is required, recY is obtained after preprocessing).

[0237] S1003: Perform a WCP based on the target information to obtain the first predicted block of the current block.

[0238] JPEG0007875986000058.jpg51152

[0239] JPEG0007875986000059.jpg61152

[0240] In a specific embodiment, after obtaining the target information, as shown in FIG. 11, the method may include the following content.

[0241] S1101: For each sample waiting for prediction, construct a luminance difference vector using the reference chroma information, reference luminance information, and the reconstructed luminance information of the current block included in the target information.

[0242] JPEG0007875986000060.jpg30152

Number

[0243] Also, under certain conditions, linear or nonlinear numerical processing can be performed on the luminance difference vectors of the samples waiting for prediction. For example, based on the control parameter S in the core parameters, the values of the luminance difference vectors of the samples waiting for prediction can be scaled.

[0244] S1102: For each sample waiting for prediction, calculate a weight vector using a non - linear function based on the luminance difference vector.

[0245] JPEG0007875986000063.jpg57152

[0246] JPEG0007875986000064.jpg32152

Number

[0247] Under certain conditions, the weight model can also be adjusted based on control parameters (S) within the core parameters. For example, if the current block size is flexible, the weight model can be adjusted based on control parameters (S). Using a nonlinear Softmax function as an example, the function can be adjusted by selecting different control parameters depending on the different block category to which the current block belongs. In this case, the formula for calculating the weight vector corresponding to each sample awaiting prediction is as follows:

number

[0248] In embodiments of this application, fixed-point arithmetic can also be performed on the weighting coefficients. Accordingly, in some embodiments, the method further includes the following: If the weighting coefficients are floating-point weighting factors, fixed-point arithmetic is performed on the floating-point weighting factors to obtain fixed-point weighting factors.

[0249] Thus, after completing the calculation based on the above number 22 or number 23, fixed-point arithmetic can be performed on cWeightFloat as follows.

number

[0250] S1103: For each sample awaiting prediction, a weighted calculation is performed based on the weight vector and the reference saturation information included in the target information to obtain a predicted saturation value.

[0251] JPEG0007875986000069.jpg50152

[0252] In one possible embodiment, the following may be included: Performing weighting calculations based on floating-point weighting coefficients and reference chrominance information to obtain initial predicted values ​​for the samples awaiting prediction; Performing fixed-point arithmetic on the initial predicted values ​​to obtain target predicted values ​​for the samples awaiting prediction.

[0253] For example, the calculation formula is as follows: Given that k=0, 1, ..., inSize-1,

number

number

number

number

[0254] In another possible embodiment, weighting calculations are performed based on fixed-point weighting coefficients and reference saturation information to obtain initial predicted values ​​for the samples awaiting prediction, and fixed-point compensation is performed on these initial predicted values ​​to obtain target predicted values ​​for the samples awaiting prediction.

[0255] For example, the calculation formula is as follows: Given that k=0, 1, ..., inSize-1,

number

Number

[0256] S1104: For each sample waiting for prediction, improve the calculated chroma prediction value to determine the first prediction block of the current block.

[0257] JPEG0007875986000078.jpg57152

[0258] BitDepth is the bit depth required for the chroma sample value to ensure that all chroma prediction values within the prediction block are between 0 and (1<<BitDepth)-1. That is,

Number

Number

Number

[0259] S1004: Perform post-processing on the chroma prediction value of the first prediction block to determine the second prediction block of the current block.

[0260] Furthermore, for S1004, a saturation prediction value is obtained by weight derivation using the reconstructed luminance information, and the obtained saturation prediction value is further processed to improve the accuracy of the saturation prediction.

[0261] Because the human eye is not very sensitive to partial removal of saturation information, in the embodiments of this application, saturation prediction can be performed only on a portion of the samples within the current block, in which case the size of the obtained first prediction block, predSizeW × predSizeH, is less than or equal to the size of the current block (i.e., the original saturation block), nTbW × nTbH. In the technical invention of the embodiments of this application, the decision of whether or not to perform upsampling filtering on saturation and whether or not to perform filtering enhancement on the saturation prediction value is mainly determined according to the output size of the first prediction block obtained after WCP prediction.

[0262] In one specific embodiment, regarding post-processing of the saturation prediction value of the first prediction block, as shown in Figure 12, the method may include the following:

[0263] S1201: Determine the output size of the first prediction block.

[0264] S1202: If the output size of the first prediction block is equal to the size of the current block, the first prediction block is directly subjected to filtering augmentation to obtain the second prediction block.

[0265] S1203: If the output size of the first prediction block is smaller than the size of the current block, determine the execution order of the first prediction block.

[0266] S1204: First, upsampling filtering is performed on the first prediction block to obtain an upsampled prediction block, and its size is restored to the same size as the current block.

[0267] S1205: Next, filtering augmentation is performed on the upsampled prediction block to obtain a second prediction block.

[0268] S1206: First, First prediction block Filtering enhancement is applied to obtain an enhanced prediction block.

[0269] S1207: Next, upsampling filtering is performed on the enhanced prediction block to obtain a second prediction block, and its size is restored to the same size as the current block.

[0270] The execution order of the first prediction block may include a first execution order and a second execution order. The first execution order is to first perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the upsampled prediction block. The second execution order is to first perform filtering enhancement on the first prediction block, and then perform upsampling filtering on the enhanced prediction block.

[0271] Here, we assume that the execution order of the first prediction block is the first execution order. That is, first, upsampling filtering is performed on the first prediction block, and then filtering augmentation is performed on the upsampled prediction block.

[0272] In actual coding, chroma sub-sampling utilizes the fact that the human eye is less sensitive to chroma signals than to luminance signals to remove some of the color information in an image without being noticed by humans. This means that a relatively low spatial sampling rate can be given to the chroma signal. Also, chroma components within the same block are relatively flat and have similar content characteristics. In video content with these two characteristics, if prediction is made for each sample within the same block of the image, the calculation of the weight vector and the weighting of the chroma prediction values ​​become highly complex, and the prediction efficiency is greatly reduced. Based on the two characteristics of video mentioned above and the high complexity of calculating the chroma prediction values ​​for all samples, it may be considered to predict only a subset of samples within the current block. That is, in the core parameters of WCP mode, if predSizeW is less than the width nTbW of the current block, or predSizeH is less than the height nTbH of the current block, upsampling filtering must be performed on predWcp to obtain the final chroma prediction value predSamples.

[0273] In the embodiments of this application, first, the horizontal upsampling factor upHor is calculated based on the output width of the first predicted block predSizeW and the current block width nTbW. Similarly, the vertical upsampling factor upVer is calculated based on the output height of the first predicted block predSizeH and the current block height nTbH. The calculation method is as follows.

number

number

[0274] Immediately afterward, the first prediction block predWcp is filled into the current second prediction block predSamples as follows:

number

[0275] Specifically, first, the upper part Shining light The degree sample refC_T is populated in the row predSamples[x][-1] above the second prediction block, and the left side is referenced. Shining light The degree sample refC_L is populated in the leftmost column predSamples[-1][y] of the second prediction block. x = 0, …, nTbW-1 and y = 0, …, nTbH-1.

[0276] In this case, equation 36 fills predWcp into the corresponding position ((x + 1) × upHor-1, (y + 1) × upVer-1) within the second prediction block predSamples. This can be understood as follows: The second prediction block is evenly divided into predSizeW × predSizeH subblocks, and the position to be filled is the lower right corner of each subblock. As shown in detail in Figure 13, using a 32 × 32 block as an example, the sample colored in the grid is shown in the upper part. Shining light The sample refC_T is shown, and the sample shaded with diagonal lines is shown on the left. Shining light The degree sample refC_L is represented by the black-colored sample, which is the position where the saturation prediction sample predWcp is filled.

[0277] If the horizontal upsampling factor upHor is greater than 1, horizontal upsampling filtering is performed first, and the upsampling process is shown by the following equation.

number

number

[0278] This process is illustrated in detail in Figure 14. Using a 32x32 block as an example, during horizontal upsampling, the samples corresponding to the horizontal positions filled with predWcp within the left-hand reference saturation sample refC_L are also used as reference samples for upsampling and are shown colored black. In this case, all the samples colored black become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of black-colored samples in the horizontal direction are colored gray.

[0279] Upsampling is performed by linear interpolation. That is, the value of each interpolated sample (painted in gray) between two reference saturation samples (painted in black) for upsampling is the weighted average value of the two reference saturation samples for upsampling. According to equations 37 and 38, the weight of the left reference saturation sample for upsampling is (upHor-dX) / upHor, and the weight of the right reference saturation sample for upsampling is dX / upHor, where dX=1, ..., upHor-1, and dx is the distance between the current interpolated sample and the left reference sample. That is, when interpolating horizontally, the weight is related only to the horizontal upsampling factor upHor. Figure 15 shows an example of weights. In this example, upHor=4. For the first interpolated sample in Figure 15, the weight of the left reference saturation sample for upsampling is 3 / 4, and the weight of the right reference saturation sample for upsampling is 1 / 4. For the second interpolated sample in Figure 15, the weight of the left reference saturation sample for upsampling is 2 / 4, and the weight of the right reference saturation sample for upsampling is 2 / 4. For the third interpolated sample in Figure 15, the weight of the left reference saturation sample for upsampling is 1 / 4, and the weight of the right reference saturation sample for upsampling is 3 / 4.

[0280] If the vertical upsampling factor upVer is greater than 1, vertical upsampling filtering is required, and this process is similar to the horizontal upsampling process. The specific process is shown by the following equation.

number

number

[0281] This process is illustrated in detail in Figure 16. Using a 32x32 block as an example, after completing the horizontal upsampling filtering shown in Figure 14, the upper reference saturation sample refC_T and all existing samples in the second prediction block are both used as reference samples for vertical upsampling and are shown colored black. In this case, all colored black samples become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of colored black samples in the vertical direction are colored gray.

[0282] Upsampling is performed by linear interpolation. According to equations 39 and 40, the weight of the upper reference sample for upsampling is (upVer-dY) / upVer, and the weight of the lower reference sample is dY / upVer, where dY=1, ..., upVer-1, and dY is the distance between the current interpolated sample and the upper reference sample. That is, when performing vertical interpolation, the weight is related only to the vertical upsampling factor upVer.

[0283] Thus, through the above process, the predSamples obtained after interpolation become the predicted values ​​for the final saturation prediction block in the current WCP technology.

[0284] Furthermore, in order to address the inaccuracy of the non-linear weight mapping model of the WCP technology and the instability caused by predicting each sample individually for each sample, the embodiments of this application may also consider applying filtering enhancement to the output prediction blocks. The prediction blocks awaiting filtering enhancement may include a first prediction block before upsampling filtering, a second prediction block after upsampling filtering, or a first prediction block that does not require upsampling filtering (when upHor=upVer=1).

[0285] Here, the filtering enhancement method used in the embodiments of this application is bilateral filtering. Bilateral filtering is a nonlinear filtering method used for edge preservation and noise reduction. This filtering method considers both spatial proximity information and color similarity information to remove noise and smooth the image while simultaneously preserving the image edges.

[0286] Specifically, bilateral filtering uses a combination of two Gaussian filters. One is for calculating spatial proximity weights, i.e., the principle of a commonly used Gaussian filter, and the other is for calculating pixel value similarity weights. Bilateral filtering is implemented with two Gaussian filters. During bilateral filtering, the optimized weights are convolved with the image to achieve edge preservation and noise reduction effects. The weights of the two Gaussian filters are obtained as shown in equations 17 to 19 above. The optimized weights w(i,j,k,l) ​​are convolved with the image to obtain the filtered predictions shown in equation 20 above. Note that predSamples(i,j) is the filtered prediction. However, predSamples(i,j) here is not necessarily the final predicted value; it could be the filtered predicted value before upsampling (in which case predSamples(i,j) is not the final predicted value), the filtered predicted value after upsampling, or even the filtered predicted value that does not require upsampling.

[0287] To ensure clarity, in embodiments of this application, in addition to using bilateral filtering as the filtering method, a median filter may be used to replace each pixel of the image with the median of pixels in a neighboring region (a square region centered on the current pixel), a Gaussian filter may be used, or a normalized box filter may be used. No limitations are imposed here. Exemplarily, in the case of a normalized filter, the output pixel value is the average of the pixel values ​​in the kernel window (all pixels have equal weighting coefficients), and the kernel is shown below.

number

[0288] Furthermore, in order to improve the prediction performance of WCP, in addition to using conventional filtering algorithms, a neural network can also be used to perform filtering augmentation on the WCP prediction output, predWcp.

[0289] To further clarify, in embodiments of this application, conventional improvements to post-processing enhancement of the output first prediction block may include the following: (1) To further improve the accuracy of WCP predictions, position-related improvements can be made to predWcp. For example, a saturation compensation value can be calculated for each sample awaiting prediction using a reference sample with a similar spatial position, and this saturation compensation value can be used to improve predWcp, with the improved prediction value being the final saturation prediction value predSamples. (2) Furthermore, weighted fusion is performed on the saturation prediction values ​​calculated by one or more other saturation prediction techniques and the saturation prediction value predWcp calculated by WCP, and the result of this fusion is the final saturation prediction value predSamples. For details on the weighted fusion method, please refer to Figure 8 mentioned above.

[0290] To further clarify, in the embodiments of this application, in addition to using a “first horizontal, then vertical” upsampling method, a “first vertical, then horizontal” upsampling method can also be used for upsampling filtering. Exemplarily, as shown in Figure 17, using a 32x32 block as an example, the grid-painted sample is shown in the upper part. Shining light The sample refC_T is shown, and the sample shaded with diagonal lines is shown on the left. Shining light The sample is refC_L.

[0291] If the vertical upsampling factor upVer is greater than 1, vertical upsampling is performed first. The upsampling process is shown by the following equation.

number

number

[0292] This process is illustrated in detail in Figure 17. Using a 32x32 block as an example, during vertical upsampling, the samples corresponding to the vertical positions filled with predWcp within the upper reference saturation sample refC_T are also used as reference samples for upsampling and are shown colored black. In this case, all colored black samples become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of colored black samples in the vertical direction are colored gray.

[0293] Upsampling is performed by linear interpolation. According to equations 42 and 43, the weight of the upper reference sample for upsampling is (upVer-dY) / upVer, and the weight of the lower reference sample is dY / upVer, where dY=1, ..., upVer-1, and dY is the distance between the current interpolated sample and the upper reference sample. That is, when performing vertical interpolation, the weight is related only to the vertical upsampling factor upVer. Figure 18 shows an example of weights. In this example, upHor=4. For the first interpolated sample in Figure 18, the weight of the upper reference saturation sample for upsampling is 5 / 8, and the weight of the lower reference saturation sample for upsampling is 3 / 8. For the second interpolated sample in Figure 18, the weight of the upper reference saturation sample for upsampling is 4 / 8, and the weight of the lower reference saturation sample for upsampling is 4 / 8. For the third interpolated sample in Figure 18, the weight of the upper reference saturation sample for upsampling is 3 / 8, and the weight of the lower reference saturation sample for upsampling is 5 / 8.

[0294] When the horizontal upsampling factor upHor is greater than 1, horizontal upsampling is required, and this process is similar to that of vertical upsampling. The specific process is shown by the following equation.

number

number

[0295] This process is illustrated in detail in Figure 19. Using a 32x32 block as an example, after completing the vertical upsampling shown in Figure 17, the reference saturation sample refC_L on the left and all existing samples in the second prediction block are both used as reference samples for horizontal upsampling and are shown colored black. In this case, all colored black samples become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of colored black samples horizontally are colored gray.

[0296] Upsampling is performed by linear interpolation. That is, the value of each interpolated sample (painted in gray) between the two reference saturation samples (painted in black) for upsampling is the weighted mean of the two reference saturation samples for upsampling. According to equations 44 and 45, the weight of the left reference saturation sample for upsampling is (upHor-dX) / upHor, and the weight of the right reference saturation sample for upsampling is dX / upHor, where dX=1, ..., upHor-1, and dx is the distance between the current interpolated sample and the left reference sample. That is, when interpolating horizontally, the weight is related only to the horizontal upsampling factor upHor.

[0297] Thus, through the above process, the predSamples obtained after interpolation become the predicted values ​​for the final saturation prediction block in the current WCP technology.

[0298] To further illustrate, in embodiments of this application, the final saturation prediction can also be obtained by averaging the saturation prediction values ​​after upsampling "first horizontally, then vertically" and the saturation prediction values ​​after upsampling "first vertically, then horizontally". Alternatively, when upsampling is performed by linear interpolation, the value of each interpolated sample (painted in gray) between the two reference saturation samples (painted in black) for upsampling may be the average value of the two reference saturation samples for upsampling, i.e., both weights are 1 / 2. Alternatively, in addition to the conventional upsampling methods described above, a convolutional operation in a neural network structure may be used instead of an upsampling operation, without any limitations.

[0299] JPEG0007875986000094.jpg184153

[0300] Referring to another embodiment of this application, Figure 20, is a flowchart 1 showing an encoding method according to an embodiment of this application. As shown in Figure 20, the method may include the following:

[0301] S2001: Determine the reference sample value for the first color component of the current block.

[0302] Furthermore, the encoding method of the embodiment of this application is applied to an encoding device or an encoding device that integrates such an encoding device (also referred to as an "encoder"). Specifically, the encoding method of the embodiment of this application refers to an intra prediction method, and more specifically, it can refer to a post-processing method for weight-based color saturation prediction (WCP).

[0303] In embodiments of this application, a video image may be divided into a plurality of encoding blocks, each encoding block may include a first color component, a second color component, and a third color component. Here, the current block refers to the encoding block in the video image on which intraprediction is currently being performed. The current block may also be called a luminance prediction block if we assume that prediction is performed on the first color component of the current block, and the first color component is the luminance component, i.e., the component awaiting prediction is the luminance component. Alternatively, the current block may also be called a saturation prediction block if we assume that prediction is performed on the second color component of the current block, and the second color component is the saturation component, i.e., the component awaiting prediction is the saturation component.

[0304] Furthermore, in embodiments of this application, the reference information for the current block may include the value of a first color component sample in the adjacent region of the current block and the value of a second color component sample in the adjacent region of the current block. These samples are determined based on encoded samples in the adjacent region of the current block. In some embodiments, the adjacent region of the current block may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0305] In some embodiments, determining the reference sample value of the first color component of the current block may include determining the reference sample value of the first color component of the current block based on the value of the first color component sample in the adjacent region of the current block.

[0306] In the embodiments of this application, the reference sample of the current block may refer to a reference sample adjacent to the current block, and may also be called the first color component sample and the second color component sample within the adjacent region of the current block, and are represented as Neighboring Sample or Reference Sample. In the embodiments of this application, the first color component is the luminance component, and the second color component is the chroma component. In this case, the value of the first color component sample within the adjacent region of the current block is represented as reference luminance information corresponding to the reference sample of the current block, and the value of the second color component sample within the adjacent region of the current block is represented as reference chroma information corresponding to the reference sample of the current block.

[0307] In some embodiments, determining the value of a first color component sample may further include determining the value of a first color component sample by selecting from first color component samples within an adjacent region.

[0308] Furthermore, the first color component samples within adjacent regions may contain some unimportant samples (e.g., samples with poor correlation) or abnormal samples. To ensure prediction accuracy, these samples must be removed, thereby obtaining valid values ​​for the first color component samples. That is, in the embodiments of this application, a first sample set is formed based on the first color component samples within adjacent regions of the current block. In this case, the values ​​for the first color component samples can be determined by selecting from the first sample set.

[0309] In a specific embodiment, determining the value of a first color component sample by selecting it from a first color component sample within an adjacent region may include the following: Determining the position of a sample awaiting selection based on the position and / or color component intensity of the first color component sample within the adjacent region. Determining the value of the first color component sample from the adjacent region based on the position of the sample awaiting selection.

[0310] In the embodiments of this application, the color component intensity can be represented by color component information such as reference luminance information and reference chroma information. A larger value of the color component information indicates a higher color component intensity. Thus, a sample can be selected from the first color component samples within an adjacent region based on the sample's position or based on its color component intensity. Based on the selected sample, a valid first color component sample is determined, and then the value of the first color component sample is determined.

[0311] In some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a second filtering on the first color component sample value to obtain the filtered adjacent sample value of the first color component of the current block; and determining the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block.

[0312] In the embodiments of this application, the number of filtered adjacent sample values ​​for the first color component of the current block is smaller than the number of values ​​for the first color component sample.

[0313] In the embodiments of this application, the second filtering may be downsampling filtering. The first color component is the luminance component. In this case, by performing downsampling filtering on the reference luminance information, the spatial resolution of the filtered reference luminance information and the spatial resolution of the reference chrominance information can be made the same.

[0314] In some embodiments, determining the reference sample value of the first color component of the current block may further include determining the reference sample value of the first color component of the current block based on the reconstructed value of the first reference color component sample within the current block.

[0315] In embodiments of this application, the first reference color component may be a luminance component. In this case, the reconstructed value of the first reference color component sample in the current block is the reconstructed luminance information of the current block.

[0316] Furthermore, in some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a third filtering on the reconstructed value of the first reference color component sample in the current block to obtain the filtered sample value of the first reference color component sample in the current block; and determining the reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.

[0317] In the embodiments of this application, the number of filtered sample values ​​for the first reference color component sample in the current block is smaller than the number of reconstructed values ​​for the first reference color component sample in the current block.

[0318] In embodiments of this application, the third filtering may be downsampling filtering. The first reference color component is the luminance component. In this case, downsampling filtering may be performed on the reconstructed luminance information within the current block.

[0319] To make it clearer, in embodiments of this application, the reference sample value of the first color component of the current block can also be set to luminance difference information. Thus, in one possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.

[0320] In another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.

[0321] In yet another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.

[0322] In further possible embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.

[0323] In other words, it is possible to choose to perform filtering before weighted prediction based on known reference information of the current block, such as reference luminance information in the adjacent region of the current block and reconstructed luminance information within the current block. Specifically, downsampling filtering may be performed on the reference luminance information in the adjacent region of the current block, downsampling filtering may be performed on the reconstructed luminance information within the current block, downsampling filtering may be performed on both the reference luminance information and the reconstructed luminance information, or downsampling filtering may not be performed on either the reference luminance information or the reconstructed luminance information. Next, luminance difference information is determined according to different combinations, and this luminance difference information can be used as the reference sample value for the first color component of the current block.

[0324] S2002: Determine the weighting coefficients based on the reference sample value of the first color component of the current block.

[0325] In the embodiments of this application, determining the weighting coefficients based on the reference sample value of the first color component of the current block may include the following: determining the value corresponding to the reference sample value of the first color component in a pre-set mapping; and setting the weighting coefficients to be equal to that value.

[0326] To make it clear, in the embodiments of this application, the reference sample value of the first color component may be the absolute difference between the filtered adjacent sample value of the first color component in the current block and the filtered sample value of the first reference color component sample in the current block. Here, the first reference color component is the first color component, which is a different color component from the predicted second color component in the embodiments of this application.

[0327] JPEG0007875986000095.jpg45152

[0328] Furthermore, in some embodiments, determining the value corresponding to the reference sample value of the first color component in a pre-configured mapping may include the following: determining the first factor; determining the first product value based on the first factor and the reference sample value of the first color component; and determining the value corresponding to the first product value in a pre-configured mapping.

[0329] In a specific embodiment, determining the first factor may include the first factor being a predetermined constant value.

[0330] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the current block size parameter.

[0331] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a pre-configured mapping lookup table of the current block size parameter and the value of the first factor.

[0332] Here, the size parameter of the current block may include at least one of the following parameters: the width of the current block or the height of the current block.

[0333] In the embodiments of this application, a classification method can be used to determine the value of the first factor. For example, the size parameters of the current block can be classified into three categories, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiments of this application, a mapping lookup table between the size parameters of the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on this lookup table. Exemplarily, Table 1 above shows the correspondence between the first factor and the size parameters of the current block.

[0334] In yet another specific embodiment, determining the first factor may include determining the value of the first factor based on the number of reference samples in the current block.

[0335] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a pre-configured mapping lookup table of the number of reference samples in the current block and the value of the first factor.

[0336] In the embodiments of this application, the number of reference samples can be classified into three categories, and the value of the first factor can still be determined by employing a classification method. For example, the number of reference samples in the current block can be classified into three categories, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiments of this application, a mapping lookup table between the number of reference samples in the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on this lookup table. Exemplarily, Table 2 above shows the correspondence between the first factor and the number of reference samples in the current block.

[0337] Furthermore, determining the first product value based on the first factor and the reference sample value of the first color component may include the following: The first product value is set to be equal to the product of the first factor and the reference sample value of the first color component. Alternatively, the first product value is set to be equal to the value obtained by bitwise right-shifting the reference sample value of the first color component, with the number of bits right-shifted being equal to the first factor. Alternatively, the first product value is set to the value obtained by performing addition and bit-shift operations on the reference sample value of the first color component based on the first factor.

[0338] For example, assuming that the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref, the first product is equal to 0.25 × Ref, which can also be expressed as Ref / 4, i.e., Ref >> 2. Furthermore, floating-point numbers can be converted to addition and shift operations during fixed-point arithmetic. In other words, there are no restrictions on how the first product is calculated.

[0339] JPEG0007875986000096.jpg50152

[0340] JPEG0007875986000097.jpg26152

[0341] Furthermore, with respect to the second factor, in a specific embodiment, the method may further include determining the second factor by performing a least-squares calculation based on the first color component value and the second color component value of the reference sample.

[0342] That is, assuming that the number of reference samples is N, the first color component value of a reference sample is the reference luminance information of the current block, and the second color component value of a reference sample is the reference saturation information of the current block, the second factor can be obtained by performing a least-squares calculation on the saturation and luminance component values ​​of the N reference samples. Exemplarily, the least-squares regression calculation is as shown in equation 5 above, and the second factor can be calculated.

[0343] Furthermore, the pre-defined mapping may be a pre-defined functional relationship. In some embodiments, the pre-defined mapping may be a Softmax function, for example, as shown in equation 6 or 7 above. The Softmax function is a normalized exponential function, but in the embodiments of this application, normalization is not required, and its range of value is not limited to [0,1].

[0344] In addition to the Softmax function, in other embodiments, the pre-set mapping may be a weighting function inversely proportional to the reference sample value of the first color component, for example, as shown in Equation 8 or Equation 9 above.

[0345] Thus, the pre-configured mapping may be as shown in Equation 4, as shown in Equation 6 or 7, as shown in Equation 8 or 9, or it may be another functional model of weighting coefficients constructed by fitting a tendency that the stronger the similarity between the reference luminance value of the reference sample and the reconstructed luminance value of the sample awaiting prediction in the current block, the greater the importance of the reference saturation value of the reference sample to the sample awaiting prediction in the current block. Furthermore, the pre-configured mapping may be in the form of a pre-configured lookup table. For example, by adopting the form of an array element lookup table, some of the calculation operations are simplified. The embodiments of this application are not particularly limited.

[0346] JPEG0007875986000098.jpg48152

[0347] S2003: Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block for the second color component of the current block is determined.

[0348] In the embodiments of this application, the first prediction block includes predicted values ​​for at least some of the second color component samples within the current block.

[0349] Furthermore, in embodiments of this application, the method for determining the reference sample value of the second color component of the current block may further include determining the reference sample value of the second color component of the current block based on the value of the second color component sample in an adjacent region of the current block.

[0350] Here, the adjacent region may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0351] In specific embodiments, the method may further include the following: a fourth filtering is performed on the values ​​of the second color component samples in the adjacent region of the current block to obtain filtered adjacent sample values ​​for the second color component of the current block; and a reference sample value for the second color component of the current block is determined based on the filtered adjacent sample values ​​for the second color component of the current block.

[0352] In the embodiments of this application, the number of filtered adjacent sample values ​​for the second color component of the current block is greater than the number of second color component sample values ​​in the adjacent region of the current block.

[0353] In embodiments of this application, the fourth filtering is upsampling filtering. The upsampling rate is a positive integer multiple of 2.

[0354] That is, the first color component is the luminance component, and the second color component is the chroma component. In the embodiments of this application, by performing upsampling filtering on the reference chroma information, the spatial resolution of the filtered reference chroma information and the spatial resolution of the reference luminance information can be made the same. For example, if the number of reference luminance information is 2M+2N and the number of reference chroma information is M+N, the number of reference chroma information can be converted to 2M+2N after upsampling filtering is performed on the reference chroma information.

[0355] Furthermore, in the embodiments of this application, both the second filtering performed on the value of the first color component sample in an adjacent region, and the third filtering performed on the reconstructed value of the first reference color component sample in the current block, may be downsampling filters. The second filtering may be performed using the first filter, and the third filtering may be performed using the second filter. Both the first and second filters may be downsampling filters. The downsampling rates of these filters may differ because the data being processed is different. Therefore, the first and second filters may be the same or different. A fourth filtering is also performed on the value of the second color component sample in an adjacent region. The fourth filtering may be performed using the third filter. If the fourth filtering is an upsampling filter, then the third filter may be an upsampling filter. Furthermore, the first, second, and third filters may all be neural network filters. No restrictions are placed on this.

[0356] To make it easier to understand, assuming that the first color component is the luminance component and the second color component is the chroma component, the spatial resolution of the value of the first color component sample in the adjacent region (i.e., reference luminance information), the spatial resolution of the value of the second color component sample in the adjacent region (i.e., reference chroma information), and the spatial resolution of the reconstructed value of the first reference color component sample in the current block (i.e., reconstructed luminance information) are all influenced by the color format information. Therefore, a second, third, or fourth filtering can also be performed based on the current color format information. Hereinafter, taking the fourth filtering as an example, in some embodiments, the method further includes performing a fourth filtering on the value of the second color component sample in the adjacent region of the current block based on the color format information to obtain the filtered adjacent sample value of the second color component of the current block.

[0357] In specific embodiments, the fourth filtering may further include the following: If the color format information indicates 4:2:0 sampling, upsampling filtering is performed on the value of the second color component sample in the adjacent region of the current block. The upsampling rate is a positive integer multiple of 2.

[0358] In the embodiments of this application, if the color format information indicates that the spatial resolution of luminance and the spatial resolution of saturation are equal (for example, the YUV444 format), no processing is required on the reference saturation information. If the color format information indicates that the spatial resolution of luminance and the spatial resolution of saturation do not match (for example, video with saturation subsampling characteristics such as the YUV422 format / YUV411 format / YUV420 format), and the spatial resolution of the saturation component is smaller than the spatial resolution of the luminance component, then upsampling filtering is required on the reference saturation information obtained from the adjacent region.

[0359] Thus, with respect to upsampling filtering of reference saturation information, the upsampling filtering method may be any one of the linear interpolation methods, such as nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, mean interpolation, median interpolation, and copy interpolation. Alternatively, the above upsampling filtering method may be any one of the nonlinear interpolation methods, such as an interpolation algorithm based on wavelet transform and an interpolation algorithm based on edge information. Alternatively, upsampling filtering may be performed based on a convolutional neural network. No limitations are imposed in the embodiments of this application.

[0360] Furthermore, after determining the reference sample value of the second color component of the current block, in some embodiments, determining the first predicted block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block for S2003 may include the following: Determining the weighted value obtained by multiplying the reference sample value of the second color component by the corresponding weighting coefficient. Setting the predicted value of the second color component sample in the first predicted block to be equal to the sum of N weighted values, where N is the number of reference sample values ​​of the second color component and is a positive integer.

[0361] That is, if the number of reference sample values ​​for the second color component is N, first, the weighted value (w) is obtained by multiplying each reference sample value of the second color component by the corresponding weighting coefficient. k C k The following is determined, and then the sum of these N weighted values ​​is used as the predicted value for the second color component sample in the prediction block. Specifically, the calculation formula is as shown in Equation 16 above. Note that this method is advantageous for parallel processing and can speed up the calculation.

[0362] In the embodiments of this application, assuming that the width of the first prediction block is predSizeW, the height of the first prediction block is predSize H, the width of the current block is nTbW, and the height of the current block is nTbH, then predSizeH is less than or equal to nTbH, or predSizeW is less than or equal to nTbW. That is, the first prediction block contains the predicted values ​​of at least a portion of the second color component samples within the current block.

[0363] S2004: Perform the first filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0364] S2005: Based on the second predicted block, determine the residual value of the second color component sample of the current block.

[0365] In the embodiments of this application, if the first prediction block includes predicted values ​​for some of the second color component samples within the current block, it is necessary to perform upsampling filtering on the first prediction block in order to obtain the final second prediction block. Therefore, in some embodiments, performing a first filter on the first prediction block to determine the second prediction block for the second color component of the current block includes performing upsampling filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0366] Furthermore, in embodiments of this application, if the number of predicted values ​​for the second color component included in the second prediction block is the same as the number of second color component samples included in the current block, but the second prediction block does not include predicted values ​​for the second color component samples of the current block, then it is necessary to perform filtering augmentation on the predicted values ​​in order to obtain the final second prediction block. Accordingly, in some embodiments, performing a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block includes performing filtering augmentation on the first prediction block to determine the second prediction block for the second color component of the current block.

[0367] Furthermore, in the embodiments of this application, if the first prediction block contains the predicted values ​​of all second color component samples in the current block, there is no need to process the first prediction block, and the first prediction block can be directly made the final second prediction block.

[0368] To ensure clarity, in the embodiments of this application, the first filtering may be upsampling filtering, filtering augmentation, or the like. No limitations are imposed here. However, for a second prediction block on which the first filtering has been performed, the second prediction block contains the predicted values ​​of all second color component samples in the current block.

[0369] Here, if the first filter is an upsampling filter, the fourth filter can perform upsampling filtering on the first prediction block. The fourth filter may also be an upsampling filter. The fourth filter may be the same as or different from the third filter described above. The fourth filter here may also be a neural network filter. No limitations are placed on this in the embodiments of this application.

[0370] In some embodiments, performing a first filtering on a first prediction block to determine the second prediction block for the second color component of the current block may include the following: The first filtering includes upsampling filtering. The input to the upsampling filtering is a first upsampling input block, and the output to the upsampling filtering is a first upsampling output block.

[0371] Furthermore, in some embodiments, upsampling filtering may include the following: determining the upsampling factor; the upsampling factor including at least one of a horizontal upsampling factor and a vertical upsampling factor; and performing upsampling filtering on a first upsampling input block based on the upsampling factor to obtain a first upsampling output block.

[0372] In one possible embodiment, obtaining a first upsampling output block by performing upsampling filtering on a first upsampling input block based on an upsampling factor may include the following: If the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1, perform upsampling filtering on the first upsampling input block to obtain a first upsampling output block.

[0373] In the embodiments of this application, performing upsampling filtering on the first upsampling input block is: Performing horizontal upsampling filtering on the first upsampling input block, Perform vertical upsampling filtering on the first upsampling input block, The first upsampling input block is subjected to horizontal upsampling filtering followed by vertical upsampling filtering, The first upsampling input block is subjected to vertical upsampling filtering followed by horizontal upsampling filtering, It may include at least one of the following.

[0374] Here, first, a horizontal upsampling factor can be calculated based on the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated based on the height of the first upsampling input block and the height of the first upsampling output block. Next, upsampling filtering can be performed on the first upsampling input block based on the horizontal and vertical upsampling factors. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, upsampling should be performed only horizontally on the first upsampling input block. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, upsampling should be performed only vertically on the first upsampling input block. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, upsampling should be performed both horizontally and vertically on the first upsampling input block. Upsampling may be performed horizontally first and then vertically, or vertically first and then horizontally. Furthermore, the upsampling filtering operation here can be replaced by a convolutional operation in a neural network structure. No limitations are imposed on the embodiments of this application.

[0375] In another possible embodiment, the first prediction block is upsampled and filtered to determine the second prediction block. In this case, the method may further include the following: the first prediction block is the first upsampled input block, and the first upsampled output block is the second prediction block for the second color component of the current block.

[0376] In another possible embodiment, the first prediction block is subjected to augmentation filtering, followed by upsampling filtering, to determine the second prediction block. In this case, the method may further include: performing filtering augmentation on the first prediction block to determine the first augmented prediction block; making the first augmented prediction block the first upsampling input block; and making the first upsampling output block the second prediction block for the second color component of the current block.

[0377] In yet another possible embodiment, the first prediction block is subjected to upsampling filtering, and then augmented filtering to determine the second prediction block. In this case, the method may further include: the first prediction block is the first upsampling input block; the first upsampling output block is the first upsampling filtered prediction block; and filtering augmentation is performed on the first upsampling filtered prediction block to determine the second prediction block for the second color component of the current block.

[0378] In a further possible embodiment, the second prediction block is determined by first performing augmented filtering on the first prediction block, then upsampling filtering, and then augmented filtering again. In this case, the method may further include the following: A first filtering augmentation is performed on the first prediction block to determine the second augmented prediction block. The second augmented prediction block is made the first upsampling input block. The first upsampling output block is made the second upsampling filtered prediction block. A second filtering augmentation is performed on the second upsampling filtered prediction block to determine the second prediction block for the second color component of the current block.

[0379] Furthermore, if the first filtering is upsampling filtering, upsampling filtering can be performed on the first predicted block using the horizontal upsampling factor and the vertical upsampling factor. Specifically, performing upsampling filtering on the first predicted block to determine the second predicted block for the second color component of the current block may include the following: Determining the horizontal upsampling factor and the vertical upsampling factor. Performing upsampling filtering on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor to obtain the second predicted block for the second color component of the current block.

[0380] In a specific embodiment, performing upsampling filtering on a first prediction block based on a horizontal upsampling factor and a vertical upsampling factor to obtain a second prediction block of the second color component of the current block may include the following: If the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1, perform upsampling filtering on the first prediction block to obtain a second prediction block.

[0381] In the embodiments of this application, performing upsampling filtering on the first prediction block is: Perform horizontal upsampling filtering on the first prediction block, Perform vertical upsampling filtering on the first prediction block, Perform horizontal upsampling filtering on the first prediction block, followed by vertical upsampling filtering. Perform vertical upsampling filtering on the first prediction block, followed by horizontal upsampling filtering. It includes at least one of the following.

[0382] Here, first, a horizontal upsampling factor can be calculated based on the width of the first predicted block and the width of the current block, and a vertical upsampling factor can be calculated based on the height of the first predicted block and the height of the current block. Next, upsampling filtering is performed on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, upsampling should be performed only horizontally on the first predicted block. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, upsampling should be performed only vertically on the first predicted block. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, upsampling should be performed both horizontally and vertically on the first predicted block. Upsampling may be performed horizontally and then vertically, or vertically and then horizontally, and furthermore, these upsampling operations can be replaced by convolutional operations in the neural network structure. No limitations are imposed in the embodiments of this application.

[0383] In some embodiments, upsampling filtering is implemented by at least one of the following methods: linear interpolation or convolutional operations based on a pre-configured neural network. That is, upsampling filtering can be implemented with different filters, such as two-dimensional filters and one-dimensional filters. In the case of a one-dimensional filter, there are two possible filtering orders: "first vertical, then horizontal" and "first horizontal, then vertical." These two orders may be fixed filtering orders or flexible filtering orders determined by certain parameters (e.g., an order directly indicated by identification information, an implicit order associated with elements such as prediction mode or block size). No limitations are placed on this in the embodiments of this application.

[0384] In yet another possible embodiment, if the first filtering is filtering augmentation, the filtering augmentation can be achieved by bilateral filtering. Specifically, performing the first filtering on a first prediction block to determine the second prediction block for the second color component of the current block may include: determining the first weight value of the first prediction block under bilateral filtering mode; and performing bilateral filtering on the first prediction block based on the first weight value to obtain the second prediction block.

[0385] Furthermore, in the embodiments of this application, the filtering augmentation may include, in addition to bilateral filtering, median filtering, Gaussian filtering, normalized filtering, etc. That is, the filtering augmentation may include, but is not particularly limited to, at least one of bilateral filtering, median filtering, Gaussian filtering, and normalized filtering.

[0386] Furthermore, in some embodiments, the method may further include the following: Filtering augmentation is performed on the first prediction block before upsampling filtering is performed on the first prediction block. The first prediction block obtained after augmentation is designated as the first prediction block.

[0387] Furthermore, in some embodiments, the method may further include the following: Upsampling filtering is performed on the first prediction block, and then filtering enhancement is performed on the first prediction block obtained after upsampling filtering to obtain a second prediction block of the second color component of the current block.

[0388] That is, in embodiments of this application, the first filtering may be upsampling filtering, filtering augmentation, or both upsampling filtering and filtering augmentation. If both are included, upsampling filtering may be performed first on the first prediction block, followed by filtering augmentation, or filtering augmentation may be performed first on the first prediction block, followed by upsampling filtering. No limitations are placed on this in embodiments of this application.

[0389] Thus, the predSamples(i,j) obtained in the aforementioned equation 20 is not necessarily the final predicted value. It may be the filtered and enhanced predicted value before upsampling (in this case, predSamples(i,j) is not the final predicted value), the filtered and enhanced predicted value after upsampling, or even the filtered and enhanced predicted value without the need for upsampling.

[0390] Furthermore, with respect to filtering enhancement, in some embodiments, the method further includes the following: determining the compensation value of the second color component sample of the first prediction block based on the reference sample value in the adjacent region of the current block; and determining the second prediction block by refining the prediction value of the second color component sample of the first prediction block based on the compensation value.

[0391] Furthermore, to further improve the prediction accuracy of WCP mode, position-related improvements can be made to the first prediction block. For example, a reference sample with a nearby spatial position can be used to calculate the saturation compensation value for each second color component sample awaiting prediction. This saturation compensation value can then be used to improve the second color component samples within the second prediction block. Based on the improved prediction values, the final predicted values ​​(predSamples) for the second color component samples can be determined, and the final second prediction block can be obtained.

[0392] Furthermore, with respect to filtering enhancement, in some embodiments, the method further includes the following: predicting the second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value for the second color component sample of the first prediction block; and determining the second prediction block by performing weighted fusion on at least one initial predicted value and the predicted value of the second color component sample in the first prediction block.

[0393] Furthermore, to further improve the prediction accuracy of the WCP mode, weighted fusion can be performed on the saturation prediction values ​​calculated under other prediction modes and the saturation prediction values ​​calculated under the WCP mode, and the final saturation prediction block can be determined based on the fusion result. Alternatively, to improve the prediction performance of WCP, a neural network model can be used to improve the saturation prediction values ​​calculated by WCP. No limitations are placed on this in the embodiments of this application.

[0394] In some embodiments, after the second prediction block is determined, the following steps may be further included after S2004, as shown in Figure 21.

[0395] S2101: Based on the second prediction block, determine the predicted value of the second color component sample of the current block.

[0396] S2102: Determine the residual value of the second color component sample of the current block based on the original value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.

[0397] S2103: Encode the residual value of the second color component sample of the current block and write the resulting encoded bits to the bitstream.

[0398] In the embodiments of this application, the predicted value of the second color component sample of the current block can be determined based on the second prediction block as follows: The predicted value of the second color component sample of the current block can be set to be equal to the value of the second prediction block. Alternatively, upsampling filtering can be performed on the value of the second prediction block to set the predicted value of the second color component sample of the current block to be equal to the output value after upsampling filtering.

[0399] Furthermore, after determining the predicted value of the second color component sample of the current block, the residual value of the second color component sample can be determined based on the original value of the second color component sample and the predicted value of the second color component sample. Specifically, the residual value of the second color component sample of the current block can be determined by subtracting the original value of the second color component sample from the predicted value of the second color component sample. In this way, after the residual value of the second color component sample is written to the bitstream, the decoding side obtains the residual value of the second color component sample through decoding, and thereby the reconstructed value of the second color component sample of the current block can be restored.

[0400] To facilitate understanding, the embodiments of this application describe in detail the post-processing process after WCP prediction during WCP mode prediction in the following four aspects. First, the calculation of the saturation weighting coefficient of the reference sample is realized by making full use of the luminance information of the reference sample and the current block. Second, the core parameters of the WCP mode are given full consideration to reduce the complexity of saturation weighting calculation by taking advantage of the low sensitivity of the human eye to saturation. That is, if predSizeW × predSizeH is less than or equal to nTbW × nTbH, upsampling is performed on the saturation prediction block. Third, when upsampling is performed, the reference saturation information is made full use and characteristics in different directions are considered. During linear interpolation, the spatial correlation between the points awaiting interpolation and existing points is given full consideration by assigning different weight values ​​to different points awaiting interpolation between existing neighboring points, thereby improving the accuracy of upsampling filtering. Fourthly, taking into full consideration the possibility that the saturation prediction block output by WCP prediction may result in unstable and inaccurate prediction values, and the possibility that the upsampling filtering of the embodiment of this application may result in inaccurate prediction values, in such cases, the saturation prediction block below is enhanced with bilateral filtering that enables edge preservation and noise reduction to further improve the accuracy and subjective and objective quality of the saturation prediction block. Note that there is no sequential relationship between the four modes described here, and they can be used individually or in combination.

[0401] Embodiments of this application further provide an encoding method. The reference sample value of the first color component of the current block is determined. Based on the reference sample value of the first color component of the current block, weighting coefficients are determined. Based on the weighting coefficients and the reference sample value of the second color component of the current block, a first predicted block of the second color component of the current block is determined. A first filtering is performed on the first predicted block to determine a second predicted block of the second color component of the current block. The second predicted block contains the predicted values ​​of all second color component samples in the current block. Based on the second predicted block, the reconstructed values ​​of the second color component samples of the current block are determined. In this way, by calculating weighting coefficients using the color component information of the current block and the reference samples adjacent to the current block, the correlation in luminance information between the current block and adjacent regions can be fully utilized, and by using this correlation in predicting the saturation of the current block, the accuracy of saturation prediction can be improved. Furthermore, taking advantage of the characteristic that the human eye is not very sensitive to saturation, upsampling filtering is performed on the first predicted block if the size of the first predicted block is smaller than the size of the current block, in order to reduce the complexity of calculating weighting coefficients. Furthermore, considering the instability of the predicted values ​​in the first prediction block, filtering enhancement can be applied to address this, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance.

[0402] In yet another embodiment of the present application, the embodiment of the present application further provides a bitstream, which is generated by bit encoding based on information to be encoded, the information to be encoded includes the residual values ​​of the second color component samples of the current block.

[0403] In the embodiments of this application, after the residual value of the second color component sample of the current block is transmitted from the encoding side to the decoding side, the decoding side obtains the residual value of the second color component sample by decoding, and can reconstruct the reconstructed value of the second color component sample of the current block based on that residual value and the predicted value of the second color component sample of the current block. Thus, taking advantage of the characteristic that the human eye is not very sensitive to saturation, upsampling filtering is performed on the first predicted block if the size of the first predicted block is smaller than the size of the current block, in order to reduce the complexity of calculating the weighting coefficients. Furthermore, considering the instability of the predicted value of the first predicted block, filtering enhancement can also be performed on it, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance.

[0404] In further embodiments of this application, referring to Figure 22, based on the same inventive idea as the embodiments described above, Figure 22 is a schematic diagram showing the structure of an encoding device 300 according to an embodiment of this application. As shown in Figure 22, the encoding device 300 may comprise a first determination unit 3001, a first prediction unit 3002, and a first filtering unit 3003. The first determination unit 3001 is configured to determine the reference sample value of the first color component of the current block and to determine the weighting coefficients based on the reference sample value of the first color component of the current block. The first prediction unit 3002 is configured to determine the first predicted block for the second color component of the current block based on a weighting coefficient and a reference sample value for the second color component of the current block. The first filtering unit 3003 is configured to perform a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block, the second prediction block containing the predicted values ​​for all second color component samples in the current block. The first determination unit 3001 is further configured to determine the residual value of the second color component sample of the current block based on the second prediction block.

[0405] In some embodiments, the first prediction block includes predicted values ​​for at least some of the second color component samples within the current block.

[0406] In some embodiments, the first determination unit 3001 is further configured to determine the reference sample value of the first color component of the current block based on the value of the first color component sample in the adjacent region of the current block. The adjacent region includes at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0407] In some embodiments, the first determination unit 3001 is further configured to determine the value of the first color component sample by selecting from the first color component samples within the adjacent region.

[0408] In some embodiments, the first confirmation unit 3001 further Based on the position and / or color component intensity of the first color component sample within the adjacent region, the sample position awaiting selection is determined. It is configured to determine the value of the first color component sample from an adjacent region based on the sample position awaiting selection.

[0409] In some embodiments, the first filtering unit 3003 further A second filtering is performed on the value of the first color component sample to obtain the filtered neighboring sample value of the first color component of the current block. It is configured to determine the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block.

[0410] In some embodiments, the number of filtered neighboring sample values ​​for the first color component of the current block is smaller than the number of values ​​for the first color component samples.

[0411] In some embodiments, the first determination unit 3001 is further configured to determine the reference sample value of the first color component in the current block based on the reconstructed value of the first reference color component sample in the current block.

[0412] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.

[0413] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.

[0414] In some embodiments, the first filtering unit 3003 further A second filtering is performed on the value of the first color component sample to obtain the first color of the current block. A third filtering is performed on the reconstructed value of the first reference color component sample in the current block to obtain the filtered sample value of the first reference color component sample in the current block. The system is configured to determine the reference sample value of the first color component in the current block based on the filtered sample value of the first reference color component sample in the current block.

[0415] In some embodiments, the number of filtered sample values ​​for the first reference color component samples in the current block is smaller than the number of reconstructed values ​​for the first reference color component samples in the current block.

[0416] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.

[0417] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.

[0418] In some embodiments, the first determination unit 3001 is further configured to determine a value corresponding to the reference sample value of the first color component in a preset mapping and to set the weighting coefficient to equal that value.

[0419] In some embodiments, the first determination unit 3001 is further configured to determine a first factor, determine a first product value based on the first factor and a reference sample value of the first color component, and determine a value corresponding to the first product value in a preset mapping.

[0420] In some embodiments, the first factor is a predetermined constant value.

[0421] In some embodiments, the first determination unit 3001 is further configured to determine the value of the first factor based on the size parameters of the current block. The size parameters of the current block include at least one of the following parameters: the width of the current block, the height of the current block, and the product of the width and height of the current block.

[0422] In some embodiments, the pre-configured mapping is a softmax function.

[0423] In some embodiments, the pre-configured mapping is a weighting function that is inversely proportional to the reference sample value of the first color component.

[0424] In some embodiments, the first determination unit 3001 is further configured to determine the reference sample value of the second color component of the current block based on the value of the second color component sample in an adjacent region of the current block.

[0425] In some embodiments, the first filtering unit 3003 further A fourth filtering is performed on the values ​​of the second color component samples within the adjacent region of the current block to obtain the filtered adjacent sample values ​​of the second color component of the current block. It is configured to determine the reference sample value of the second color component of the current block based on the filtered adjacent sample value of the second color component of the current block.

[0426] In some embodiments, the number of filtered adjacent sample values ​​for the second color component of the current block is greater than the number of second color component sample values ​​in the adjacent region of the current block.

[0427] In some embodiments, the fourth filtering is upsampling filtering. The upsampling rate is a positive integer multiple of 2.

[0428] In some embodiments, the first filtering unit 3003 is further configured to perform a fourth filtering on the values ​​of the second color component samples in the adjacent region of the current block, based on color format information, to obtain filtered adjacent sample values ​​of the second color component of the current block.

[0429] In some embodiments, the first filtering unit 3003 further If the color format information indicates 4:2:0 sampling, the system is configured to perform upsampling filtering on the value of the second color component sample within the adjacent region of the current block. The upsampling rate is a positive integer multiple of 2.

[0430] In some embodiments, the first prediction unit 3002 further The weighted values ​​obtained by multiplying the reference sample value of the second color component by the corresponding weighting coefficient are determined. The system is configured to set the predicted value of the second color component sample within the first prediction block to be equal to the sum of N weighted values. N represents the number of reference sample values ​​for the second color component, and N is a positive integer.

[0431] In some embodiments, the first filtering includes upsampling filtering, the input to the upsampling filtering is a first upsampling input block, and the output to the upsampling filtering is a first upsampling output block.

[0432] In some embodiments, the first determination unit 3001 is further configured to determine an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor and a vertical upsampling factor. The first filtering unit 3003 is further configured to perform upsampling filtering on the first upsampling input block based on an upsampling factor to obtain a first upsampling output block.

[0433] In some embodiments, the first filtering unit 3003 further The system is configured to perform upsampling filtering on the first upsampling input block to obtain the first upsampling output block if the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1.

[0434] In some embodiments, the first filtering unit 3003, configured to perform upsampling filtering on the first upsampling input block, further: Performing horizontal upsampling filtering on the first upsampling input block, Perform vertical upsampling filtering on the first upsampling input block, The first upsampling input block is subjected to horizontal upsampling filtering followed by vertical upsampling filtering, The first upsampling input block is subjected to vertical upsampling filtering followed by horizontal upsampling filtering, It is configured to perform at least one of the following:

[0435] In some embodiments, the first filtering unit 3003 further The first prediction block is used as the first upsampling input block. The first upsampling output block is configured to be the second prediction block for the second color component of the current block.

[0436] In some embodiments, the first filtering unit 3003 further Filtering augmentation is performed on the first prediction block to obtain the first augmented prediction block. The first augmentation prediction block is set as the first upsampling input block. The first upsampling output block is configured to be the second prediction block for the second color component of the current block.

[0437] In some embodiments, the first filtering unit 3003 further The first augmentation prediction block is set as the first upsampling input block. The first upsampling output block is set as the first upsampling filtering prediction block. The system is configured to perform filtering enhancement on the first upsampling filtering prediction block to determine the second prediction block for the second color component of the current block.

[0438] In some embodiments, the first filtering unit 3003 further The first filtering augmentation is applied to the first prediction block to determine the second augmented prediction block. The second augmentation prediction block is used as the first upsampling input block. The first upsampling output block is used as the second upsampling filtering prediction block. The system is configured to perform a second filtering augmentation on the second upsampling filtering prediction block to determine the second prediction block for the second color component of the current block.

[0439] In some embodiments, the first filtering unit 3003 is further configured to perform upsampling filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0440] In some embodiments, the first filtering unit 3003 is further configured to determine a horizontal upsampling factor and a vertical upsampling factor, and to perform upsampling filtering on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of the second color component of the current block.

[0441] In some embodiments, the first filtering unit 3003 further The system is configured to perform upsampling filtering on the first prediction block to obtain the second prediction block if the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1.

[0442] In some embodiments, the first filtering unit 3003, configured to perform upsampling filtering on the first prediction block, further Perform horizontal upsampling filtering on the first prediction block, Perform vertical upsampling filtering on the first prediction block, Perform horizontal upsampling filtering on the first prediction block, followed by vertical upsampling filtering. Perform vertical upsampling filtering on the first prediction block, followed by horizontal upsampling filtering. It is configured to perform at least one of the following:

[0443] In some embodiments, the first filtering unit 3003 further The system is configured to perform filtering enhancement on the first prediction block before applying upsampling filtering to the first prediction block, and then use the enhanced first prediction block as the final first prediction block.

[0444] In some embodiments, the first filtering unit 3003 is further configured to perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the first prediction block obtained after upsampling filtering to obtain a second prediction block of the second color component of the current block.

[0445] In some embodiments, upsampling filtering is achieved by at least one of the following methods: linear interpolation or convolutional operations based on a pre-configured neural network.

[0446] In some embodiments, filtering augmentation includes at least one of bilateral filtering, median filtering, Gaussian filtering, normalization filtering, and neural network filtering.

[0447] In some embodiments, the first filtering unit 3003 is further configured to perform filtering augmentation on the first prediction block to determine the second prediction block for the second color component of the current block.

[0448] In some embodiments, the first filtering unit 3003 further Determine the first weight value of the first prediction block under bilateral filtering mode. The system is configured to perform bilateral filtering on the first prediction block based on the first weight value to obtain the second prediction block.

[0449] In some embodiments, the first prediction unit 3002 further Based on the reference sample values ​​in the adjacent region of the current block, the compensation value for the second color component sample of the first predicted block is determined. The system is configured to refine the predicted value of the second color component sample of the first prediction block based on the compensation value, thereby determining the second prediction block.

[0450] In some embodiments, the first prediction unit 3002 further Based on at least one prediction mode, the second color component sample of the first prediction block is predicted to determine at least one initial predicted value for the second color component sample of the first prediction block. The system is configured to determine the second prediction block by performing weighted fusion on at least one initial prediction value and the prediction value of the second color component sample within the first prediction block.

[0451] In some embodiments, the first confirmation unit 3001 further Based on the second prediction block, the predicted value of the second color component sample of the current block is determined. The system is configured to determine the residual value of the second color component sample of the current block based on the original value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.

[0452] In some embodiments, referring to Figure 22, the encoding device 300 may further include an encoding unit 3004. The encoding unit 3004 is configured to encode the residual value of the second color component sample of the current block and write the resulting encoded bits to the bitstream.

[0453] In the embodiments of this application, it can be understood that a “unit” may be part of a circuit, part of a processor, part of a program, or part of software. Naturally, a “unit” may be a module or a non-module. Furthermore, each component unit according to this embodiment may be integrated into a single processing unit, each unit may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of a hardware or software functional module.

[0454] The integrated unit may be stored on a computer-readable storage medium when implemented as a software function module rather than being sold or used as a standalone product. Under this understanding, the essential parts of the proposed invention of this application, or parts that contribute to the prior art, or all or part of the proposed invention, may be expressed as a software product. This computer software product is stored on a storage medium and includes a number of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the method described in this embodiment. The storage medium includes various types of media capable of storing program code, such as universal serial bus (USB) flash disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0455] Accordingly, embodiments of this application provide a computer-readable storage medium applicable to an encoding device 300. A computer program is stored in this computer-readable storage medium. When the computer program is executed by a first processor, the method described in any one of the embodiments described above is performed.

[0456] Referring to Figure 23, based on the configuration of the encoding device 300 and the computer-readable storage medium described above, Figure 23 is a schematic diagram showing the specific hardware structure of the encoding device 310 according to an embodiment of the present application. As shown in Figure 23, the encoding device 310 may include a first communication interface 3101, a first memory 3102, and a first processor 3103. Each component is coupled together via a first bus system 3104. To make it clear, the first bus system 3104 is used to enable connection and communication between these components. In addition to the data bus, the first bus system 3104 further includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, in Figure 23, the various buses are marked as the first bus system 3104. The first communication interface 3101 is used to send and receive signals in the process of sending and receiving information with other external network elements. The first memory 3102 is used to store computer programs that can be executed by the first processor 3103. The first processor 3103 is used to perform the following when executing a computer program: Determine the reference sample value for the first color component of the current block. The weighting coefficients are determined based on the reference sample value of the first color component of the current block. The first predicted block for the second color component of the current block is determined based on the weighting coefficients and the reference sample value of the second color component of the current block. The first prediction block is subjected to a first filtering process to determine the second prediction block for the second color component of the current block. The second prediction block contains the predicted values ​​for all second color component samples within the current block. Based on the second prediction block, the residual value of the second color component sample of the current block is determined.

[0457] To ensure understanding, the first memory 3102 of the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), or flash memory. Volatile memory may be random-access memory (RAM) that functions as an external high-speed cache. Examples of various RAMs available include, but are not limited to, static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synch-link dynamic random access memory (synch-link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM). The first memory 3102 of the systems and methods described in this application may include, but is not limited to, these and any other suitable types of memory.

[0458] The first processor 3103 may be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the method may be completed by an integrated logic circuit in hardware form or by instructions in software form of the first processor 3103. The first processor 3103 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor may 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 ordinary processor. The steps of the methods disclosed in the embodiments of this application may be executed and completed directly by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. The storage medium is located in the first memory 3102. The first processor 3103 reads the information in the first memory 3102 and, in conjunction with the processor hardware, completes the steps of the method described above.

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

[0460] Selectively, in another embodiment, the first processor 3103 is further configured to perform the method described in any one of the above embodiments when executing a computer program.

[0461] This embodiment provides an encoding device, which may further include the encoding apparatus 300 described in any one of the embodiments described above. The encoding apparatus takes advantage of the low sensitivity of the human eye to saturation and performs upsampling filtering on the first prediction block when the size of the first prediction block is smaller than the size of the current block, in order to reduce the complexity of calculating weighting coefficients. Furthermore, considering the instability of the prediction values ​​of the first prediction block, filtering enhancement can also be performed on it, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance.

[0462] Referring to Figure 24, based on the same inventive idea as the embodiments described above, Figure 24 is a schematic diagram showing the structure of a decoding device 320 according to an embodiment of the present application. As shown in Figure 24, the decoding device 320 may include a second determination unit 3201, a second prediction unit 3202, and a second filtering unit 3203. The second determination unit 3201 is configured to determine the reference sample value of the first color component of the current block and to determine the weighting coefficients based on the reference sample value of the first color component of the current block. The second prediction unit is configured to determine the first predicted block for the second color component of the current block, based on a weighting coefficient and a reference sample value for the second color component of the current block. The second filtering unit 3203 is configured to perform a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block, the second prediction block containing the predicted values ​​for all second color component samples in the current block.

[0463] In some embodiments, the first prediction block includes predicted values ​​for at least some of the second color component samples within the current block.

[0464] In some embodiments, the second determination unit 3201 is further configured to determine the reference sample value of the first color component of the current block based on the value of the first color component sample in the adjacent region of the current block. The adjacent region includes at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.

[0465] In some embodiments, the second determination unit 3201 is further configured to determine the value of the first color component sample by selecting from the first color component samples within the adjacent region.

[0466] In some embodiments, the second determinative unit 3201 further Based on the position and / or color component intensity of the first color component sample within the adjacent region, the sample position awaiting selection is determined. It is configured to determine the value of the first color component sample from an adjacent region based on the sample position awaiting selection.

[0467] In some embodiments, the second filtering unit 3203 further A second filtering is performed on the value of the first color component sample to obtain the filtered neighboring sample value of the first color component of the current block. It is configured to determine the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block.

[0468] In some embodiments, the number of filtered neighboring sample values ​​for the first color component of the current block is smaller than the number of values ​​for the first color component samples.

[0469] In some embodiments, the second determination unit 3201 is further configured to determine the reference sample value of the first color component in the current block based on the reconstructed value of the first reference color component sample in the current block.

[0470] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.

[0471] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.

[0472] In some embodiments, the second filtering unit 3203 further A third filtering is performed on the reconstructed value of the first reference color component sample in the current block to obtain the filtered sample value of the first reference color component sample in the current block. The system is configured to determine the reference sample value of the first color component in the current block based on the filtered sample value of the first reference color component sample in the current block.

[0473] In some embodiments, the number of filtered sample values ​​for the first reference color component samples in the current block is smaller than the number of reconstructed values ​​for the first reference color component samples in the current block.

[0474] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.

[0475] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.

[0476] In some embodiments, the second determination unit 3201 is further configured to determine a value corresponding to the reference sample value of the first color component in a preset mapping and to set the weighting coefficient to equal that value.

[0477] In some embodiments, the second determinative unit 3201 further Determine the first factor, Based on the first factor and the reference sample value of the first color component, the first product value is determined. It is configured to determine the value corresponding to the first product in a pre-configured mapping.

[0478] In some embodiments, the first factor is a predetermined constant value.

[0479] In some embodiments, the second determination unit 3201 is further configured to determine the value of the first factor based on the size parameters of the current block. The size parameters of the current block include at least one of the following parameters: the width of the current block, the height of the current block, and the product of the width and height of the current block.

[0480] In some embodiments, the pre-configured mapping is a softmax function.

[0481] In some embodiments, the pre-configured mapping is a weighting function that is inversely proportional to the reference sample value of the first color component.

[0482] In some embodiments, the second determination unit 3201 is further configured to determine the reference sample value of the second color component of the current block based on the value of the second color component sample in an adjacent region of the current block.

[0483] In some embodiments, the second filtering unit 3203 further A fourth filtering is performed on the values ​​of the second color component samples within the adjacent region of the current block to obtain the filtered adjacent sample values ​​of the second color component of the current block. It is configured to determine the reference sample value of the second color component of the current block based on the filtered adjacent sample value of the second color component of the current block.

[0484] In some embodiments, the number of filtered adjacent sample values ​​for the second color component of the current block is greater than the number of second color component sample values ​​in the adjacent region of the current block.

[0485] In some embodiments, the fourth filtering is upsampling filtering. The upsampling rate is a positive integer multiple of 2.

[0486] In some embodiments, the second filtering unit 3203 is further configured to perform a fourth filtering on the values ​​of the second color component samples in the adjacent region of the current block, based on color format information, to obtain filtered adjacent sample values ​​of the second color component of the current block.

[0487] In some embodiments, the second filtering unit 3203 further If the color format information indicates 4:2:0 sampling, the system is configured to perform upsampling filtering on the value of the second color component sample within the adjacent region of the current block. The upsampling rate is a positive integer multiple of 2.

[0488] In some embodiments, the second prediction unit 3202 further The weighted values ​​obtained by multiplying the reference sample value of the second color component by the corresponding weighting coefficient are determined. The system is configured to set the predicted value of the second color component sample within the first prediction block to be equal to the sum of N weighted values. N represents the number of reference sample values ​​for the second color component, and N is a positive integer.

[0489] In some embodiments, the first filtering includes upsampling filtering, the input to the upsampling filtering is a first upsampling input block, and the output to the upsampling filtering is a first upsampling output block.

[0490] In some embodiments, the second determining unit 3201 is further configured to determine an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor and a vertical upsampling factor. The second filtering unit 3203 is further configured to perform upsampling filtering on the first upsampling input block based on an upsampling factor to obtain a first upsampling output block.

[0491] In some embodiments, the second filtering unit 3203 further The system is configured to perform upsampling filtering on the first upsampling input block to obtain the first upsampling output block if the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1.

[0492] In some embodiments, a second filtering unit 3203 configured to perform upsampling filtering on a first upsampling input block is further configured Performing horizontal upsampling filtering on the first upsampling input block, Perform vertical upsampling filtering on the first upsampling input block, The first upsampling input block is subjected to horizontal upsampling filtering followed by vertical upsampling filtering, The first upsampling input block is subjected to vertical upsampling filtering followed by horizontal upsampling filtering, It is configured to perform at least one of the following:

[0493] In some embodiments, the second filtering unit 3203 further The first prediction block is used as the first upsampling input block. The first upsampling output block is configured to be the second prediction block for the second color component of the current block.

[0494] In some embodiments, the second filtering unit 3203 further Filtering augmentation is performed on the first prediction block to obtain the first augmented prediction block. The first augmentation prediction block is set as the first upsampling input block. The first upsampling output block is configured to be the second prediction block for the second color component of the current block.

[0495] In some embodiments, the second filtering unit 3203 further The first augmentation prediction block is set as the first upsampling input block. The first upsampling output block is set as the first upsampling filtering prediction block. The system is configured to perform filtering enhancement on the first upsampling filtering prediction block to determine the second prediction block for the second color component of the current block.

[0496] In some embodiments, the second filtering unit 3203 further The first filtering augmentation is applied to the first prediction block to determine the second augmented prediction block. The second augmentation prediction block is used as the first upsampling input block. The first upsampling output block is used as the second upsampling filtering prediction block. The system is configured to perform a second filtering augmentation on the second upsampling filtering prediction block to determine the second prediction block for the second color component of the current block.

[0497] In some embodiments, the second filtering unit 3203 is further configured to perform upsampling filtering on the first prediction block to determine the second prediction block for the second color component of the current block.

[0498] In some embodiments, the second filtering unit 3203 is further configured to determine the horizontal upsampling factor and the vertical upsampling factor, and to perform upsampling filtering on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of the second color component of the current block.

[0499] In some embodiments, the second filtering unit 3203 further The system is configured to perform upsampling filtering on the first prediction block to obtain the second prediction block if the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1.

[0500] In some embodiments, a second filtering unit 3203 configured to perform upsampling filtering on a first prediction block is further: Perform horizontal upsampling filtering on the first prediction block, Perform vertical upsampling filtering on the first prediction block, Perform horizontal upsampling filtering on the first prediction block, followed by vertical upsampling filtering. Perform vertical upsampling filtering on the first prediction block, followed by horizontal upsampling filtering. It is configured to perform at least one of the following:

[0501] In some embodiments, the second filtering unit 3203 further The system is configured to perform filtering enhancement on the first prediction block before applying upsampling filtering to the first prediction block, and then use the enhanced first prediction block as the final first prediction block.

[0502] In some embodiments, the second filtering unit 3203 is further configured to perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the first prediction block obtained after upsampling filtering to obtain a second prediction block of the second color component of the current block.

[0503] In some embodiments, upsampling filtering is achieved by at least one of the following methods: linear interpolation or convolutional operations based on a pre-configured neural network.

[0504] In some embodiments, filtering augmentation includes at least one of bilateral filtering, median filtering, Gaussian filtering, normalization filtering, and neural network filtering.

[0505] In some embodiments, the second filtering unit 3203 is further configured to perform filtering augmentation on the first prediction block to determine the second prediction block for the second color component of the current block.

[0506] In some embodiments, the second filtering unit 3203 further Determine the first weight value of the first prediction block under bilateral filtering mode. The system is configured to perform bilateral filtering on the first prediction block based on the first weight value to obtain the second prediction block.

[0507] In some embodiments, the second prediction unit 3202 further Based on the reference sample values ​​in the adjacent region of the current block, the compensation value for the second color component sample of the first predicted block is determined. The system is configured to refine the predicted value of the second color component sample of the first prediction block based on the compensation value, thereby determining the second prediction block.

[0508] In some embodiments, the second prediction unit 3202 further Based on at least one prediction mode, the second color component sample of the first prediction block is predicted to determine at least one initial predicted value for the second color component sample of the first prediction block. The system is configured to determine the second prediction block by performing weighted fusion on at least one initial prediction value and the prediction value of the second color component sample within the first prediction block.

[0509] In some embodiments, the second determinative unit 3201 further Determine the residual value of the second color component sample in the current block. Based on the second prediction block, the predicted value of the second color component sample of the current block is determined. The system is configured to determine the reconstructed value of the second color component sample of the current block based on the residual value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.

[0510] In some embodiments, referring to Figure 24, the decoding apparatus 320 further comprises a decoding unit 3204. The decoding unit 3204 is configured to analyze the bitstream to determine the residual value of the second color component sample of the current block.

[0511] In the embodiments of this application, it can be understood that a “unit” may be part of a circuit, part of a processor, part of a program, or part of software. Naturally, a “unit” may be a module or a non-module. Furthermore, each component unit according to this embodiment may be integrated into a single processing unit, each unit may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of a hardware or software functional module.

[0512] The integrated unit may be stored in a computer-readable storage medium when it is implemented as a software function module rather than being sold or used as a standalone product. According to this understanding, this embodiment provides a computer-readable storage medium applicable to a decoding device 320. A computer program is stored in this computer-readable storage medium. When the computer program is executed by a second processor, the method described in any one of the above embodiments is performed.

[0513] Referring to Figure 25, based on the configuration of the decoding device 320 and the computer-readable storage medium described above, Figure 25 is a schematic diagram showing the specific hardware structure of a decoding device 330 according to an embodiment of the present application. As shown in Figure 25, the decoding device 330 may include a second communication interface 3301, a second memory 3302, and a second processor 3303. Each component is coupled together via a second bus system 3304. To make it clear, the second bus system 3304 is used to enable connection and communication between these components. In addition to the data bus, the second bus system 3304 further includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, in Figure 25, the various buses are marked as the second bus system 3304. The second communication interface 3301 is used to send and receive signals in the process of sending and receiving information with other external network elements. The second memory 3302 is used to store computer programs that can be executed by the second processor 3303. The second processor 3303 is used to perform the following when executing a computer program: Determine the reference sample value for the first color component of the current block. The weighting coefficients are determined based on the reference sample value of the first color component of the current block. Based on the weighting coefficients and the reference sample value of the second color component of the current block, the first predicted block for the second color component of the current block is determined. The first prediction block is subjected to a first filtering process to determine the second prediction block for the second color component of the current block. The second prediction block contains the predicted values ​​for all second color component samples within the current block. Based on the second prediction block, the reconstruction value of the second color component sample of the current block is determined.

[0514] Selectively, in another embodiment, the second processor 3303 is further configured to perform the method described in any one of the above embodiments when executing a computer program.

[0515] To make it clear, the second memory 3302 has hardware functions similar to the first memory 3102, and the second processor 3303 has hardware functions similar to the first processor 3103, which are not described in detail here.

[0516] This embodiment provides a decoding device. The decoding device may further include the decoding apparatus 320 described in the above embodiment. The decoding apparatus takes advantage of the low sensitivity of the human eye to saturation and performs upsampling filtering on the first prediction block when the size of the first prediction block is smaller than the size of the current block, in order to reduce the complexity of calculating weighting coefficients. Furthermore, considering the instability of the predicted value of the first prediction block, filtering enhancement can also be performed on it, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance.

[0517] Referring to Figure 26, in a further embodiment of this application, Figure 26 is a schematic diagram showing the structure of a coding system according to an embodiment of this application. As shown in Figure 26, the coding system 340 may include an encoder 3401 and a decoder 3402. The encoder 3401 may be a device integrating the encoding device 300 described in the above embodiments, or it may be the encoding device 310 described in the above embodiments. The decoder 3402 may be a device integrating the decoding device 320 described in the above embodiments, or it may be the decoding device 330 described in the above embodiments.

[0518] In the embodiments of this application, the codec system 340 utilizes the characteristic that the human eye is less sensitive to saturation, and in order to reduce the complexity of calculating weighting coefficients, upsampling filtering can be performed on the first prediction block when the size of the first prediction block is smaller than the size of the current block. Furthermore, filtering enhancement can be performed to account for the instability of the prediction values ​​of the first prediction block, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, and further improving coding performance.

[0519] In this application, terms such as “includes,” “equipment,” or other variants are intended to cover, not exclude, the inclusion of other components. Therefore, a process, method, article, or apparatus that includes a set of elements may include not only those elements but also other elements not explicitly listed, or other elements specific to the process, method, article, or apparatus. Unless further restrictions are imposed, the phrase “includes…” does not exclude the existence of other identical elements in a process, method, article, or apparatus that includes the elements limited by that phrase.

[0520] The sequence numbers of the embodiments described above in this application are not intended to indicate the superiority or inferiority of the embodiments, but are used solely for illustrative purposes.

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

[0522] The features disclosed in some product embodiments relating to this application can be arbitrarily combined, as long as they do not contradict each other, to obtain new product embodiments.

[0523] The features disclosed in some embodiments of the method or apparatus relating to this application can be combined in any way, as long as they do not conflict, to obtain new embodiments of the method or apparatus.

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

[0525] In the embodiments of this application, the reference sample value of the first color component of the current block is determined on either the encoding or decoding side. Based on the reference sample value of the first color component of the current block, a weighting coefficient is determined. Based on the weighting coefficient and the reference sample value of the second color component of the current block, a first prediction block of the second color component of the current block is determined. A first filtering is performed on the first prediction block to determine a second prediction block of the second color component of the current block. The second prediction block contains the predicted values ​​of all second color component samples in the current block. In this way, on the encoding side, the residual value of the second color component sample of the current block can be determined based on the second prediction block, and the residual value can be written to the bitstream. On the decoding side, the reconstructed value of the second color component sample of the current block can be determined based on the second prediction block and the residual value obtained by decoding. In this way, by calculating weighting coefficients using the color component information of the current block and the reference sample adjacent to the current block, the correlation in luminance information between the current block and adjacent regions can be fully utilized, and by using this correlation in predicting the saturation of the current block, the accuracy of saturation prediction can be improved. Furthermore, taking advantage of the fact that the human eye is not very sensitive to saturation, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block, in order to reduce the complexity of calculating the weighting coefficients. In addition, considering the instability of the predicted value of the first predicted block, filtering augmentation can also be performed for it, thereby further improving the accuracy and subjective and objective quality of saturation prediction, saving bitrate, improving coding efficiency, and further improving coding performance.

Claims

1. A decoding device, Equipped with memory and a processor, The memory is configured to store computer programs that can be executed by the processor, When the processor executes the computer program, To determine the reference sample value of the first color component of the current block, Based on the reference sample value of the first color component of the current block, the weighting coefficient is determined, Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block of the second color component of the current block is determined. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of the current block, wherein the second prediction block contains the predicted values ​​of all second color component samples within the current block. Based on the second prediction block, the reconstruction value of the second color component sample of the current block is determined, It is configured to perform A decoding device characterized by the following features.

2. The processor, configured to determine the reference sample value of the first color component of the current block, The system is configured to determine the reference sample value of the first color component of the current block based on the value of the first color component sample in the adjacent region of the current block. The adjacent region includes at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region. The decoding device according to feature 1.

3. The aforementioned processor, The system is further configured to determine the value of the first color component sample by selecting it from the first color component samples within the adjacent region. The decoding device according to feature 2.

4. The processor, configured to determine the value of the first color component sample by selecting from the first color component samples within the adjacent region, Based on the position and / or color component intensity of the first color component sample within the adjacent region, the sample position awaiting selection is determined. Based on the sample position awaiting selection, the value of the first color component sample is determined from the adjacent region, as configured. The decoding device according to feature 3.

5. The processor, configured to perform a first filtering on the first prediction block to determine the second prediction block of the second color component of the current block, It is configured to perform upsampling filtering, the input to the upsampling filtering is a first upsampling input block, and the output to the upsampling filtering is a first upsampling output block. The decoding device according to feature 1.

6. The processor configured to perform the upsampling filtering is: The upsampling factor is configured to be determined, and the upsampling factor includes at least one of a horizontal upsampling factor and a vertical upsampling factor. The system is configured to perform upsampling filtering on the first upsampling input block based on the upsampling factor to obtain the first upsampling output block. The decoding device according to feature 5.

7. The processor, configured to perform upsampling filtering on the first upsampling input block based on the upsampling factor to obtain the first upsampling output block, The system is configured such that if the horizontal upsampling factor is greater than 1, or if the vertical upsampling factor is greater than 1, upsampling filtering is performed on the first upsampling input block to obtain the first upsampling output block. The decoding device according to feature 6.

8. The processor configured to perform upsampling filtering on the first upsampling input block is: Performing horizontal upsampling filtering on the first upsampling input block, Performing vertical upsampling filtering on the first upsampling input block, Performing horizontal upsampling filtering on the first upsampling input block, followed by vertical upsampling filtering, Performing vertical upsampling filtering on the first upsampling input block, followed by horizontal upsampling filtering, Configured to perform at least one of the following: The decoding device according to feature 7.

9. The aforementioned processor, The first prediction block is set as the first upsampling input block, The first upsampling output block is set as the second prediction block for the second color component of the current block, It is configured to perform further actions, The decoding device according to feature 5.

10. The aforementioned processor, The first prediction block is subjected to filtering and augmentation to obtain the first augmented prediction block, The first enhancement prediction block is set as the first upsampling input block, The first upsampling output block is set as the second prediction block for the second color component of the current block, It is configured to perform further actions, The decoding device according to feature 5.

11. The aforementioned processor, The first prediction block is set as the first upsampling input block, The aforementioned first upsampling output block is made into a first upsampling filtering prediction block, The filtering is enhanced to the first upsampling filtering prediction block to determine the second prediction block of the second color component of the current block, It is configured to perform further actions, The decoding device according to feature 5.

12. The aforementioned processor, The first filtering augmentation is performed on the first prediction block to determine the second augmented prediction block, The second enhancement prediction block is set to the first upsampling input block, The first upsampling output block is made into a second upsampling filtering prediction block, The second filtering enhancement is performed on the second upsampling filtering prediction block to determine the second prediction block of the second color component of the current block, It is configured to perform further actions, The decoding device according to feature 5.

13. The upsampling filtering is implemented by at least one of the following methods: linear interpolation or a convolutional operation based on a pre-configured neural network. A decoding device according to any one of claims 5 to 12, characterized by the above.

14. The filtering enhancement includes at least one of the following: bilateral filtering, median filtering, Gaussian filtering, normalization filtering, and neural network filtering. A decoding device according to any one of claims 10 to 12, characterized in that it is a decoding device.

15. The processor, configured to perform a first filtering on the first prediction block to determine the second prediction block of the second color component of the current block, Determine the first weight value of the first prediction block under bilateral filtering mode. Based on the first weight value, bilateral filtering is performed on the first prediction block to obtain the second prediction block. It is structured in such a way. The decoding device according to feature 1.

16. The processor, configured to perform a first filtering on the first prediction block to determine the second prediction block of the second color component of the current block, Based on the reference sample value in the adjacent region of the current block, the compensation value of the second color component sample of the first predicted block is determined. Based on the compensation value, the predicted value of the second color component sample of the first prediction block is improved to determine the second prediction block. It is structured in such a way. The decoding device according to feature 1.

17. The processor, configured to perform a first filtering on the first prediction block to determine the second prediction block of the second color component of the current block, Based on at least one prediction mode, the second color component sample of the first prediction block is predicted, and at least one initial predicted value of the second color component sample of the first prediction block is determined. The second prediction block is determined by performing weighted fusion on the at least one initial prediction value and the prediction value of the second color component sample in the first prediction block. It is structured in such a way. The decoding device according to feature 1.

18. The processor, configured to determine the reconstruction value of the second color component sample of the current block based on the second prediction block, Determine the residual value of the second color component sample of the current block. Based on the second prediction block, the predicted value of the second color component sample of the current block is determined. Based on the residual value of the second color component sample of the current block and the predicted value of the second color component sample of the current block, the reconstructed value of the second color component sample of the current block is determined. It is structured in such a way. The decoding device according to feature 1.

19. An encoding device, Equipped with memory and a processor, The memory is configured to store computer programs that can be executed by the processor, When the processor executes the computer program, To determine the reference sample value of the first color component of the current block, Based on the reference sample value of the first color component of the current block, the weighting coefficient is determined, Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block of the second color component of the current block is determined. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of the current block, wherein the second prediction block contains the predicted values ​​of all second color component samples within the current block. Based on the second prediction block, the residual value of the second color component sample of the current block is determined, It is configured to perform An encoding device characterized by the following features.

20. A method for transmitting a bitstream, The process involves generating the bitstream by executing an encoding method, The transmission of the aforementioned bitstream, Includes, The encoding method described above is: To determine the reference sample value of the first color component of the current block, Based on the reference sample value of the first color component of the current block, the weighting coefficient is determined, Based on the weighting coefficient and the reference sample value of the second color component of the current block, the first predicted block of the second color component of the current block is determined. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of the current block, wherein the second prediction block contains the predicted values ​​of all second color component samples within the current block. Based on the second prediction block, the residual value of the second color component sample of the current block is determined, including, A method for transmitting a bitstream characterized by the following.