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

The method addresses low prediction accuracy in H.266/VVC by determining reference sample values and filtering to improve saturation prediction, resulting in enhanced coding performance and reduced bitrate.

JP7875984B2Active 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

Smart Images

  • Figure 0007875984000091
    Figure 0007875984000091
  • Figure 0007875984000092
    Figure 0007875984000092
  • Figure 0007875984000093
    Figure 0007875984000093
Patent Text Reader

Abstract

The embodiments of the present application provide a coding method and apparatus, an encoding device, a decoding device, and a storage medium. The method includes the following: determine a reference sample value of a first color component of a current block; determine a weighting factor according to the reference sample value of the first color component of the current block; determine 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; the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block; perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; determine a reconstructed value of the second color component sample of the current block according to the second predicted block. Thereby, the accuracy of chroma prediction can be improved, the bit rate can be saved, and the 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; the number of predicted values ​​for the second color component included in the first predicted block is greater than the number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block for the second color component of 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 aspect, an 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; the number of predicted values ​​for the second color component included in the first predicted block being greater than the number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block for the second color component of 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 embodiment, the present invention provides an encoding device comprising a first determination unit, a first prediction unit, and a first filtering unit. The first determination unit 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 is configured to determine the first prediction block of the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component of the current block, wherein the number of predicted values ​​of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The first filtering unit 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 first confirmation unit is further configured to confirm the residual value of the second color component sample 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 embodiment, the present invention 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 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 prediction 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, wherein the number of predicted values ​​for the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The second filtering unit 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 confirmation unit is further configured to confirm the reconstructed value of the second color component sample 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, 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, a first predicted block of the second color component of the current block is determined. The number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. 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 predicted 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 predicted block. In this way, by utilizing the reference samples adjacent to the current block and the color component information within the current block, a more accurate nonlinear mapping model can be established based on not only sufficient consideration of existing color component information but also without loss of luminance information, allowing weighted prediction by assigning weights to each reference sample value of the saturation component. Furthermore, the first filtering fully considers different color format information and performs sampling filtering of saturation and / or luminance based on different color format information. This ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match, ensuring the accuracy of existing luminance information, improving the accuracy of saturation prediction when performing saturation component prediction using lossless luminance information, 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]Figure 2 is a schematic diagram showing the distribution of the selection area under different prediction modes. [Figure 3] Figure 3 is a flowchart showing the model parameter derivation scheme. [Figure 4A] Figure 4A is a block diagram showing the structure of the encoder according to an embodiment of the present application. [Figure 4B] Figure 4B is a block diagram showing the structure of the decoder according to an embodiment of the present application. [Figure 5] Figure 5 is a flowchart 1 showing the decoding method according to an embodiment of the present application. [Figure 6A] Figure 6A is a schematic diagram showing the reference area of the current block according to an embodiment of the present application. [Figure 6B] Figure 6B is a schematic diagram showing the upsampling interpolation for the reference chroma information according to an embodiment of the present application. [Figure 7] Figure 7 is a schematic diagram showing the weighted prediction based on the chroma prediction (WCP) mode based on weight and other prediction modes according to an embodiment of the present application. [Figure 8] Figure 8 is a schematic diagram showing the framework of WCP according to an embodiment of the present application. [Figure 9] Figure 9 is a flowchart 2 showing the decoding method according to an embodiment of the present application. [Figure 10] Figure 10 is a flowchart 3 showing the decoding method according to an embodiment of the present application. [Figure 11] Figure 11 is a flowchart 4 showing the decoding method according to an embodiment of the present application. [Figure 12] Figure 12 is a schematic diagram 1 showing the process of upsampling interpolation according to an embodiment of the present application. [Figure 13] Figure 13 is a schematic diagram 2 showing the process of upsampling interpolation according to an embodiment of the present application. [Figure 14] Figure 14 is a schematic diagram showing the weight values in the upsampling interpolation according to an embodiment of the present application. [Figure 15] Figure 15 is a schematic diagram 3 showing the upsampling interpolation process according to the embodiment of this application. [Figure 16] Figure 16 is a flowchart 5 showing a decoding method according to an embodiment of this application. [Figure 17] Figure 17 is a flowchart 6 showing a decoding method according to an embodiment of this application. [Figure 18] Figure 18 is a flowchart 1 showing an encoding method according to an embodiment of this application. [Figure 19] Figure 19 is a flowchart 2 showing an encoding method according to an embodiment of this application. [Figure 20] Figure 20 is a schematic diagram showing the structure of an encoding device according to an embodiment of this application. [Figure 21] Figure 21 is a schematic diagram showing a specific hardware structure of an encoding device according to the embodiment of this application. [Figure 22] Figure 22 is a schematic diagram showing the structure of a decoding device according to an embodiment of this application. [Figure 23] Figure 23 is a schematic diagram showing a specific hardware structure of a decoding device according to an embodiment of this application. [Figure 24] Figure 24 is a schematic diagram showing the structure of a coding system according to an embodiment of this application. [Modes 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] JPEG0007875984000001.jpg43167

[0021] JPEG0007875984000002.jpg45167

[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] JPEG0007875984000003.jpg75165

[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] JPEG0007875984000004.jpg143168

[0039] Based on the above, embodiments of this application 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, 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 predicted block of the second color component of the current block is determined. The number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. Based on the second predicted block, the residual value of the second color component sample of the current block is 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. The number of predicted values ​​for the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. 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 utilizing the reference samples adjacent to the current block and the color component information within the current block, a more accurate nonlinear mapping model can be established based on not only sufficient consideration of existing color component information but also without loss of luminance information, and weighted prediction can be performed by assigning weights to each reference sample value of the saturation component. Furthermore, the first filtering fully considers different color format information and performs sampling filtering of saturation and / or luminance based on different color format information. This ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match, ensuring the accuracy of existing luminance information, and when performing saturation component prediction using lossless luminance information, the accuracy and stability of the nonlinear mapping model can be improved based on accurate luminance information, improving the accuracy 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. Furthermore, the decoding method of the embodiment of this application specifically refers to an intra prediction method, and more specifically, it can refer to a weight-based chroma prediction (WCP) method.

[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, Figure 6A As shown in detail, the adjacent region may 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 referred to as 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 greater than the number of values ​​for the first color component sample.

[0066] In embodiments of this application, the second filtering may be upsampling filtering. The first color component is the luminance component. To ensure that there is no loss of reference luminance information, the reference luminance information may be left unchanged, or upsampling filtering may be performed on the reference luminance information. For example, if the current block size is 2M × 2N and the number of reference luminance information elements is 2M + 2N, after upsampling filtering, it can be converted to 4M + 4N elements.

[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 ​​of the first reference color component sample in the current block is greater than the number of reconstructed values ​​of the first reference color component sample in the current block.

[0071] In embodiments of this application, the third filtering may be upsampling filtering. The first reference color component is the luminance component. To ensure that there is no loss of reconstructed luminance information in the current block and to obtain a more accurate saturation prediction value, the reconstructed luminance information in the current block may be left unchanged, or upsampling 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 4M × 4N after upsampling 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] That is, upsampling filtering may be performed on the reference luminance information in the adjacent region of the current block while ensuring no loss of luminance information, or on the reconstructed luminance information within the current block, or on both the reference luminance information and the reconstructed luminance information, or even without performing upsampling filtering on both the reference luminance information and the reconstructed luminance information. Next, luminance difference information is determined according to different combinations, and the luminance difference information is 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] JPEG0007875984000005.jpg83157

number

[0082] Furthermore, in the embodiments of this application, if the number of reference sample values ​​for the second color component is N, then the number of weighting coefficients is also N. Here, the sum of the N weighting coefficients is equal to 1, and each weighting coefficient is a value between 0 and 1, i.e., 0 ≤ w k The value is ≤ 1. However, the idea that "the sum of N weighting coefficients is equal to 1" is merely a theoretical concept; in actual fixed-point implementations, the absolute value of the weighting coefficients may be greater than 1.

[0083] JPEG0007875984000008.jpg74168

number

[0084] JPEG0007875984000010.jpg39167

number

[0085] JPEG0007875984000012.jpg20157

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] JPEG0007875984000014.jpg33157

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

[0089] JPEG0007875984000015.jpg70168

[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, the height of the current block, or the product of the width and 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] JPEG0007875984000018.jpg59170

[0102] JPEG0007875984000019.jpg51166

[0103] JPEG0007875984000020.jpg31163

[0104] Furthermore, for 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 the reference sample is the reference luminance information of the current block, and the second color component value of the reference sample is the reference chroma information of the current block, the second factor can be obtained by performing a least-squares calculation on the chroma component values and luminance component values of the N reference samples. Exemplarily, the least-squares regression calculation is as follows.

Equation

[0106] Also, for the preset mapping, the preset mapping may be a preset functional relationship. In some embodiments, the preset mapping may be a Softmax function. The Softmax function is a normalized exponential function, but normalization may not be required in the embodiments of the present application, and the range of its values is not limited to [0,1].

[0107] JPEG0007875984000022.jpg23168

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] JPEG0007875984000026.jpg17168

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] JPEG0007875984000029.jpg62164

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

[0115] JPEG0007875984000030.jpg46169

[0116] JPEG0007875984000031.jpg35166

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] JPEG0007875984000035.jpg29166

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] JPEG0007875984000039.jpg49169

[0125] JPEG0007875984000040.jpg46162

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] JPEG0007875984000044.jpg57167

[0130] JPEG0007875984000045.jpg53165

[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 this embodiment of the present application, in order to avoid loss of luminance information, chroma prediction is performed for each reconstructed luminance position within the current block, so that the size of the resulting first predicted block is larger than the original size of the current block. That is, the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in 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] In other words, the first color component is the luminance component, and the second color component is the chroma component. To ensure that there is no loss of reference luminance information, upsampling filtering can be performed on the reference chroma information. For example, for a current block of 2M × 2N in YUV420 format, the size of the chroma block is M × N, and the number of reference chroma information points in adjacent regions is M + N. After upsampling filtering, 2M + 2N chroma reference sample values ​​are obtained, then 2M × 2N chroma prediction values ​​are obtained using a weighted prediction method, and then downsampling filtering is performed to obtain M × N chroma prediction values ​​to obtain the final prediction value. Note that for a current block of 2M × 2N in YUV420 format, the size of the chroma block is M × N, and the number of reference chroma information points in adjacent regions is M + N. Using only these M + N reference chroma information points, 2M × 2N chroma prediction values ​​are obtained using weighting coefficients, and then downsampling filtering is performed to obtain M × N chroma prediction values ​​to obtain the final prediction value.

[0139] Furthermore, for a current block of 2M×2N in YUV420 format, the size of the chroma block is M×N, the number of reference chroma information points in adjacent regions is M+N, and after upsampling filtering, 4M+4N chroma reference sample values ​​are obtained. Alternatively, for a current block of 2M×2N in YUV444 format, the size of the chroma block is 2M×2N, the number of reference chroma information points in adjacent regions is 2M×2N, and after upsampling filtering, 4M+4N chroma reference sample values ​​are obtained. Subsequently, based on these chroma reference sample values, M×N chroma prediction values ​​can be obtained as the final prediction values ​​using a weighted prediction and downsampling filtering scheme. No limitations are placed on this in the embodiments of this application.

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

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

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

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

[0144] 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).

[0145] 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 in S503 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.

[0146] 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 taken as the predicted value for the second color component sample in the prediction block. Specifically, the calculation formula is as follows:

number

[0147] For example, first, the absolute lumen difference is calculated based on the reconstructed lumen information of the current block position (i, j) and the reference lumen information in the adjacent region. Next, weighting coefficients are calculated according to the Softmax function, and then, using equation 16, the predicted value of the saturation component of the predicted block position (i, j) can be obtained. In particular, this method is advantageous for parallel processing and can speed up computation.

[0148] To further understand, when performing upsampling filtering on both the reference luminance information and reference saturation information within the adjacent region of the current block, the following may be included: Based on the color format information, a second filtering is performed on the values ​​of the first color component samples within the adjacent region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered adjacent sample values ​​for the first color component of the current block. A fourth filtering is performed on the values ​​of the second color component samples within the adjacent region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered adjacent sample values ​​for the second color component of the current block.

[0149] In one possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:0 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.

[0150] In the embodiments of this application, upsampling filtering is performed on the reference luminance information. In this case, there is no loss of luminance information. In this case, since the spatial resolution of the luminance component is always greater than or equal to the spatial resolution of the chroma component in YUV video, it is necessary to perform upsampling filtering on the reference chroma information in order to match the spatial resolution of the reference chroma information with that of the reference luminance information. In this case, it is necessary to determine the spatial upsampling rate of the reference chroma information (second horizontal upsampling factor and second vertical upsampling factor) based on the YUV video format and the spatial upsampling rate of the reference luminance information (first horizontal upsampling factor and first vertical upsampling factor).

[0151] The first horizontal upsampling factor is represented by S_Hor_RefLuma, the first vertical upsampling factor by S_Ver_RefLuma, the second horizontal upsampling factor by S_Hor_RefChroma, and the second vertical upsampling factor by S_Ver_RefChroma. Thus, for YUV444 format video, S_Hor_RefChroma can be set to equal S_Hor_RefLuma, and S_Ver_RefChroma can be set to equal S_Ver_RefLuma. For YUV422 format video, S_Hor_RefChroma can be set to twice S_Hor_RefLuma, and S_Ver_RefChroma can be set to equal S_Ver_RefLuma. For YUV411 format video, S_Hor_RefChroma can be set to four times S_Hor_RefLuma, and S_Ver_RefChroma can be set to equal S_Ver_RefLuma. For YUV420 format video, S_Hor_RefChroma can be set to twice the value of S_Hor_RefLuma, and S_Ver_RefChroma can be set to twice the value of S_Ver_RefLuma.

[0152] To further understand this, if upsampling filtering is not performed on the reconstructed luminance information within the current block, the size of the first predicted block can be estimated based on the YUV video format. Therefore, in another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then it is determined that the width of the first predicted block is equal to the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, then it is determined that the width of the first predicted block is equal to four times the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:0 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to twice the height of the current block.

[0153] In the embodiments of this application, the size parameters of the first prediction block include width and height. The width of the first prediction block is represented by predSizeW, and the height of the first prediction block is represented by predSizeH. The size parameters of the current block also include width and height, with the width of the current block being represented by nTbW, and the height of the current block being represented by nTbH. Thus, for YUV444 format video, the spatial resolution of the luminance component and the spatial resolution of the chroma component are equal, in which case predSizeW can be set to be equal to nTbW, and predSizeH can be set to be equal to nTbH. For YUV422 format video, the vertical resolution of the luminance component and the vertical resolution of the chroma component are the same, but the horizontal resolution of the chroma component is half the horizontal resolution of the luminance component, in which case predSizeW can be set to be equal to twice nTbW, and predSizeH can be set to be equal to nTbH. For YUV411 format video, the vertical resolution of the luminance component and the vertical resolution of the saturation component are the same, but the horizontal resolution of the saturation component is 1 / 4 of the horizontal resolution of the luminance component. In this case, predSizeW can be set to 4 times nTbW, and predSizeH can be set to 1 / 4 of nTbH. For YUV420 format video, the horizontal resolution of the saturation component is 1 / 2 of the horizontal resolution of the luminance component, and the vertical resolution of the saturation component is 1 / 2 of the vertical resolution of the luminance component. In this case, predSizeW can be set to 2 times nTbW, and predSizeH can be set to 2 times nTbH.

[0154] To further understand this, when performing upsampling filtering on the reconstructed luminance information within the current block, it is necessary to estimate the size of the first predicted block based on the YUV video format and the spatial upsampling rate of the luminance of the current block, after performing luminance upsampling on the current block. In this case, the following may be included: Based on the color format information, a third horizontal upsampling factor and a third vertical upsampling factor are used to perform a third filtering on the reconstructed value of the first reference color component sample within the current block to obtain the filtered sample value of the first reference color component sample within the current block.

[0155] In yet another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then the width of the first predicted block is determined to be equal to the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the width of the first predicted block is determined to be equal to four times the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:0 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to twice the product of the current block height and the third vertical upsampling factor.

[0156] In the embodiments of this application, the third horizontal upsampling factor is represented by S_Hor_RecLuma, and the third vertical upsampling factor is represented by S_Ver_RecLuma. Upsampling filtering is performed on the reconstructed luminance information in the current block based on S_Hor_RecLuma and S_Ver_RecLuma. In this case, with respect to the size of the first predicted block, for a YUV444 format video, the spatial resolution of the luminance component and the spatial resolution of the chroma component are equal, and in this case, predSizeW can be set to be equal to the product of S_Hor_RecLuma and nTbW, and predSizeH can be set to be equal to the product of S_Ver_RecLuma and nTbH. For YUV422 format video, the vertical resolution of the luminance component and the vertical resolution of the saturation component are the same, but the horizontal resolution of the saturation component is half the horizontal resolution of the luminance component. In this case, predSizeW can be set to equal twice the product of S_Hor_RecLuma and nTbW, and predSizeH can be set to equal the product of S_Ver_RecLuma and nTbH. For YUV411 format video, the vertical resolution of the luminance component and the vertical resolution of the saturation component are the same, but the horizontal resolution of the saturation component is one-quarter the horizontal resolution of the luminance component. In this case, predSizeW can be set to equal four times the product of S_Hor_RecLuma and nTbW, and predSizeH can be set to equal the product of S_Ver_RecLuma and nTbH. For YUV420 format video, the horizontal resolution of the saturation component is half the horizontal resolution of the luminance component, and the vertical resolution of the saturation component is half the vertical resolution of the luminance component. In this case, predSizeW can be set to equal twice the product of S_Hor_RecLuma and nTbW, and predSizeH can be set to equal twice the product of S_Ver_RecLuma and nTbH.

[0157] In the embodiments of this application, predSizeH is greater than or equal to the current block height nTbH, or predSizeW is greater than or equal to the current block width nTbW, thereby the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block.

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

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

[0160] In the embodiments of this application, the first filtering may be downsampling filtering. In this way, for the second prediction block on which downsampling filtering has been performed, the number of predicted values ​​of 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.

[0161] In one possible embodiment, 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: Using a preset filter, downsampling filtering is performed on the first prediction block to determine the second prediction block for the second color component of the current block.

[0162] Furthermore, in the embodiments of this application, the preset filter may be a downsampling filter. Moreover, the downsampling filter may be a neural network filter. No limitations are placed on this in the embodiments of this application.

[0163] In another possible embodiment, performing a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block may include: determining the horizontal downsampling factor and the vertical downsampling factor; and performing downsampling filtering on the first prediction block based on the horizontal downsampling factor and the vertical downsampling factor to obtain the second prediction block for the second color component of the current block.

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

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

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

[0167] Furthermore, downsampling filtering can be performed on the first filtering using a sampling interval, with examples including two-dimensional filters and one-dimensional filters. In the case of a one-dimensional filter, filtering may be performed "first vertically, then horizontally," or "first horizontally, then vertically," or in a fixed filtering order, or in a flexible, adjustable filtering order (e.g., a filtering order indicated by identification information, an order associated with a prediction mode or block size). No limitations are placed on this in the embodiments of this application.

[0168] 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 downsampling filtering. The input to the downsampling filtering is a first downsampling input block, and the output to the downsampling filtering is a first downsampling output block.

[0169] Furthermore, in some embodiments, Downsampling Filtering may include the following: determining the downsampling factor. The downsampling factor includes at least one of a horizontal downsampling factor and a vertical downsampling factor. Downsampling filtering is performed on the first downsampling input block based on the downsampling factor to obtain the first downsampling output block.

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

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

[0172] Here, first, a horizontal downsampling factor can be calculated based on the width of the first downsampling input block and the width of the first downsampling output block, and a vertical downsampling factor can be calculated based on the height of the first downsampling input block and the height of the first downsampling output block. Next, downsampling filtering can be performed on the first downsampling input block based on the horizontal and vertical downsampling factors. Specifically, if the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling should be performed only horizontally on the first downsampling input block. If the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling should be performed only vertically on the first downsampling input block. If the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling should be performed both horizontally and vertically on the first downsampling input block. Downsampling may be performed horizontally first and then vertically, or vertically first and then horizontally. Furthermore, the downsampling 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.

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

[0174] In another possible embodiment, the first prediction block is first subjected to enhancement filtering, and then to downsampling 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 used as the first downsampling input block; and the first downsampling output block is used as the second prediction block for the second color component of the current block.

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

[0176] In a further possible embodiment, the second prediction block is determined by first performing augmented filtering on the first prediction block, then downsampling 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 downsampling input block. The first downsampling output block is made the second downsampling filtered prediction block. A second filtering augmentation is performed on the second downsampling filtered prediction block to determine the second prediction block for the second color component of the current block.

[0177] In addition to the above, 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 may further include the following: Based on a horizontal downsampling factor and a vertical downsampling factor, a weighted sum calculation is performed for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions to obtain the second prediction block.

[0178] In possible embodiments, obtaining a second prediction block by performing a weighted sum calculation for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions may include the following: Obtaining a second prediction block by performing a weighted sum calculation for the number of predicted values ​​of the horizontal downsampling factor of the second color component of the first prediction block in the horizontal direction.

[0179] In another possible embodiment, obtaining a second prediction block by performing a weighted sum calculation for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions may include the following: obtaining a second prediction block by performing a weighted sum calculation for the number of predicted values ​​of the vertical downsampling factor of the second color component of the first prediction block in the vertical direction.

[0180] In yet another possible embodiment, obtaining a second prediction block by performing a weighted sum calculation for a predetermined number of predicted values ​​of the second color components of the first prediction block in the horizontal and / or vertical directions may include the following: Performing a weighted sum calculation for the second color components of the first prediction block in the horizontal direction for each predicted value of the number of horizontal downsampling factors, and performing a weighted sum calculation for the second color components of the first prediction block in the vertical direction for each predicted value of the number of vertical downsampling factors, thereby obtaining a second prediction block.

[0181] In other words, in the embodiments of this application, without considering the horizontal downsampling factor and the vertical downsampling factor, a weighted sum calculation is performed for each predetermined number of saturation prediction values ​​in the direction in which downsampling is required (vertical or horizontal). In the special case where the weights of each saturation prediction value are equal, performing a weighted sum calculation for each predetermined number of saturation prediction values ​​can be considered as obtaining the average value of these predetermined number of saturation prediction values, and this average value is taken as the prediction value after downsampling filtering.

[0182] Furthermore, in some embodiments, the method may further include: determining weighting coefficients based on reference sample values ​​of the first color component of some samples within the first prediction block; and determining a second prediction block for the second color component of the current block based on the weighting coefficients and reference sample values ​​of the second color component of some samples within the first prediction block.

[0183] In a specific embodiment, determining the second 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 some samples within the first predicted block may include the following: Based on the weighting coefficient, a weighting calculation is performed on the reference sample value for the second color component of the sample at position (i,j) within the first predicted block to obtain the predicted value for the second color component of the sample at position (x,y) within the current block. i, j, x, y These are all integers greater than or equal to 0.

[0184] In this embodiment, upsampling filtering is not performed on the reconstructed luminance information within the current block in order to reduce computational complexity. In this case, instead of predicting collocated chroma samples for the reconstructed luminance information at all luminance locations within the current block, it is possible to select some luminance locations and predict collocated chroma samples. This eliminates the need to perform downsampling filtering after obtaining the prediction block, ensuring the accuracy of the existing luminance information. Accurate luminance information is advantageous for improving the accuracy and stability of the nonlinear mapping model, and as a result, the accuracy of the chroma prediction can be improved.

[0185] In this embodiment, to reduce subsequent upsampling or downsampling operations on the prediction block, chroma prediction can be performed by selecting corresponding positions based on the characteristics of the YUV video format. Assuming the current luminance sample position is CurRecLuma(i, j), the sample position for which chroma prediction needs to be performed is CurPredChroma(x, y). In this case, in some embodiments, the method may further include the following: If the color format information indicates 4:4:4 sampling, set x to equal to i and y to equal to j. If the color format information indicates 4:2:2 sampling, set x to be equal to the product of i and 2, and y to be equal to j. If the color format information indicates 4:1:1 sampling, set x to be equal to the product of i and 4, and y to be equal to j. If the color format information indicates 4:2:0 sampling, set x to be equal to the product of i and 2, and y to be equal to the product of j and 2.

[0186] Furthermore, in some embodiments, the method may further include the following: Determining the horizontal sampling position factor and the vertical sampling position factor; setting x to be equal to the product of i and the horizontal sampling position factor, and y to be equal to the product of j and the vertical sampling position factor.

[0187] In other words, to further reduce the complexity of the calculations during prediction, fewer colocated chroma samples can be selected for prediction. Assuming the current luminance sample position is CurRecLuma(i, j), the position of the sample for which chroma prediction needs to be performed is CurPredChroma(x, y). Assuming that the horizontal sampling position factor of the reconstructed luminance information in the current block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the current luminance sample position and the position of the sample for which chroma prediction needs to be performed is as follows. If the color format information indicates video in YUV444 format / YUV422 format / YUV411 format / YUV420 format, x can be set to be equal to the product of i and S_Pos_Hor, and y can be set to be equal to the product of j and S_Pos_Ver.

[0188] Furthermore, after determining the second prediction block, post-processing is performed on the second prediction block under certain conditions to obtain the final second prediction block. Thus, in some embodiments, the method may further include determining the second prediction block of the second color component of the current block, performing related processing on the second prediction block, and making the processed second prediction block the second prediction block.

[0189] In the embodiments of this application, performing related processing on the second prediction block is: Perform a third filter on the second prediction block, This involves refining the second prediction block using pre-set compensation values, Perform weighted fusion on the second predicted block using the predicted value of the second color component of the current block under at least one prediction mode, It includes at least one of the following.

[0190] In one possible embodiment, the third filtering may be smoothing filtering. For example, in WCP mode, to reduce instability caused by parallel prediction for each sample, smoothing filtering may be performed on the second prediction block, and then the processed second prediction block may be made the final second prediction block.

[0191] In another possible embodiment, a preset compensation value for the second color component of the second prediction block is determined based on a reference sample value in an adjacent region of the current block, and the predicted value of the second color component sample in the second prediction block is refined based on the preset compensation value to determine the final second prediction block. Exemplarily, position-related refinement can be performed on the second prediction block to further improve the prediction accuracy in WCP mode. For example, a saturation compensation value for each second color component sample awaiting prediction is calculated using a reference sample in a nearby spatial position, the second color component sample in the second prediction block is refined using this saturation compensation value, the final predicted value of the second color component sample is determined based on the refined predicted value, and the final second prediction block is obtained.

[0192] In yet another possible embodiment, the second color component sample in the second prediction block is predicted based on at least one prediction mode to determine at least one initial predicted value for the second color component sample in the second prediction block, and the final second prediction block is determined by performing a weighted fusion on the at least one initial predicted value and the predicted value for the second color component sample in the second prediction block.

[0193] 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. For example, as shown in Figure 7, 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 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.

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

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

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

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

[0198] To make it clear, the embodiments of this application primarily involve three modes of performing chroma prediction using lossless luminance information during prediction in WCP mode. On the one hand, the calculation of the chroma weighting coefficient of the reference sample is realized by making full use of the luminance information of the reference sample and the current block. On the other hand, the importance of existing luminance information is fully considered, and a more accurate nonlinear mapping model is established based on the fact that the luminance information is not lost, and weights are assigned to the reference chroma sample to perform weighted prediction. Furthermore, when performing collocated chroma prediction by upsampling the reference chroma and based on the position of each luminance sample in the current block, the characteristics of various YUV video formats are fully considered, and based on the chroma subsampling format and luminance upsampling situation of different YUV videos, it is ensured that the spatial resolution of the chroma component and the spatial resolution of the luminance component always match, and the accuracy of the chroma prediction in WCP mode is improved by making full use of existing lossless luminance information to perform collocated chroma prediction.

[0199] JPEG0007875984000047.jpg62165

[0200] 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, weighting coefficients are determined. Based on the weighting coefficients 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. The number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. 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 utilizing the reference samples adjacent to the current block and the color component information within the current block, a more accurate nonlinear mapping model can be established based on sufficient consideration of existing color component information without losing luminance information, and weighted prediction can be performed by assigning weights to each reference sample value of the saturation component. Furthermore, the first filtering takes into account different color format information, and sampling filtering of saturation and / or luminance is performed based on different color format information. This ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match, which not only ensures the accuracy of existing luminance information but also improves the accuracy and stability of the nonlinear mapping model based on accurate luminance information when performing saturation component prediction using lossless luminance information, thereby improving the accuracy of saturation prediction, saving bitrate, improving coding efficiency, and further improving coding performance.

[0201] 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 and reference saturation information in the adjacent region are all decoded reference information. Therefore, in this embodiment, a WCP (Write-by-Constant) technique utilizing the above information is proposed. Based on this, in order to ensure that there is no loss between the reference luminance information and the reconstructed luminance information in the current block, the spatial resolution of the reference saturation is matched with the spatial resolution of the reference luminance, the spatial resolution of the currently predicted saturation is matched with the spatial resolution of the existing reconstructed luminance, downsampling filtering is performed on the predicted saturation based on the matched values, and finally, post-processing is performed on the predicted saturation values.

[0202] In this embodiment of the application, we primarily propose further improving the accuracy of saturation prediction without compromising luminance information, based on WCP prediction technology. The detailed steps of the saturation prediction process using WCP mode are as follows.

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

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

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

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

[0207] S901: Confirm the core parameters for WCP mode.

[0208] Furthermore, regarding the determination of core parameters related to WCP mode for S901, the core parameters of WCP mode can be obtained or estimated by setting or by some method, for example, the core parameters can be obtained from the bitstream on the decoding side.

[0209] 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 = S / 4 It can be set to 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.

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

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

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

[0213] The current block is classified into one of three categories based on its current width and height. The control parameters (S) corresponding to different categories can be set differently, while 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:

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

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

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

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

[0218]

Table 6

[0219] Another example can also be described by classifying into three categories.

[0220] The current block is classified into three categories according to the width and height of the current block. The control parameter (S) corresponding to different categories can be set differently, and 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.

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

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

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

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

[0225] [Table 7]

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

[0227] 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 (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 nTbW×nTbH represents the number of samples of the current block. The block category wcpSizeId is defined as follows.

[0228] 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 chroma prediction values is the number of WCP outputs nTbH×nTbW.

[0229] wcpSizeId = 1: Represents the current block where 128 <= (nTbWnTbH) <= 256. 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.

[0230] wcpSizeId = 2: Represents the current block where (nTbWnTbH) > 256. The control parameter(s) is 1, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.

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

[0232]

Table 8

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

[0234] 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:

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

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

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

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

[0239] [Table 9]

[0240] S902: Upsampling filtering is performed on the reference saturation information without compromising the reference luminance information, maintaining the same spatial resolution as the reference luminance information.

[0241] Note that when predicting the current block with respect to S902, the upper region, upper left region, and left region of the current block are regarded as the adjacent regions of the current block (which may also be referred to as "reference regions"), and as shown in FIG. 6A described above, all the samples in the adjacent regions are decoded reference samples.

[0242] Here, the reference chroma information refC and the reference luminance information refY can be obtained from the adjacent regions. The human eye is relatively sensitive to luminance information. In the embodiments of the present application, mainly the existing luminance information is used to build a model for chroma prediction. Therefore, from the perspective of not damaging the reference luminance information, for different YUV video formats, upsampling filtering is performed on the reference chroma information so as to realize the matching between the spatial resolution of the reference chroma information and the spatial resolution of the reference luminance information. In a specific embodiment, as shown in FIG. 10, step S902 may include the following content.

[0243] S1001: There is no loss in the reference luminance information.

[0244] S1002: The reference luminance information is not changed.

[0245] S1003: Upsampling filtering is performed on the reference luminance information.

[0246] S1004: If the reference luminance information is not changed, the reference chroma information is not changed.

[0247] S1005: If the reference luminance information is not changed, upsampling filtering is performed on the reference chroma information.

[0248] S1006: If upsampling filtering is performed on the reference luminance information, upsampling filtering is performed on the reference chroma information.

[0249] Furthermore, while ensuring that there is no loss of reference luminance information, the case can be divided into two cases: (1) The reference luminance information is not changed. (2) Upsampling filtering is performed on the reference luminance information. Case (1) can be further divided into two subcases: (a) The reference saturation information is not changed. (b) Upsampling filtering is performed on the reference saturation information. For case (2), there is no subcase where the reference saturation information is not changed, and upsampling filtering must be performed on the reference saturation information.

[0250] In case (1), i.e., step S1002, the reference luminance information is not changed. Therefore, there is no loss of luminance information. In this case, due to the diversity of YUV video formats, it is necessary to process the reference saturation information in different subcases.

[0251] Subcase 1: For YUV444 format video, the spatial resolution of the luminance component and the spatial resolution of the saturation component are equal, in which case no processing is required for the reference saturation component.

[0252] Subcase 2: For videos with chroma subsampling characteristics such as YUV422, YUV411, and YUV420, the spatial resolution of the luminance component and the spatial resolution of the chroma component do not match, and the spatial resolution of the chroma component is smaller than the spatial resolution of the luminance component. In this case, it is necessary to perform upsampling filtering on the reference chroma component based on the YUV video format. 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 interpolation algorithms based on wavelet transforms and interpolation algorithms 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. Here, the YUV420 video format and copy interpolation are described as examples, and Figure 6B shows an interpolation method for a reference chroma copy for 4×1 reference chroma information and 8×2 reference luminance information. As shown in Figure 6B, the 8x2 shaded blocks represent reference luminance information, and the 4x1 grid blocks represent collated reference saturation information. Each sample within the 4x1 grid blocks corresponds to the top-left corner sample of each 2x2 subblock within the 8x2 saturation block after upsampling filtering; that is, the sample values ​​of each saturation sample within the 2x2 subblock after copy interpolation are the same. Specifically, for each 2x2 subblock, the other three saturation samples (blocks shaded with dots) are all obtained by copying the top-left corner sample (block shaded with a grid).

[0253] In case (2), i.e., step S1003, upsampling filtering is performed on the reference luminance information. In this case, there is no loss of luminance information. In this case, since the spatial resolution of the luminance component is always greater than or equal to the spatial resolution of the chroma component in YUV format video, it is necessary to perform upsampling filtering on the reference chroma information in order to match the spatial resolution of the reference chroma information with that of the reference luminance information. In this case, it is necessary to determine the spatial upsampling rate of the reference chroma information based on the YUV video format and the spatial upsampling rate of the reference luminance information. Here, the horizontal upsampling rate of the reference luminance information (i.e., the first horizontal upsampling factor in the above-described embodiment) is denoted as S_Hor_RefLuma, the vertical upsampling rate of the reference luminance information (i.e., the first vertical upsampling factor in the above-described embodiment) is denoted as S_Ver_RefLuma, the horizontal upsampling rate of the reference chrominance information (i.e., the second horizontal upsampling factor in the above-described embodiment) is denoted as S_Hor_RefChroma, and the vertical upsampling rate of the reference chrominance information (i.e., the second vertical upsampling factor in the above-described embodiment) is denoted as S_Ver_RefChroma.

[0254] For YUV444 format video, S_Hor_RefChroma = S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV422 format video, S_Hor_RefChroma = 2 × S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV411 format video, S_Hor_RefChroma = 4 × S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV420 format video, S_Hor_RefChroma = 2 × S_Hor_RefLuma and S_Ver_RefChroma = 2 × S_Ver_RefLuma.

[0255] S903: Determine the target information for the current block based on the core parameters.

[0256] Furthermore, for S903, the target information for the current block may include reference chrominance information (refC), reference luminance information (refY), and reconstructed luminance information (recY). Reference chrominance information refC and reference luminance information refY are obtained from the reference region in Figure 6A. The obtained reference chrominance information includes, but is not limited to, the corresponding reference chrominance information obtained based on the position of the reference luminance information. The obtained reference luminance information includes, but is not limited to, the reference reconstructed luminance value selected from the upper region of the current block and the reference reconstructed luminance value selected from the left region of the current block.

[0257] Furthermore, in the embodiments of this application, refC, refY, or recY can be pre-treated under certain conditions before being used as input to WCP.

[0258] For example, different filtering can be applied to refC, refY, or recY for the current block having different sizes. Obtaining target information may include the following: Obtaining reference saturation information refC, where the value is inSize. Here, refC may or may not have undergone upsampling filtering. If preprocessing such as filtering is required, refC is obtained after preprocessing.

[0259] Obtaining target information may include the following: Obtaining reference luminance information refY, where the value is inSize. This refY may or may not have undergone upsampling filtering. If preprocessing such as filtering is required, refY will be obtained after preprocessing.

[0260] Furthermore, obtaining target information may also include the following: obtaining the reconstructed luminance information recY within the current block. recY will be described in detail in subsequent steps.

[0261] S904: Without losing the reconstructed brightness information within the current block, WCP is performed based on the target information to obtain the first predicted block of the current block.

[0262] Furthermore, in order to avoid damaging the reconstructed luminance information within the current block, the acquired reconstructed luminance information recY may be left unprocessed or may be subjected to upsampling filtering. As shown in Figure 11, acquiring the reconstructed luminance information may include the following steps.

[0263] S1101: There is no loss of reconstructed luminance information within the current block.

[0264] S1102: The reconfigured brightness information within the current block is not changed.

[0265] S1103: Upsampling filtering is performed on the reconstructed luminance information within the current block.

[0266] In other words, in order to obtain more accurate saturation prediction values, in the embodiments of this application, for each luminance sample in the current block, the difference between the luminance value of the luminance sample and the reference luminance is calculated to obtain a luminance difference, the weight of the collated reference saturation of each reference luminance is obtained based on the luminance difference, and finally, a weighted prediction is performed based on the weight to obtain the WCP value of each collated saturation. In this way, the spatial resolution of the predicted block obtained through the above process will match the spatial resolution of the current block. Therefore, operations can be performed on the reconstructed luminance information in the current block according to the following two cases.

[0267] In Case 1 (i.e., in step S1102), if no processing is performed on the reconstructed luminance information within the current block, it is necessary to estimate the size of the first predicted block to be output based on the YUV video format. For YUV444 format video, the spatial resolution of the luminance component and the spatial resolution of the saturation component are equal, in which case predSizeW = nTbW and predSizeH = nTbH. For YUV422 format video, the luminance and saturation components have the same vertical resolution, but the horizontal resolution of the saturation component is half that of the luminance component. In this case, predSizeW = 2 × nTbW and predSizeH = nTbH. For YUV411 format video, the luminance and saturation components have the same vertical resolution, but the horizontal resolution of the saturation component is 1 / 4 of the horizontal resolution of the luminance component. In this case, predSizeW = 4 × nTbW and predSizeH = nTbH. For YUV420 format video, the horizontal resolution of the saturation component is half the horizontal resolution of the luminance component, and the vertical resolution of the saturation component is half the vertical resolution of the luminance component. In this case, predSizeW = 2 × nTbW and predSizeH = 2 × nTbH.

[0268] In Case 2 (i.e., in step S1103), if upsampling filtering is performed on the reconstructed luminance information within the current block, 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, or 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 or an interpolation algorithm based on edge information. Alternatively, upsampling filtering may be performed based on a convolutional neural network. After performing upsampling filtering on the reconstructed luminance information within the current block, it is necessary to estimate the size of the output first predicted block based on the YUV video format and the spatial upsampling rate of the reconstructed luminance information. The horizontal upsampling rate of the reconstructed luminance information (i.e., the third horizontal upsampling factor in the above embodiment) is denoted as S_Hor_RecLuma, and the vertical upsampling rate of the reconstructed luminance information (i.e., the third vertical upsampling factor in the above embodiment) is denoted as S_Ver_RecLuma.

[0269] For YUV444 format video, the spatial resolution of the luminance component and the spatial resolution of the saturation component are equal. In this case, predSizeW = S_Hor_RecLuma × nTbW and predSizeH = S_Ver_RecLuma × nTbH. For YUV422 format video, the luminance and saturation components have the same vertical resolution, but the horizontal resolution of the saturation component is half that of the luminance component. In this case, predSizeW = 2 × nTbW × S_Hor_RecLuma and predSizeH = nTbH × S_Ver_RecLuma. For YUV411 format video, the luminance and saturation components have the same vertical resolution, but the horizontal resolution of the saturation component is 1 / 4 of the horizontal resolution of the luminance component. In this case, predSizeW = 4 × nTbW × S_Hor_RecLuma and predSizeH = nTbH × S_Ver_RecLuma. For YUV420 format video, the horizontal resolution of the saturation component is half the horizontal resolution of the luminance component, and the vertical resolution of the saturation component is half the vertical resolution of the luminance component. In this case, predSizeW = 2 × nTbW × S_Hor_RecLuma and predSizeH = 2 × nTbH × S_Ver_RecLuma.

[0270] For example, assuming that the horizontal upsampling rate S_Hor_RecLuma of the reconstructed luminance information is abbreviated as upHor, and the vertical upsampling rate S_Ver_RecLuma of the reconstructed luminance information is abbreviated as upVer, then upsampling filtering is performed on the reconstructed luminance information recY to generate the input reconstructed luminance information in_recY. An example of the interpolation process is as follows.

[0271] First, the upper part Teruki The degree sample refY_T is filled into the row in_recY[x][-1] above the reconstructed luminance information to be input, and the left side is used as a reference. Teruki The degree sample refY_L is populated into the leftmost column of the reconstructed luminance information to be input, in_recY[-1][y]. x=0, …, predSizeW-1 and y=0, …, predSizeH-1. In this case, recY is populated into the corresponding position ((x+1)×upHor-1,(y+1)×upVer-1) in in_recY based on the following formula.

number

[0272] It can be understood as follows: in_recY is evenly divided into recSizeW × recSizeH subblocks, and the position to be filled is the lower right corner of each subblock. Referring to Figure 12, predSizeW = 8, predSizeH = 8, and the current block size is 4 × 4 as an example, the shaded area is the upper part. Teruki The degree sample is refY_T, and the one colored with vertical lines is the left side of the sample. Teruki The degree sample refY_L represents the position where the reconstructed luminance information recY of the current block is filled in the grid.

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

number

number

[0274] This process can be seen in Figure 13. As an example, when performing horizontal upsampling, with predSizeW=8, predSizeH=8, and the current block size being 4x4, the samples corresponding to the horizontal positions where rec_Y is filled among the reference luminance samples refY_L on the left are also used as reference samples for upsampling, and these are shown by being colored in a grid. In this case, all the samples colored in the grid become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of colored samples in the horizontal grid are represented by colored horizontal lines.

[0275] Upsampling is performed by linear interpolation. That is, the value of each interpolated sample (colored with horizontal lines) between two reference luminance samples (colored with a grid) for upsampling is the weighted average value of the two reference luminance samples for upsampling. According to equations 18 and 19, 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. Thus, when interpolating horizontally, the weight is related only to the horizontal upsampling rate upHor. Figure 14 shows an example of weights. In this example, upHor=4. For the first interpolated sample in Figure 14, 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 14, 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 14, 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.

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

number

number

[0277] This process can be seen in Figure 15. As an example, with predSizeW=8, predSizeH=8, and the current block size being 4x4, after completing the horizontal upsampling shown in Figure 13, all existing samples in the upper reference luminance samples refY_T and in_recY are used as reference samples for vertical upsampling and are shown as a grid. In this case, all samples colored in the grid become reference samples for upsampling, and the predicted samples obtained by linear interpolation between each pair of grid-colored samples in the vertical direction are represented by the horizontal lines.

[0278] Upsampling is performed by linear interpolation. According to equations 20 and 21, 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. Thus, when performing vertical interpolation, the weight is related only to the vertical upsampling rate upVer.

[0279] Thus, the final in_recY can be obtained through the above process. Regarding the above interpolation process, in addition to using the "first horizontal, then vertical" upsampling method, the "first vertical, then horizontal" upsampling method can also be used. Furthermore, the final input reconstructed luminance value in_recY can also be obtained by averaging the reconstructed luminance value obtained by the "first horizontal, then vertical" upsampling method with the reconstructed luminance value obtained by the "first vertical, then horizontal" upsampling method. Alternatively, a convolution operation in a neural network can be used instead of the upsampling operation. The embodiments of this application do not impose any limitations on this.

[0280] Thus, the final acquired target information may include reference saturation information refC, whose number is inSize, reference luminance information refY, whose number is inSize, and reconstructed luminance information recY within the current block.

[0281] JPEG0007875984000057.jpg107168

[0282] In one specific embodiment, after obtaining reconstructed luminance information, the method may further include the following, as shown in Figure 16.

[0283] S1601: For each sample awaiting prediction at each brightness position, a brightness difference vector is constructed using the reference saturation information, reference brightness information included in the target information, and the reconstructed brightness information of the current block.

[0284] JPEG0007875984000058.jpg33169

number

[0285] Furthermore, under certain conditions, linear or nonlinear numerical processing can be performed on the luminance difference vectors of samples awaiting prediction. For example, the values ​​of the luminance difference vectors of samples awaiting prediction can be scaled based on a control parameter S within the core parameters.

[0286] S1602: For each sample awaiting prediction at each brightness position, a weight vector is calculated using a nonlinear function based on the brightness difference vector.

[0287] JPEG0007875984000061.jpg62169

[0288] JPEG0007875984000062.jpg35169

number

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

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

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

number

[0292] S1603: For each luminance position, a weighted calculation is performed on the pending samples based on the weight vector and the reference saturation information included in the target information to obtain a saturation prediction value.

[0293] JPEG0007875984000067.jpg57166

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

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

number

number

number

number

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

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

Number

Number

[0298] S1604: For the samples waiting for prediction at each luminance position, improve the calculated chroma prediction value to determine the first prediction block of the current block.

[0299] JPEG0007875984000076.jpg70168

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

Number

Number

Number

[0301] S905: Perform down - sampling filtering on the calculated first prediction block to determine the second prediction block of the current block. The chroma components of the second prediction block and the current block have the same spatial resolution.

[0302] Furthermore, for S905, saturation prediction is performed on the reconstructed luminance information at each position within the current block to ultimately obtain a first predicted block with size predSizeW × predSizeH. In this case, since the size of the first predicted block is greater than or equal to the size of the current block, it is necessary to perform downsampling filtering on the first predicted block to restore it to the same size as the current block.

[0303] First, the horizontal downsampling factor downHor is calculated based on the width of the first predicted block (predSizeW) and the width of the current block (nTbW). Similarly, the vertical downsampling factor downVer is calculated based on the height of the first predicted block (predSizeH) and the height of the current block (nTbH). The calculation method is as follows:

number

number

[0304] Next, depending on the situation, downsampling filtering is performed on the first prediction block predWcp, and the sampled values ​​are populated into the second prediction block predSamples.

[0305] (i) If downHor is greater than 1 and downVer is equal to 1, downsampling filtering should be performed only in the horizontal direction. The specific calculation formula is as follows:

number

[0306] (ii) If downHor is equal to 1 and downVer is greater than 1, downsampling should be performed only in the vertical direction. The specific calculation formula is as follows:

number

[0307] (iii) If both downHor and downVer are greater than 1, downsampling must be performed in both the horizontal and vertical directions. The specific calculation formula is as follows:

number

[0308] (iv) If both downHor and downVer are equal to 1, it is not necessary to downsample in both the horizontal and vertical directions. The specific calculation formula is as follows:

number

[0309] S906: Post-processing is performed on the saturation prediction value of the second prediction block to determine the target prediction block for the current block.

[0310] Furthermore, for S906, after outputting saturation prediction values ​​(predWcp) based on WCP, under certain conditions, post-processing is required to obtain the final saturation prediction values ​​(predSamples). Under conditions other than those mentioned above, the final saturation prediction values ​​predSamples are predWcp.

[0311] For example, in WCP, to reduce instability caused by parallel prediction for each sample, smoothing filtering can be applied to predWcp, and the smoothed and filtered values ​​can be used as the final saturation prediction values ​​predSamples. Alternatively, 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 values ​​being the final saturation prediction values ​​predSamples. Alternatively, to further improve the accuracy of WCP predictions, weighted fusion can be performed on saturation predictions calculated in other saturation prediction modes and saturation predictions predWcp calculated in WCP, and the fusion result can be used as the final saturation prediction values ​​predSamples. For example, the saturation predictions obtained by prediction in CCLM mode and the saturation predictions predWcp calculated in WCP can be weighted equally or unevenly, and the weighted result can be used as the final saturation prediction values ​​predSamples. Alternatively, to improve the prediction performance of WCP, a neural network model may be used to improve the prediction output predWcp in WCP. No limitations are made in the embodiments of this application.

[0312] Furthermore, in the embodiments of this application, in order to ensure no loss of luminance information when performing saturation prediction, downsampling filtering is not performed on the reference luminance information and the currently reconstructed luminance information; instead, the luminance is left as is or upsampled. Next, the absolute value of the difference between the currently reconstructed luminance information and the reference luminance information for each luminance sample is calculated, and a nonlinear mapping is performed on the absolute value of this difference to obtain the weight of each reference saturation sample. All reference saturation samples are then weighted to obtain the predicted values ​​of the collated saturation samples. Thus, since the number of saturation samples that need to be predicted is the same as the number of luminance samples in the currently reconstructed luminance region, it is necessary to perform downsampling filtering on the saturation prediction block to restore it to the same size as the original saturation block. This ensures the accuracy of the existing luminance information, and accurate luminance information is advantageous in improving the accuracy and stability of the nonlinear mapping model, thereby improving the accuracy of the saturation prediction values.

[0313] To reduce computational complexity, upsampling filtering can be omitted from the currently reconstructed luminance information, and instead of predicting colocated chroma samples for the currently reconstructed luminance information at all luminance locations, colocated chroma samples can be predicted for only some luminance locations. Thus, downsampling filtering is not necessarily performed on the chroma prediction block later. In another specific embodiment, as shown in Figure 17, the method may include the following:

[0314] S1701: There is no loss of reconstructed luminance information within the current block.

[0315] S1702: The reconfigured brightness information within the current block is not changed.

[0316] S1703: For samples awaiting prediction at certain brightness locations, a brightness difference vector is constructed using the reference saturation information, reference brightness information, and the reconstructed brightness information of the current block included in the target information.

[0317] S1704: For samples awaiting prediction at certain brightness locations, a weight vector is calculated using a nonlinear function based on the brightness difference vector.

[0318] S1705: For samples awaiting prediction at certain brightness locations, a weighted calculation is performed based on the weight vector and the reference saturation information included in the target information to obtain saturation prediction values.

[0319] S1706: For samples awaiting prediction at certain brightness positions, the calculated saturation prediction values ​​are improved to determine the first prediction block for the current block.

[0320] In the embodiments of this application, the improvement described herein includes clipping.

[0321] Furthermore, in embodiments of this application, it is possible to select some luminance positions and predict a colocated saturation sample. The process is described below.

[0322] (i) To reduce subsequent upsampling or downsampling filtering operations on the saturation prediction block, saturation prediction can be performed by selecting the corresponding position based on the characteristics of the YUV video format. Assuming the current luminance sample position is CurRecLuma(i, j), the sample position for which saturation prediction is required is CurPredChroma(x, y). The coordinate relationship between these two sample positions is as follows: If a video in YUV444 format is shown, then x = i and y = j. If a video in YUV422 format is shown, then x = 2 × i and y = j. If a video in YUV411 format is shown, then x = 4 × i and y = j. If a video in YUV420 format is shown, then x = 2 × i and y = 2 × j.

[0323] (ii) To further reduce the complexity of the calculations during saturation prediction, fewer colocated saturation samples can be selected for prediction. Assuming the current luminance sample location is CurRecLuma(i, j), the location of the sample for which saturation prediction is needed is CurPredChroma(x, y). Assuming the horizontal sampling position factor of the current luminance block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the current luminance sample location and the location of the sample for which saturation prediction is needed is as follows: If a video in YUV444 format / YUV422 format / YUV411 format / YUV420 format is shown, then x = i × S_Pos_Hor and y = j × S_Pos_Ver.

[0324] To further understand, in embodiments of this application, it is possible to employ different downsampling filtering methods depending on the different cases in the embodiments of this application, or, in all cases, i.e., without considering the horizontal downsampling factor and the vertical downsampling factor, the average value of these predicted values ​​can be calculated for each nTbW / predSizeW predicted value or each nTbH / predSizeH predicted value in the direction in which downsampling filtering is required (vertical or horizontal), and this average value can be used as the predicted value after downsampling. Alternatively, the downsampling filtering operation can be replaced with convolution and pooling operations in a neural network model. No limitations are placed on embodiments of this application.

[0325] JPEG0007875984000086.jpg153168

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

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

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

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

[0330] Furthermore, in embodiments of this application, the reference information for the current block may include the values ​​of the first color component sample and the values ​​of the second color component sample within the adjacent region of the current block. These samples can be determined based on encoded samples within 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.

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

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

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

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

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

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

[0337] 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 value of the first color component sample 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. In embodiments of this application, the number of filtered adjacent sample values ​​of the first color component of the current block is greater than the number of first color component sample values.

[0338] In embodiments of this application, the second filtering may be upsampling filtering. The first color component is the luminance component. To ensure that there is no loss of reference luminance information, the reference luminance information may be left unchanged, or upsampling filtering may be performed on the reference luminance information.

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

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

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

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

[0343] In embodiments of this application, the third filtering may be upsampling filtering. The first reference color component is the luminance component. In order to ensure that there is no loss of reconstructed luminance information in the current block and to obtain a more accurate saturation prediction value, the reconstructed luminance information in the current block may be left unchanged, or upsampling filtering may be performed on the reconstructed luminance information in the current block.

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

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

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

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

[0348] That is, upsampling filtering may be performed on the reference luminance information in the adjacent region of the current block while ensuring no loss of luminance information, or on the reconstructed luminance information within the current block, or on both the reference luminance information and the reconstructed luminance information, or even without performing upsampling filtering on both the reference luminance information and the reconstructed luminance information. Next, luminance difference information is determined according to different combinations, and the luminance difference information is used as the reference sample value for the first color component of the current block.

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

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

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

[0352] JPEG0007875984000087.jpg52169

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

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

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

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

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

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

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

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

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

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

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

[0364] JPEG0007875984000088.jpg58168

[0365] JPEG0007875984000089.jpg30168

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

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

[0368] Furthermore, regarding the pre-set mapping, in some embodiments, the pre-set mapping may be a Softmax function, for example, as shown in Equation 6 or Equation 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].

[0369] Furthermore, in addition to the Softmax function, the pre-set mapping in other embodiments 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.

[0370] 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 operation can be simplified, for example, by employing an array element lookup table method to simplify some of the calculation operations. The embodiments of this application are not particularly limited.

[0371] JPEG0007875984000090.jpg39169

[0372] S1803: Determine the first predicted block for 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.

[0373] In this embodiment of the present application, in order to avoid loss of luminance information, chroma prediction is performed for each reconstructed luminance position within the current block, so that the size of the resulting first predicted block is larger than the original size of the current block. That is, the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block.

[0374] 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 the adjacent region of the current block. 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.

[0375] In specific embodiments, the method may further include: 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 ​​of the second color component of the current block; a reference sample value of the second color component of the current block is determined based on the filtered adjacent sample values ​​of the second color component of the current block; in embodiments of the present application, the number of filtered adjacent sample values ​​of 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.

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

[0377] Specifically, the first color component is the luminance component, and the second color component is the chroma component. To ensure that there is no loss of reference luminance information, upsampling filtering can be performed on the reference chroma information. For example, for a current block of 2M × 2N in YUV420 format, the size of the chroma block is M × N, and the number of reference chroma information points in adjacent regions is M + N. After upsampling filtering, 2M + 2N chroma reference sample values ​​are obtained, then 2M × 2N chroma prediction values ​​are obtained using a weighted prediction method, and then downsampling filtering is performed to obtain M × N chroma prediction values ​​to obtain the final prediction value. Note that for a current block of 2M × 2N in YUV420 format, the size of the chroma block is M × N, and the number of reference chroma information points in adjacent regions is M + N. Using only these M + N reference chroma information points, 2M × 2N chroma prediction values ​​are obtained using weighting coefficients, and then downsampling filtering is performed to obtain M × N chroma prediction values ​​to obtain the final prediction value. Furthermore, for a current block of 2M×2N in YUV420 format, the size of the chroma block is M×N, the number of reference chroma information points in adjacent regions is M+N, and after upsampling filtering, 4M+4N chroma reference sample values ​​are obtained. Alternatively, for a current block of 2M×2N in YUV444 format, the size of the chroma block is 2M×2N, the number of reference chroma information points in adjacent regions is 2M×2N, and after upsampling filtering, 4M+4N chroma reference sample values ​​are obtained. Subsequently, based on these chroma reference sample values, M×N chroma prediction values ​​can be obtained as the final prediction values ​​using a weighted prediction and downsampling filtering scheme. No limitations are placed on this in the embodiments of this application.

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

[0379] To make it clear, the spatial resolution of the value of the first color component sample in an adjacent region (i.e., reference luminance information), the spatial resolution of the value of the second color component sample in an adjacent region (i.e., reference saturation 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 an 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.

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

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

[0382] 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 S1803 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.

[0383] 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 kThe 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.

[0384] To further understand, when performing upsampling filtering on both the reference luminance information and reference saturation information within the adjacent region of the current block, the following may be included: Based on the color format information, a second filtering is performed on the values ​​of the first color component samples within the adjacent region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered adjacent sample values ​​for the first color component of the current block. A fourth filtering is performed on the values ​​of the second color component samples within the adjacent region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered adjacent sample values ​​for the second color component of the current block.

[0385] In one possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:0 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.

[0386] In the embodiments of this application, upsampling filtering is performed on the reference luminance information. In this case, there is no loss of luminance information. In this case, since the spatial resolution of the luminance component is always greater than or equal to the spatial resolution of the chroma component in YUV video, it is necessary to perform upsampling filtering on the reference chroma information in order to match the spatial resolution of the reference chroma information with that of the reference luminance information. In this case, it is necessary to determine the spatial upsampling rate of the reference chroma information (second horizontal upsampling factor and second vertical upsampling factor) based on the YUV video format and the spatial upsampling rate of the reference luminance information (first horizontal upsampling factor and first vertical upsampling factor).

[0387] To further understand this, if upsampling filtering is not performed on the reconstructed luminance information within the current block, the size of the first predicted block can be estimated based on the YUV video format. Therefore, in another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then it is determined that the width of the first predicted block is equal to the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, then it is determined that the width of the first predicted block is equal to four times the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:0 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to twice the height of the current block.

[0388] To further understand this, when performing upsampling filtering on the reconstructed luminance information within the current block, it is necessary to estimate the size of the first predicted block based on the YUV video format and the spatial upsampling rate of the luminance of the current block, after performing luminance upsampling on the current block. In this case, the following may be included: Based on the color format information, a third horizontal upsampling factor and a third vertical upsampling factor are used to perform a third filtering on the reconstructed values ​​of the first reference color component samples within the current block to obtain the filtered sample values ​​of the first reference color component samples within the current block.

[0389] In yet another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, then the width of the first predicted block is determined to be equal to the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the width of the first predicted block is determined to be equal to four times the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:0 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to twice the product of the current block height and the third vertical upsampling factor.

[0390] In the embodiments of this application, the width of the first predicted block is represented by predSizeW, and the height of the first predicted block is represented by predSizeH. The width of the current block is represented by nTbW, and the height of the current block is represented by nTbH. Thus, for the first predicted block obtained based on the method described above, predSizeH is greater than or equal to the height of the current block nTbH, or predSizeW is greater than or equal to the width of the current block nTbW. That is, the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block.

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

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

[0393] In the embodiments of this application, the first filtering may be downsampling filtering. In this way, for the second prediction block on which downsampling filtering has been performed, the number of predicted values ​​of 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.

[0394] In one possible embodiment, 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: Using a preset filter, downsampling filtering is performed on the first prediction block to determine the second prediction block for the second color component of the current block.

[0395] Furthermore, in the embodiments of this application, the preset filter may be a downsampling filter. Moreover, the downsampling filter may be a neural network filter. No limitations are placed on this in the embodiments of this application.

[0396] In another possible embodiment, performing a first filtering on the first prediction block to determine the second prediction block for the second color component of the current block may include: determining the horizontal downsampling factor and the vertical downsampling factor; and performing downsampling filtering on the first prediction block based on the horizontal downsampling factor and the vertical downsampling factor to obtain the second prediction block for the second color component of the current block.

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

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

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

[0400] Furthermore, downsampling filtering can be performed on the first filtering by sampling interval, with examples including two-dimensional filters and one-dimensional filters. In the case of a one-dimensional filter, it may be performed "first vertically, then horizontally," or "first horizontally, then vertically," or it may be performed in a fixed filtering order, or it may be performed in a flexible, adjustable filtering order (e.g., a filtering order indicated by identification information, an order associated with a prediction mode or block size). No limitations are placed on this in the embodiments of this application.

[0401] In addition to the above, 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 may further include the following: Based on a horizontal downsampling factor and a vertical downsampling factor, a weighted sum calculation is performed for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions to obtain the second prediction block.

[0402] Here, obtaining a second prediction block involves performing a weighted sum calculation for each predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions. Alternatively, a second prediction block can be obtained by performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of the second color component of the first prediction block in the horizontal direction, or Alternatively, a second prediction block can be obtained by performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction, or A weighted sum calculation is performed for each predicted number of horizontal downsampling factors in the second color component of the first prediction block in the horizontal direction, and a weighted sum calculation is performed for each predicted number of vertical downsampling factors in the second color component of the first prediction block in the vertical direction to obtain the second prediction block. Includes.

[0403] In other words, in the embodiments of this application, without considering the horizontal downsampling factor and the vertical downsampling factor, a weighted sum calculation is performed for each predetermined number of saturation prediction values ​​in the direction in which downsampling is required (vertical or horizontal). In the special case where the weights of each saturation prediction value are equal, performing a weighted sum calculation for each predetermined number of saturation prediction values ​​can be considered as obtaining the average value of these predetermined number of saturation prediction values, and this average value is taken as the prediction value after downsampling filtering.

[0404] Furthermore, in some embodiments, the method may further include: determining weighting coefficients based on reference sample values ​​of the first color component of some samples within the first prediction block; and determining a second prediction block for the second color component of the current block based on the weighting coefficients and reference sample values ​​of the second color component of some samples within the first prediction block.

[0405] In a specific embodiment, determining the second 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 some samples within the first predicted block may include the following: Based on the weighting coefficient, a weighting calculation is performed on the reference sample value for the second color component of the sample at position (i,j) within the first predicted block to obtain the predicted value for the second color component of the sample at position (x,y) within the current block. i, j, x, y These are all integers greater than or equal to 0.

[0406] In this embodiment, upsampling filtering is not performed on the reconstructed luminance information within the current block in order to reduce computational complexity. In this case, instead of predicting collated chroma samples for the reconstructed luminance information at all luminance positions within the current block, it is possible to select some luminance positions and predict collated chroma samples. This eliminates the need to perform downsampling filtering after obtaining the prediction block, ensuring the accuracy of the existing luminance information. Accurate luminance information is advantageous for improving the accuracy and stability of the nonlinear mapping model, and as a result, the accuracy of the chroma prediction values ​​can be improved.

[0407] In this embodiment, to reduce subsequent upsampling or downsampling operations on the prediction block, chroma prediction can be performed by selecting corresponding positions based on the characteristics of the YUV video format. Assuming the current luminance sample position is CurRecLuma(i, j), the sample position for which chroma prediction needs to be performed is CurPredChroma(x, y). In this case, in some embodiments, the method may further include the following: If the color format information indicates 4:4:4 sampling, set x to equal to i and y to equal to j. If the color format information indicates 4:2:2 sampling, set x to be equal to the product of i and 2, and y to be equal to j. If the color format information indicates 4:1:1 sampling, set x to be equal to the product of i and 4, and y to be equal to j. If the color format information indicates 4:2:0 sampling, set x to be equal to the product of i and 2, and y to be equal to the product of j and 2.

[0408] Furthermore, in some embodiments, the method may further include the following: Determining the horizontal sampling position factor and the vertical sampling position factor; setting x to be equal to the product of i and the horizontal sampling position factor, and y to be equal to the product of j and the vertical sampling position factor.

[0409] In other words, to further reduce the complexity of the calculations during prediction, fewer colocated chroma samples can be selected for prediction. Assuming the current luminance sample position is CurRecLuma(i, j), the position of the sample for which chroma prediction needs to be performed is CurPredChroma(x, y). Assuming that the horizontal sampling position factor of the reconstructed luminance information in the current block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the current luminance sample position and the position of the sample for which chroma prediction needs to be performed is as follows. If the color format information indicates video in YUV444 format / YUV422 format / YUV411 format / YUV420 format, x can be set to be equal to the product of i and S_Pos_Hor, and y can be set to be equal to the product of j and S_Pos_Ver.

[0410] Furthermore, after determining the second prediction block, post-processing is performed on the second prediction block under certain conditions to obtain the final second prediction block. Thus, in some embodiments, the method may further include determining the second prediction block of the second color component of the current block, performing related processing on the second prediction block, and making the processed second prediction block the second prediction block.

[0411] In the embodiments of this application, performing related processing on the second prediction block is: Perform a third filter on the second prediction block, The second prediction block is improved using pre-set compensation values, Perform weighted fusion on the second predicted block using the predicted value of the second color component of the current block under at least one prediction mode, It includes at least one of the following.

[0412] Specifically, regarding the processing of the second prediction block, in order to reduce instability caused by parallel prediction for each sample in WCP, smoothing filtering can be performed on the second prediction block, and the smoothed and filtered value can be used as the final saturation prediction value. Alternatively, in order to further improve the accuracy of the WCP prediction value, position-related improvements can be made to the second prediction block. For example, a saturation compensation value can be calculated for each sample awaiting prediction using a reference sample with a nearby spatial position, and the prediction block can be improved using this saturation compensation value, with the improved prediction value being used as the final saturation prediction value. Alternatively, in order to further improve the accuracy of the WCP prediction value, weighted fusion can be performed on the saturation prediction value calculated in WCP and the saturation prediction value calculated in other saturation prediction modes, and the fusion result can be used as the final saturation prediction value. Alternatively, in order to improve the prediction performance of WCP, a neural network model can be used to improve the saturation prediction value calculated in WCP. The embodiments of this application do not impose any limitations thereon.

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

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

[0415] S1902: 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.

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

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

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

[0419] As can be seen from the above, performing saturation prediction using lossless luminance information during prediction in WCP mode mainly involves the following three approaches: On the one hand, it fully utilizes the luminance information of the reference sample and the current block to calculate the weighting coefficient of the saturation of the reference sample. On the other hand, it fully considers the importance of existing luminance information and establishes a more accurate nonlinear mapping model based on not losing luminance information, assigning weights to the reference saturation sample to perform weighted prediction. Furthermore, when performing coordinated saturation prediction based on upsampling the reference saturation and the position of each luminance sample in the current block, it fully considers the characteristics of various YUV video formats and ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match based on the saturation subsampling format and luminance upsampling situation of different YUV videos, and improves the accuracy of saturation prediction values ​​in WCP mode by performing coordinated saturation prediction using full utilization of existing lossless luminance information.

[0420] 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. The number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. Based on the second predicted block, residual values ​​of the second color component samples of the current block are determined. In this way, by utilizing the reference samples adjacent to the current block and the color component information within the current block, a more accurate nonlinear mapping model can be established based on sufficient consideration of existing color component information without compromising luminance information, and weighted prediction can be performed by assigning weights to each reference sample value of the saturation component. Furthermore, the first filtering fully considers different color format information, and sampling filtering of saturation and / or luminance is performed based on different color format information. This ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match, which not only ensures the accuracy of existing luminance information but also improves the accuracy and stability of the nonlinear mapping model based on accurate luminance information when performing saturation component prediction using lossless luminance information, thereby improving the accuracy of saturation prediction, saving bitrate, and further improving coding performance.

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

[0422] 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. In this way, not only is the existing color component information fully considered, but different color format information is also fully considered. As a result, not only is the accuracy of the existing luminance information ensured, but when performing saturation component prediction using lossless luminance information, the accuracy and stability of the nonlinear mapping model can be improved based on accurate luminance information, the accuracy of saturation prediction can be improved, the bitrate can be saved, and coding performance can be further improved.

[0423] In a further embodiment of this application, referring to Figure 20, based on the same inventive idea as the embodiments described above, Figure 20 is a schematic diagram showing the structure of an encoding device 300 according to an embodiment of this application. As shown in Figure 20, 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 prediction block of the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component of the current block, wherein the number of predicted values ​​of the second color component included in the first prediction block is greater than the number of second color component samples included in 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 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.

[0424] In some embodiments, 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.

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

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

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

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

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

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

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

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

[0433] In some embodiments, the first filtering unit 3003 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.

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

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

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

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

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

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

[0440] 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 and the height of the current block.

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

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

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

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

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

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

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

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

[0449] In some embodiments, the first filtering unit 3003 further Using the first horizontal upsampling factor and the first vertical upsampling factor, a second filtering is performed on the values ​​of the first color component samples in the adjacent region of the current block to obtain the filtered adjacent sample values ​​of the first color component of the current block. The system is configured to perform a fourth filtering on the values ​​of the second color component samples within the adjacent region of the current block, using a second horizontal upsampling factor and a second vertical upsampling factor, in order to obtain filtered adjacent sample values ​​of the second color component of the current block. The first confirmed unit 3001 further, If the color format information indicates 4:4:4 sampling, then it is determined that the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then it is determined that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. The system is configured such that, when the color format information indicates 4:2:0 sampling, the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.

[0450] In some embodiments, the first confirmation unit 3001 further If the color format information indicates 4:4:4 sampling, then it is determined that the width of the first predicted block is equal to the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, then it is determined that the width of the first predicted block is equal to four times the width of the current block, and the height of the first predicted block is equal to the height of the current block. The system is configured such that, when the color format information indicates 4:2:0 sampling, the width of the first predicted block is determined to be equal to twice the width of the current block, and the height of the first predicted block is determined to be equal to twice the height of the current block.

[0451] In some embodiments, the first filtering unit 3003 further The system is configured to use a third horizontal upsampling factor and a third vertical upsampling factor to perform a third filtering on the reconstructed value of the first reference color component sample in the current block, thereby obtaining the filtered sample value of the first reference color component sample in the current block. The first confirmed unit 3001 further, If the color format information indicates 4:4:4 sampling, then the width of the first predicted block is determined to be equal to the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the width of the first predicted block is determined to be equal to four times the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. When the color format information indicates 4:2:0 sampling, the system is configured such that the width of the first predicted block is equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is equal to twice the product of the current block height and the third vertical upsampling factor.

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

[0453] In some embodiments, the first filtering is downsampling filtering.

[0454] In some embodiments, the first filtering unit 3003 is further configured to perform downsampling filtering on the first prediction block using a preset filter to determine the second prediction block for the second color component of the current block.

[0455] In some embodiments, the first filtering unit 3003 further Determine the horizontal downsampling factor and the vertical downsampling factor. The system is configured to perform downsampling filtering on the first prediction block based on horizontal and vertical downsampling factors to obtain a second prediction block for the second color component of the current block.

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

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

[0458] In some embodiments, the first filtering unit 3003 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions, based on horizontal downsampling factors and vertical downsampling factors.

[0459] In some embodiments, the first filtering unit 3003 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors in the second color component of the first prediction block in the horizontal direction.

[0460] In some embodiments, the first filtering unit 3003 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction.

[0461] In some embodiments, the first filtering unit 3003 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted number of horizontal downsampling factors for the second color component of the first prediction block in the horizontal direction, and then performing a weighted sum calculation for each predicted number of vertical downsampling factors for the second color component of the first prediction block in the vertical direction.

[0462] In some embodiments, the first filtering unit 3003 further Based on the reference sample values ​​of the first color component of some samples within the first prediction block, the weighting coefficients are determined. The system is configured to determine the second predicted block for the second color component of the current block based on a weighting coefficient and the reference sample values ​​of the second color component of some samples within the first predicted block.

[0463] In some embodiments, the first filtering unit 3003 is further configured to perform a weighting calculation on the reference sample value of the second color component of the sample at position (i,j) in the first prediction block based on weighting coefficients, in order to obtain a predicted value of the second color component of the sample at position (x,y) in the current block. i, j, x, y These are all integers greater than or equal to 0.

[0464] In some embodiments, the first confirmation unit 3001 further If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j. If the color format information indicates 4:2:2 sampling, set x to be equal to the product of i and 2, and y to be equal to j. If the color format information indicates 4:1:1 sampling, set x to be equal to the product of i and 4, and y to be equal to j. If the color format information indicates 4:2:0 sampling, it is configured to set x to equal the product of i and 2, and y to equal the product of j and 2.

[0465] In some embodiments, the first confirmation unit 3001 further Determine the horizontal sampling position factor and the vertical sampling position factor. The system is configured such that x is equal to the product of i and the horizontal sampling position factor, and y is equal to the product of j and the vertical sampling position factor.

[0466] In some embodiments, the first filtering unit 3003 further The system is configured to determine the second prediction block for the second color component of the current block, then perform related processing on the second prediction block, and finally designate the processed second prediction block as the second prediction block. Performing related processing on the second prediction block is: Perform a third filter on the second prediction block, The second prediction block is improved using pre-set compensation values, Perform weighted fusion on the second predicted block using the predicted value of the second color component of the current block under at least one prediction mode, It includes at least one of the following.

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

[0468] In some embodiments, referring to Figure 20, 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.

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

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

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

[0472] Referring to Figure 21, based on the configuration of the encoding device 300 and the computer-readable storage medium described above, Figure 21 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 21, 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 21, 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. Based on the weighting coefficients and the reference sample values ​​for the second color component of the current block, the first predicted block for the second color component of the current block is determined. The number of predicted values ​​for the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. The first prediction block is subjected to the first filtering process to determine the second prediction block for the second color component of the current block. Based on the second prediction block, the residual value of the second color component sample of the current block is determined.

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

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

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

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

[0477] This embodiment provides an encoding device. The encoding device may further include the encoding apparatus 300 described in any one of the embodiments described above. The encoding apparatus not only fully considers existing color component information but also fully considers different color format information. This ensures the accuracy of existing luminance information, and when performing saturation component prediction using lossless luminance information, it is possible to improve the accuracy and stability of the nonlinear mapping model based on accurate luminance information, improve the accuracy of saturation prediction, save bitrate, and further improve coding performance.

[0478] 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 a decoding device 320 according to an embodiment of the present application. As shown in Figure 22, 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 3202 is configured to determine a first prediction block of the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component of the current block, wherein the number of predicted values ​​of the second color component included in the first prediction block is greater than the number of second color component samples included in 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 confirmation unit 3201 is further configured to confirm the reconstruction value of the second color component sample of the current block based on the second prediction block.

[0479] In some embodiments, 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0504] In some embodiments, the second filtering unit 3203 further Using the first horizontal upsampling factor and the first vertical upsampling factor, a second filtering is performed on the values ​​of the first color component samples in the adjacent region of the current block to obtain the filtered adjacent sample values ​​of the first color component of the current block. The system is configured to perform a fourth filtering on the values ​​of the second color component samples within the adjacent region of the current block, using a second horizontal upsampling factor and a second vertical upsampling factor, in order to obtain filtered adjacent sample values ​​of the second color component of the current block. The second confirmed unit 3201 further, If the color format information indicates 4:4:4 sampling, then it is determined that the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then it is determined that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. The system is configured such that, when the color format information indicates 4:2:0 sampling, the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.

[0505] In some embodiments, the second determinative unit 3201 further If the color format information indicates 4:4:4 sampling, then it is determined that the width of the first predicted block is equal to the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, then it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, then it is determined that the width of the first predicted block is equal to four times the width of the current block, and the height of the first predicted block is equal to the height of the current block. The system is configured such that, when the color format information indicates 4:2:0 sampling, the width of the first predicted block is determined to be equal to twice the width of the current block, and the height of the first predicted block is determined to be equal to twice the height of the current block.

[0506] In some embodiments, the second filtering unit 3203 further The system is configured to use a third horizontal upsampling factor and a third vertical upsampling factor to perform a third filtering on the reconstructed value of the first reference color component sample in the current block, thereby obtaining the filtered sample value of the first reference color component sample in the current block. The second confirmed unit 3201 further, If the color format information indicates 4:4:4 sampling, then the width of the first predicted block is determined to be equal to the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then the width of the first predicted block is determined to be equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, then the width of the first predicted block is determined to be equal to four times the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is determined to be equal to the product of the current block height and the third vertical upsampling factor. When the color format information indicates 4:2:0 sampling, the system is configured such that the width of the first predicted block is equal to twice the product of the current block width and the third horizontal upsampling factor, and the height of the first predicted block is equal to twice the product of the current block height and the third vertical upsampling factor.

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

[0508] In some embodiments, the first filtering is downsampling filtering.

[0509] In some embodiments, the second filtering unit 3203 is further configured to perform downsampling filtering on the first prediction block using a preset filter to determine the second prediction block for the second color component of the current block.

[0510] In some embodiments, the second filtering unit 3203 further Determine the horizontal downsampling factor and the vertical downsampling factor. The system is configured to perform downsampling filtering on the first prediction block based on horizontal and vertical downsampling factors to obtain a second prediction block for the second color component of the current block.

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

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

[0513] In some embodiments, the second filtering unit 3203 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions, based on horizontal downsampling factors and vertical downsampling factors.

[0514] In some embodiments, the second filtering unit 3203 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors in the second color component of the first prediction block in the horizontal direction.

[0515] In some embodiments, the second filtering unit 3203 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction.

[0516] In some embodiments, the second filtering unit 3203 further The system is configured to obtain a second prediction block by performing a weighted sum calculation for each predicted number of horizontal downsampling factors for the second color component of the first prediction block in the horizontal direction, and then performing a weighted sum calculation for each predicted number of vertical downsampling factors for the second color component of the first prediction block in the vertical direction.

[0517] In some embodiments, the second filtering unit 3203 further Based on the reference sample values ​​of the first color component of some samples within the first prediction block, the weighting coefficients are determined. The system is configured to determine the second predicted block for the second color component of the current block based on a weighting coefficient and the reference sample values ​​of the second color component of some samples within the first predicted block.

[0518] In some embodiments, the second filtering unit 3203 is further configured to perform a weighting calculation on the reference sample value of the second color component of the sample at position (i,j) in the first prediction block based on weighting coefficients, in order to obtain a predicted value of the second color component of the sample at position (x,y) in the current block. i, j, x, y These are all integers greater than or equal to 0.

[0519] In some embodiments, the second determinative unit 3201 further If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j. If the color format information indicates 4:2:2 sampling, set x to be equal to the product of i and 2, and y to be equal to j. If the color format information indicates 4:1:1 sampling, set x to be equal to the product of i and 4, and y to be equal to j. If the color format information indicates 4:2:0 sampling, it is configured to set x to equal the product of i and 2, and y to equal the product of j and 2.

[0520] In some embodiments, the second determinative unit 3201 further Determine the horizontal sampling position factor and the vertical sampling position factor. The system is configured such that x is equal to the product of i and the horizontal sampling position factor, and y is equal to the product of j and the vertical sampling position factor.

[0521] In some embodiments, the second filtering unit 3203 further The system is configured to determine the second prediction block for the second color component of the current block, then perform related processing on the second prediction block, and finally designate the processed second prediction block as the second prediction block. Performing related processing on the second prediction block is: Perform a third filter on the second prediction block, The second prediction block is improved using pre-set compensation values, Perform weighted fusion on the second predicted block using the predicted value of the second color component of the current block under at least one prediction mode, It includes at least one of the following.

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

[0523] In some embodiments, referring to Figure 22, 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.

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

[0525] 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 the decoder 320. A computer program is stored in this computer-readable storage medium. When the computer program is executed by the second processor, the method described in any one of the above embodiments is performed.

[0526] Referring to Figure 23, based on the configuration of the decoding device 320 and the computer-readable storage medium described above, Figure 23 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 23, 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 23, 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 values ​​for the second color component of the current block, the first predicted block for the second color component of the current block is determined. The number of predicted values ​​for the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. The first prediction block is subjected to the first filtering process to determine the second prediction block for the second color component of the current block. Based on the second prediction block, the reconstruction value of the second color component sample of the current block is determined.

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

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

[0529] This embodiment provides a decoding device. The decoding device may further include the decoding apparatus 320 described in the above embodiment. The decoding apparatus not only fully considers existing color component information but also fully considers different color format information. This ensures the accuracy of existing luminance information, and when performing saturation component prediction using lossless luminance information, it is possible to improve the accuracy and stability of the nonlinear mapping model based on accurate luminance information, improve the accuracy of saturation prediction, save bitrate, and further improve coding performance.

[0530] Referring to Figure 24, in a further embodiment of this application, Figure 24 is a schematic diagram showing the structure of a coding system according to an embodiment of this application. As shown in Figure 24, 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.

[0531] In the embodiments of this application, the coding system 340 fully considers existing color component information and different color format information in either the encoder 3401 or the decoder 3402. This not only ensures the accuracy of existing luminance information, but also improves the accuracy and stability of the nonlinear mapping model based on accurate luminance information when performing saturation component prediction using lossless luminance information, thereby improving the accuracy of saturation prediction, saving bitrate, and further improving coding performance.

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

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

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

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

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

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

[0538] 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, the first predicted block of the second color component of the current block is determined. The number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. 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. 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 predicted 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 predicted block and the residual value obtained by decoding. In this way, by utilizing the reference samples adjacent to the current block and the color component information within the current block, a more accurate nonlinear mapping model can be established based on not only sufficient consideration of existing color component information but also without loss of luminance information, and weighted prediction can be performed by assigning weights to each reference sample value of the saturation component. Furthermore, the first filtering fully considers different color format information and performs sampling filtering of saturation and / or luminance based on different color format information. This ensures that the spatial resolution of the saturation component and the spatial resolution of the luminance component always match, ensuring the accuracy of existing luminance information, and when performing saturation component prediction using lossless luminance information, the accuracy and stability of the nonlinear mapping model can be improved based on accurate luminance information, improving the accuracy 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 such that the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of 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, and based on the reconstruction value of the first reference color component sample in 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, Based on the value of the second color component sample in the adjacent region of the current block, the reference sample value of the second color component of the current block is determined. A fourth filtering is performed on the values ​​of the second color component samples in the adjacent region of the current block to obtain the filtered adjacent sample values ​​of the second color component of the current block. Based on the filtered adjacent sample values ​​of the second color component of the current block, the reference sample value of the second color component of the current block is determined. It is further structured in the following way: The decoding device according to feature 1.

4. 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. The decoding device according to feature 3.

5. The aforementioned processor, If the color format information indicates 4:2:0 sampling, the system is further configured to perform a fourth filtering on the value of the second color component sample in the adjacent region of the current block to obtain the filtered adjacent sample value of the second color component of the current block. The fourth filtering described above is upsampling filtering, and the upsampling rate is a positive integer multiple of 2. The decoding device according to feature 3.

6. The aforementioned processor, Using a first horizontal upsampling factor and a first vertical upsampling factor, a second filtering is performed on the values ​​of the first color component samples in the adjacent region of the current block to obtain filtered adjacent sample values ​​of the first color component of the current block. Using a second horizontal upsampling factor and a second vertical upsampling factor, 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 ​​of the second color component of the current block. If the color format information indicates 4:4:4 sampling, then it is determined that the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates a 4:1:1 sampling ratio, then it is determined that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:0 sampling, then it is determined that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor. It is further structured in the following way: The decoding device according to feature 3.

7. The aforementioned processor, If the color format information indicates 4:4:4 sampling, it is determined that the width of the first predicted block is equal to the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates a 4:1:1 sampling ratio, it is determined that the width of the first predicted block is equal to four times the width of the current block, and the height of the first predicted block is equal to the height of the current block. If the color format information indicates 4:2:0 sampling, it is determined that the width of the first predicted block is equal to twice the width of the current block, and the height of the first predicted block is equal to twice the height of the current block. It is further structured in the following way: The decoding device according to feature 2.

8. The first filtering described above is downsampling filtering, 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, The system is configured to perform downsampling filtering on the first prediction block using a pre-configured filter to determine the second prediction block for the second color component of the current block. The decoding device according to feature 1.

9. The processor is configured to perform the first filtering on the first prediction block to determine the second prediction block of the second color component of the current block, wherein the first filtering is downsampling filtering, Determine the horizontal downsampling factor and the vertical downsampling factor. Based on the horizontal downsampling factor and the vertical downsampling factor, downsampling filtering is performed on the first prediction block to obtain a second prediction block of the second color component of the current block. It is structured in such a way. The decoding device according to feature 1.

10. The processor, configured to perform downsampling filtering on the first prediction block based on the horizontal downsampling factor and the vertical downsampling factor, to obtain a second prediction block of the second color component of the current block, The system is configured such that if the horizontal downsampling factor is greater than 1, or if the vertical downsampling factor is greater than 1, downsampling filtering is performed on the first prediction block to obtain the second prediction block. The decoding device according to feature 9.

11. The processor configured to perform downsampling filtering on the first prediction block, Performing horizontal downsampling filtering on the first prediction block, Performing vertical downsampling filtering on the first prediction block, Performing horizontal downsampling filtering on the first prediction block, followed by vertical downsampling filtering, Performing vertical downsampling filtering on the first prediction block, followed by horizontal downsampling filtering, Configured to perform at least one of the following: The decoding device according to feature 10.

12. 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 horizontal downsampling factor and the vertical downsampling factor, a weighted sum calculation is performed for each predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions to obtain the second prediction block. The decoding device according to feature 9.

13. The processor, configured to obtain the second prediction block by performing a weighted sum calculation for each of a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions, The system is configured to obtain the second prediction block by performing a weighted sum calculation on the second color component of the first prediction block in the horizontal direction, for each predicted value of the number of horizontal downsampling factors. The decoding device according to feature 12.

14. The processor, configured to obtain the second prediction block by performing a weighted sum calculation for each of a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions, The system is configured to obtain the second prediction block by performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction. The decoding device according to feature 12.

15. The processor, configured to obtain the second prediction block by performing a weighted sum calculation for each of a predetermined number of predicted values ​​of the second color component of the first prediction block in the horizontal and / or vertical directions, The system is configured to obtain the second prediction block by performing a weighted sum calculation for each predicted number of horizontal downsampling factors on the second color component of the first prediction block in the horizontal direction, and by performing a weighted sum calculation for each predicted number of vertical downsampling factors on the second color component of the first prediction block in the vertical direction. The decoding device according to feature 12.

16. The aforementioned processor, Based on the reference sample values ​​of the first color component of some samples within the first prediction block, the weighting coefficients are determined. Based on the weighting coefficient and the reference sample value of the second color component of some samples within the first prediction block, the second prediction block of the second color component of the current block is determined. Determining the second 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 some samples within the first predicted block is: This includes performing a weighting calculation on the reference sample value of the second color component of the sample at position (i, j) within the first prediction block based on the weighting coefficients, and obtaining a predicted value of the second color component of the sample at position (x, y) within the current block. i, j, x, and y are all non-negative integers. The decoding device according to feature 1.

17. The aforementioned processor, If the color format information indicates 4:4:4 sampling, set x to equal to i and y to equal to j. If the color format information indicates 4:2:2 sampling, set x to be equal to the product of i and 2, and y to be equal to j. If the color format information indicates 4:1:1 sampling, set x to be equal to the product of i and 4, and y to be equal to j. If the color format information indicates 4:2:0 sampling, set x to be equal to the product of i and 2, and y to be equal to the product of j and 2. It is further structured in the following way: The decoding device according to feature 16.

18. The aforementioned processor, Determine the horizontal sampling position factor and the vertical sampling position factor. The system is configured such that x is equal to the product of i and the horizontal sampling position factor, and y is equal to the product of j and the vertical sampling position factor. The decoding device according to feature 16.

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 such that the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of 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 such that the number of predicted values ​​of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Performing a first filter on the first prediction block to determine the second prediction block of the second color component of 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.