Encoding / Decoding Method and Apparatus, Encoding Device, Decoding Device, and Storage Medium

By improving the color component prediction method in H.266/VVC, the problem of large deviation between the predicted value and the original value is solved, and higher prediction accuracy and coding performance are achieved.

JP2025513048AActive Publication Date: 2025-04-22GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2024560298
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2025-04-22
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

The intercolor component prediction technology of H.266/VVC leads to a large deviation between the predicted value of the encoding block and the original value, resulting in a decrease in prediction accuracy, a decrease in decoded video quality and a weakened encoding performance.

Method used

By determining the reference information of the current block, information filtering is performed to obtain the target information, a weighting factor of the color component is calculated, and the second color component of the current block is predicted based on the factor and the reference sample value, and the reconstruction value is then determined.

Benefits of technology

Improves the accuracy of color prediction, reduces the bit rate, and improves encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025513048000001_ABST
    Figure 2025513048000001_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an encoding and decoding method and its device, encoding device, decoding device, and storage medium, the method includes: determining reference information of a current block; performing a filtering process on a part of the reference information of the current block to determine target information of the current block; determining a weighting coefficient according to a reference sample value of a first color component in the target information; determining a predicted block of a second color component of the current block according to the weighting coefficient and the reference sample value of a second color component in the target information; and determining a reconstructed value of a sample point of a second color component of the current block according to the predicted block. In this way, the accuracy of chrominance prediction can be improved, and the bit rate can be saved, as well as the encoding and decoding performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to the field of video encoding and decoding technology, and in particular to an encoding and decoding method and apparatus, an encoding device, a decoding device, and a storage medium. [Background technology]

[0002] As people's demands for video display quality increase, new video application forms such as high definition and ultra-high definition video are emerging. The Joint Video Exploration Team (JVET) of the International Organization for Standardization (ISO / IEC) and ITU-T has developed the next-generation video coding standard H.266 / Versatile Video Coding (VVC).

[0003] H.266 / VVC includes an inter-color component prediction technique. However, there is a large deviation between the predicted value of the coding block calculated by the inter-color component prediction technique of H.266 / VVC and the original value, which causes a decrease in prediction accuracy, degrading the quality of the decoded video and degrading the coding performance. Summary of the Invention [Problem to be solved by the invention]

[0004] The embodiments of the present application provide an encoding / decoding method and apparatus, an encoding device, a decoding device, and a storage medium, which can improve the accuracy of chromaticity prediction, save bit rate, and improve encoding / decoding performance. [Means for solving the problem]

[0005] The technical solutions of the embodiments of the present application can be realized as follows.

[0006] According to a first aspect, an embodiment of the present application provides a decoding method, the method comprising: Determining a reference for a current block; Performing a filtering process on a portion of the reference information of the current block to determine target information of the current block; determining a weighting coefficient based on a reference sample value of a first color component in the target information; determining a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; determining, based on the predicted block, reconstructed values ​​of the second color component sample points of the current block.

[0007] According to a second aspect, an embodiment of the present application provides an encoding method, the encoding method comprising: Determining a reference for a current block; Performing a filtering process on a portion of the reference information of the current block to determine target information of the current block; determining a weighting coefficient based on a reference sample value of a first color component in the target information; determining a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; determining a predicted difference value of the second color component sample point of the current block based on the predicted block.

[0008] According to a third aspect, an embodiment of the present application provides an encoding device, comprising a first determining unit, a first filtering unit, and a first predicting unit, wherein: The first determining unit is configured to determine reference information of a current block; The first filtering unit is configured to perform a filtering process on a portion of information in the reference information of the current block to determine target information of the current block; The first determining unit is further configured to determine the weighting coefficient based on a reference sample value of the first color component in the target information; The first prediction unit is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; The first determining unit is further configured to determine, based on the predicted block, a predicted difference value of a second color component sample point of the current block.

[0009] According to a fourth aspect, an embodiment of the present application provides an encoding device comprising a first memory and a first processor, wherein: the first memory is configured to store a computer program executable by the first processor; The first processor is configured to execute a computer program to perform the method according to the second aspect.

[0010] According to a fifth aspect, an embodiment of the present application provides a decoding device, comprising: a second determining unit, a second filtering unit, and a second predicting unit, wherein: The second determining unit is configured to determine reference information of the current block; The second filtering unit is configured to perform a filtering process on a portion of information of the reference information of the current block to determine target information of the current block; The second determining unit is further configured to determine the weighting coefficient based on the reference sample value of the first color component in the target information; The second prediction unit is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; The second determining unit is further configured to determine, based on the predicted block, a reconstructed value of the second color component sample point of the current block.

[0011] According to a sixth aspect, an embodiment of the present application provides a decoding device comprising a second memory and a second processor, wherein: the second memory is configured to store a computer program executable by the second processor; The second processor is configured to execute a computer program to perform the method according to the first aspect.

[0012] According to a seventh aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program for executing the method according to the first aspect or the method according to the second aspect. Effect of the Invention

[0013] The embodiment of the present application provides an encoding / decoding method and its device, an encoding device, a decoding device, and a storage medium, and whether the encoding side or the decoding side determines reference information of a current block, performs a filtering process on a part of the reference information of the current block, determines target information of the current block, determines a weighting coefficient based on the reference sample value of the first color component in the target information, and determines a 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 in the target information. In this way, the encoding side can determine a predicted difference value of the second color component sample point of the current block based on the predicted block, and the decoding side can determine a reconstructed value of the second color component sample point of the current block based on the predicted block. In this way, the characteristics of the color format information are fully taken into account for the color component information in the adjacent area of ​​the current block and the color component information in the current block, so that the accuracy of these reference information can be improved. In addition, by performing filtering processes such as upsampling and downsampling on the reference information, it is possible to strengthen the continuity of the spatial correlation to a certain extent or to remove some information with relatively weak spatial correlation. By using the target information obtained after the filtering process, it is possible to perform more appropriate chromaticity prediction, thereby improving the accuracy of chromaticity prediction, saving bitrates, and improving encoding and decoding performance. [Brief description of the drawings]

[0014] [Figure 1]FIG. 1 is a schematic diagram of the distribution of effective adjacent regions. [Diagram 2] FIG. 1 is a schematic diagram of the distribution of selected regions in different prediction modes. [Diagram 3] 1 is an exemplary flowchart of a method for deriving model parameters. [Figure 4A] FIG. 2 is a schematic block diagram of an encoder configuration according to an embodiment of the present application; [Figure 4B] FIG. 2 is a schematic block diagram of a decoder configuration according to an embodiment of the present application; [Diagram 5] 1 is an exemplary flowchart 1 of a decoding method according to an embodiment of the present application; [Figure 6] FIG. 1 is a schematic diagram of a reference area of ​​a current block according to an embodiment of the present application; [Figure 7A] FIG. 13 is a schematic diagram of downsampling positions of reference luminance information according to an embodiment of the present application; [Figure 7B] FIG. 13 is a schematic diagram of upsampling positions of reference chromaticity information according to an embodiment of the present application; [Figure 8] FIG. 13 is a schematic diagram of a relocation position of reference luminance information according to an embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of weighted prediction for WCP mode and other prediction modes according to an embodiment of the present application; [Figure 10] FIG. 1 is a schematic diagram of a weight-based chromaticity prediction framework according to an embodiment of the present application; [Figure 11] 2 is an exemplary flow chart 2 of a decoding method according to an embodiment of the present application; [Figure 12] FIG. 1 is a schematic diagram of an upsampling interpolation process according to an embodiment of the present application; [Figure 13] FIG. 2 is a schematic diagram of an upsampling interpolation process according to an embodiment of the present application; [Figure 14] FIG. 2 is a schematic diagram of weight values ​​of upsampling interpolation according to an embodiment of the present application; [Figure 15] FIG. 3 is a schematic diagram of an upsampling interpolation process according to an embodiment of the present application; [Figure 16]3 is an exemplary flowchart 3 of a decoding method according to an embodiment of the present application; [Figure 17] FIG. 2 is a schematic diagram of a reference area of ​​a current block according to an embodiment of the present application; [Figure 18] 1 is an exemplary flowchart 1 of an encoding method according to an embodiment of the present application; [Figure 19] 2 is an exemplary flowchart 2 of an encoding method according to an embodiment of the present application; [Figure 20] FIG. 2 is an exemplary structural diagram of an encoding device configuration according to an embodiment of the present application; [Figure 21] FIG. 2 is a schematic diagram of a specific hardware structure of an encoding device according to an embodiment of the present application; [Figure 22] FIG. 2 is an exemplary structural diagram of a configuration of a decoding device according to an embodiment of the present application; [Diagram 23] FIG. 2 is a schematic diagram of a specific hardware structure of a decoding device according to an embodiment of the present application; [Figure 24] 1 is an exemplary structural diagram of an encoding / decoding system according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] In order to more fully understand the features and technical contents of the embodiments of the present application, the embodiments of the present application will be described in detail below with reference to the drawings, and the accompanying drawings are for reference purposes only and are not intended to limit the embodiments of the present invention.

[0016] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terms used herein are for the purpose of describing the present application only and are not intended to be limiting of the present application.

[0017] In the following description, the term "some embodiments" refers to a subset of all possible embodiments, and it is understood that the term "some embodiments" may be the same or different subsets of all possible embodiments, which may be combined with each other without conflict. It is noted that the terms "first / second / third" referred to in the embodiments of the present application are merely for distinguishing similar objects and do not represent a specific order of the objects, and it is understood that "first / second / third" may be interchangeable in some cases with a specific order or precedence order, whereby the embodiments of the present application described herein may be implemented in an order other than that shown or described.

[0018] In a video image, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component, where the three color components are one luminance component, one blue chrominance component, and one red chrominance component, respectively. Exemplarily, the luminance component is usually represented by the code "Y", the blue chrominance component is usually represented by the code "Cb" or "U", and the red chrominance component is usually represented by the code "Cr" or "V", and thus the video image may be represented in a YCbCr format or a YUV format. In addition, the video image may be represented in an RGB format, a YCgCo format, etc., and the embodiment of the present application is not limited thereto.

[0019] It can be understood that in the current video image or video encoding and decoding process, the cross-component prediction technology mainly includes a cross-component linear model (CCLM) prediction mode and a multi-directional linear model (MDLM) prediction mode. Whether the model parameters derived based on the CCLM prediction mode or the model parameters derived based on the MDLM prediction mode, the corresponding prediction models can realize prediction between color components, such as prediction from the first color component to the second color component, prediction from the second color component to the first color component, prediction from the first color component to the third color component, prediction from the third color component to the first color component, prediction from the second color component to the third color component, or prediction from the third color component to the second color component.

[0020] Take the prediction from the first color component to the second color component as an example. Suppose the first color component is a luma component and the second color component is a chroma component. In order to reduce the redundancy between the luma and chroma components, H.266 / Versatile Video Coding (VVC) uses CCLM prediction mode, that is, it builds the prediction value of chroma based on the luma reconstruction value of the same coding block, e.g., Pred_C(i,j)=α·Rec L (i,j)+β.

[0021] Here, (i,j) represents the position coordinates of the pixel to be predicted in the coding block, i represents the horizontal direction, j represents the vertical direction, Pred_C(i,j) represents the chrominance prediction value corresponding to the pixel to be predicted at the position coordinates (i,j) in the coding block, and Rec_L(i,j) represents the luma reconstruction value corresponding to the pixel to be predicted at the (downsampled) position coordinates (i,j) in the same coding block. Furthermore, α and β represent model parameters and can be derived by reference pixels.

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

[0023] Specifically, when the size of the coding block corresponding to the chrominance components is W×H, the upper selected area corresponding to the reference pixels is W′, and the left selected area corresponding to the reference pixels is H′, then In the case of INTRA_LT_CCLM mode, the reference pixels can be selected from the upper adjacent region and the left adjacent region, i.e., set W′=W and H′=H; In the case of INTRA_L_CCLM mode, the reference pixels can be selected from the left adjacent region and the bottom left adjacent region, i.e., H′=W+H, and set W′=0; For INTRA_T_CCLM mode, the reference pixels can be selected from the upper neighboring region and the upper right neighboring region, i.e., W′=W+H and set H′=0.

[0024] It should be noted that in VTM, only pixel points with the maximum W range are stored in the upper right adjacent region, and only pixel points with the maximum H range are stored in the lower left adjacent region. The range of the selection region in INTRA_L_CCLM mode and INTRA_T_CCLM mode is defined as W+H, but in actual applications, the selection region in INTRA_L_CCLM mode is limited to within H+H, and the selection region in INTRA_T_CCLM mode is limited to within W+W, so In the INTRA_L_CCLM mode, the reference pixels can be selected from the left-side neighboring region and the bottom-left neighboring region, where H′=min{W+H,H+H}. In the case of the INTRA_T_CCLM mode, the reference pixels can be selected from the upper neighboring region and the upper right neighboring region, and W′=min{W+H, W+W}.

[0025] A schematic diagram of the distribution of valid neighboring regions is shown in Figure 1. In Figure 1, the left neighboring region, the lower left neighboring region, the upper neighboring region, and the upper right neighboring region are all valid, and the block filled with gray is the pixel to be predicted whose position coordinates in the coding block are (i, j).

[0026] Thus, based on FIG. 1, the selection regions of the three prediction modes are as shown in FIG. 2. Here, in FIG. 2, (a) shows the selection region of the INTRA_LT_CCLM mode, which includes the left adjacent region and the upper adjacent region, (b) shows the selection region of the INTRA_L_CCLM mode, which includes the left adjacent region and the lower left adjacent region, and (c) shows the selection region of the INTRA_T_CCLM mode, which includes the upper adjacent region and the upper right adjacent region. In this way, after the selection regions of the three prediction modes are determined, the pixels used to derive the model parameters can be selected in the selection region. The pixels selected in this way are called reference pixels, and the number of reference pixels is usually four. Also, in the case of a coding block with a fixed size of W×H, the positions of the reference pixels are generally determined.

[0027] After obtaining the preset number of reference pixels, chromaticity prediction is now performed according to the exemplary flowchart of the model parameter derivation scheme shown in Figure 3. According to the process shown in Figure 3, assuming that the preset number is 4, the process may include the following steps:

[0028] In step S301, reference pixels are obtained from the selected region.

[0029] In step S302, the number of valid reference pixels is determined.

[0030] In step S303, if the number of valid reference pixels is 0, the model parameter α is set to 0, and β is set to a default value.

[0031] In step S304, the chromaticity prediction values ​​are filled with default values.

[0032] In step S305, if the number of valid reference pixels is 4, two reference pixels with larger luminance component values ​​and two reference pixels with smaller luminance component values ​​are obtained by comparison.

[0033] In step S306, the average point corresponding to the larger value and the average point corresponding to the smaller value are calculated.

[0034] In step S307, model parameters α and β are derived based on the two average points.

[0035] In step S308, chromaticity prediction is performed using the prediction model constructed by α and β.

[0036] In VVC, whether the number of valid reference pixels is 0 is determined based on the validity of the adjacent region.

[0037] It is further necessary to explain that the prediction model is built using the principle of "determining one line by two points", where the two points are also called fitting points. In the current technical solution, after obtaining the four reference pixels, two reference pixels with large values ​​and two reference pixels with small values ​​of the luminance component are obtained by comparison, and then the mean point (mean) is calculated based on the two reference pixels with large values. max Then, another mean point is calculated based on the two reference pixels with the smallest values. max (which can be expressed as max and mean min We can obtain the meanmax and mean min can be used as two fitting points to derive model parameters (which can be represented by α and β), and finally, a prediction model is constructed based on α and β, and prediction processing of the chromaticity components is performed based on the prediction model.

[0038] However, in the related art, the chrominance components of each coding block are calculated using a simple linear model Pred C (i,j)=α·Rec L(i,j)+β is used for prediction, and pixels at any position in each coding block are also predicted using the same model parameters α and β. Such a method has the following drawbacks. The first drawback is that all coding blocks with different content characteristics realize chrominance prediction by mapping luminance to chrominance using a simple linear model, but the luminance-to-chrominance mapping function in all coding blocks cannot be accurately fitted by this simple linear model, which leads to insufficient prediction accuracy in some coding blocks. The second drawback is that in the prediction process, pixel points at different positions in a coding block all use the same model parameters α and β, so there is a large difference in prediction accuracy at different positions in the coding block. The third drawback is that the prediction process of the CCLM technique does not fully take into account the high correlation between the reconstructed luminance information of the current block and the reference information of the neighboring region, which leads to the technique being unable to perform accurate prediction in some coding blocks, which affects the gain effect of the technique. In short, in the current CCLM technology, there is a large deviation between the predicted values ​​and the original values ​​of some coding blocks, which leads to poor prediction accuracy, poor quality, and consequently poor coding and decoding efficiency.

[0039] In view of this, an embodiment of the present application provides an encoding method, in which reference information of a current block is determined, a filtering process is performed on a portion of the reference information of the current block, target information of the current block is determined, a weighting coefficient is determined based on a reference sample value of a first color component in the target information, a predicted block of a second color component of the current block is determined based on the weighting coefficient and the reference sample value of a second color component in the target information, and a predicted difference value of a sample point of the second color component of the current block is determined based on the predicted block.

[0040] An embodiment of the present application further provides a decoding method, in which reference information of a current block is determined, a filtering process is performed on a portion of the reference information of the current block, target information of the current block is determined, a weighting coefficient is determined based on a reference sample value of a first color component in the target information, a predicted block of a second color component of the current block is determined based on the weighting coefficient and the reference sample value of a second color component in the target information, and a reconstructed value of a sample point of the second color component of the current block is determined based on the predicted block.

[0041] In this way, the characteristics of the color format information are fully taken into consideration for the color component information in the adjacent areas of the current block and the color component information within the current block, so that the accuracy of these reference information can be improved. Furthermore, by performing filtering processes such as upsampling and downsampling on these reference information, the continuity of spatial correlation can be strengthened to a certain extent, or some information with relatively weak spatial correlation can be removed. By using the target information obtained by the filtering process, chromaticity prediction can be performed more appropriately, thereby improving the accuracy of chromaticity prediction, saving bit rate, and improving encoding and decoding performance.

[0042] Hereinafter, each embodiment of the present application will be described in detail with reference to the drawings.

[0043] Referring to Fig. 4A, a schematic block diagram of an encoder according to an embodiment of the present application is shown. As shown in Fig. 4A, an encoder (specifically, a "video encoder") 100 includes a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109 and a decoded image buffer unit 110, etc., where the filtering unit 108 can realize deblocking filtering and sample adaptive offset (SAO: Sample Adaptive Offset) filtering, and the encoding unit 109 can realize header information coding and context-based adaptive binary arithmetic coding (CABAC: Context-based Adaptive Binary Arithmetic Coding). For the input original video signal, one video coding block can be obtained by dividing the coding tree unit (CTU), and then for the residual pixel information obtained by intra prediction or inter prediction, the video coding block is transformed via the transform and quantization unit 101, which includes transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients, thereby further reducing the bit rate.The intra estimation unit 102 and the intra prediction unit 103 are configured to perform intra prediction on the video coding block, specifically, the intra estimation unit 102 and the intra prediction unit 103 are configured to determine an intra prediction mode to be used for coding the video coding block, the motion compensation unit 104 and the motion estimation unit 105 are configured to perform inter-prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information, the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, which is used to estimate the motion of the video coding block, and the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105, after the intra prediction mode is determined, the intra prediction unit 103 is further configured to provide the selected intra prediction data to the coding unit 109, and the motion estimation unit 105 also sends the motion vector data determined by calculation to the coding unit 109. Further, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block, where the residual block is reconstructed in the pixel domain, where the reconstructed residual block is filtered for blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and where the reconstructed residual block is added to one prediction block in the frame of the decoded picture buffer unit 110 to generate a reconstructed video coding block. The coding unit 109 is configured to code various coding parameters and quantized transform coefficients, where in a CABAC-based coding algorithm, the context content may be based on neighboring coding blocks, and may be used to code information indicating a determined intra-prediction mode and output a bitstream of the video signal, where the decoded picture buffer unit 110 is configured to store the reconstructed video coding block used for prediction reference.As the encoding of the video pictures progresses, newly reconstructed video coding blocks are continually generated, and all these reconstructed video coding blocks are stored in the decoded picture buffer unit 110 .

[0044] Referring to FIG. 4B, a schematic block diagram of a decoder configuration according to an embodiment of the present application is shown. As shown in FIG. 4B, a decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205 and a decoded image buffer unit 206, etc., where the decoding unit 201 can realize header information decoding and CABAC decoding, and the filtering unit 205 can realize deblocking filtering and SAO filtering. After performing the encoding process of FIG. 4A on the input video signal, it outputs a bitstream of the video signal, and the bitstream is input to the decoder 200, and first, the decoding unit 201 processes to obtain decoded transform coefficients, and the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra prediction unit 203 is configured to generate prediction data of the current video decoded block based on the determined intra prediction mode and data of the previous decoded block from the current frame or picture; the motion compensation unit 204 is configured to determine prediction information of the video decoded block by analyzing the motion vector and other related syntax elements, and use the prediction information to generate a prediction block of the video decoded block being decoded; and form a decoded video block by adding the residual block from the inverse transform and inverse quantization unit 202 and the corresponding prediction block generated by the intra prediction unit 203 or the motion compensation unit 204; the decoded video signal is filtered by the filtering unit 205 to remove blocking artifacts and improve video quality; and store the decoded video block in the decoded image buffer unit 206, which is configured to store a reference image used for subsequent intra prediction or motion compensation, and output the video signal to obtain a restored original video signal.

[0045] It should be noted that the method of the embodiment of the present application is mainly applied to the intra prediction unit 103 shown in Fig. 4A and the intra prediction unit 203 shown in Fig. 4B. That is, the embodiment of the present application may be applied to the encoder, or may be applied to the decoder, or may be applied to both the encoder and the decoder at the same time, but the embodiment of the present application is not limited thereto.

[0046] It should be further explained that when applied to the intra prediction unit 103, the "current block" specifically refers to the encoded block currently being intra predicted, and when applied to the intra prediction unit 203, the "current block" specifically refers to the decoded block currently being intra predicted.

[0047] In one embodiment of the present application, referring to Fig. 5, an exemplary flow chart 1 of a decoding method according to an embodiment of the present application is shown. As shown in Fig. 5, the method may include the following steps:

[0048] In step S501, the reference information of the current block is determined.

[0049] It should be noted that the decoding method of the embodiment of the present application can be applied to a decoding device or a decoding device (also called a "decoder") integrated with the decoding device. In addition, the decoding method of the embodiment of the present application can specifically refer to an intra prediction method, more specifically, a pre-processing operation method of weight-based chroma prediction (WCP).

[0050] In the embodiment of the present application, a video image can be divided into a plurality of decoded blocks, each of which may include a first color component, a second color component, and a third color component, where the current block refers to a decoded block that is currently intra-predicted in a video image.Furthermore, if the current block performs prediction of the first color component, and the first color component is a luma component, that is, if the component to be predicted is a luma component, the current block can also be called a luma prediction block.Or, if the current block performs prediction of the second color component, and the second color component is a chroma component, that is, if the component to be predicted is a chroma component, the current block can also be called a chroma prediction block.

[0051] It should be further explained that in the embodiments of the present application, the reference information of the current block may include a value of a first color component sample point in an adjacent region of the current block and a value of a second color component sample point in an adjacent region of the current block, and these sample points (Samples) can be determined based on decoded pixels in the adjacent region of the current block. In some embodiments, the adjacent region of the current block may include at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region.

[0052] Here, the entire upper neighboring region and the entire upper right neighboring region can be regarded as the upper region, the entire left neighboring region and the entire lower left neighboring region can be regarded as the left region, and in addition, the neighboring regions may further include the upper left region (see FIG. 6). Here, when predicting the second color component for the current block, the upper region, the left region, and the upper left region of the current block as the neighboring regions can be referred to as the reference region of the current block, and all pixels in the reference region are decoded reference pixels.

[0053] In addition, the reference information of the current block may further include a reconstruction value of the first reference color component sample point in the current block. Thus, in some embodiments, determining the reference information of the current block may include: This may include determining reference information for the current block based on values ​​of the first color component sample points in adjacent regions of the current block, values ​​of the second color component sample points in adjacent regions of the current block, and reconstructed values ​​of the first reference color component sample points in the current block.

[0054] In the embodiment of the present application, the reference pixel of the current block may refer to a reference pixel point adjacent to the current block, and is also called a first color component sample point or a second color component sample point in the adjacent region of the current block, and is expressed as a Neighboring Sample or a Reference Sample. Here, the term "adjacent" may mean spatially adjacent, but is not limited thereto. For example, the term "adjacent" may mean adjacent in the time domain, or adjacent in the space and time domain. Furthermore, the reference pixel of the current block may be a reference pixel point adjacent in space, a reference pixel point adjacent in the time domain, or a reference pixel obtained by performing a specific process on a reference pixel point adjacent in the space and time domain, but the embodiment of the present application is not limited thereto.

[0055] It should be further explained that in the embodiment of the present application, the first color component is a luminance component and the second color component is a chrominance component, then the value of the first color component sample point in the adjacent region of the current block is indicated as reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sample point in the adjacent region of the current block is indicated as reference chrominance information corresponding to the reference pixel of the current block.

[0056] In some embodiments, determining the reference pixels of the current block may include performing a filtering process on pixels in a neighboring region of the current block to determine the reference pixels.

[0057] Specifically, in the embodiment of the present application, a first reference pixel set can be configured based on pixels in the neighboring region of the current block, and a selection process can be performed on the first reference pixel set to determine reference pixels. Here, the number of reference pixels can be M, where M is a positive integer. In other words, M reference pixels can be selected from the pixels in the neighboring region. Here, the value of M can be generally 4, but is not particularly limited.

[0058] It should be further mentioned that the pixels in the neighboring regions of the current block may have some unimportant pixels (e.g., these pixels have low correlation) or some abnormal pixels, and in order to ensure the accuracy of prediction, these pixels need to be removed to obtain valid reference pixels.

[0059] In one particular embodiment, performing a filtering process on pixels in the neighboring region to determine the reference pixels includes: determining a location of the selected pixel based on the pixel's location and / or color component intensity in the neighboring region; and determining reference pixels from pixels in the neighboring region based on the location of the selected pixel.

[0060] In addition, in the embodiment of the present application, the color component intensity can be represented by color component information such as reference luminance information or reference chromaticity information, where the larger the value of the color component information, the higher the color component intensity. In this way, the selection of the pixels in the neighboring region can be based on the pixel position or based on the color component intensity, so that the reference pixel of the current block can be determined based on the selected pixel, and the value of the first color component sample point in the neighboring region of the current block and the value of the second color component sample point in the neighboring region of the current block can be determined.

[0061] In step S502, a filtering process is performed on a portion of the reference information of the current block to determine target information of the current block.

[0062] In the embodiment of the present application, since the quantity of values ​​of the first color component sample points in the adjacent area of ​​the current block may differ from the quantity of values ​​of the second color component sample points, in this case, in order to make the two quantities the same, it may be necessary to perform a filtering process on the values ​​of the first color component sample points or a filtering process on the values ​​of the second color component sample points. In addition, since the quantity of the reconstructed values ​​of the first reference color component sample points in the current block differs from the preset size, in this case, it may be necessary to perform a filtering process on the reconstructed values ​​of the first reference color component sample points in the current block, and convert the quantity of the reconstructed values ​​of the first reference color component sample points obtained from the current block into the preset size and input it. That is, for the reference information of the current block, the filtering process may be performed only on the values ​​of the first color component sample points in the adjacent area of ​​the current block, the filtering process may be performed only on the values ​​of the second color component sample points in the adjacent area of ​​the current block, the filtering process may be performed only on the reconstructed values ​​of the first reference color component sample points in the current block, or the filtering process may be performed on any two of these, or even on all three of these, and the embodiment of the present application is not limited thereto. Each of these situations is described below.

[0063] In one possible embodiment, performing a filtering process on a portion of the reference information of the current block to determine target information of the current block includes: performing a first filtering process on values ​​of first color component sample points in the adjacent area of ​​the current block to obtain filtered sample values ​​of the first color component in the adjacent area of ​​the current block; and determining target information for the current block based on the filtered sample values ​​of the first color component in a neighboring region of the current block.

[0064] In an embodiment of the present application, the number of filtered sample values ​​(Sample) of the first color component in the adjacent region of the current block is equal to L, where L represents the number of values ​​(Sample) of the second color component sample points in the adjacent region of the current block, and L is a positive integer.

[0065] In one specific embodiment, the first filtering process may be a downsampling filtering process. For example, the number of reference luma information of the current block is usually greater than the number of reference chroma information, so that the number of reference luma information and the number of reference chroma information are equal to each other, a downsampling filtering process may be performed on the reference luma information of the current block.

[0066] It should be further explained that since the number of reference luma information and the number of reference chroma information of the current block are affected by the color format information, in some embodiments, the method may further include performing a first filtering process on values ​​of first color component sample points in an adjacent area of ​​the current block based on the color format information, and obtaining filtered sample values ​​of the first color component in the adjacent area of ​​the current block.

[0067] In one particular embodiment, the first filtering process comprises: If the color format information indicates 4:4:4 sampling, downsampling filtering is not performed on the value of the first color component sample point in the adjacent area of ​​the current block; If the color format information indicates 4:2:2 sampling, performing downsampling filtering on values ​​of first color component sample points in an adjacent region of the current block; If the color format information indicates 4:2:0 sampling, the method may further include performing downsampling filtering on values ​​of the first color component sample points in the neighboring region of the current block.

[0068] Note that in this embodiment, if the color format information indicates 4:2:0 sampling, then the downsampling rate is the reciprocal of a positive integer multiple of two.

[0069] It should be further explained that in the embodiment of the present application, the color format information may include 4:4:4 sampling, 4:2:2 sampling, 4:2:0 sampling, etc. Here, if the color format information indicates 4:4:4 sampling (which can also be represented by YUV444), i.e., if the ratio of the luma and chroma samples is 4:4:4, the number of reference luma information obtained from the adjacent region is the same as the number of reference chroma information, and no operation is required. If the color format information indicates 4:2:2 sampling (which can also be represented by YUV422), i.e., if the ratio of the luma and chroma samples is 4:2:2, or if the color format information indicates 4:2:0 sampling (which can also be represented by YUV420), i.e., if the ratio of the luma and chroma samples is 4:1:1, the number of reference luma information obtained from the adjacent region is different from the number of reference chroma information, and in this case, it is necessary to perform downsampling filtering on the reference luma information obtained from the adjacent region to match the number of reference chroma information.

[0070] In this manner, the downsampling filtering performed on the reference luminance information obtained from the adjacent region may involve downsampling using a multi-tap filter (e.g., a 4-tap filter, a 5-tap filter, a 6-tap filter, etc.), or may involve obtaining a specific pixel from among multiple reference luminance pixels at a position corresponding to the reference chrominance pixel, or may even involve other downsampling methods, and the embodiments of the present application are not limited thereto.

[0071] For example, as shown in Fig. 7A, when the color format information indicates 4:2:0 sampling, take an adjacent region of 8x4 luma pixels as an example, this region needs to be downsampled to a region of 4x2 pixels, where (a) represents the reference luma information refY, the thick frame includes four luma pixels corresponding to the same chroma pixel, (k,l) is the corresponding pixel position of the upper left corner, (b) represents the downsampled reference luma information refY', the thick frame includes a specific luma pixel that has been downsampled, the same chroma pixel corresponding to the four luma pixels in the thick frame of (a) and the specific luma pixel that has been downsampled are a pair of luma pixel and chroma pixel at the same position, (i,j) is the position of the downsampled luma pixel in the downsampled reference luma information, where i=0,...,3, j=0,1.

[0072] Furthermore, when the number of down-sampling filtered reference luma information is L and is the same as the number of reference chroma information, it is necessary to make L equal to a preset number. Thus, in some embodiments, the method includes: Comparing L to a preset number; and According to a comparison result between L and a preset number, performing a second filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

[0073] In one particular embodiment, performing a second filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block based on the comparison result between L and the preset number to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block, comprises: If L is greater than a preset number, performing a first sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; If L is smaller than a preset number, performing a second sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0074] In the embodiment of the present application, the preset number may be represented by inSize. Here, inSize represents the number of inputs when predicting based on the weighting coefficient, and the value of inSize is related to the type of the current block. For example, assuming that the width of the current block is nTbW and the height of the current block is nTbH, the value of inSize may be 2×nTbH+2×nTbW, 1.5×nTbH+1.5×nTbW, or even nTbH+nTbW, and is not particularly limited here.

[0075] It should be further explained that in the embodiment of the present application, when L is equal to a preset number, no operation is required, when L is greater than the preset number, a first sub-filtering process (i.e., size reduction) needs to be performed on the reference luma information and the reference chroma information, and when L is less than the preset number, a second sub-filtering process (i.e., size enlargement) needs to be performed on the reference luma information and the reference chroma information.

[0076] In another possible embodiment, performing a filtering process on a portion of the reference information of the current block to determine target information of the current block includes: performing a third filtering process on values ​​of second color component sample points in the adjacent area of ​​the current block to obtain filtered sample values ​​of the second color component in the adjacent area of ​​the current block; and determining target information for the current block based on the filtered sample values ​​of the second color component in a neighboring region of the current block.

[0077] In an embodiment of the present application, the quantity of filtered sample values ​​of the second color component in the adjacent region of the current block is equal to K, where K represents the quantity of values ​​of the first color component sample points in the adjacent region of the current block, and K is a positive integer.

[0078] In one specific embodiment, the third filtering process is an upsampling filtering process.Exemplarily, the number of reference luma information of the current block is usually greater than the number of reference chroma information, so that the number of reference luma information and the number of reference chroma information are equal, the upsampling filtering process can be performed on the reference chroma information of the current block.

[0079] Because the number of reference luma information and the number of reference chroma information of the current block are affected by the color format information, in some embodiments, the method may further include performing a third filtering process on values ​​of second color component sample points in an adjacent area of ​​the current block based on the color format information, and obtaining filtered sample values ​​of the second color component in the adjacent area of ​​the current block.

[0080] In one particular embodiment, the third filtering process comprises: If the color format information indicates 4:4:4 sampling, not performing upsampling filtering on values ​​of second color component sample points in adjacent regions of the current block; If the color format information indicates 4:2:2 sampling, performing upsampling filtering on values ​​of second color component sample points in an adjacent region of the current block; If the color format information indicates 4:2:0 sampling, the method may further include performing upsampling filtering on values ​​of second color component sample points in the neighboring region of the current block.

[0081] Note that in the embodiment of the present application, when the color format information indicates 4:2:0 sampling, the upsampling rate is a positive integer multiple of 2. In this way, when the number of reference luma information obtained from the adjacent region is different from the number of reference chroma information, upsampling filtering can be performed on the reference chroma information obtained from the adjacent region to match the number of reference luma information.

[0082] In this manner, the upsampling filtering performed on the reference chromaticity information obtained from the adjacent region may involve upsampling using a method such as linear interpolation or nonlinear interpolation, or may involve replicating specific reference chromaticity pixels, or may even involve other upsampling methods, and the embodiments of the present application are not limited thereto.

[0083] For example, as shown in FIG. 7B, when the color format information indicates 4:2:0 sampling, for example, a neighboring area of ​​4×2 chrominance pixels size needs to be upsampled to an area of ​​8×4 pixels size. In FIG. 7B, (a) represents reference chrominance information refC, (b) represents upsampled reference chrominance information refC′, where the bold frame of (a) includes chrominance pixels corresponding to the four upsampled chrominance pixels in the bold frame of (b), and k=0,...,3, l=0,1. The four chrominance pixels in the bold frame of (b) are upsampled chrominance pixels corresponding to the bold frame of (a), and (i,j) is the pixel position of the upper left corner.

[0084] Furthermore, if the number of upsampling filtered reference chrominance information is K and is the same as the number of reference luma information, K needs to be equal to a preset number. Thus, in some embodiments, the method includes: Comparing K to a preset number; and According to a comparison result between K and a preset number, performing a fourth filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

[0085] In one particular embodiment, performing a fourth filtering process on the values ​​of the first color component sample points in the neighboring region of the current block and the filtered sample values ​​of the second color component in the neighboring region of the current block based on a comparison result between K and the preset number to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block, includes: If K is greater than a preset number, performing a first sub-filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; If K is smaller than a preset number, the method may include performing a second sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block.

[0086] It should be noted that in the embodiment of the present application, the preset number can be represented by inSize. Specifically, when K is equal to inSize, no operation is required, when K is greater than inSize, the first sub-filtering process (i.e., size reduction) needs to be performed on the reference luma information and the reference chroma information, and when K is smaller than inSize, the second sub-filtering process (i.e., size expansion) needs to be performed on the reference luma information and the reference chroma information.

[0087] It can further be understood that in an embodiment of the present application, when color format information is not taken into account, the number of reference luminance information obtained from adjacent regions can be made the same as the number of reference chromaticity information by directly matching them with inSize.

[0088] In one possible embodiment, performing a filtering process on a portion of the reference information of the current block to determine target information of the current block includes: determining a quantity of values ​​of a first color component sample point in an adjacent region of the current block as a first quantity; performing a fifth filtering process on values ​​of the first color component sample points in the neighboring region of the current block according to a comparison result between the first quantity and the preset number to determine filtered neighboring sample values ​​of the first color component of the current block; and determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block.

[0089] In one particular embodiment, performing a fifth filtering process on values ​​of the first color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block includes: If the first quantity is greater than the preset number, performing a first sub-filtering process on values ​​of first color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block; If the first quantity is smaller than a preset number, performing a second sub-filtering process on values ​​of the first color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block.

[0090] In addition, in the embodiment of the present application, the number of reference luminance information obtained from the adjacent region can be the same as the preset number. Here, the number of reference luminance information obtained from the adjacent region (i.e., the first quantity) can be represented by refYnum, and the preset number can be represented by inSize. Specifically, when refYnum is equal to inSize, no operation is required, when refYnum is greater than inSize, the first sub-filtering process (i.e., size reduction) needs to be performed on the reference luminance information, and when refYnum is smaller than inSize, the second sub-filtering process (i.e., size expansion) needs to be performed on the reference luminance information.

[0091] In another possible embodiment, performing a filtering process on a portion of the reference information of the current block to determine target information of the current block includes: determining a quantity of values ​​of second color component sample points in an adjacent region of the current block as a second quantity; performing a sixth filtering process on values ​​of second color component sample points in the neighboring region of the current block according to a comparison result between the second quantity and the preset number to determine filtered neighboring sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the second color component of the current block.

[0092] In one particular embodiment, performing a sixth filtering operation on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block includes: If the second quantity is greater than the preset number, performing a first sub-filtering process on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block; If the second quantity is smaller than the preset number, performing a second sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block.

[0093] It should be further explained that in the embodiment of the present application, the number of reference chromaticity information obtained from the adjacent region can be equal to a preset number. Here, the number of reference chromaticity information obtained from the adjacent region (i.e., the second quantity) can be represented by refCnum, and the preset number can be represented by inSize. Specifically, when refCnum is equal to inSize, no operation is required; when refCnum is greater than inSize, a first sub-filtering process (i.e., size reduction) needs to be performed on the reference chromaticity information; when refCnum is less than inSize, a second sub-filtering process (i.e., size expansion) needs to be performed on the reference chromaticity information.

[0094] Here, the first sub-filtering process may be a downsampling filtering process. In addition, in some embodiments, the first sub-filtering process may be A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by adopting a successive position selection scheme.

[0095] In addition, taking the reference luminance information as an example, the number of reference luminance information obtained from the adjacent region is refYnum. When performing size reduction using the fixed interval position selection method, that is, refYnum reference luminance pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then points are selected at fixed intervals based on the magnitude relationship between inSize and refYnum, thereby reducing the size of the reference luminance information. As shown in FIG. 8, the reference luminance information refY obtained from a one-row, one-column "L"-shaped reference region can be rearranged into a one-dimensional vector refY' based on the positional relationship from the lower left to the upper left, and then from the upper left to the upper right. Here, the method of arranging into a one-dimensional vector and the starting position of the fixed interval selection can be freely set, and are not particularly limited here. In this way, assuming that the fixed interval used for size reduction is subDist, by starting from the first pixel position of the one-dimensional vector and selecting one pixel for each of (subDist-1) pixel positions, inSize reference luminance information can finally be obtained.

[0096] Still, if we take the reference luminance information as an example, when the size is reduced by the continuous position selection method, that is, refYnum reference luminance pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then inSize pixels are continuously selected from the preset positions of the one-dimensional vector, thereby obtaining inSize pieces of reference luminance information. Here, the preset position may be the first pixel position or the pos pixel position, and is not particularly limited here.

[0097] In addition, the second sub-filtering process may be an upsampling filtering process. In addition, in some embodiments, the second sub-filtering process may further include performing the sub-filtering process by adopting a fixed interval position interpolation manner.

[0098] In addition, when the size is enlarged by adopting the fixed interval position interpolation method, that is, refCnum reference chromaticity pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then points are selected at fixed intervals based on the magnitude relationship between inSize and refCnum, thereby enlarging the size of the reference chromaticity information. Here, the method of arranging in the one-dimensional vector and the starting position of the fixed interval interpolation can be freely set, and are not particularly limited here. In this way, after arranging the reference luminance information in the same manner as in the size reduction, a one-dimensional vector is obtained, and then, based on the fixed interval used for the size enlargement, inSize pieces of reference luminance information are finally obtained by interpolation starting from the first pixel position of the one-dimensional vector.

[0099] It should further be noted that, after performing a first filtering process on values ​​of the first color component sample points in the neighboring region of the current block, target information of the current block is determined based on the filtered neighboring sample values ​​of the first color component of the current block, where the target information may include the filtered neighboring sample values ​​of the first color component of the current block, values ​​of the second color component sample points in the neighboring region of the current block, and the reconstructed value of the first reference color component sample point in the current block. Similarly, after performing a second filtering process on values ​​of the second color component sample points in the neighboring region of the current block, target information of the current block is determined based on the filtered neighboring sample values ​​of the second color component of the current block, where the target information may include the filtered neighboring sample values ​​of the second color component of the current block, values ​​of the first color component sample points in the neighboring region of the current block, and the reconstructed value of the first reference color component sample point in the current block. Alternatively, after performing a first filtering process on values ​​of first color component sample points in an adjacent region of the current block and a second filtering process on values ​​of second color component sample points in an adjacent region of the current block, the target information may include filtered adjacent sample values ​​of the first color component of the current block, filtered adjacent sample values ​​of the second color component of the current block, and reconstructed values ​​of the first reference color component sample points in the current block.

[0100] It can be further understood that when performing chrominance component prediction for the current block, the reference information of the current block may further include reconstructed luma information of the current block. Thus, in some embodiments, determining the reference information of the current block may further include determining the reference information of the current block based on a reconstructed value of a first reference color component sample point in the current block.

[0101] It should be noted that in the embodiment of the present application, the first reference color component may be a luminance component, in which case the reconstructed value of the first reference color component sample point in the current block is the reconstructed luminance information of the current block.

[0102] It should be further noted that in the embodiment of the present application, since the amount of reconstructed luminance information of the current block is different from the preset size, a filtering process needs to be performed on the reconstructed luminance information of the current block to convert the amount of reconstructed luminance information obtained from the current block into the preset size and input it, where the preset size is predSizeW×predSizeH, where predSizeW represents the width of the prediction block and predSizeH represents the height of the prediction block.

[0103] In some embodiments, performing a filtering process on a portion of the reference information of the current block to determine target information of the current block includes: performing a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; and determining target information for the current block based on the filtered sample values ​​of the first reference color component sample points in the current block.

[0104] In one particular embodiment, performing a seventh filtering operation on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block includes: determining a first width and a first height based on the reconstructed values ​​of the first reference color component sample points in the current block; If the first width is greater than the width of the prediction block or the first height is greater than the height of the prediction block, performing a third sub-filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; If the first width is smaller than the width of the predicted block, or if the first height is smaller than the height of the predicted block, performing a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block.

[0105] In addition, in the embodiment of the present application, assuming that the number of reconstructed luminance information is recSizeW×recSizeH, recSizeW represents a first width and recSizeH represents a first height. Specifically, when recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required, when recSizeW is larger than predSizeW or recSizeH is larger than predSizeH, a first sub-filtering process (i.e., size reduction) needs to be performed on the reconstructed luminance information, and when recSizeW is smaller than predSizeW or recSizeH is smaller than predSizeH, a second sub-filtering process (i.e., size enlargement) needs to be performed on the reconstructed luminance information.

[0106] It should be further explained that in the embodiments of the present application, the third sub-filtering process may be a downsampling filtering process. In addition, in some embodiments, the third sub-filtering process may be: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process vertically on the reconstructed values ​​of the first reference color component sample points in the current block; performing a downsampling filtering process in the horizontal direction and then a downsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and The method may further include at least one of performing a downsampling filtering operation in a vertical direction and then performing a downsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

[0107] Here, first, a horizontal downsampling factor can be calculated according to recSizeW and predSizeW, a vertical downsampling factor can be calculated according to recSizeH and predSizeH, and then downsampling filtering can be performed on the reconstructed luminance information according to the horizontal downsampling factor and the vertical downsampling factor. Specifically, when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling can only be performed on the reconstructed luminance information in the horizontal direction; when the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling can only be performed on the reconstructed luminance information in the vertical direction; when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling can be performed on the reconstructed luminance information in both the horizontal and vertical directions, where the horizontal downsampling can be performed first and then the vertical downsampling, or the vertical downsampling can be performed first and then the horizontal downsampling, and even a convolution operation in a neural network structure can be adopted instead of the downsampling operation here, and the embodiment of the present application is not limited thereto.

[0108] It should be further explained that in the embodiments of the present application, the fourth sub-filtering process is an upsampling filtering process. In addition, in some embodiments, the fourth sub-filtering process is performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in the horizontal direction and then a upsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and The method may further include at least one of performing an upsampling filtering operation in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing an upsampling filtering operation in a horizontal direction.

[0109] Here, firstly, a horizontal upsampling factor is calculated based on recSizeW and predSizeW, a vertical upsampling factor is calculated based on recSizeH and predSizeH, and then upsampling filtering is performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical upsampling factor. Specifically, when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, it is only necessary to perform upsampling on the reconstructed luminance information in the horizontal direction; when the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, it is only necessary to perform upsampling on the reconstructed luminance information in the vertical direction; when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, it is necessary to perform upsampling on the reconstructed luminance information in both the horizontal and vertical directions, whereby the horizontal upsampling may be performed first and then the vertical upsampling, or the vertical upsampling may be performed first and then the horizontal upsampling; furthermore, a weighted average may be performed on the upsampling result of "horizontal first, then vertical" and the upsampling result of "vertical first, then horizontal" to determine the final upsampling result; or a convolution operation in a neural network structure may be adopted instead of the upsampling operation here, and the embodiments of the present application are not limited thereto.

[0110] That is, in an embodiment of the present application, the reference information of the current block may include values ​​of the first color component sample points in the adjacent area of ​​the current block, values ​​of the second color component sample points in the adjacent area of ​​the current block, and a reconstructed value of the first reference color component sample point in the current block, and the target information may include filtered adjacent sample values ​​of the first color component of the current block, filtered adjacent sample values ​​of the second color component of the current block, and a filtered sample value of the first reference color component sample point in the current block, where if there is no need to perform a filtering process on the values ​​of the first color component sample points in the adjacent area of ​​the current block, the filtered adjacent sample values ​​of the first color component of the current block are equal to the values ​​of the first color component sample points in the adjacent area of ​​the current block. Similarly, if no filtering operation needs to be performed on the value of the second color component sample point in the adjacent area of ​​the current block, the filtered adjacent sample value of the second color component of the current block is equal to the value of the second color component sample point in the adjacent area of ​​the current block, and if no filtering operation needs to be performed on the reconstructed value of the first reference color component sample point in the current block, the filtered sample value of the first reference color component sample point in the current block is equal to the reconstructed value of the first reference color component sample point in the current block.

[0111] In this way, the obtained target information may include filtered adjacent sample values ​​of the first color component of the current block, filtered adjacent sample values ​​of the second color component of the current block, and filtered sample values ​​of the first reference color component sample point in the current block, i.e., inSize pieces of reference chromaticity information, inSize pieces of reference luma information, and reconstructed luma information that fits a preset size.

[0112] In step S503, a weighting coefficient is determined based on a reference sample value of a first color component in the target information.

[0113] In addition, after determining the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point in the current block, in some embodiments, the method may further include setting the reference sample value of the first color component in the target information to an absolute value of a difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block.

[0114] In some embodiments, the method may further include setting a reference sample value of the second color component in the target information to the filtered neighboring sample value of the second color component of the current block.

[0115] Furthermore, when considering the filtering process for the reference information, the filtering process can be performed only on the reference luminance information, the filtering process can be performed only on the reconstructed luminance information, the filtering process can be performed only on the reference luminance information and the reconstructed luminance information, or the filtering process can be performed on all of the reference chromaticity information, the reference luminance information, and the reconstructed luminance information, and there is no particular limitation here. Therefore, the calculation of the luminance difference can 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 reference luminance information and the reconstructed luminance information after the filtering process ... or the absolute value of the difference between the reference luminance information after the filtering process and the reconstructed luminance information after the filtering process. Therefore, in an embodiment of the present application, with respect to the reference sample value of the first color component in the target information, the method may further include: setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in an adjacent area of ​​the current block and the reconstructed value of the first reference color component sample point in the current block; or setting the reference sample value of the first color component in the target information to the absolute value of the difference between the filtered adjacent sample value of the first color component of the current block and the reconstructed value of the first reference color component sample point in the current block; or setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in an adjacent area of ​​the current block and the filtered sample value of the first reference color component sample point in the current block, and the methods are not particularly limited thereto.

[0116] In some embodiments, determining a weighting coefficient based on a reference sample value of a first color component in the target information comprises: determining a value corresponding to the reference sample value of the first color component based on a preset mapping relationship; and setting a weighting factor equal to that value.

[0117] It should be noted that in the embodiment of the present application, the reference sample value of the first color component may be an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of the first reference color component sample point in the current block, where the first reference color component is a first color component, which is a color component different from the predicted second color component in the embodiment of the present application.

[0118] As an example, assuming that the first color component is a chrominance component and the second color component is a luminance component, the embodiment of the present application mainly relates to predicting the chrominance component of the pixel to be predicted in the current block. First, at least one pixel to be predicted in the current block is selected, and the luminance difference (|ΔC k The chromaticity difference in the neighboring regions of the prediction target pixel at different positions is different, and the reference pixel position with the smallest chromaticity difference changes with the change of the prediction target pixel in the current block. Generally, the magnitude of the chromaticity difference represents the degree of similarity between chromaticities. |ΔC k When | is relatively small, it indicates that the similarity of the chromaticity values ​​is relatively strong, and the corresponding weighting coefficient (w k ) and conversely, |ΔC k When | is relatively large, it indicates that the similarity of the chromaticity values ​​is relatively weak, and w k We can give a small weight to w k and |ΔC k The relationship with | is almost inversely proportional. Thus, as shown below, |ΔC k Based on |, a pre-configured mapping relationship can be established.

[0119] w k =f(|ΔC k |) (1) Here, taking equation (1) as an example, |ΔC k | represents the reference sample value of the first color component, and f(|ΔC k |) represents the value corresponding to the reference sample value of the first color component in the preset mapping relationship, and w k represents the weighting coefficient, i.e., wk f(|ΔC k Set it equal to |).

[0120] It should be further explained that in the embodiment of the present application, when the quantity of the reference sample values ​​of the second color component is N, the number of weighting coefficients is also N, where the sum of the N weighting coefficients is equal to 1, and each weighting coefficient is greater than or equal to 0 and less than or equal to 1, i.e., 0≦w k ≦1. However, it should be noted that "the sum of N weighting coefficients is equal to 1" is only a theoretical concept, and in the actual fixed-point implementation process, the absolute value of the weighting coefficients may be greater than 1.

[0121] As one can understand, in probability theory and related fields, the normalized exponential function (also called the Softmax function) is a generalized boolean function that can "compress" an N-dimensional vector z containing any real numbers into another N-dimensional vector σ(z) such that each element is in the range (0,1) and all elements sum to 1, and is often used as a nonlinear activation function in neural networks for multi-class classification. The Softmax function is shown below:

[0122]

number

[0123]

number

[0124]

number

[0125] In the present embodiment, the first factor is a constant value less than zero. Taking the Softmax function as an example, in equation (4), γ represents the first factor, |ΔC k | represents the first reference color component parameter, and γ|ΔC k | represents the first product value, and w k represents the weighting coefficients, k=1,2,…,N.

[0126] In one particular embodiment, determining the first factor may include the first factor being a preset constant value.

[0127] In this case, it is possible to capture a weighting coefficient distribution suitable for chromaticity prediction of natural images by adjusting the distribution of weighting coefficients of adjacent chromaticities based on the characteristic that chromaticity is relatively flat. To determine a parameter γ suitable for chromaticity prediction of natural images, a given γ set is traversed and the appropriateness of γ is evaluated based on the difference between the predicted chromaticity and the original chromaticity at different γ. For example, γ is set to -2 εwhere ε∈{1,0,-1,-2,-3}, and experiments show that in this set of γ, the optimal value of γ is −0.25. Thus, in one particular embodiment, γ can be set to −0.25, although embodiments of the present application are not limited thereto.

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

[0129] Moreover, in some embodiments, the method may further include determining a value of the first factor based on a mapping lookup table of a preset size parameter of the current block and a value of the first factor.

[0130] Here, the size parameter of the current block may include at least one of the width of the current block, the height of the current block, and the multiplication product of the width and height of the current block.

[0131] In addition, in the embodiment of the present application, the value of the first factor can be fixed in a classification manner. For example, the size parameter of the current block can be divided into three categories, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiment of the present application, a mapping lookup table between the size parameter of the current block and the value of the first factor can be stored in advance, and the value of the first factor can be determined based on the lookup table. For example, Table 1 shows the correspondence relationship between the first factor and the size parameter of the current block according to the embodiment of the present application. In addition, Table 1 is merely an exemplary lookup table, and is not limited thereto.

[0132] [Table 1]

[0133] In another particular embodiment, determining the first factor may include determining a value of the first factor based on a quantity of reference pixels of the current block.

[0134] Furthermore, in some embodiments, the method may further include determining a value of the first factor based on a mapping lookup table between a preset number of reference pixels of the current block and a value of the first factor.

[0135] It should be noted that in the embodiment of the present application, the quantity of reference pixels can be divided into three categories, and the value of the first factor is still fixed in a classification manner. For example, the quantity of reference pixels of the current block is divided into three categories, and the value of the first factor corresponding to each category is determined. In this case, the embodiment of the present application can also store a mapping lookup table of the quantity of reference pixels of the current block and the value of the first factor in advance, and the value of the first factor can be determined based on the lookup table. For example, Table 2 shows the correspondence relationship between the first factor and the quantity of reference pixels of the current block according to the embodiment of the present application. It should be noted that Table 2 is merely an exemplary lookup table, and is not limited thereto.

[0136] [Table 2]

[0137] Further, determining a first product value based on the first factor and a reference sample value of a first color component for a first product value includes: setting a first product value equal to the product of the first factor and the reference sample value of the first color component; or setting the first multiplication value to a value obtained by performing a bit right shift on the reference sample value of the first color component, the number of bits of the bit right shift being equal to the first factor; or The method may include setting a first multiplication value to a numerical value obtained by adding and bit-shifting to a reference sample value of the first color component based on a first factor.

[0138] For example, assume 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 multiplication value is 0.25×Ref, and 0.25×Ref can be expressed as Ref / 4, that is, Ref>>2. Furthermore, in the fixed-point calculation process, floating-point numbers may be converted into addition and bit shift operations. That is, the calculation method of the first multiplication value is not particularly limited.

[0139] It can be further understood that in the embodiment of the present application, the first color component can be a luminance component, and the second color component can be a chrominance component, in which case, at least one pixel to be predicted in the current block is selected, and the luminance difference (represented by |ΔYk|) between their reconstructed luminance and the reference luminance in the neighboring region is calculated respectively, where |ΔYk| is relatively small, indicating that the similarity of the luminance value is relatively strong, and the corresponding weighting coefficient (w k Conversely, if |ΔYk| is relatively large, it indicates that the similarity of the brightness values ​​is relatively weak, and w k can be given a small weight, that is, when calculating the weighting coefficient, the reference sample value of the first color component can be |ΔYk|, and the weighting coefficient can be calculated in this manner.

[0140] It should be noted that when predicting the chrominance of the pixel to be predicted in the current block, the chrominance of the pixel to be predicted cannot be directly calculated, so the chrominance difference |ΔC k However, since there is a strong correlation between the components in the local region of the current block, in this case, the luminance difference |ΔY k Based on |ΔC k | can be derived, that is, |ΔY k Based on the product of | and the second factor, |ΔC k | can be obtained, and thus the first product value is the first factor and |ΔC k It is equal to the product of |.

[0141] That is, in the embodiment of the present application, the reference sample value of the first color component may be |ΔCk|, i.e., the absolute value of the chromaticity difference, or |ΔYk|, i.e., the absolute value of the luminance difference, or |αΔYk|, i.e., the product of the absolute value of the luminance difference and a preset multiplier, where the preset multiplier is the second factor described in the embodiment of the present application.

[0142] Further, for the second factor, in one particular embodiment, the method may further include performing a least squares calculation based on the first color component value of the reference pixel and the second color component value of the reference pixel to determine the second factor.

[0143] That is, assuming that the number of reference pixels is N, the first color component value of the reference pixel is the reference luminance information of the current block, and the second color component value of the reference pixel is the reference chrominance information of the current block, the second factor can be obtained by performing least squares regression calculation on the chrominance component values ​​and luminance component values ​​of the N reference pixels. For example, the least squares regression calculation is as follows:

[0144]

number

[0145] Furthermore, for the preset mapping relationship, in some embodiments, the preset mapping relationship may be a preset function relationship. In some embodiments, the preset mapping relationship may be a Softmax function. Here, the Softmax function is a normalized exponential function, but in the embodiments of the present application, normalization may not be used and its value is not limited to the range of [0, 1].

[0146] For example, |ΔY k For example, let us assume that | is the reference sample value of the first color component. Then, the weighting coefficient w k can be calculated by equation (4), or can be replaced as follows:

[0147]

number

number

[0148] Exemplarily, the value of S is related to the size parameters of the current block, where the size parameters of the current block include the width and height of the current block. In one possible embodiment, if the minimum value of the width and height is equal to or less than 4, the value of S is equal to 8, if the minimum value of the width and height is greater than 4 and less than or equal to 16, the value of S is equal to 12, if the minimum value of the width and height is greater than 16, the value of S is equal to 16. In another possible embodiment, if the minimum value of the width and height is equal to or less than 4, the value of S is equal to 7, if the minimum value of the width and height is greater than 4 and less than or equal to 16, the value of S is equal to 11, if the minimum value 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 quantity (R) of reference pixels 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 greater than or equal to 16 and less than 32, the value of S is equal to 12, if R is greater than or equal to 16, the value of S is equal to 16, and the embodiment of the present application is not limited thereto.

[0149] It should be further explained that in addition to the Softmax function, in some other embodiments, the pre-set mapping relationship may be a weighting function having an inverse relationship with the reference sample value of the first color component.

[0150] For illustrative purposes, if |ΔYk| is still taken as the reference sample value of the first color component, the Softmax function in equation (4) can be replaced as follows:

[0151]

number

[0152] In this way, when the pre-set mapping relationship is a pre-set functional relationship, it may be as shown in equation (4), as shown in equation (6) or (7), as shown in equation (8) or (9), or even other functional models of weighting coefficients constructed to adapt to the tendency that the closer the reference luminance value of the reference pixel is to the luminance reconstruction value of the pixel to be predicted in the current block, the greater the importance of the reference chromaticity value of the reference pixel with respect to the pixel to be predicted in the current block; the embodiments of the present application are not limited thereto.

[0153] Further, in some embodiments, the preset mapping relationship may be in the form of a preset look-up table. That is, in the embodiments of the present application, the operation can be further simplified, for example, some calculation operations can be reduced by adopting an array element look-up table method, etc. Here, in the case of the preset mapping relationship, the value of the array element can be determined based on the preset reference sample value of the first color component, the first factor, and the mapping look-up table of the array element, and then the value corresponding to the value of the array element can be determined based on the preset mapping relationship, and the weighting coefficient can be set equal to the value.

[0154] Specifically, the f model for calculating the weighting coefficients can be realized by a simplified operation such as a lookup table. Here, the luminance difference |ΔY k | is |ΔY kij|, and thus the weighting factor w kij =f(|ΔY kij |) is calculated. Here, the numerator of the f model is the independent variable |ΔY kij The function can be stored as an array index with | and the number of categories of S, and subsequently, all operations similar to numerator calculations related to the f model can be obtained by a lookup table, thereby avoiding numerator and denominator calculation operations.

[0155] In the present embodiment, the storage can be divided into complete storage and partial storage.

[0156] In one particular embodiment, perfect storage means that |ΔY kij This refers to memorizing the range of | and the numerator of the number of categories of S. In the case of complete memorization, (|ΔY kij It is necessary to set up an array space of size |ΔY kij | is the size of the range of values, in which case performance remains unchanged.

[0157] For example, taking a 10-bit pixel and equation (7), the variable |ΔY kij The range of | is an integer between 0 and 1023, the number of categories of S is 3, and |ΔY kij The molecule is stored in full using | and the number of categories in S as indices into the two-dimensional array storMole.

[0158]

number

[0159]

number

[0160] [Table 3]

[0161] Furthermore, for full memory, we set the corresponding array offset amount according to the classification of S, and then (|ΔY kij The molecule can be stored completely by using | plus an offset as an index into the one-dimensional array ostorMole, as shown below.

[0162]

number

[0163]

number

[0164] [Table 4]

[0165] In another specific embodiment, partial storage refers to selecting and storing a portion of all numerator values ​​in the calculation of the weighting coefficients, |ΔY kij You can select and store numerator values ​​for some range of | and / or some categories of S, and f model values ​​outside the selected range default to 0. The size of the storage array required is (selected |ΔY kij The product of the range of | and the number of selected categories of S.

[0166] For example, taking a 10-bit pixel and equation (7), |ΔY kij Assuming that the range of | is an integer from 0 to 99 and the number of categories of S is 3, we select and partially store the numerator value. kijThe range of | is an integer between 0 and 99, and the number of categories of S is 3, so |ΔY kij We store the molecules using | and the number of categories in S as indices into the two-dimensional array partstorMole.

[0167]

number

[0168]

number

[0169] [Table 5]

[0170] That is, the storage range of the partial storage can be stored according to actual needs, and the example shows an integer |ΔY within 100. kij The present invention is not limited to the three or four categories of S, and a one-dimensional storage space for storage can be set by setting an offset amount corresponding to a selected part of the categories of S in the partial storage, and the embodiment of the present application is not limited thereto. Furthermore, in the case of Tables 3 to 5, an expanded integer value can be stored for fixed-point calculation, and in this case, a corresponding reduction operation needs to be further performed after the prediction value is determined subsequently.

[0171] In this way, the reference sample value of the first color component (e.g., |ΔY kij |), the weighting coefficient can be determined, specifically, w 1 , w 2 , ..., w Nand so on, where N represents the quantity of the reference sample values ​​of the second color component. Here, theoretically, the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value greater than or equal to 0 and less than or equal to 1. However, it should be noted that "the sum of N weighting coefficients is equal to 1" is only a theoretical concept, and in an actual fixed-point implementation process, the absolute value of the weighting coefficient may be greater than 1.

[0172] In step S504, a prediction block of the second color component of the current block is determined according to the weighting coefficient and the reference sample value of the second color component in the target information.

[0173] In step S505, the reconstruction values ​​of the second color component sample points of the current block are determined based on the prediction block.

[0174] After the weighting coefficient is determined, the weighting coefficient can be used to perform weighted calculation on the reference sample value of the second color component to obtain the predicted value of the second color component sample point in the prediction block.

[0175] In some embodiments, determining a prediction block of a second color component of the current block based on the weighting coefficients and the reference sample values ​​of the second color component in the target information includes: determining a reference sample value of a second color component and a weight value of the corresponding weighting coefficient; This may include setting a predicted value of a second color component sample point in the prediction block to the sum of N weighted values, where N represents a quantity of reference sample values ​​of the second color component and N is a positive integer.

[0176] That is, when the number of the reference sample values ​​of the second color component is N, first, the weight value of each reference sample value of the second color component and the corresponding weighting coefficient (i.e., w k C k ) is determined, and then the sum of these N weighted values ​​is taken as the predicted value of the second color component sample point in the predicted block. Specifically, the calculation formula is as follows:

[0177]

number

[0178] It should be further explained that in the present embodiment, the first color component is a luma component and the second color component is a chroma component, and since the resolution of the luma component may differ from the resolution of the chroma component, performing a filtering process on the reference information includes performing downsampling filtering on the luma component to match the resolution of the chroma component, or performing upsampling filtering on the chroma component to match the resolution of the luma component.

[0179] In the embodiment of the present application, the prediction block includes prediction values ​​of at least some second color component sample points in the current block. If the prediction block includes only prediction values ​​of some second color component sample points in the current block or does not include prediction values ​​of the second color component sample points (if the prediction value needs to be subjected to enhanced filtering to obtain a final prediction value), the prediction block can be further subjected to a filtering process. In this case, the prediction block can be set as a first prediction block, and an upsampling filtering process can be performed on the first prediction block to determine a second prediction block of the second color component of the current block, where the second prediction block is the final prediction block of the second color component of the current block and includes prediction values ​​of all second color component sample points in the current block. Specifically, in some embodiments, performing an upsampling filtering process on the first prediction block to determine a second prediction block of the second color component of the current block may include that the input of the upsampling filtering process is a first upsampling input block, and the output of the upsampling filtering process is a first upsampling output block.

[0180] Further, in some embodiments, the upsampling filtering process comprises: determining an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor and a vertical upsampling factor; performing an upsampling filtering process on the first upsampling input block based on the upsampling factor to obtain a first upsampling output block.

[0181] In one possible embodiment, performing an upsampling filtering process on a first upsampling input block based on an upsampling factor to obtain a first upsampling output block may include performing an upsampling filtering process on the first upsampling input block to obtain a first upsampling output block when the horizontal upsampling factor is greater than 1 or when the vertical upsampling factor is greater than 1.

[0182] In an embodiment of the present application, performing an upsampling filtering process on the first upsampling input block includes: performing an upsampling filtering process on a first upsampling input block in a horizontal direction; performing an upsampling filtering operation on a first upsampling input block in a vertical direction; performing an upsampling filtering process on the first upsampling input block in the horizontal direction and then performing an upsampling filtering process on the first upsampling input block in the vertical direction; and performing an upsampling filtering operation on the first upsampling input block in a vertical direction, and then performing an upsampling filtering operation on the first upsampling input block in a horizontal direction.

[0183] Here, first, a horizontal upsampling factor can be calculated based on the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated based on the height of the first upsampling input block and the height of the first upsampling output block, and then upsampling filtering can be performed on the first upsampling input block based on the horizontal upsampling factor and the vertical upsampling factor. Specifically, when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, it is only necessary to perform upsampling in the horizontal direction on the first upsampling input block; when the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, it is only necessary to perform upsampling in the vertical direction on the first upsampling input block; when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, it is necessary to perform upsampling in both the horizontal and vertical directions on the first upsampling input block, where horizontal upsampling can be performed first and then vertical upsampling, or vertical upsampling can be performed first and then horizontal upsampling, and even a convolution operation in a neural network structure can be adopted instead of the upsampling filtering operation here, and the embodiments of the present application are not limited thereto.

[0184] In another possible embodiment, the first predicted block is subjected to upsampling filtering to determine a second predicted block, in which case the method may further include: the first predicted block being a first upsampling input block, and the first upsampling output block being a second predicted block of a second color component of the current block.

[0185] In another possible embodiment, the first prediction block is first subjected to enhanced filtering, and then subjected to upsampling filtering to determine a second prediction block, in which the method may further include: performing an enhanced filtering process on the first prediction block to determine a first enhanced prediction block, and the first enhanced prediction block is a first upsampling input block, and the first upsampling output block is a second prediction block of a second color component of the current block.

[0186] In another possible embodiment, the first predicted block is first subjected to upsampling filtering, and then subjected to enhanced filtering to determine a second predicted block, in which the method may further include: taking the first predicted block as a first upsampling input block, and the first upsampling output block as a first upsampling filtered predicted block, and performing an enhanced filtering process on the first upsampling filtered predicted block to determine a second predicted block of a second color component of the current block.

[0187] In another possible embodiment, the first prediction block is first subjected to enhanced filtering, then subjected to upsampling filtering, and then subjected to enhanced filtering to determine a second prediction block. In this case, the method may further include: performing a first filtering enhanced process on the first prediction block to determine a second enhanced prediction block, taking the second enhanced prediction block as a first upsampling input block, and taking the first upsampling output block as a second upsampling filtered prediction block, performing a second filtering enhanced process on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.

[0188] Furthermore, the predicted value of the second color component sample points within the prediction block usually needs to be restricted within a preset range. Therefore, in some embodiments, the method may further include performing a correction operation on the predicted value of the second color component sample points within the prediction block to determine the prediction block of the second color component of the current block.

[0189] In addition, in the embodiments of the present application, the preset range may be in the range of 0 to (1<<BitDepth)-1, where BitDepth is the bit depth required for the chrominance component. When the predicted value exceeds the value of the preset range, it is necessary to perform a corresponding correction operation on the predicted value. Exemplarily,

Number

[0190]

Number

Number

Number

Number

[0191] In this way, by performing a correction process on the predicted value, the predicted values of all the second color component sample points within the prediction block can be made to be within the range of 0 to (1<<BitDepth)-1.

[0192] Furthermore, after determining the predicted block, the predicted block may require further post-processing under certain conditions in order to be used as the final predicted block. Thus, in some embodiments, the method includes: The method may further include performing related processing on the predicted block, and setting the processed predicted block as a predicted block of a second color component of the current block.

[0193] In one possible embodiment, performing related processing on the prediction block may include performing an enhanced filtering process on the prediction block and making the processed prediction block a prediction block of a second color component of the current block.

[0194] In addition, in WCP mode, in order to reduce instability caused by performing independent and parallel prediction on a pixel-by-pixel basis, for example, a smoothing filtering process can be performed on the prediction block, and the prediction block after the process can be used as the final prediction block.

[0195] In another possible embodiment, performing related processing on the prediction block may include determining a compensation value of a second color component of the prediction block based on reference sample values ​​in adjacent areas of the current block, and performing a correction process on predicted values ​​of second color component sample points in the prediction block based on the compensation value to determine a prediction block of the second color component of the current block.

[0196] In addition, to further improve the prediction accuracy in the WCP mode, a position-related correction process can be performed on the prediction block, for example, by using reference pixels with nearby spatial positions to calculate a chromaticity compensation value for each predicted second color component sample point, correcting the second color component sample point in the prediction block using the chromaticity compensation value, and determining the final predicted value (predSamples) of the second color component sample point according to the corrected predicted value to obtain the final prediction block.

[0197] In another possible embodiment, performing related processing on the prediction block may include performing a prediction process on a second color component sample point in the prediction block according to at least one prediction mode, determining at least one initial predicted value of the second color component sample point in the prediction block, and performing a weighted fusion process based on the at least one initial predicted value and the predicted value of the second color component sample point in the prediction block, to determine a prediction block of the second color component of the current block.

[0198] In addition, in order to further improve the prediction accuracy in the WCP mode, a weighted fusion may be performed on the chroma predicted value calculated in the other prediction modes and the chroma predicted value calculated in the WCP mode, and the final chroma predicted block may be determined based on the fusion result. Exemplarily, as shown in FIG. 9, the other prediction modes may include a planar mode, a direct current (DC) mode, a vertical mode, a horizontal mode, and a CCLM mode, etc., and each prediction mode is connected to one switch, and the switch is used to control whether the chroma predicted value in this prediction mode participates in the weighted fusion process. Assuming that the weight value corresponding to the planar mode is W_Planar, the weight value corresponding to the DC mode is W_DC, the weight value corresponding to the vertical mode is W_Ver, the weight value corresponding to the horizontal mode is W_Hor, the weight value corresponding to the CCLM mode is W_CCLM, and the weight value corresponding to the WCP mode is W_Wcp, for the chromaticity predicted value in the planar mode, the chromaticity predicted value in the DC mode, the chromaticity predicted value in the vertical mode, the chromaticity predicted value in the horizontal mode, and the chromaticity predicted value in the CCLM mode, when only the switch connected to the CCLM mode is in a closed state, weighted fusion can be performed on the chromaticity predicted value in the CCLM mode and the chromaticity predicted value in the WCP mode based on W_CCLM and W_Wcp, and it can be determined based on the values ​​of W_CCLM and W_Wcp whether to perform weighted fusion with equal weighting or weighted fusion with unequal weighting, and the weighted result becomes the final chromaticity predicted value of the second color component sample point, thereby obtaining the final predicted block.

[0199] In some embodiments, after determining a predicted block, determining reconstructed values ​​of second color component sample points of the current block based on the predicted block includes: determining a predicted difference value of a second color component sample point of the current block; determining a predicted value of a second color component sample point of the current block based on the predicted block; determining a reconstructed value of the second color component sample point of the current block based on a predicted difference value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block.

[0200] In addition, in an embodiment of the present application, determining a predicted residual value of a second color component sample point of the current block may also be determining a predicted residual value of a second color component sample point of the current block by analyzing the bitstream.

[0201] It should be further explained that in the embodiment of the present application, the prediction block may include predicted values ​​of at least some second color component sample points in the current block, where if the prediction block includes predicted values ​​of all second color component sample points in the current block, the predicted values ​​of the second color component sample points of the current block can be set equal to the values ​​of the prediction block, and if the prediction block includes predicted values ​​of some second color component sample points in the current block, upsampling filtering can be performed on the values ​​of the prediction block, and the predicted values ​​of the second color component sample points of the current block can be set equal to the output values ​​after the upsampling filtering.

[0202] That is, in an embodiment of the present application, determining a predicted value of a second color component sample point of a current block based on a predicted block may be to set the predicted value of the second color component sample point of the current block equal to the value of the predicted block, or to filter the value of the predicted block and then set the predicted value of the second color component sample point of the current block equal to the output value of the filtering.

[0203] Thus, taking the chrominance component as an example, the chrominance prediction difference value of the current block can be determined by analyzing the bitstream, and then the chrominance prediction value of the current block can be determined based on the predicted block, and then the chrominance prediction value and the chrominance prediction difference value can be added to obtain the chrominance reconstruction value of the current block.

[0204] It can be understood that the embodiment of the present application optimizes the process of obtaining input information in the prediction process of WCP mode, and mainly includes the following three aspects: First, the accuracy of reference luma information and reference chroma information is improved by fully considering the characteristics of input color format information; Second, the filtering process such as upsampling, downsampling, size enlargement or size reduction is performed on the reference luma information, reference chroma information, and reconstructed luma information of the current block by fully utilizing spatial correlation; Third, the accuracy of WCP prediction technology is improved by fully considering the related information of the prediction block and adopting different filtering processing methods on the reference luma information, reference chroma information, and reconstructed luma information of the current block.

[0205] In brief, the present embodiment further provides a framework for weight-based chrominance prediction, as shown in FIG. 10 , for each sample point recY[i][j] of the reconstructed luminance information in the downsampled current block (i.e., the downsampled luminance block), first obtain a luminance difference vector diffY[i][j] based on the absolute value of the difference between recY[i][j] and the neighboring luminance vector refY[k], then derive a normalized weight vector cWeight[i][j] based on a nonlinear mapping model associated with diffY[i][j], and then use the weight vector to perform vector multiplication of the weight vector with the neighboring chrominance vector of the current block to obtain a predicted chrominance prediction value.

number

[0206] The embodiment of the present application further provides a decoding method, in which the method includes determining reference information of a current block, performing a filtering process on a part of the reference information of the current block, determining target information of the current block, determining a weighting coefficient according to a reference sample value of a first color component in the target information, determining a predicted block of a second color component of the current block according to the weighting coefficient and the reference sample value of a second color component in the target information, and determining a reconstruction value of a sample point of a second color component of the current block according to the predicted block. In this way, the characteristics of the color format information of the color component information in the adjacent area of ​​the current block and the color component information in the current block are fully considered, so that the accuracy of these reference information can be improved, and further, by performing a filtering process such as upsampling or downsampling on these reference information, the continuity of spatial correlation can be enhanced to a certain extent or some information with relatively weak spatial correlation can be removed, and the target information obtained after the filtering process can be used to perform chrominance prediction more appropriately, thereby improving the accuracy of chrominance prediction and improving the encoding and decoding performance while saving the bit rate.

[0207] In another embodiment of the present application, take chroma prediction for a current block based on the decoding method described in the above embodiment as an example. In the embodiment of the present application, the reconstructed luma information of the current block and the reference luma information and reference chroma information of the neighboring region are all decoded reference information. Therefore, the embodiment of the present application proposes a weight-based chroma prediction technique that utilizes the above information, and based on these information, the process of determining the target information of the current block can analyze and process the information of the neighboring region of the current block, the information of the current block, and the current color format information. Here, the information of the neighboring region mainly refers to the position of the sample point in the neighboring region, the reference luma information, and the reference chroma information, the information of the current block mainly refers to the reconstructed luma information in the current block, and the current color format information mainly refers to the parameter InputChromaFormat in the configuration file (*.cfg format) in the decoding process, that is, the ratio of luma and chroma samples of the input video.

[0208] It can be understood that the embodiment of the present application mainly proposes: (1) selecting whether to perform downsampling on the reference luma information of the neighboring region or whether to perform upsampling on the reference chroma information of the neighboring region based on the current color format information; (2) making the reference luma information, reference chroma information of the neighboring region and the reconstructed luma information in the current block conform to the preset size of the core parameters through different size enlargement / reduction operations.

[0209] Here, the detailed steps of the chromaticity prediction process of the WCP mode are as follows:

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

[0211] Output of WCP mode: Predicted values ​​of the current block, predSamples[x][y], where x=0,...,nTbW-1 and y=0,...,nTbH-1, with the top left corner of the current block as the origin.

[0212] Here, the prediction process of the WCP mode may include steps such as determining core parameters, obtaining target information, chrominance prediction based on weights, and a post-processing process, and a pre-processing step is added to the process of obtaining target information, which can obtain the chrominance prediction value of the current block.

[0213] In one particular embodiment, referring to Fig. 11, an exemplary flow chart 2 of a decoding method according to an embodiment of the present application is shown. As shown in Fig. 11, the method may include the following steps:

[0214] In step S1101, the core parameters of the WCP mode are determined.

[0215] Regarding step S1101, determining the core parameters related to the WCP mode may involve obtaining or inferring the core parameters of the WCP mode through settings or some other method, for example, obtaining the core parameters from the bitstream on the decoding side.

[0216] Here, the core parameters of the WCP mode include, but are not limited to, a control parameter (S), the number of weight-based chroma prediction inputs (inSize), and the number of weight-based chroma prediction outputs (ordered as predSizeW×predSizeH). Here, the prediction block output by the weight-based chroma prediction can be represented as predWcp, where the number of weight-based chroma prediction outputs can be set to the same value (e.g., predSizeW=predSizeH=T / 4) or can be set to be related to the size parameter of the current block (e.g., predSizeW=nTbW, predSizeH=nTbH). Here, the control parameter (S) is used to adjust the nonlinear function in the subsequent stage or to adjust data related to the subsequent stage.

[0217] The determination of the core parameters may be influenced by the size of the block, the contents of the block, or the number of pixels in the block under certain conditions. For example, When the WCP mode applies many kinds of block sizes, or when the block sizes are significantly different, or when the block contents are significantly different, or when the number of pixels in a block is significantly different, the current block can be classified based on the block size of the current block, or the block contents, or the number of pixels in the block, and the same or different core parameters can be determined based on different categories. That is, the control parameters (S) corresponding to different categories, or the number of weight-based chroma prediction inputs inSize, or the number of weight-based chroma prediction outputs (arranged in predSizeW×predSizeH) can be the same or different. It should be noted that predSizeW and predSizeH can also be the same or different.

[0218] In the following, two simple classifications are taken as examples to better illustrate the determination of core parameters.

[0219] In Example 1 of classification, in the WCP mode, the current block can be classified based on the width and height of the current block, and the type of the block is represented by wcpSizeId. For different types of blocks, the control parameter(s), the number of chrominance prediction inputs inSize based on weights, and the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) based on weights may be the same or different. Here, an example of dividing into three categories will be described.

[0220] The current block is divided into three categories based on the width and height of the current block. The control parameter(s) for different categories are set differently, the inSize for different categories is set the same, and the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) based on weights for different categories can be set the same. nTbW represents the width of the current block, nTbH represents the height of the current block, and the block category wcpSizeId is defined as follows.

[0221] That wcpSizeId = 0 indicates the current block with min(nTbW, nTbH) ≤ 4. Here, the control parameter(s) is 8, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.

[0222] That wcpSizeId = 1 indicates the current block with 4 < min(nTbW, nTbH) ≤ 16. Here, the control parameter(s) is 12, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.

[0223] That wcpSizeId = 2 indicates the current block with min(nTbW, nTbH) > 16. Here, the control parameter(s) is 16, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.

[0224] Table 6 is a table showing the numerical relationships of the above core parameters in tabular form.

[0225] [Table 6]

[0226] Another example of dividing into three categories will be described.

[0227] Based on the width and height of the current block, the current block is divided into three categories, and the control parameter(s) for different categories are set differently, the inSize for different categories is set the same, and the number of chrominance prediction outputs based on the weights of different categories (arranged in predSizeW×predSizeH) can be set 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.

[0228] wcpSizeId = 0 indicates the current block where min(nTbW, nTbH) ≤ 4. Here, the control parameter(s) is 8, the inSize is (2×nTbH + 2×nTbW), and nTbH×nTbW chrominance prediction values are output by chrominance prediction based on weights.

[0229] wcpSizeId = 1 indicates the current block where 4 < min(nTbW, nTbH) ≤ 16. Here, the control parameter(s) is 12, the inSize is (1.5×nTbH + 1.5×nTbW), and nTbH / 2×nTbW / 2 chrominance prediction values are output by chrominance prediction based on weights.

[0230] wcpSizeId = 2 indicates the current block where min(nTbW, nTbH) > 16. Here, the control parameter(s) is 16, the inSize is (nTbH + nTbW), and nTbH / 4×nTbW / 4 chrominance prediction values are output by chrominance prediction based on weights.

[0231] Table 7 shows the numerical relationships of the above core parameters in the form of a table.

[0232] [Table 7]

[0233] In classification example 2, the current block can also be classified in WCP mode based on its width and height, and the category of the block is represented by wcpSizeId. For blocks of different categories, the control parameter (S), the number of weight-based chroma prediction inputs inSize, and the number of weight-based chroma prediction outputs (ordered as predSizeW×predSizeH) may be the same or different. Here, the division into three categories is taken as an example.

[0234] Based on the width and height of the current block, the current block is divided into three categories, the control parameters (S) of different categories are set differently, the inSize of different categories is set to the same, and the number of chrominance prediction outputs (ordered as predSizeW×predSizeH) based on the weights of different categories can be set to 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 pixels of the current block. The block category wcpSizeId is defined as follows:

[0235] wcpSizeId=0 indicates a current block with (nTbW×nTbH)<128, where the control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and weight-based chrominance prediction outputs nTbH×nTbW chrominance prediction values.

[0236] wcpSizeId=1 indicates that the current block is 128≦(nTbW×nTbH)≦256, where the control parameter (S) is 8, inSize is (2×nTbH+2×nTbW), and the weight-based chrominance prediction outputs nTbH×nTbW chrominance prediction values.

[0237] wcpSizeId=2 indicates a current block of (nTbW×nTbH)>256, where the control parameter (S) is 1, inSize is (2×nTbH+2×nTbW), and weight-based chroma prediction outputs nTbH×nTbW chroma prediction values.

[0238] Table 8 shows the numerical relationships of the above core parameters in the form of a table.

[0239] [Table 8]

[0240] Here's another example that breaks it down into three categories:

[0241] Based on the width and height of the current block, the current block is divided into three categories, the control parameters (S) of different categories are set differently, the inSize of different categories is set to the same, and the number of chrominance prediction outputs (ordered as predSizeW×predSizeH) based on the weights of different categories can be set to 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 pixels of the current block. The block category wcpSizeId is defined as follows:

[0242] wcpSizeId=0 indicates a current block with (nTbW×nTbH)<64, where the control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and weight-based chrominance prediction outputs nTbH×nTbW chrominance prediction values.

[0243] wcpSizeId=1 indicates a current block with 64≦(nTbW×nTbH)≦512, where the control parameter (S) is 4, inSize is (1.5×nTbH+1.5×nTbW), and weight-based chrominance prediction outputs nTbH / 2×nTbW / 2 chrominance prediction values.

[0244] wcpSizeId=2 indicates a current block with (nTbW×nTbH)>512, where the control parameter (S) is 1, inSize is (nTbH+nTbW), and weight-based chroma prediction outputs nTbH / 4×nTbW / 4 chroma prediction values.

[0245] Table 9 shows the numerical relationships of the above core parameters in the form of a table.

[0246] [Table 9]

[0247] In step S1102, target information after a pre-processing operation is determined based on the core parameters.

[0248] In step S1102, the target information may include reference chromaticity information (refC), reference luma information (refY), and reconstructed luma information (recY). Here, for obtaining the target information (i.e., input information), when predicting the current block, the upper region, the upper left region, and the left region of the current block are the adjacent regions (also called "reference regions") of the current block, and all the pixels in the adjacent regions are decoded reference pixels, as shown in FIG. 6 above.

[0249] It should be further explained that the reference chrominance information refC and the reference luma information refY are obtained from adjacent regions. Obtaining the reference chrominance information includes but is not limited to selecting the reference chrominance reconstruction value of the upper region of the current block and / or the reference chrominance reconstruction value of the left region. Obtaining the reference luma information includes but is not limited to obtaining the corresponding reference luma information according to the position of the reference chrominance information.

[0250] The reconstructed luminance information recY of the current block is obtained, and the acquisition method includes, but is not limited to, obtaining corresponding reconstructed luminance information as the reconstructed luminance information of the current block based on the position of the chrominance information in the current block.

[0251] It can be understood that if the number of reference chromaticity information refC and the number of reference luma information refY obtained from the neighboring regions as described above are partially or completely different from the inSize specified in the step of determining the core parameters, or if the number of reconstructed luma information recY obtained from the current block is different from the pre-set size (predSizeW×predSizeH) specified in the step of determining the core parameters, then related processing needs to be performed on the three pieces of information obtained, and this step is performed before the prediction process, so this step is named as the process of pre-processing operation.

[0252] Here, the embodiment of the present application mainly targets the case where the inSize specified in the step of determining the core parameters is different from the number of reference chromaticity information refC and the number of reference luminance information refY obtained from the neighboring region, or the number of reconstructed luminance information recY obtained from the current block is different from the preset size (predSizeW×predSizeH) specified in the step of determining the core parameters. The following will introduce these two cases in detail.

[0253] First case: If the inSize specified in the step of determining the core parameters is different from the number of reference chromaticity information refC and the number of reference luma information refY obtained from the adjacent area, the number of pixels of the reference chromaticity information refC and the reference luma information refY obtained from the adjacent area needs to be converted into the inSize specified in the step of determining the core parameters and input, and the number of reference chromaticity information and the number of reference luma information are determined by the current color format information. Then, the specific process of the pre-processing operation for the first case is as follows:

[0254] (1) Considering the current color format information, normally, the quantity of reference luminance information and the quantity of reference chrominance information obtained from adjacent regions are unified and then matched with inSize in the core parameters. The processing process is as follows:

[0255] a. The quantity of reference luminance information and the quantity of reference chromaticity information obtained from adjacent regions are unified to refNum.

[0256] ●If the current color format information indicates 4:4:4 sampling (i.e., YUV444) and the ratio of luma samples to chroma samples is 4:4:4, the number of reference luma information refY obtained from the adjacent area is the same as the number of reference chroma information refC, and no operation is required.

[0257] ●If the current color format information indicates 4:2:2 sampling (i.e., YUV422) and the ratio of luma samples to chroma samples is 4:2:2, or if the current color format information indicates 4:2:0 sampling (i.e., YUV420) and the ratio of luma samples to chroma samples is 4:1:1, the reference luma information refY obtained from the adjacent area needs to be downsampled to match the number of reference chroma information refC, or the reference chroma information refC obtained from the adjacent area needs to be upsampled to match the number of reference luma information refY.

[0258] ●The current color format information includes, but is not limited to, the above-mentioned color format information, and the processing principle is that when the ratio of luma and chroma samples is different, downsampling needs to be performed on the reference luma information or upsampling needs to be performed on the reference chroma information.

[0259] b. Match the number of reference information, refNum, to inSize in the core parameters.

[0260] If inSize is equal to refNum, no operation is required.

[0261] If inSize is smaller than refNum, then size reduction must be performed on the reference luma and chroma information.

[0262] If inSize is greater than refNum, then it is necessary to perform size enlargement on the reference luma and chroma information.

[0263] It should be noted that the downsampling process mentioned in the processing process of the first case is specifically as follows: For the refNum reference chromaticity information refC obtained from the adjacent region, the downsampling of the reference luminance information refY can be performed by using a multi-tap filter to perform downsampling, by obtaining a specific pixel from a plurality of reference luminance pixels at the corresponding position of the reference chromaticity pixel, or by adopting other downsampling methods, and the embodiment of the present application is not limited thereto.

[0264] For example, as shown in FIG. 7A, when the color format information indicates 4:2:0 sampling, for example, a neighboring region of 8×4 luma pixels size needs to be downsampled to a region of 4×2 pixels size. In FIG. 7A, (a) represents the reference luma information refY, and (b) represents the reference luma information refY′ after downsampling. Here, the bold frame in (a) contains four luma pixels corresponding to the same chroma pixel, and (k, l) is the pixel position of the corresponding upper left corner. The bold frame in (b) contains a specific luma pixel that has been downsampled, and the same chroma pixel corresponding to the four luma pixels in the bold frame in (a) and the specific luma pixel that has been downsampled are a pair of luma pixel and chroma pixel at the same position, and (i, j) is the position of the downsampled luma pixel in the downsampled reference luma information refY′, where i=0,...,3, j=0,1.

[0265] When downsampling is performed using a 4-tap filter, for example, when the filter coefficients are [1,1,1,1], the calculation process of the pixel points of refY' is as follows:

[0266]

number

[0267]

number

[0268]

number

[0269] The upsampling process mentioned in the processing process of the first case is specifically as follows: For the refNum reference luminance information refY obtained from the adjacent region, the upsampling of the reference chrominance information refC can be performed by adopting a method such as linear interpolation or nonlinear interpolation, duplicating a specific reference chrominance pixel, or other upsampling methods, and the embodiment of the present application is not limited thereto.

[0270] For example, as shown in FIG. 7B, when the color format information indicates 4:2:0 sampling, for example, a neighboring area of ​​4×2 chrominance pixels size needs to be upsampled to an area of ​​8×4 pixels size. In FIG. 7B, (a) represents reference chrominance information refC, and (b) represents upsampled reference chrominance information refC′. Here, the bold frame of (a) includes chrominance pixels corresponding to the four upsampled chrominance pixels in the bold frame of (b), where k=0,...,3, l=0,1. The four chrominance pixels in the bold frame of (b) are upsampled chrominance pixels corresponding to the bold frame of (a), and (i,j) is the pixel position of the upper left corner.

[0271] When horizontal linear interpolation is adopted for upsampling, it is necessary to perform linear interpolation for pixel points of refC' using horizontally adjacent points, for example:

[0272] for k=0,…,3 and l=0,1 refC'[i][j]=(w0×refC[k][l]+w1×refC[k+1][l]+offset)≫shift (21) refC'[i+1][j]=(w2×refC[k][l]+w3×refC[k+1][l]+offset)≫shift(22) refC'[i][j+1]=(w4×refC[k][l]+w5×refC[k+1][l]+offset)≫shift(23) refC'[i+1][j+1]=(w6×refC[k][l]+w7×refC[k+1][l]+offset)≫shift (twenty four) where offset=1<<(shift-1). {w0, w1, w2, w3, w4, w5, w6, w7} and shift can be selected differently depending on the block size or block content, and the following shows an example of a commonly used combination of coefficients.

[0273]

number

[0274] for k=0,…,3 and l=0,1 refC'[i][j]=(w0×refC[k][l]+w1×refC[k][l+1]+offset)≫shift (25) refC'[i+1][j]=(w2×refC[k][l]+w3×refC[k][l+1]+offset)≫shift(26) refC'[i][j+1]=(w4×refC[k][l]+w5×refC[k][l+1]+offset)≫shift(27) refC'[i+1][j+1]=(w6×refC[k][l]+w7×refC[k][l+1]+offset)≫shift (28) where offset=1<<(shift-1). {w0, w1, w2, w3, w4, w5, w6, w7} and shift can be selected differently depending on the block size or block content, and the following shows an example of a commonly used combination of coefficients.

[0275]

number

[0276] for k=0,…,3 and l=0,1 refC'[i][j]=refC[k][l] (29) refC'[i+1][j]=refC[k][l] (30) refC'[i][j+1]=refC[k][l] (31) refC'[i+1][j+1]=refC[k][l] (32) (2) If the current color format information is not taken into account, it is sufficient to match the core parameter inSize, and the processing process is as follows:

[0277] a. The number of reference luminance information refYnum obtained from the adjacent reference area is made to match the core parameter inSize.

[0278] If inSize is equal to refYnum, no operation is required.

[0279] If inSize is smaller than refYnum, then size reduction must be performed on the reference luminance information.

[0280] If inSize is larger than refYnum, the reference luminance information needs to be enlarged.

[0281] b. The number of reference chromaticity information refCnum obtained from the reference area is made to match the WCP core parameter inSize.

[0282] If inSize is equal to refYnum, no operation is required.

[0283] If inSize is smaller than refYnum, then size reduction must be performed on the reference chromaticity information.

[0284] If inSize is larger than refYnum, the reference chromaticity information needs to be enlarged in size.

[0285] The size reduction operation process mentioned in the processing process of the first case is specifically as follows: Take the reference luminance information as an example, the number of reference luminance information obtained from the adjacent region is refYnum.

[0286] When size reduction is performed using a fixed interval point selection method, that is, refYnum reference luminance pixels are arranged in a one-dimensional vector according to a certain positional relationship, and then points are selected at fixed intervals based on the magnitude relationship between inSize and refYnum, thereby reducing the size of the reference luminance information. Here, the method of arranging in a one-dimensional vector and the start position of the fixed interval selection can be freely set, and the embodiment of the present application is not limited thereto.

[0287] For example, as shown in FIG. 8, reference luminance information refY obtained from an “L”-shaped reference area with one row and one column can be rearranged into a one-dimensional vector refY′ based on the positional relationship from the bottom left to the top left, and then from the top left to the top right.

[0288] Here, the fixed interval used for size reduction is subDist=(refYnum+inSize-1) / inSize, and starting from the first pixel position of refY' obtained above, one pixel is selected for every (subDist-1) pixel positions, so that inSize pieces of reference luminance information in_refY can finally be obtained. The detailed process is as follows:

[0289] for i = 0, …, inSize-1 in_refY[i]=refY'[i×subDist] (33) ●When size reduction is performed using the successive position selection method, that is, refYnum reference luminance pixels are arranged into a one-dimensional vector based on a certain positional relationship, and then inSize pixels are successively selected from specific positions of the one-dimensional vector to obtain in_refY. For example, selection starts from the posth position of refY'. The detailed process is as follows:

[0290] for i = 0, …, inSize-1 in_refY[i]=refY'[pos+i] (34) The operation process of size enlargement mentioned in the processing process of the first case is specifically as follows: Taking the reference chromaticity information as an example, the number of reference chromaticity information obtained from the adjacent region is refCnum.

[0291] ●When the size is enlarged by using the fixed interval interpolation method, that is, the reference chrominance pixels refCnum are arranged in a one-dimensional vector based on a certain positional relationship, and then points are selected at fixed intervals based on the magnitude relationship between inSize and refCnum, so that the size of the reference chrominance information can be enlarged. Here, the method of arranging in a one-dimensional vector and the starting position of the fixed interval interpolation can be freely set, and the embodiment of the present application is not limited thereto. After arranging refY in the same manner as in the size reduction, a one-dimensional vector refY' is obtained, and then the fixed interval used for the size enlargement is subDist=(refCnum+inSize-1) / refCnum, and starting from the first pixel position of refY', inSize pieces of reference luminance information in_refY are finally obtained. When the linear interpolation method is used, the detailed process is as follows:

[0292] for i = 0, …, inSize-1 if (i%subDist==0) in_refY[i]=refY'[i×subDist] (35) else

number

[0293]

number

[0294] If recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required.

[0295] If recSizeW is larger than predSizeW or recSizeH is larger than predSizeH, size reduction needs to be performed on the reconstructed luminance information recY.

[0296] If recSizeW is smaller than predSizeW, or if recSizeH is smaller than predSizeH, then size enlargement must be performed on the reconstructed luminance information recY.

[0297] The size reduction operation process mentioned in the processing process of the second case is specifically as follows: First, calculate a horizontal downsampling factor downHor based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed luminance information recY, and similarly, calculate a vertical downsampling factor downVer based on the height predSizeH determined by the core parameters and the height recSizeH of the reconstructed luminance information recY, and the calculation method thereof is as follows:

[0298] downHor=recSizeW / predSizeW (37) downVer=recSizeH / predSizeH (38) Next, downsampling is performed according to the following conditions to generate the input reconstructed luminance information in_recY.

[0299] (1) If downHor is greater than 1 and downVer is equal to 1, only horizontal downsampling is needed, and the specific formula is as follows:

[0300] in_recY[x][y]=(recY[downHor×x-1][y] +2×recY[downHor×x][y] +recY[downHor×x+1][y]+2)>>2 (39) (2) If downHor is equal to 1 and downVer is greater than 1, only vertical downsampling is needed, and the specific formula is as follows:

[0301] in_recY[x][y]=(recY[x][downVer×y-1]+2×recY[x][downVer×y] +recY[x][downVer×y+1]+2)>>2 (40) (3) If downHor and downVer are both greater than 1, downsampling needs to be performed in both the horizontal and vertical directions, and the specific formula is as follows:

[0302] in_recY[x][y]= (recY[downHor×x-1][downVer×y] +recY[downHor×x-1][downVer×y+1] +2*recY[downHor×x][downVer×y] +2*recY[downHor×x][downVer×y+1] +recY[downHor×x+1][downVer×y] +recY[downHor×x+1][downVer×y+1]+4)>>3 (41) The operation process of size enlargement mentioned in the processing process of the second case is specifically as follows: First, calculate a horizontal upsampling factor upHor based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed luminance information recY, and similarly, calculate a vertical upsampling factor upVer based on the height predSizeH determined by the core parameters and the height recSizeH of the reconstructed luminance information recY, and the calculation method thereof is as follows:

[0303] upHor=predSizeW / recSizeW (42) upVer=predSizeH / recSizeH (43) Next, upsampling is performed according to the following conditions to generate the input reconstructed luminance information in_recY.

[0304] First, the top reference reconstructed luminance pixel refY_T is input to the top row in_recY[x][-1] of the input reconstructed luminance information, and the left reference reconstructed luminance pixel refY_L is input to the left column in_recY[-1][y] of the input reconstructed luminance information, where x=0,...,predSizeW-1 and y=0,...,predSizeH-1. In this case, recY is substituted into the corresponding position of in_recY ((x+1)×upHor-1, (y+1)×upVer-1) according to the following formula:

[0305] in_recY[(x+1)×upHor-1][(y+1)×upVer-1]=recY[x][y](44) When in_recY is evenly divided into recSizeW×recSizeH sub-blocks, it can be understood that the assigned position is the position of the lower right corner of each sub-block. Referring to FIG. 12, for example, when predSizeW=8, predSizeH=8, and the size of the current block is 4×4, the diagonal lines are filled with the upper reference reconstructed luminance pixels refY_T, the vertical lines are filled with the left reference reconstructed luminance pixels refY_L, and the grid-like filled areas are the positions where the reconstructed luminance information recY of the current block is input.

[0306] If the horizontal upsampling factor upHor is greater than 1, first perform horizontal upsampling, and the upsampling process is as shown in the following formula:

[0307]

number

[0308] Linear interpolation upsampling is adopted as the upsampling method, that is, every value of each point (horizontal line fill) obtained by interpolation between two upsampling luminance reference points (grid fill) is the weighted average of two upsampling reference luminance points. According to Equation (45) and Equation (46), the weight of the left upsampling reference chromaticity point is (upHor-dX) / upHor, and the weight of the right upsampling reference chromaticity point is dX / upHor, where dX=1,...,upHor-1 (i.e., the distance between the current interpolation point and the left reference point). Thus, when performing horizontal interpolation, the weight only relates to the horizontal upsampling factor upHor. Figure 14 shows an example of the weight. In this example, upHor=4. Here, for the first interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 3 / 4 and the weight of the right upsampling reference chromaticity point is 1 / 4; for the second interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 2 / 4 and the weight of the right upsampling reference chromaticity point is 2 / 4; and for the third interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 1 / 4 and the weight of the right upsampling reference chromaticity point is 3 / 4.

[0309] If the vertical upsampling factor upVer is greater than 1, vertical upsampling needs to be performed, and the process is the same as the horizontal upsampling process. The specific process is as follows:

[0310] sum=(upVer-dY)×rec_Y[xVer][yVer]+dY×rec_Y[xVer][yVer+upVer](47)

number

[0311] The upsampling method also adopts linear interpolation, and according to equations (47) and (48), the weight of the upper upsampling reference point is (upVer-dY) / upVer, and the weight of the lower reference point is dY / upVer, where dY=1,...,upVer-1 (i.e., the distance between the current interpolation point and the upper reference point). Thus, when performing vertical interpolation, the weight only relates to the vertical upsampling factor upVer.

[0312] Thus, the final in_recY is obtained by the above process. For the above size enlargement process, in addition to the "horizontal first, then vertical" upsampling method, the "vertical first, then horizontal" upsampling method may be adopted, and the "horizontal first, then vertical" upsampled reconstructed luminance value and the "vertical first, then horizontal" upsampled reconstructed luminance value may be averaged to obtain the final input reconstructed luminance value in_recY, or a convolution operation in a neural network may be adopted instead of the upsampling operation, and the embodiment of the present application is not limited thereto.

[0313] In this way, the finally obtained input target information may include inSize pieces of reference chrominance information refC, inSize pieces of reference luma information refY, and reconstructed luma information recY of the current prediction block.

[0314] In step S1103, a weight-based chromaticity prediction calculation is performed based on the target information to determine a prediction block of the current block.

[0315] In step S1103, the chromaticity prediction value within the preset size specified by the core parameters is C pred It is represented as [i][j], where i=0,...,predSizeW-1, j=0,...,predSizeH-1, and is obtained step by step. Note that predSizeH and predSizeW are core parameters, and may be the same as or different from the height nTbH or width nTbW of the current block. Thus, under certain conditions, it is also possible to perform the following calculation for only a part of the pixels to be predicted in the current block.

[0316] Here, the chromaticity prediction calculation of the WCP mode may include the operation of obtaining weights and performing weighted prediction based on the weights to obtain chromaticity prediction values ​​based on the weights. The weight obtaining process includes constructing a luminance difference vector and calculating weights. The detailed calculation process is as follows:

[0317] For i = 0, …, predSizeW-1, j = 0, …, predSizeH-1 For k=0,1…,inSize-1 Construct each element of the brightness difference vector diffY[i][j][k] Each element of the weight vector, cWeight[i][j][k] (or cWeightFloat[i][j][k]), is calculated, and then the chromaticity prediction value Cpred[i][j] is calculated using cWeight[i][j] (or cWeightFloat[i][j][k]) and refC.

[0318] In one particular embodiment, referring to Fig. 16, an exemplary flow chart 3 of a decoding method according to an embodiment of the present application is shown. As shown in Fig. 16, the method may include the following steps:

[0319] In step S1601, for each pixel to be predicted, a luminance difference vector is constructed using reference chrominance information, reference luminance information included in the target information, and reconstructed luminance information of the current block.

[0320] For each prediction target pixel Cpred[i][j] within the size specified by the core parameters, the corresponding reconstructed luminance information recY[i][j] is subtracted from the inSize number of reference luminance information refY, and the absolute value of the subtracted difference is calculated to obtain the luminance difference vector diffY[i][j][k]. The specific calculation formula is as follows:

[0321] diffY[i][j][k]=abs(refY[k]-recY[i][j]) (49) Where:

number

[0322] It should be further noted that under certain conditions, the luminance difference vector of the pixel to be predicted can be subjected to linear or non-linear numerical processing, for example, the numerical value of the luminance difference vector of the pixel to be predicted can be scaled based on the control parameter S in the core parameters.

[0323] In step S1602, for each pixel to be predicted, a weight vector is calculated using a nonlinear function based on the luminance difference vector.

[0324] In the embodiment of the present application, a weight model is used to calculate each prediction target pixel C pred The brightness difference vector diffY[i][j] corresponding to [i][j] is processed to obtain a corresponding floating-point weight vector cWeightFloat[i][j], where the weight model includes, but is not limited to, a nonlinear function such as a nonlinear normalization function, a nonlinear exponential normalization function, and the present application is not limited thereto.

[0325] For example, a nonlinear Softmax function can be used as the weighting model, in which the luminance difference vector diffY[i][j] corresponding to each pixel to be predicted is input to the weighting model, and the weighting model outputs a floating-point weight vector cWeightFloat[i][j] corresponding to each pixel to be predicted, and the calculation formula for this vector is as follows:

[0326]

number

[0327]

number

[0328] In this way, after the calculation of the above equation (50) or (51) is completed, the fixed-point processing can be performed on cWeightFloat as shown below.

[0329] cWeight[i][j][k]=round(cWeightFloat[i][j][k]×2 Shift ) (52) Here, round(x) = Sign(x) × Floor(abs(x) + 0.5), where Floor(x) is the largest integer less than or equal to x,

number

[0330] In step S1603, a weighted calculation is performed for each pixel to be predicted based on the weight vector and the reference chromaticity information included in the target information to obtain a chromaticity predicted value.

[0331] The chromaticity prediction value of the prediction target pixel is calculated based on the weight vector cWeight[i][j] (or cWeightFloat[i][j]) corresponding to each prediction target pixel and the reference chromaticity information refC. pred The reference chromaticity information refC of [i][j] is multiplied by the weight vector element corresponding to each pixel to be predicted one by one to obtain subC[i][j] (or subCFloat[i][j]). The result of accumulating the multiplication results is the chromaticity prediction value C of each pixel to be predicted. pred [i][j], and weighted prediction for the chrominance components is realized.

[0332] In one possible embodiment, a weighted calculation can be performed based on the floating-point weighting coefficients and reference chromaticity information to obtain an initial predicted value of the pixel to be predicted, and a fixed-point conversion process can be performed on the initial predicted value to obtain a target predicted value of the pixel to be predicted.

[0333] As an example, the calculation formula is as follows:

[0334] For k=0,1,…,inSize-1 subCFloat[i][j][k]=(cWeightFloat[i][j][k]×refC[k]) (53) After the calculation is completed, the fixed-point conversion process can be performed on subCFloat[i][j][k]. In order to maintain a certain calculation accuracy in the fixed-point conversion process, a coefficient can be multiplied here, as shown below:

[0335] subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift ) (54) or For i = 0, …, predSizeW-1, j = 0, …, predSizeH-1

number

[0336] C pred [i][j]=round(C pred Float[i][j]) (56) In another possible embodiment, a weighted calculation can be performed based on the fixed-point weighting coefficients and reference chromaticity information to obtain an initial predicted value of the pixel to be predicted, and a fixed-point compensation process can be performed on the initial predicted value to obtain a target predicted value of the pixel to be predicted.

[0337] As an example, the calculation formula is as follows:

[0338] For k=0,1,…,inSize-1 subC[i][j][k]=(cWeight[i][j][k]×refC[k]) (57) Next, calculation is performed using the fixed-point converted subC[i][j][k], as shown below.

[0339] For i = 0, …, predSizeW-1, j = 0, …, predSizeH-1

number

[0340] In step S1604, for each pixel to be predicted, a correction process is performed on the calculated chrominance prediction value to determine the predicted block of the current block.

[0341] Note that the chrominance prediction value should be restricted within a preset range. When it exceeds the preset range, it is necessary to perform a corresponding correction operation. Exemplarily, in one possible embodiment, a clamp operation can be performed on the chrominance prediction value of C pred [i][j], and specifically it is as follows.

[0342] ● If the value of C pred [i][j] is less than 0, set it to 0; ● If the value of C pred [i][j] is greater than (1 << BitDepth) - 1, set it to (1 << BitDepth) - 1.

[0343] Here, BitDepth is the bit depth required for the chrominance pixel value, and all chrominance prediction values within the predicted block are made to be within the range of 0 to (1 << BitDepth) - 1.

[0344] That is, C pred [i][j] = Clip3(0, (1 << BitDepth) - 1, C pred [i][j]) (59) Here,

Equation

[0345]

number

[0346] In addition, after the chromaticity prediction value (predWcp) is output by the weight-based chromaticity prediction, under certain conditions, a post-processing operation needs to be performed to obtain the final chromaticity prediction value (predSamples); otherwise, the final chromaticity prediction value predSamples is predWcp.

[0347] For example, in order to reduce instability caused by performing independent and parallel prediction for each pixel in WCP, smoothing filtering can be performed on predWcp to obtain the final chrominance prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, a position-related correction process can be performed on predWcp. For example, a reference pixel with a close spatial position can be used to calculate a chrominance compensation value for each pixel to be predicted, and the chrominance compensation value can be used to correct predWcp, and the corrected prediction value can be the final chrominance prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, a chrominance prediction value calculated in another chrominance prediction mode and a chrominance prediction value predWcp calculated in WCP can be weighted and fused, and the fusion result can be the final chrominance prediction value predSamples. For example, a chrominance prediction value predicted in CCLM mode and a chrominance prediction value predWcp calculated in WCP can be weighted or unequal, and the weighted result can be the final chrominance prediction value predSamples. Alternatively, in order to improve the prediction performance of the WCP, the prediction output predWcp of the WCP may be modified using a neural network model, and the embodiments of the present application are not limited thereto.

[0348] It can be further understood that in the embodiment of the present application, when the reference chromaticity information redCref and reference luma information redYref having a parameter size of inSize determined in WCP mode, and the reconstructed luma information redYrec of the current block having a parameter size of (predSizeW×predSizeH) determined in WCP mode have already been obtained, some of the above three pieces of information have already undergone upsampling, downsampling or size reduction / enlargement operations, or have not undergone these operations, so there is still spatial redundancy between them. In this case, filtering operations can be performed on the reference chromaticity information redCref, reference luma information redYref, and reconstructed luma information redYrec, and three new sets of information can be obtained, including reference chromaticity information redCref', reference luma information redYref', and reconstructed luma information redYrec', by adopting different filtering operations according to different parameter values ​​of inSize and predSizeW×predSizeH determined in WCP mode. For example, filtering can be performed on redCref, redYref, and redYrec using linear and nonlinear filtering such as mean filtering, median filtering, and Gaussian filtering, or methods such as neural networks. Furthermore, these filtering operations can be performed before upsampling, downsampling, or size reduction / enlargement operations to obtain three new sets of information including reference chromaticity information refC', reference luma information refY', and reconstructed luma information recY', which can then be subjected to upsampling, downsampling, or size reduction / enlargement operations.

[0349] It can be further understood that in the embodiment of the present application, the number of reference chromaticity information refC obtained from the neighboring region is refSizeC, the number of reference luma information refY obtained from the neighboring region is refSizeY, and the size of the reconstructed luma information recY obtained from the current block is recSizeW×recSizeH, where recSizeW is the block width of the reconstructed luma information recY, and recSizeH is the block height of the reconstructed luma information recY. These reference chromaticity information, reference luma information, and reconstructed luma information can all be matched by the neural network to the inSize and (predSizeW×predSizeH) specified in the step of determining the core parameters, and these three pieces of information can adopt the same or different neural network models according to different situations, that is, the operations of upsampling, downsampling, or size reduction / enlargement are all replaced by the neural network model. In addition, the filtering operation according to the above embodiment can be performed before or after using the neural network model to obtain three new sets of information including reference luma information, reference chromaticity information, and reconstructed luma information.

[0350] It can be further understood that in the embodiment of the present application, in the weight-based chrominance prediction of the WCP mode, the reference information used for predicting a chrominance pixel is fixed, which inevitably affects the prediction accuracy. Therefore, a method for changing the reference pixel of each pixel is proposed here, and the detailed process is as follows:

[0351] First, the core parameters include, but are not limited to, a control parameter (S), the number of weight-based chrominance prediction inputs inSize[i][j], and the number of weight-based chrominance prediction outputs (predWcp) (ordered as predSizeW×predSizeH), where inSize[i][j] represents the number of reference pixels used for a given prediction target pixel Cpred[i][j], i=0,...,predSizeW-1,j=0,...,predSizeH-1.

[0352] Then, the reference chrominance information refC and the reference luma information refY are obtained from the neighboring regions. Obtaining the reference chrominance information includes but is not limited to selecting the reference chrominance reconstruction value of the upper region of the current block and the reference chrominance reconstruction value of the left region. Obtaining the reference luma information includes but is not limited to obtaining the corresponding reference luma information according to the reference chrominance information position.

[0353] The reconstructed luminance information recY of the current block is obtained, and the acquisition method includes, but is not limited to, obtaining corresponding reconstructed luminance information as the reconstructed luminance information of the current block based on the position of the chrominance information in the current block.

[0354] Third, for different prediction positions of a block of size predSizeW×predSizeH, different reference luma information refY[i][j] and reference chroma information refC[i][j] are selected from the reference chroma information refC and reference luma information refY obtained from adjacent regions, and the detailed process is as follows:

[0355] For i = 0, …, predSizeW-1, j = 0, …, predSizeH-1 For k=0,1,…,inSize-1 Obtaining input target information includes obtaining inSize[i][j] pieces of reference chromaticity information refC, obtaining inSize[i][j] pieces of reference luma information refY, and obtaining reconstructed luma information recY[i][j].

[0356] Fourth, for each prediction target pixel C within the size specified by the core parameters pred For [i][j], subtract inSize[i][j] pieces of reference luminance information refY[i][j] from the corresponding reconstructed luminance information recY[i][j], and obtain the absolute value of the subtracted difference to obtain a luminance difference vector diffY[i][j][k]. Here, refY[i][j] is the pixel to be predicted.

number

[0357] For i = 0, …, predSizeW-1, j = 0, …, predSizeH-1 For k=0,1,…,inSize[i][j]-1 diffY[i][j][k]=abs(refY[i][j][k]-recY[i][j]) (62) Under certain conditions, the luminance difference vector of the pixel to be predicted may be subjected to linear or non-linear numerical processing. For example, the numerical value of the luminance difference vector of the pixel to be predicted may be scaled according to the control parameter S in the core parameters.

[0358] Fifth, a chromaticity prediction value of the prediction target pixel is calculated based on the weight vector cWeight[i][j] and reference chromaticity information refC corresponding to each prediction target pixel. Specifically, the reference chromaticity information refC[i][j] of each prediction target pixel Cpred[i][j] is multiplied by the weight vector element corresponding to each prediction target pixel one by one to obtain subC[i][j], and the result of accumulating the multiplication results becomes the chromaticity prediction value Cpred[i][j] of each prediction target pixel (i.e., weighted prediction). Here, refC[i][j] is the chromaticity prediction value of the prediction target pixel Cpred[i][j] (i.e., weighted prediction). pred A set of reference chromaticity vectors corresponding to [i][j], and the calculation formula is as follows:

[0359] For k=0,1,…,inSize-1 subCFloat[i][j][k]=(cWeightFloat[i][j][k]·refC[i][j][k]) (63) After the calculation is completed, subCFloat can be converted to fixed point. In order to maintain a certain calculation accuracy in the fixed point conversion process, a coefficient can be further multiplied, as shown in the following formula:

[0360] subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift ) (64) or subC[i][j][k]=(cWeight[i][j][k]×refC[i][j][k]) (65) It can be further understood that in the embodiment of the present application, the neighboring region is the same as that used in other existing chrominance prediction modes, which inevitably affects the prediction accuracy. Therefore, it is also possible to change the neighboring region. For example, the reference region of the WCP prediction technology can be extended using the existing multi-reference row technology in H.266, and can be extended to neighboring regions of multiple rows or columns such as 0, 1, 2, 3, 4, 5, 6, 7, etc., as shown in FIG. 17, and used as the reference region of the current block, but is not limited to this technology, and the reference row or reference column can be increased or decreased, and the embodiment of the present application is not limited thereto.

[0361] This embodiment provides a decoding method, and through this embodiment, the specific implementation of the above-mentioned embodiment is described in detail, and it can be seen that the technical solution of the above-mentioned embodiment can improve the accuracy of the WCP prediction technology. Specifically, by optimizing the acquisition process of the target information, under different core parameter circumstances, according to the current different color format information or the number of different acquired information, different processing methods (including filtering methods such as upsampling, downsampling, size reduction, and size expansion) are used to match the number of acquired information with the number of information specified by the WCP, and the target information modification process is completed to obtain the final chrominance predicted value. In the case of different color format information, the spatial characteristics shown by all pixels of the reference luminance pixels and reference chrominance pixels acquired from the adjacent area are different according to the images of different content characteristics, so that the continuity of its spatial correlation can be enhanced to a certain extent through upsampling or downsampling processing, or some information with relatively weak spatial correlation can be removed, and used as the final input target information of the WCP prediction technology, thereby improving the accuracy of the predicted value, improving the accuracy of chrominance prediction, and improving the encoding and decoding performance while saving the bit rate.

[0362] In another embodiment of the present application, referring to Fig. 18, an exemplary flow chart 1 of an encoding method according to an embodiment of the present application is shown. As shown in Fig. 18, the method may include the following steps:

[0363] In step S1801, the reference information for the current block is determined.

[0364] It should be noted that the encoding method of the embodiment of the present application can be applied to an encoding device or an encoding device (also called an "encoder") integrated with the encoding device. In addition, the encoding method of the embodiment of the present application can specifically refer to an intra prediction method, more specifically, a pre-processing operation method of weight-based chrominance prediction.

[0365] In the embodiment of the present application, a video image can be divided into a plurality of coding blocks, each coding block may include a first color component, a second color component, and a third color component, where the current block refers to a coding block that is currently intra-predicted in a video image. Furthermore, if the current block performs prediction of the first color component, and the first color component is a luma component, that is, if the component to be predicted is a luma component, the current block can also be called a luma prediction block. Or, if the current block performs prediction of the second color component, and the second color component is a chroma component, that is, if the component to be predicted is a chroma component, the current block can also be called a chroma prediction block.

[0366] It should be further explained that in the embodiments of the present application, the reference information of the current block may include a value of a first color component sample point in a neighboring region of the current block and a value of a second color component sample point in a neighboring region of the current block, and these sample points (Samples) can be determined based on the encoded pixels in the neighboring region of the current block. In some embodiments, the neighboring region of the current block may include at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region.

[0367] In addition, the reference information of the current block may further include a reconstruction value of the first reference color component sample point in the current block. Thus, in some embodiments, determining the reference information of the current block may include: This may include determining reference information for the current block based on values ​​of the first color component sample points in adjacent regions of the current block, values ​​of the second color component sample points in adjacent regions of the current block, and reconstructed values ​​of the first reference color component sample points in the current block.

[0368] In the embodiment of the present application, the reference pixel of the current block may refer to a reference pixel point adjacent to the current block, and is also called a first color component sample point or a second color component sample point in the adjacent region of the current block, and is expressed as a Neighboring Sample or a Reference Sample. Here, the term "adjacent" may mean spatially adjacent, but is not limited thereto. For example, the term "adjacent" may mean adjacent in the time domain, or adjacent in the space and time domain. Furthermore, the reference pixel of the current block may be a reference pixel point adjacent in space, a reference pixel point adjacent in the time domain, or a reference pixel obtained by performing a specific process on a reference pixel point adjacent in the space and time domain, but the embodiment of the present application is not limited thereto.

[0369] It should be further explained that in the embodiment of the present application, the first color component is a luminance component and the second color component is a chrominance component, then the value of the first color component sample point in the adjacent region of the current block is indicated as reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sample point in the adjacent region of the current block is indicated as reference chrominance information corresponding to the reference pixel of the current block.

[0370] In step S1802, a filtering process is performed on a portion of the reference information of the current block to determine target information of the current block.

[0371] In an embodiment of the present application, there may be cases where the quantity of values ​​of the first color component sample points in an adjacent area of ​​the current block is different from the quantity of values ​​of the second color component sample points. In this case, in order to make the quantities of both the values ​​the same, it may be necessary to perform a filtering process on the values ​​of the first color component sample points or a filtering process on the values ​​of the second color component sample points.

[0372] In one possible embodiment, performing a filtering process on a part of the reference information of the current block to determine the target information of the current block includes performing a first filtering process on values ​​of first color component sample points in an adjacent area of ​​the current block to obtain filtered sample values ​​of the first color component in the adjacent area of ​​the current block; and determining target information for the current block based on the filtered sample values ​​of the first color component in a neighboring region of the current block.

[0373] In an embodiment of the present application, the quantity of filtered sample values ​​of the first color component in the adjacent region of the current block is equal to L, where L represents the quantity of values ​​of the second color component sample points in the adjacent region of the current block, and L is a positive integer.

[0374] In one specific embodiment, the first filtering process may be a downsampling filtering process. For example, the number of reference luma information of the current block is usually greater than the number of reference chroma information, so that the number of reference luma information and the number of reference chroma information are equal to each other, a downsampling filtering process may be performed on the reference luma information of the current block.

[0375] It should be further explained that since the number of reference luma information and the number of reference chroma information of the current block are affected by the color format information, in some embodiments, the method may further include performing a first filtering process on values ​​of first color component sample points in an adjacent area of ​​the current block based on the color format information, and obtaining filtered sample values ​​of the first color component in the adjacent area of ​​the current block.

[0376] In one particular embodiment, the first filtering process comprises: If the color format information indicates 4:4:4 sampling, downsampling filtering is not performed on the value of the first color component sample point in the adjacent area of ​​the current block; If the color format information indicates 4:2:2 sampling, performing downsampling filtering on values ​​of first color component sample points in an adjacent region of the current block; If the color format information indicates 4:2:0 sampling, the method may further include performing downsampling filtering on values ​​of the first color component sample points in the neighboring region of the current block.

[0377] Note that in this embodiment, if the color format information indicates 4:2:0 sampling, then the downsampling rate is the reciprocal of a positive integer multiple of two.

[0378] In this manner, the downsampling filtering performed on the reference luminance information obtained from the adjacent region may involve downsampling using a multi-tap filter (e.g., a 4-tap filter, a 5-tap filter, a 6-tap filter, etc.), or may involve obtaining a specific pixel from among multiple reference luminance pixels at a position corresponding to the reference chrominance pixel, or may even involve other downsampling methods, and the embodiments of the present application are not limited thereto.

[0379] Furthermore, when the number of down-sampling filtered reference luma information is L and is the same as the number of reference chroma information, it is necessary to make L equal to a preset number. Thus, in some embodiments, the method includes: Comparing L to a preset number; and According to a comparison result between L and a preset number, performing a second filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

[0380] In one particular embodiment, performing a second filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block based on the comparison result between L and the preset number to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block, comprises: If L is greater than a preset number, performing a first sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; If L is smaller than a preset number, performing a second sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0381] It should be noted that in the embodiment of the present application, the preset number can be expressed as inSize. Specifically, when L is equal to the preset number, no operation is required, when L is greater than the preset number, a first sub-filtering process (i.e., size reduction) needs to be performed on the reference luma information and the reference chroma information, and when L is smaller than the preset number, a second sub-filtering process (i.e., size expansion) needs to be performed on the reference luma information and the reference chroma information.

[0382] In another possible embodiment, performing a filtering process on a part of the reference information of the current block to determine the target information of the current block includes performing a third filtering process on values ​​of second color component sample points in an adjacent area of ​​the current block to obtain filtered sample values ​​of the second color component in the adjacent area of ​​the current block; and determining target information for the current block based on the filtered sample values ​​of the second color component in a neighboring region of the current block.

[0383] In an embodiment of the present application, the quantity of filtered sample values ​​of the second color component in the adjacent region of the current block is equal to K, where K represents the quantity of values ​​of the first color component sample points in the adjacent region of the current block, and K is a positive integer.

[0384] In one specific embodiment, the third filtering process is an upsampling filtering process.Exemplarily, the number of reference luma information of the current block is usually greater than the number of reference chroma information, so that the number of reference luma information and the number of reference chroma information are equal, the upsampling filtering process can be performed on the reference chroma information of the current block.

[0385] Because the number of reference luma information and the number of reference chroma information of the current block are affected by the color format information, in some embodiments, the method may further include performing a third filtering process on values ​​of second color component sample points in an adjacent area of ​​the current block based on the color format information, and obtaining filtered sample values ​​of the second color component in the adjacent area of ​​the current block.

[0386] In one particular embodiment, the third filtering process comprises: If the color format information indicates 4:4:4 sampling, not performing upsampling filtering on values ​​of second color component sample points in adjacent regions of the current block; If the color format information indicates 4:2:2 sampling, performing upsampling filtering on values ​​of second color component sample points in an adjacent region of the current block; If the color format information indicates 4:2:0 sampling, the method may further include performing upsampling filtering on values ​​of second color component sample points in the neighboring region of the current block.

[0387] Note that in the embodiment of the present application, when the color format information indicates 4:2:0 sampling, the upsampling rate is a positive integer multiple of 2. In this way, when the number of reference luma information obtained from the adjacent region is different from the number of reference chroma information, upsampling filtering can be performed on the reference chroma information obtained from the adjacent region to match the number of reference luma information.

[0388] In this manner, the upsampling filtering performed on the reference chromaticity information obtained from the adjacent region may involve upsampling using a method such as linear interpolation or nonlinear interpolation, or may involve replicating specific reference chromaticity pixels, or may even involve other upsampling methods, and the embodiments of the present application are not limited thereto.

[0389] Furthermore, if the number of upsampling filtered reference chrominance information is K and is the same as the number of reference luma information, K needs to be equal to a preset number. Thus, in some embodiments, the method includes: Comparing K to a preset number; and According to a comparison result between K and a preset number, performing a fourth filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

[0390] In one particular embodiment, performing a fourth filtering process on the values ​​of the first color component sample points in the neighboring region of the current block and the filtered sample values ​​of the second color component in the neighboring region of the current block based on a comparison result between K and the preset number to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block, includes: If K is greater than a preset number, performing a first sub-filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; If K is smaller than a preset number, the method may include performing a second sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block.

[0391] It should be noted that in the embodiment of the present application, the preset number can be represented by inSize. Specifically, when K is equal to inSize, no operation is required, when K is greater than inSize, the first sub-filtering process (i.e., size reduction) needs to be performed on the reference luma information and the reference chroma information, and when K is smaller than inSize, the second sub-filtering process (i.e., size expansion) needs to be performed on the reference luma information and the reference chroma information.

[0392] It can further be understood that in an embodiment of the present application, when color format information is not taken into account, the number of reference luminance information obtained from adjacent regions can be made the same as the number of reference chromaticity information by directly matching them with inSize.

[0393] In one possible embodiment, performing a filtering process on a part of the reference information of the current block to determine the target information of the current block includes determining a quantity of values ​​of a first color component sample point in an adjacent region of the current block as a first quantity; performing a fifth filtering process on values ​​of the first color component sample points in the neighboring region of the current block according to a comparison result between the first quantity and the preset number to determine filtered neighboring sample values ​​of the first color component of the current block; and determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block.

[0394] In one particular embodiment, performing a fifth filtering process on values ​​of the first color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block includes: If the first quantity is greater than the preset number, performing a first sub-filtering process on values ​​of first color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block; If the first quantity is smaller than a preset number, performing a second sub-filtering process on values ​​of the first color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block.

[0395] In addition, in the embodiment of the present application, the number of reference luminance information obtained from the adjacent region can be the same as the preset number. Here, the number of reference luminance information obtained from the adjacent region (i.e., the first quantity) can be represented by refYnum, and the preset number can be represented by inSize. Specifically, when refYnum is equal to inSize, no operation is required, when refYnum is greater than inSize, the first sub-filtering process (i.e., size reduction) needs to be performed on the reference luminance information, and when refYnum is smaller than inSize, the second sub-filtering process (i.e., size expansion) needs to be performed on the reference luminance information.

[0396] In another possible embodiment, performing a filtering process on a part of the reference information of the current block to determine the target information of the current block includes determining a quantity of values ​​of the second color component sample points in an adjacent region of the current block as a second quantity; performing a sixth filtering process on values ​​of second color component sample points in the neighboring region of the current block according to a comparison result between the second quantity and the preset number to determine filtered neighboring sample values ​​of the second color component of the current block; The method may further include determining target information of the current block based on the filtered neighboring sample values ​​of the second color component of the current block.

[0397] In one particular embodiment, performing a sixth filtering operation on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block includes: If the second quantity is greater than the preset number, performing a first sub-filtering process on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block; If the second quantity is smaller than the preset number, performing a second sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block.

[0398] It should be further explained that in the embodiment of the present application, the number of reference chromaticity information obtained from the adjacent region can be equal to a preset number. Here, the number of reference chromaticity information obtained from the adjacent region (i.e., the second quantity) can be represented by refCnum, and the preset number can be represented by inSize. Specifically, when refCnum is equal to inSize, no operation is required; when refCnum is greater than inSize, a first sub-filtering process (i.e., size reduction) needs to be performed on the reference chromaticity information; when refCnum is less than inSize, a second sub-filtering process (i.e., size expansion) needs to be performed on the reference chromaticity information.

[0399] In some embodiments of the present application, the first sub-filtering process may be a downsampling filtering process. In addition, in some embodiments, the first sub-filtering process may be A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by adopting a successive position selection scheme.

[0400] In the embodiments of the present application, the second sub-filtering process may be an upsampling filtering process. In addition, in some embodiments, the second sub-filtering process may further include performing the sub-filtering process by adopting a fixed interval position interpolation manner.

[0401] It can be further understood that when performing chrominance component prediction on the current block, the reference information of the current block may further include reconstructed luma information of the current block, and thus the reference information of the current block can also be determined based on the reconstructed value of the first reference color component sample point in the current block.

[0402] In an embodiment of the present application, the first reference color component may be a luminance component, and in this case, the reconstructed value of the first reference color component sample point in the current block is the reconstructed luminance information of the current block. Since the amount of reconstructed luminance information of the current block is different from the preset size, a filtering process needs to be performed on the reconstructed luminance information of the current block in order to convert the amount of reconstructed luminance information obtained from the current block into the preset size and input it. Here, the preset size is predSizeW×predSizeH, where predSizeW represents the width of the prediction block and predSizeH represents the height of the prediction block.

[0403] In some embodiments, performing a filtering process on a portion of the reference information of the current block and determining target information of the current block may include performing a seventh filtering process on a reconstructed value of a first reference color component sample point in the current block and determining a filtered sample value of the first reference color component sample point in the current block; and determining the target information of the current block based on the filtered sample value of the first reference color component sample point in the current block.

[0404] In one particular embodiment, performing a seventh filtering operation on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block includes: determining a first width and a first height based on the reconstructed values ​​of the first reference color component sample points in the current block; If the first width is greater than the width of the prediction block or the first height is greater than the height of the prediction block, performing a third sub-filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; If the first width is smaller than the width of the predicted block, or if the first height is smaller than the height of the predicted block, performing a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block.

[0405] In addition, in the embodiment of the present application, assuming that the number of reconstructed luminance information is recSizeW×recSizeH, recSizeW represents a first width and recSizeH represents a first height. Specifically, when recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required, when recSizeW is larger than predSizeW or recSizeH is larger than predSizeH, a first sub-filtering process (i.e., size reduction) needs to be performed on the reconstructed luminance information, and when recSizeW is smaller than predSizeW or recSizeH is smaller than predSizeH, a second sub-filtering process (i.e., size enlargement) needs to be performed on the reconstructed luminance information.

[0406] It should be further explained that in the embodiments of the present application, the third sub-filtering process may be a downsampling filtering process. In addition, in some embodiments, the third sub-filtering process may be: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process vertically on the reconstructed values ​​of the first reference color component sample points in the current block; performing a downsampling filtering process in the horizontal direction and then a downsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and The method may further include at least one of performing a downsampling filtering operation in a vertical direction and then performing a downsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

[0407] Here, first, a horizontal downsampling factor can be calculated according to recSizeW and predSizeW, a vertical downsampling factor can be calculated according to recSizeH and predSizeH, and then downsampling filtering can be performed on the reconstructed luminance information according to the horizontal downsampling factor and the vertical downsampling factor. Specifically, when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling can only be performed on the reconstructed luminance information in the horizontal direction; when the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling can only be performed on the reconstructed luminance information in the vertical direction; when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling can be performed on the reconstructed luminance information in both the horizontal and vertical directions, where the horizontal downsampling can be performed first and then the vertical downsampling, or the vertical downsampling can be performed first and then the horizontal downsampling, and even a convolution operation in a neural network structure can be adopted instead of the downsampling operation here, and the embodiment of the present application is not limited thereto.

[0408] It should be further explained that in the embodiments of the present application, the fourth sub-filtering process is an upsampling filtering process. In addition, in some embodiments, the fourth sub-filtering process is performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in the horizontal direction and then a upsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and The method may further include at least one of performing an upsampling filtering operation in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing an upsampling filtering operation in a horizontal direction.

[0409] Here, firstly, a horizontal upsampling factor is calculated based on recSizeW and predSizeW, a vertical upsampling factor is calculated based on recSizeH and predSizeH, and then upsampling filtering is performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical upsampling factor. Specifically, when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, it is only necessary to perform upsampling on the reconstructed luminance information in the horizontal direction; when the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, it is only necessary to perform upsampling on the reconstructed luminance information in the vertical direction; when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, it is necessary to perform upsampling on the reconstructed luminance information in both the horizontal and vertical directions, whereby the horizontal upsampling may be performed first and then the vertical upsampling, or the vertical upsampling may be performed first and then the horizontal upsampling; furthermore, a weighted average may be performed on the upsampling result of "horizontal first, then vertical" and the upsampling result of "vertical first, then horizontal" to determine the final upsampling result; or a convolution operation in a neural network structure may be adopted instead of the upsampling operation here, and the embodiments of the present application are not limited thereto.

[0410] That is, in an embodiment of the present application, the reference information of the current block may include values ​​of the first color component sample points in the adjacent area of ​​the current block, values ​​of the second color component sample points in the adjacent area of ​​the current block, and a reconstructed value of the first reference color component sample point in the current block, and the target information may include filtered adjacent sample values ​​of the first color component of the current block, filtered adjacent sample values ​​of the second color component of the current block, and a filtered sample value of the first reference color component sample point in the current block, where if there is no need to perform a filtering process on the values ​​of the first color component sample points in the adjacent area of ​​the current block, the filtered adjacent sample values ​​of the first color component of the current block are equal to the values ​​of the first color component sample points in the adjacent area of ​​the current block. Similarly, if no filtering operation needs to be performed on the value of the second color component sample point in the adjacent area of ​​the current block, the filtered adjacent sample value of the second color component of the current block is equal to the value of the second color component sample point in the adjacent area of ​​the current block, and if no filtering operation needs to be performed on the reconstructed value of the first reference color component sample point in the current block, the filtered sample value of the first reference color component sample point in the current block is equal to the reconstructed value of the first reference color component sample point in the current block.

[0411] In this way, the obtained target information may include filtered adjacent sample values ​​of the first color component of the current block, filtered adjacent sample values ​​of the second color component of the current block, and filtered sample values ​​of the first reference color component sample point in the current block, i.e., inSize pieces of reference chromaticity information, inSize pieces of reference luma information, and reconstructed luma information that fits a preset size.

[0412] In step S1803, a weighting coefficient is determined based on a reference sample value of a first color component in the target information.

[0413] In addition, after determining the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point in the current block, in some embodiments, the method may further include setting the reference sample value of the first color component in the target information to an absolute value of a difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block.

[0414] In some embodiments, the method may further include setting a reference sample value of the second color component in the target information to the filtered neighboring sample value of the second color component of the current block.

[0415] Further, considering the filtering process on the reference information, the filtering process can be performed only on the reference luminance information, the filtering process can be performed only on the reconstructed luminance information, the filtering process can be performed only on the reference luminance information and the reconstructed luminance information, or the filtering process can be performed on all of the reference chromaticity information, the reference luminance information, and the reconstructed luminance information, and the filtering process can be performed ...

[0416] In some embodiments, determining a weighting coefficient based on a reference sample value of a first color component in the target information comprises: determining a value corresponding to the reference sample value of the first color component based on a preset mapping relationship; and setting a weighting factor equal to that value.

[0417] It should be noted that in the embodiment of the present application, the reference sample value of the first color component may be an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of the first reference color component sample point in the current block, where the first reference color component is a first color component, which is a color component different from the predicted second color component in the embodiment of the present application.

[0418] In the embodiment of the present application, in order to predict the chrominance components of the pixel to be predicted in the current block, at least one pixel to be predicted in the current block is selected, and the luminance difference |ΔY k | (represented by |ΔY k When | is relatively small, it indicates that the similarity of the brightness values ​​is relatively strong, and the corresponding weight coefficient (w k ) and conversely, |ΔY k When | is relatively large, it indicates that the similarity of the brightness values ​​is relatively weak, and w k In other words, in the pre-defined mapping relationship, w k and |ΔY k | are almost inversely proportional.

[0419] Further, in some embodiments, determining a value corresponding to a reference sample value of a first color component based on the preset mapping relationship may include determining a first factor, determining a first product value based on the first factor and the reference sample value of the first color component, and determining a corresponding value of the first product value based on the preset mapping relationship.

[0420] In one particular embodiment, determining the first factor may include the first factor being a preset constant value.

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

[0422] Moreover, in some embodiments, the method may further include determining a value of the first factor based on a mapping lookup table of a preset size parameter of the current block and a value of the first factor.

[0423] Here, the size parameter of the current block may include at least one of the width of the current block, the height of the current block, and the multiplication product of the width and height of the current block.

[0424] In addition, in the embodiment of the present application, the value of the first factor can be fixed in a classification manner. For example, the size parameter of the current block can be divided into three categories, and the value of the first factor corresponding to each category can be determined. For example, the above Table 1 shows an exemplary correspondence relationship between the first factor and the size parameter of the current block.

[0425] In another particular embodiment, determining the first factor may include determining a value of the first factor based on a quantity of reference pixels of the current block.

[0426] Furthermore, in some embodiments, the method may further include determining a value of the first factor based on a mapping lookup table between a preset number of reference pixels of the current block and a value of the first factor.

[0427] In addition, in the embodiment of the present application, the number of reference pixels can be divided into three categories, and the value of the first factor is still fixed in a classification manner. For example, the above Table 2 shows an example correspondence between the first factor and the number of reference pixels of the current block.

[0428] Further, determining a first product value based on the first factor and a reference sample value of a first color component for a first product value includes: setting a first product value equal to the product of the first factor and the reference sample value of the first color component; or setting the first multiplication value to a value obtained by performing a bit right shift on the reference sample value of the first color component, the number of bits of the bit right shift being equal to the first factor; or The method may include setting a first multiplication value to a numerical value obtained by adding and bit-shifting to a reference sample value of the first color component based on a first factor.

[0429] For example, assume 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 multiplication value is 0.25×Ref, and 0.25×Ref can be expressed as Ref / 4, that is, Ref>>2. Furthermore, in the fixed-point calculation process, floating-point numbers may be converted into addition and bit shift operations. That is, the calculation method of the first multiplication value is not particularly limited.

[0430] It can be further understood that in the embodiment of the present application, the first reference color component can be a chrominance component, that is, at least one pixel to be predicted in the current block having obvious chrominance is selected, and the chrominance difference (represented by |ΔCk|) between its reconstructed chrominance and the reference chrominance in the neighboring region is calculated respectively. Here, if |ΔCk| is relatively small, it indicates that the similarity of the chrominance value is relatively strong, and the corresponding weighting coefficient (w k Conversely, if |ΔCk| is relatively large, it indicates that the similarity of the chromaticity values ​​is relatively weak, and w k can be given a small weight, that is, when calculating the weighting coefficient, the reference sample value of the first color component can be |ΔCk|, and the weighting coefficient can be calculated based on it.

[0431] In brief, in the present embodiment, the reference sample value of the first color component can be |ΔCk|, i.e., the absolute value of the chromaticity difference, or |ΔYk|, i.e., the absolute value of the luminance difference, or |αΔYk|, i.e., the product of the absolute value of the luminance difference and a preset multiplier, where the preset multiplier is the second factor described in the present embodiment.

[0432] Further, for the second factor, in one particular embodiment, the method may further include performing a least squares calculation based on the first color component value of the reference pixel and the second color component value of the reference pixel to determine the second factor.

[0433] In other words, assuming that the number of reference pixels is N, the first color component value of the reference pixel is the reference luminance information of the current block, and the second color component value of the reference pixel is the reference chromaticity information of the current block, the second factor can be obtained by performing a least squares calculation (e.g., the least squares regression calculation shown in the above equation (5)) on the chromaticity component values ​​and luminance component values ​​of the N reference pixels.

[0434] Furthermore, for the preset mapping relationship, the preset mapping relationship may be a preset function relationship. In some embodiments, the preset mapping relationship may be a Softmax function as shown in the above formula (6) or formula (7). Here, the Softmax function is a normalized exponential function, but in the embodiments of the present application, normalization may not be used, and its value is not limited to the range of [0, 1].

[0435] It should be further explained that in addition to the Softmax function, in some other embodiments, the pre-set mapping relationship may be a weighting function having an inverse relationship with the reference sample value of the first color component, as shown in the above equation (8) or equation (9).

[0436] In this way, the preset mapping relationship may be as shown in Equation (4), as shown in Equation (6) or Equation (7), as shown in Equation (8) or Equation (9), or may be a function model of weighting coefficients constructed in accordance with a tendency that the closer the reference luminance value of the reference pixel is to the luminance reconstruction value of the pixel to be predicted in the current block, the higher the importance of the reference chrominance value of the reference pixel for the pixel to be predicted in the current block. Also, the preset mapping relationship may be in the form of a preset look-up table, for example, an array element look-up table method may be adopted to reduce some calculation operations, and the embodiment of the present application is not limited thereto.

[0437] In this way, the reference sample value of the first color component (e.g., |ΔY kij |), the weighting coefficient can be determined, specifically, w 1 , w 2 , ..., w N and so on, where N represents the quantity of the reference sample values ​​of the second color component, where theoretically, the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value greater than or equal to 0 and less than or equal to 1.

[0438] In step S1804, a prediction block of the second color component of the current block is determined according to the weighting coefficient and the reference sample value of the second color component in the target information.

[0439] In step S1805, a prediction difference value of a second color component sample point of the current block is determined based on the prediction block.

[0440] After the weighting coefficient is determined, the weighting coefficient can be used to perform weighted calculation on the reference sample value of the second color component to obtain the predicted value of the second color component sample point in the prediction block.

[0441] In some embodiments, determining a prediction block of a second color component of the current block based on the weighting coefficients and the reference sample values ​​of the second color component in the target information includes: determining a reference sample value of a second color component and a weight value of the corresponding weighting coefficient; This may include setting a predicted value of a second color component sample point in the prediction block to the sum of N weighted values, where N represents a quantity of reference sample values ​​of the second color component and N is a positive integer.

[0442] That is, when the number of the reference sample values ​​of the second color component is N, first, the weight value of each reference sample value of the second color component and the corresponding weighting coefficient (i.e., w k C k ) is determined, and then the sum of these N weighted values ​​is taken as the predicted value of the second color component sample point in the predicted block. Specifically, the calculation formula is as shown in the above formula (16), and such a calculation method is suitable for parallel processing and can improve the calculation speed.

[0443] It should be further explained that in the present embodiment, the first color component is a luma component and the second color component is a chroma component, and since the resolution of the luma component may differ from the resolution of the chroma component, performing a filtering process on the reference information includes performing downsampling filtering on the luma component to match the resolution of the chroma component, or performing upsampling filtering on the chroma component to match the resolution of the luma component.

[0444] In addition, the predicted value of the second color component sample point in the predicted block usually needs to be restricted within a preset range. Therefore, in some embodiments, the method may further include performing a correction operation on the predicted value of the second color component sample point in the predicted block to determine a predicted block of the second color component of the current block.

[0445] In the embodiments of the present application, the pre-set range can be in the range of 0 to (1 << BitDepth)-1. When the predicted value exceeds the value in the pre-set range, it is necessary to perform a corresponding correction operation on the predicted value. Exemplarily,

Number

[0446] Furthermore, after determining the prediction block, the prediction block requires further post-processing in order to be used as the final prediction block under specific conditions. Therefore, in some embodiments, the method may further include performing related processing on the prediction block and using the processed prediction block as the prediction block of the second color component of the current block.

[0447] In one possible embodiment, performing related processing on the prediction block may include performing enhanced filtering processing on the prediction block and using the processed prediction block as the prediction block of the second color component of the current block.

[0448] In another possible embodiment, performing related processing on the prediction block may include determining a compensation value for the second color component of the prediction block based on the reference sample values in the adjacent region of the current block, and performing correction processing on the predicted values of the second color component sample points in the prediction block based on the compensation value to determine the prediction block of the second color component of the current block.

[0449] In another possible embodiment, performing related processing on the prediction block may include performing a prediction process on a second color component sample point in the prediction block according to at least one prediction mode, determining at least one initial predicted value of the second color component sample point in the prediction block, and performing a weighted fusion process based on the at least one initial predicted value and the predicted value of the second color component sample point in the prediction block, to determine a prediction block of the second color component of the current block.

[0450] That is, in order to reduce instability caused by performing independent and parallel prediction for each pixel in the WCP with respect to the related processing of the prediction block, smoothing filtering can be performed on the prediction block to obtain the final chrominance prediction value. Alternatively, in order to further improve the accuracy of the WCP prediction value, a position-related correction process can be performed on the prediction block. For example, a chrominance compensation value can be calculated for each pixel to be predicted using a reference pixel that is spatially close, and the prediction block is corrected using the chrominance compensation value, and the corrected prediction value is the final chrominance prediction value. Alternatively, in order to further improve the accuracy of the WCP prediction value, a chrominance prediction value calculated in another chrominance prediction mode and a chrominance prediction value calculated by the WCP can be weighted and fused, and the fusion result can be the final chrominance prediction value. Alternatively, in order to improve the prediction performance of the WCP, a neural network model can be used to correct the chrominance prediction value calculated by the WCP, and the embodiment of the present application is not limited thereto.

[0451] In some embodiments, after determining the prediction block, as shown in FIG. 19, after step S1804, the process may further include the following steps:

[0452] In step S1901, a predicted value of a second color component sample point of a current block is determined based on a predicted block.

[0453] In step S1902, a predicted difference value of the second color component sample point of the current block is determined based on the original value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block.

[0454] In step S1903, the prediction difference value of the second color component sample point of the current block is encoded, and the obtained encoded bits are written into the bitstream.

[0455] It should be noted that in the embodiment of the present application, the prediction block may include predicted values ​​of at least some second color component sample points in the current block, where if the prediction block includes predicted values ​​of all second color component sample points in the current block, the predicted values ​​of the second color component sample points of the current block may be set equal to values ​​of the prediction block, and if the prediction block includes predicted values ​​of some second color component sample points in the current block, upsampling filtering may be performed on the values ​​of the prediction block, and the predicted values ​​of the second color component sample points of the current block may be set equal to output values ​​after the upsampling filtering.

[0456] It should be further explained that after the predicted value of the second color component sample point of the current block is determined, a predicted difference value of the second color component sample point can be determined according to the original value of the second color component sample point and the predicted value of the second color component sample point, specifically, the predicted difference value of the second color component sample point of the current block can be determined by performing subtraction on the original value of the second color component sample point and the predicted value of the second color component sample point. In this way, after the predicted difference value of the second color component sample point is written into the bitstream, the predicted difference value of the second color component sample point can be obtained by decoding at the decoding side subsequently, so that the reconstructed value of the second color component sample point of the current block can be restored.

[0457] As can be seen from the above, taking chrominance prediction for a current block as an example, in the embodiment of the present application, the reconstructed luminance information of the current block, the reference luminance information and the reference chrominance information of the neighboring region are all encoded reference information. Therefore, the embodiment of the present application proposes a weight-based chrominance prediction technique that utilizes the above information, and the process of determining the target information of the current block based on these information can analyze and process the information of the neighboring region of the current block, the information of the current block, and the current color format information, which mainly includes the following two aspects. The first is to select whether to downsample the reference luminance information of the neighboring region or whether to upsample the reference chrominance information of the neighboring region based on the current color format information. The second is to make the reference luminance information and reference chrominance information of the neighboring region and the reconstructed luminance information in the current block match the preset size of the core parameter through different size enlargement / reduction operations, thereby improving the accuracy of the WCP prediction technique.

[0458] The embodiment of the present application further provides an encoding method, in which reference information of a current block is determined, a filtering process is performed on a part of the reference information of the current block, target information of the current block is determined, a weighting coefficient is determined according to a reference sample value of a first color component in the target information, a prediction block of a second color component of the current block is determined according to the weighting coefficient and the reference sample value of a second color component in the target information, and a prediction difference value of a second color component sample point of the current block is determined according to the prediction block. In this way, the characteristics of color format information are fully taken into consideration for the color component information in the neighboring area of ​​the current block and the color component information in the current block, so that the accuracy of these reference information can be improved, and further, filtering processes such as upsampling and downsampling can be performed on these reference information to enhance the continuity of spatial correlation to a certain extent or remove some information with relatively weak spatial correlation, and the target information obtained after the filtering process can be used to perform chrominance prediction more appropriately, thereby improving the accuracy of chrominance prediction and improving the encoding and decoding performance while saving the bit rate.

[0459] In yet another embodiment of the present application, the embodiment of the present application further provides a bitstream, the bitstream being generated by performing bit encoding based on encoding target information, where the encoding target information includes at least a predicted difference value of a second color component sample point of the current block.

[0460] In the embodiment of the present application, after the prediction difference value of the second color component sample point of the current block is transmitted from the encoding side to the decoding side, the decoding side can obtain the prediction difference value of the second color component sample point by decoding, and combine it with the prediction value of the second color component sample point of the current block to restore the reconstructed value of the second color component sample point of the current block. In this way, by fully considering the characteristics of the input color format information, the accuracy of the reference information of the neighboring region can be improved, and by fully utilizing the spatial correlation, filtering processes such as upsampling, downsampling, size enlargement, size reduction, etc. are performed on the reference information of the neighboring region and the reconstructed luminance information of the current block, so that the accuracy of chromaticity prediction is improved, and not only the bit rate is saved, but also the encoding and decoding performance is improved.

[0461] In yet another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, referring to Fig. 20, an exemplary structural diagram of the configuration of an encoding device 300 according to an embodiment of the present application is shown. As shown in Fig. 20, the encoding device 300 includes a first determination unit 3001, a first filtering unit 3002 and a first prediction unit 3003, in which: The first determining unit 3001 is configured to determine reference information of a current block; The first filtering unit 3002 is configured to perform a filtering process on at least a part of information of the reference information of the current block to determine target information of the current block; The first determining unit 3001 is further configured to determine a weighting coefficient based on a reference sample value of a first color component in the target information; The first prediction unit 3003 is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; The first determining unit 3001 is further configured to determine, based on the predicted block, a predicted difference value of a second color component sample point of the current block.

[0462] In some embodiments, the prediction block includes predictions of at least some of the second color component sample points in the current block.

[0463] In some embodiments, the first determination unit 3001 is further configured to determine reference information of the current block based on values ​​of a first color component sample point in an adjacent region of the current block, values ​​of a second color component sample point in an adjacent region of the current block, and a reconstructed value of a first reference color component sample point in the current block.

[0464] In some embodiments, the neighboring regions of the current block include at least one of an upper neighboring region, a top right neighboring region, a left neighboring region, and a lower left neighboring region.

[0465] In some embodiments, the first filtering unit 3002 is further configured to perform a first filtering process on values ​​of first color component sample points in an adjacent region of the current block to obtain filtered sample values ​​of the first color component in the adjacent region of the current block, and determine target information of the current block based on the filtered sample values ​​of the first color component in the adjacent region of the current block.

[0466] In some embodiments, the quantity of filtered sample values ​​of the first color component in the neighboring region of the current block is equal to L, where L represents the quantity of values ​​of the second color component sample points in the neighboring region of the current block, and L is a positive integer.

[0467] In some embodiments, the first filtering process is a downsampling filtering process.

[0468] In some embodiments, the first filtering unit 3002 is further configured to perform a first filtering process on values ​​of first color component sample points in the adjacent region of the current block based on the color format information, to obtain filtered sample values ​​of the first color component in the adjacent region of the current block.

[0469] In some embodiments, the first filtering unit 3002 is further configured to perform downsampling filtering on values ​​of first color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the downsampling rate is the inverse of a positive integer multiple of two.

[0470] In some embodiments, the first filtering unit 3002 is further configured to compare L with a preset number, and based on a comparison result between L and the preset number, perform a second filtering process on the filtered sample values ​​of the first color component in the adjacent area of ​​the current block and the values ​​of the second color component sample points in the adjacent area of ​​the current block, determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0471] In some embodiments, the first filtering unit 3002 is further configured to: perform a first sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block, to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, when L is greater than the preset number; and perform a second sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block, to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, when L is smaller than the preset number.

[0472] In some embodiments, the first filtering unit 3002 is further configured to perform a third filtering process on values ​​of the second color component sample points in the adjacent region of the current block to obtain filtered sample values ​​of the second color component in the adjacent region of the current block, and determine target information of the current block based on the filtered sample values ​​of the second color component in the adjacent region of the current block.

[0473] In some embodiments, the quantity of filtered sample values ​​of the second color component in the neighboring region of the current block is equal to K, where K represents the quantity of values ​​of the first color component sample points in the neighboring region of the current block, and K is a positive integer.

[0474] In some embodiments, the third filtering process is an upsampling filtering process.

[0475] In some embodiments, the first filtering unit 3002 is further configured to perform a third filtering process on values ​​of the second color component sample points in the adjacent region of the current block based on the color format information, to obtain filtered sample values ​​of the second color component in the adjacent region of the current block.

[0476] In some embodiments, the first filtering unit 3002 is further configured to perform upsampling filtering on values ​​of second color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the upsampling rate is a positive integer multiple of two.

[0477] In some embodiments, the first filtering unit 3002 is further configured to compare K with a preset number, and based on a comparison result between K and the preset number, perform a fourth filtering process on values ​​of the first color component sample points in the adjacent area of ​​the current block and the filtered sample values ​​of the second color component in the adjacent area of ​​the current block, determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0478] In some embodiments, the first filtering unit 3002 is further configured to: perform a first sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block and filtered sample values ​​of the second color component in the adjacent region of the current block, when K is greater than the preset number, to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block; and perform a second sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block and filtered sample values ​​of the second color component in the adjacent region of the current block, when K is smaller than the preset number, to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block.

[0479] In some embodiments, the first filtering unit 3002 is further configured to determine a quantity of values ​​of the first color component sample points in the adjacent area of ​​the current block as a first quantity, perform a fifth filtering process on the values ​​of the first color component sample points in the adjacent area of ​​the current block based on a comparison result between the first quantity and a preset number, determine filtered adjacent sample values ​​of the first color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block.

[0480] In some embodiments, the first filtering unit 3002 is further configured to: perform a first sub-filtering process on values ​​of the first color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block if the first quantity is greater than a preset number; and perform a second sub-filtering process on values ​​of the first color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block if the first quantity is smaller than the preset number.

[0481] In some embodiments, the first filtering unit 3002 is further configured to determine a quantity of values ​​of the second color component sample points in the adjacent area of ​​the current block as a second quantity, perform a sixth filtering process on the values ​​of the second color component sample points in the adjacent area of ​​the current block based on a comparison result between the second quantity and a preset number, determine filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the second color component of the current block.

[0482] In some embodiments, the first filtering unit 3002 is further configured to: perform a first sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block if the second quantity is greater than a preset number; and perform a second sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block if the second quantity is smaller than the preset number.

[0483] In some embodiments, the first filtering unit 3002 is further configured to set a reference sample value of the second color component in the target information to the filtered neighboring sample value of the second color component of the current block.

[0484] In some embodiments, the first sub-filtering process is a downsampling filtering process.

[0485] In some embodiments, the first filtering unit 3002 further comprises: A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by employing a successive position selection scheme.

[0486] In some embodiments, the second sub-filtering process is an upsampling filtering process.

[0487] In some embodiments, the first filtering unit 3002 is further configured to perform a second sub-filtering process, which includes performing the sub-filtering process by adopting a fixed-interval position interpolation scheme.

[0488] In some embodiments, the first filtering unit 3002 is further configured to perform a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block, determine filtered sample values ​​of the first reference color component sample points in the current block, and determine target information of the current block based on the filtered sample values ​​of the first reference color component sample points in the current block.

[0489] In some embodiments, the first filtering unit 3002 is further configured to determine a first width and a first height based on the reconstructed value of the first reference color component sample point in the current block, and if the first width is greater than the width of the predicted block or the first height is greater than the height of the predicted block, perform a third sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block, and if the first width is smaller than the width of the predicted block or the first height is smaller than the height of the predicted block, perform a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block.

[0490] In some embodiments, the third sub-filtering process is a downsampling filtering process.

[0491] In some embodiments, the first filtering unit 3002 further comprises: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process vertically on the reconstructed values ​​of the first reference color component sample points in the current block; performing a downsampling filtering process in the horizontal direction and then a downsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and and performing a third sub-filtering process including at least one of performing a downsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing a downsampling filtering process in a horizontal direction.

[0492] In some embodiments, the fourth sub-filtering process is an upsampling filtering process.

[0493] In some embodiments, the first filtering unit 3002 further comprises: performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in the horizontal direction and then a upsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and and performing a fourth sub-filtering process including at least one of performing an upsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing an upsampling filtering process in a horizontal direction.

[0494] In some embodiments, the first filtering unit 3002 is further configured to set a reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in an adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block.

[0495] In some embodiments, the first filtering unit 3002 is further configured to set a reference sample value of the first color component in the target information to the absolute value of the difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block.

[0496] In some embodiments, the first determination unit 3001 is further configured to determine a value corresponding to a reference sample value of the first color component based on a pre-set mapping relationship, and set the weighting coefficient equal to the value.

[0497] 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 corresponding value of the first product value based on a preset mapping relationship.

[0498] In some embodiments, the first factor is a preset constant value.

[0499] In some embodiments, the first determination unit 3001 is further configured to determine a value of the first factor based on a size parameter of the current block, where the size parameter of the current block includes at least one parameter of a width of the current block, a height of the current block.

[0500] In some embodiments, the pre-defined mapping relationship is a Softmax function.

[0501] In some embodiments, the pre-defined mapping relationship is a weighting function having an inverse relationship with the reference sample value of the first color component.

[0502] In some embodiments, the first prediction unit 3003 is further configured to determine weighted values ​​of the reference sample values ​​of the second color component and corresponding weighting coefficients, and set the predicted value of the second color component sample point in the prediction block to the sum of N weighted values, where N represents the quantity of the reference sample values ​​of the second color component, and N is a positive integer.

[0503] In some embodiments, the first prediction unit 3003 is further configured to perform a modification operation on the predicted value of the second color component sample point in the prediction block to determine a prediction block of the second color component of the current block.

[0504] In some embodiments, the first prediction unit 3003 is further configured to perform an enhanced filtering process on the prediction block, and the processed prediction block is a prediction block of a second color component of the current block.

[0505] In some embodiments, the first prediction unit 3003 is further configured to determine a compensation value of a second color component of the prediction block based on reference sample values ​​in adjacent areas of the current block, and perform a correction process on the prediction value of the second color component sample point in the prediction block based on the compensation value, so as to determine a prediction block of the second color component of the current block.

[0506] In some embodiments, the first prediction unit 3003 is further configured to perform a prediction process on a second color component sample point in the prediction block according to at least one prediction mode, determine at least one initial predicted value of the second color component sample point in the prediction block, perform a weighted fusion process on the at least one initial predicted value and the predicted value of the second color component sample point in the prediction block, and determine a prediction block of the second color component of the current block.

[0507] In some embodiments, the first determination unit 3001 is further configured to determine a predicted value of a second color component sample point of the current block based on the predicted block, and determine a predicted difference value of the second color component sample point of the current block based on the original value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block.

[0508] In some embodiments, referring to FIG. 20, the encoding device 300 may further include an encoding unit 3004, which is configured to encode the predicted difference values ​​of the second color component sample points of the current block and write the resulting encoded bits into a bitstream.

[0509] In the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and of course, it should be understood that a "unit" may be a module or a non-module. In addition, each component in the present embodiment may be integrated into one processing unit, or each unit may be a separate independent physical unit, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional module.

[0510] When the integrated unit is realized in the form of a software functional module, rather than being sold or used as an independent product, it can be stored in one computer-readable storage medium. Based on this understanding, the essential part of the technical solution of the present embodiment, i.e., the part contributing to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in one storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method according to each embodiment of the present application. The aforementioned storage medium includes various media capable of storing program code, such as U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0511] Therefore, an embodiment of the present application provides a computer-readable storage medium applied to the encoding device 300, the computer-readable storage medium storing a computer program, the computer program causing a first processor to execute the method in any of the embodiments described above.

[0512] Based on the above configuration of the encoding device 300 and the computer-readable storage medium, referring to FIG. 21, a schematic diagram of a specific hardware structure of an encoding device 310 according to an embodiment of the present application is shown. As shown in FIG. 21, the encoding device 310 can include a first communication interface 3101, a first memory 3102, and a first processor 3103, and each component is coupled to each other by a first bus system 3104. It can be understood that the first bus system 3104 is used to realize the connection 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 the sake of clarity, various buses are denoted as the first bus system 3104 in FIG. 21.

[0513] The first communication interface 3101 is configured to send and receive signals in the process of sending and receiving information to and from other external network elements; The first memory 3102 is configured to store a computer program executable on the first processor 3103; The first processor 3103 is configured to execute the computer program to execute the following steps, which include: Determining a reference for a current block; Performing a filtering process on a portion of the reference information of the current block to determine target information of the current block; determining a weighting coefficient based on a reference sample value of a first color component in the target information; determining a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; determining a predicted difference value of the second color component sample point of the current block based on the predicted block.

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

[0515] Also, the processor 3103 may be an integrated circuit chip with signal processing functions. In implementation, each step of the above method can be performed by an integrated logic circuit in hardware form or an instruction in software form in the first processor 3103. The above 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 devices, discrete gate or transistor logic devices, discrete hardware components, etc., and can realize or execute each method, step, and logic block diagram disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor. The software module can be arranged in a conventional storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is arranged in the first memory 3102, and the first processor 3103 reads the information in the first memory 3102 and completes the steps of the method in combination with its hardware.

[0516] As can be understood, the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processing (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field-Programmable Gate Arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof. For software implementation, the techniques described herein can be implemented by modules (processes, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented within the processor or outside the processor.

[0517] Illustratively, as another embodiment, the first processor 3103 is further configured to execute the computer program, thereby performing the method described in any one of the above embodiments.

[0518] This embodiment provides an encoding device, which may further include the encoding device 300 described in the above embodiment. In the encoding device, the accuracy of the reference information of the neighboring region can be improved by fully considering the characteristics of the input color format information, and the spatial correlation is fully utilized to perform filtering processes such as upsampling, downsampling, size enlargement, size reduction, etc. on the reference information of the neighboring region and the reconstructed luminance information of the current block, thereby improving the accuracy of chromaticity prediction, not only saving the bit rate but also improving the encoding and decoding performance.

[0519] Based on the same inventive concept as the above embodiment, referring to Fig. 22, an exemplary structural diagram of the configuration of a decoding device 320 according to an embodiment of the present application is shown. As shown in Fig. 22, the decoding device 320 can include a second determination unit 3201, a second filtering unit 3202 and a second prediction unit 3203, where: The second determining unit 3201 is configured to determine reference information of a current block; The second filtering unit 3202 is configured to perform a filtering process on at least a part of the reference information of the current block to determine target information of the current block; The second determining unit 3201 is further configured to determine a weighting coefficient according to a reference sample value of the first color component in the target information; The second prediction unit 3203 is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information; The second determining unit 3201 is further configured to determine, based on the prediction block, a reconstructed value of a second color component sample point of the current block.

[0520] In some embodiments, the prediction block includes predictions of at least some of the second color component sample points in the current block.

[0521] In some embodiments, the second determination unit 3201 is further configured to determine reference information of the current block based on values ​​of the first color component sample points in adjacent areas of the current block, values ​​of the second color component sample points in adjacent areas of the current block, and reconstructed values ​​of the first reference color component sample points in the current block.

[0522] In some embodiments, the neighboring regions of the current block may include at least one of an upper neighboring region, a top right neighboring region, a left neighboring region, and a lower left neighboring region.

[0523] In some embodiments, the second filtering unit 3202 is further configured to perform a first filtering process on values ​​of the first color component sample points in the adjacent region of the current block to obtain filtered sample values ​​of the first color component in the adjacent region of the current block, and determine target information of the current block based on the filtered sample values ​​of the first color component in the adjacent region of the current block.

[0524] In some embodiments, the quantity of filtered sample values ​​of the first color component in the neighboring region of the current block is equal to L, where L represents the quantity of values ​​of the second color component sample points in the neighboring region of the current block, and L is a positive integer.

[0525] In some embodiments, the first filtering process is a downsampling filtering process.

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

[0527] In some embodiments, the second filtering unit 3202 is further configured to perform downsampling filtering on values ​​of the first color component sample points in the adjacent region of the current block when the color format information indicates 4:2:0 sampling, where the downsampling rate is the inverse of a positive integer multiple of two.

[0528] In some embodiments, the second filtering unit 3202 is further configured to compare L with a preset number, and based on a comparison result between L and the preset number, perform a second filtering process on the filtered sample values ​​of the first color component in the adjacent area of ​​the current block and the values ​​of the second color component sample points in the adjacent area of ​​the current block, determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0529] In some embodiments, the second filtering unit 3202 is further configured to: perform a first sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block, to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, when L is greater than the preset number; and perform a second sub-filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block, to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, when L is smaller than the preset number.

[0530] In some embodiments, the second filtering unit 3202 is further configured to perform a third filtering process on values ​​of the second color component sample points in the adjacent area of ​​the current block to obtain filtered sample values ​​of the second color component in the adjacent area of ​​the current block, and determine target information of the current block based on the filtered sample values ​​of the second color component in the adjacent area of ​​the current block.

[0531] In some embodiments, the quantity of filtered sample values ​​of the second color component in the neighboring region of the current block is equal to K, where K represents the quantity of values ​​of the first color component sample points in the neighboring region of the current block, and K is a positive integer.

[0532] In some embodiments, the third filtering process is an upsampling filtering process.

[0533] In some embodiments, the second filtering unit 3202 is further configured to perform a third filtering process on values ​​of the second color component sample points in the adjacent area of ​​the current block based on the color format information, to obtain filtered sample values ​​of the second color component in the adjacent area of ​​the current block.

[0534] In some embodiments, the second filtering unit 3202 is further configured to perform upsampling filtering on values ​​of second color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the upsampling rate is a positive integer multiple of 2.

[0535] In some embodiments, the second filtering unit 3202 is further configured to compare K with a preset number, and based on a comparison result between K and the preset number, perform a fourth filtering process on the values ​​of the first color component sample points in the adjacent area of ​​the current block and the filtered sample values ​​of the second color component in the adjacent area of ​​the current block, determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block.

[0536] In some embodiments, the second filtering unit 3202 is further configured to: perform a first sub-filtering process on values ​​of the first color component sample points in the adjacent area of ​​the current block and filtered sample values ​​of the second color component in the adjacent area of ​​the current block when K is greater than the preset number, to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block; and perform a second sub-filtering process on values ​​of the first color component sample points in the adjacent area of ​​the current block and filtered sample values ​​of the second color component in the adjacent area of ​​the current block when K is less than the preset number, to determine filtered adjacent sample values ​​of the first color component of the current block and filtered adjacent sample values ​​of the second color component of the current block.

[0537] In some embodiments, the second filtering unit 3202 is further configured to determine a quantity of values ​​of the first color component sample points in the adjacent area of ​​the current block as a first quantity, perform a fifth filtering process on the values ​​of the first color component sample points in the adjacent area of ​​the current block based on a comparison result between the first quantity and a preset number, determine filtered adjacent sample values ​​of the first color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the first color component of the current block.

[0538] In some embodiments, the second filtering unit 3202 is further configured to: perform a first sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block if the first quantity is greater than the preset number; and perform a second sub-filtering process on values ​​of the first color component sample points in the adjacent region of the current block to determine filtered adjacent sample values ​​of the first color component of the current block if the first quantity is smaller than the preset number.

[0539] In some embodiments, the second filtering unit 3202 is further configured to determine a quantity of values ​​of the second color component sample points in the adjacent area of ​​the current block as a second quantity, perform a sixth filtering process on the values ​​of the second color component sample points in the adjacent area of ​​the current block based on a comparison result between the second quantity and a preset number, determine filtered adjacent sample values ​​of the second color component of the current block, and determine target information of the current block based on the filtered adjacent sample values ​​of the second color component of the current block.

[0540] In some embodiments, the second filtering unit 3202 is further configured to: perform a first sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block if the second quantity is greater than a preset number; and perform a second sub-filtering process on values ​​of second color component sample points in an adjacent region of the current block to determine filtered adjacent sample values ​​of the second color component of the current block if the second quantity is smaller than the preset number.

[0541] In some embodiments, the second filtering unit 3202 is further configured to set a reference sample value of the second color component in the target information to the filtered neighboring sample value of the second color component of the current block.

[0542] In some embodiments, the first sub-filtering process is a downsampling filtering process.

[0543] In some embodiments, the first filtering unit 3002 further comprises: A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by employing a successive position selection scheme.

[0544] In some embodiments, the second sub-filtering process is an upsampling filtering process.

[0545] In some embodiments, the first filtering unit 3002 is further configured to perform a second sub-filtering process, which includes performing the sub-filtering process by adopting a fixed-interval position interpolation scheme.

[0546] In some embodiments, the second filtering unit 3202 is further configured to perform a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block, determine filtered sample values ​​of the first reference color component sample points in the current block, and determine target information of the current block based on the filtered sample values ​​of the first reference color component sample points in the current block.

[0547] In some embodiments, the second filtering unit 3202 is further configured to determine a first width and a first height based on the reconstructed value of the first reference color component sample point in the current block, and if the first width is greater than the width of the predicted block or the first height is greater than the height of the predicted block, perform a third sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block, and if the first width is smaller than the width of the predicted block or the first height is smaller than the height of the predicted block, perform a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block to determine a filtered sample value of the first reference color component sample point in the current block.

[0548] In some embodiments, the third sub-filtering process is a downsampling filtering process.

[0549] In some embodiments, the first filtering unit 3002 further comprises: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process vertically on the reconstructed values ​​of the first reference color component sample points in the current block; performing a downsampling filtering process in the horizontal direction and then a downsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and and performing a third sub-filtering process including at least one of performing a downsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing a downsampling filtering process in a horizontal direction.

[0550] In some embodiments, the fourth sub-filtering process is an upsampling filtering process.

[0551] In some embodiments, the second filtering unit 3202 further comprises: performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in the horizontal direction and then a upsampling filtering process in the vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and and performing a fourth sub-filtering process including at least one of performing an upsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block, and then performing an upsampling filtering process in a horizontal direction.

[0552] In some embodiments, the second filtering unit 3202 is further configured to set a reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in an adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block.

[0553] In some embodiments, the second filtering unit 3202 is further configured to set a reference sample value of the first color component in the target information to an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of the first reference color component sample point in the current block.

[0554] 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 based on a preset mapping relationship, and set the weighting coefficient equal to the value.

[0555] In some embodiments, the second determination unit 3201 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 corresponding value of the first product value based on a preset mapping relationship.

[0556] In s...

Claims

1. 1. A method of decoding, comprising: Determining a reference for a current block; Performing a filtering process on at least a portion of the reference information of the current block to determine target information of the current block; determining a weighting coefficient based on a reference sample value of a first color component in the target information; determining a prediction block of a second color component of the current block according to the weighting coefficient and a reference sample value of a second color component in the target information; determining reconstructed values ​​of second color component sample points of the current block based on the predicted block.

2. the predicted block includes predicted values ​​of at least some of the second color component sample points in the current block; The method of decoding according to claim 1 .

3. Determining the reference information of the current block includes: determining reference information for the current block based on values ​​of first color component sample points in adjacent regions of the current block, values ​​of second color component sample points in adjacent regions of the current block, and reconstructed values ​​of first reference color component sample points in the current block; The method of decoding according to claim 1 .

4. the neighboring region of the current block includes at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region; The decoding method according to claim 3.

5. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a first filtering process on values ​​of first color component sample points in the neighboring region of the current block to obtain filtered sample values ​​of the first color component in the neighboring region of the current block; determining target information of the current block based on the filtered sample values ​​of the first color component in a neighboring region of the current block; The decoding method according to claim 3.

6. A quantity of the filtered sample values ​​of the first color component in the neighboring region of the current block is equal to L, where L represents a quantity of values ​​of the second color component sample points in the neighboring region of the current block, and L is a positive integer. The decoding method according to claim 5.

7. The first filtering process is a downsampling filtering process. The decoding method according to claim 5.

8. The decoding method includes: and performing a first filtering process on values ​​of first color component sample points in the neighboring region of the current block according to color format information to obtain filtered sample values ​​of the first color component in the neighboring region of the current block. The decoding method according to claim 5.

9. The first filtering process includes: If the color format information indicates 4:2:0 sampling, the method further includes performing downsampling filtering on values ​​of the first color component sample points in the neighboring region of the current block, where the downsampling rate is an inverse of a positive integer multiple of 2; The decoding method according to claim 8.

10. The decoding method includes: Comparing L to a preset number; According to a comparison result between L and a preset number, performing a second filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of a first color component of the current block and the filtered neighboring sample values ​​of a second color component of the current block. The decoding method according to claim 6.

11. performing a second filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; If L is greater than the preset number, performing a first sub-filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; If L is smaller than the preset number, performing a second sub-filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block. The decoding method according to claim 10.

12. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a third filtering process on values ​​of second color component sample points in the neighboring area of ​​the current block to obtain filtered sample values ​​of the second color component in the neighboring area of ​​the current block; determining target information of the current block based on the filtered sample values ​​of the second color component in an adjacent region of the current block; The decoding method according to claim 3.

13. A quantity of the filtered sample values ​​of the second color component in the neighboring region of the current block is equal to K, where K represents a quantity of values ​​of the first color component sample points in the neighboring region of the current block, and K is a positive integer. The method of decoding according to claim 12.

14. the third filtering process is an upsampling filtering process; The method of decoding according to claim 12.

15. The decoding method includes: and performing a third filtering process on values ​​of second color component sample points in the neighboring region of the current block according to color format information to obtain filtered sample values ​​of the second color component in the neighboring region of the current block. The method of decoding according to claim 12.

16. The third filtering process includes: If the color format information indicates 4:2:0 sampling, the method further includes performing upsampling filtering on values ​​of second color component sample points in the neighboring region of the current block, and the upsampling rate is a positive integer multiple of 2.

16. The method of decoding according to claim 15.

17. The decoding method includes: Comparing K to a preset number; performing a fourth filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block according to a comparison result between K and a preset number, to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of a first color component of the current block and the filtered neighboring sample values ​​of a second color component of the current block. The method of decoding according to claim 13.

18. performing a fourth filtering process on values ​​of first color component sample points in the neighboring region of the current block and filtered sample values ​​of a second color component in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block and filtered neighboring sample values ​​of the second color component of the current block; If K is greater than the preset number, performing a first sub-filtering process on values ​​of first color component sample points in the neighboring region of the current block and filtered sample values ​​of a second color component in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block and filtered neighboring sample values ​​of the second color component of the current block; If K is smaller than the preset number, performing a second sub-filtering process on values ​​of the first color component sample points in the neighboring region of the current block and the filtered sample values ​​of the second color component in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

18. The method of decoding according to claim 17.

19. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: determining a quantity of values ​​of first color component sample points in an adjacent region of the current block as a first quantity; performing a fifth filtering process on values ​​of first color component sample points in the neighboring region of the current block according to a comparison result between the first quantity and a preset number to determine filtered neighboring sample values ​​of the first color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block; The decoding method according to claim 3.

20. performing a fifth filtering process on values ​​of first color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block; performing a first sub-filtering process on values ​​of first color component sample points in a neighboring region of the current block when the first quantity is greater than the preset number to determine a filtered neighboring sample value of the first color component of the current block; If the first quantity is smaller than the preset number, performing a second sub-filtering process on values ​​of first color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block.

20. The method of decoding according to claim 19.

21. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: determining a quantity of values ​​of second color component sample points in the neighboring region of the current block as a second quantity; performing a sixth filtering process on values ​​of second color component sample points in the neighboring region of the current block according to a comparison result between the second quantity and a preset number to determine filtered neighboring sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of the second color component of the current block; The decoding method according to claim 3.

22. performing a sixth filtering process on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block; performing a first sub-filtering process on values ​​of second color component sample points in a neighboring region of the current block when the second quantity is greater than the preset number to determine filtered neighboring sample values ​​of the second color component of the current block; if the second quantity is less than the preset number, performing a second sub-filtering process on values ​​of second color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block.

22. The method of decoding according to claim 21.

23. The decoding method includes: and setting a reference sample value of a second color component in the target information to a filtered neighboring sample value of the second color component of the current block. A method for decoding according to claim 10, 17 or 21.

24. The first sub-filtering process is a downsampling filtering process.

23. A method for decoding according to claim 11, 18, 20 or 22.

25. The first sub-filtering process includes: A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by adopting a successive position selection method.

23. A method for decoding according to claim 11, 18, 20 or 22.

26. the second sub-filtering process is an upsampling filtering process; 23. A method for decoding according to claim 11, 18, 20 or 22.

27. The second sub-filtering process includes: performing sub-filtering processing by adopting a fixed interval position interpolation method; 23. A method for decoding according to claim 11, 18, 20 or 22.

28. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; determining target information of the current block based on the filtered sample values ​​of first reference color component sample points in the current block; A decoding method according to claim 3 or 10.

29. performing a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; determining a first width and a first height based on the reconstructed values ​​of first reference color component sample points in the current block; performing a third sub-filtering process on the reconstructed values ​​of the first reference color component sample points in the current block when the first width is greater than the width of the prediction block or when the first height is greater than the height of the prediction block, to determine filtered sample values ​​of the first reference color component sample points in the current block; performing a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block when the first width is smaller than the width of the prediction block or when the first height is smaller than the height of the prediction block, to determine a filtered sample value of the first reference color component sample point in the current block.

29. The method of decoding according to claim 28.

30. the third sub-filtering process is a downsampling filtering process; 30. The method of decoding according to claim 29.

31. The third sub-filtering process includes: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing a downsampling filtering process in a horizontal direction and then a downsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and performing a downsampling filtering operation in a vertical direction and then a downsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

31. The method of decoding according to claim 30.

32. the fourth sub-filtering process is an upsampling filtering process; 30. The method of decoding according to claim 29.

33. The fourth sub-filtering process includes: performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in a horizontal direction and then a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and performing an upsampling filtering operation in a vertical direction and then performing an upsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

33. The method of decoding according to claim 32.

34. The decoding method includes: and setting a reference sample value of the first color component in the target information to an absolute value of a difference between a value of a first color component sample point in an adjacent region of the current block and a reconstructed value of a first reference color component sample point in the current block.

29. The method of decoding according to claim 28.

35. The decoding method includes: and setting a reference sample value of a first color component in the target information to an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of a first reference color component sample point in the current block.

29. The method of decoding according to claim 28.

36. Determining a weighting coefficient based on a reference sample value of a first color component in the target information includes: determining a value corresponding to a reference sample value of the first color component based on a preset mapping relationship; setting said weighting factor equal to said value. The method of decoding according to claim 1 .

37. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: determining a first factor; determining a first product value based on the first factor and a reference sample value of the first color component; determining a corresponding value of the first product value based on the pre-established mapping relationship.

37. The method of decoding according to claim 36.

38. Determining the first factor comprises: The first factor may be a preset constant value.

38. The method of decoding according to claim 37.

39. Determining the first factor comprises: determining a value of the first factor based on a size parameter of the current block; the size parameters of the current block include at least one of a width of the current block and a height of the current block; 38. The method of decoding according to claim 37.

40. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: The pre-defined mapping relationship is a Softmax function.

37. The method of decoding according to claim 36.

41. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: the preset mapping relationship is a weighting function having an inverse relationship with the reference sample value of the first color component; 37. The method of decoding according to claim 36.

42. determining a prediction block of a second color component of the current block based on the weighting coefficient and a reference sample value of a second color component in the target information; determining a reference sample value of the second color component and a corresponding weight value of the weighting coefficient; and setting a predicted value of a second color component sample point in the prediction block to a sum of N of the weighted values, where N represents a quantity of reference sample values ​​of the second color component, and N is a positive integer. The method of decoding according to claim 1 .

43. The decoding method includes: performing a correction operation on a predicted value of a second color component sample point in the predicted block to determine a predicted block of a second color component of the current block; 43. The method of decoding according to claim 42.

44. The decoding method includes: performing an enhanced filtering process on the predicted block; and using the processed predicted block as a predicted block of a second color component of the current block. The method of decoding according to claim 1 .

45. The decoding method includes: determining a compensation value of a second color component of the prediction block according to reference sample values ​​in an adjacent region of the current block; and performing a correction process on a predicted value of a second color component sample point in the predicted block according to the compensation value to determine a predicted block of a second color component of the current block. The method of decoding according to claim 1 .

46. The decoding method includes: performing a prediction process on second color component sample points in the prediction block according to at least one prediction mode to determine at least one initial predicted value of the second color component sample points in the prediction block; performing a weighted fusion process according to the at least one initial prediction value and a prediction value of a second color component sample point in the prediction block to determine a prediction block of a second color component of the current block; The method of decoding according to claim 1 .

47. determining a reconstructed value of a second color component sample point of the current block based on the predicted block, determining a predicted difference value of a second color component sample point of the current block; determining a predicted value of a second color component sample point of the current block based on the predicted block; determining a reconstructed value of the second color component sample point of the current block based on a predicted difference value of the second color component sample point of the current block and a predicted value of the second color component sample point of the current block; The method of decoding according to claim 1 .

48. 1. A method of encoding, comprising: Determining a reference for a current block; Performing a filtering process on at least a portion of the reference information of the current block to determine target information of the current block; determining a weighting coefficient based on a reference sample value of a first color component in the target information; determining a prediction block of a second color component of the current block according to the weighting coefficient and a reference sample value of a second color component in the target information; determining a prediction difference value of a second color component sample point of the current block based on the prediction block.

49. the predicted block includes predicted values ​​of at least some of the second color component sample points in the current block; 49. The encoding method of claim 48.

50. Determining the reference information of the current block includes: determining reference information for the current block based on values ​​of first color component sample points in adjacent regions of the current block, values ​​of second color component sample points in adjacent regions of the current block, and reconstructed values ​​of first reference color component sample points in the current block; 49. The encoding method of claim 48.

51. the neighboring region of the current block includes at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region; 51. The encoding method of claim 50.

52. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a first filtering process on values ​​of first color component sample points in the neighboring region of the current block to obtain filtered sample values ​​of the first color component in the neighboring region of the current block; determining target information of the current block based on the filtered sample values ​​of the first color component in a neighboring region of the current block; 51. The encoding method of claim 50.

53. A quantity of the filtered sample values ​​of the first color component in the neighboring region of the current block is equal to L, where L represents a quantity of values ​​of the second color component sample points in the neighboring region of the current block, and L is a positive integer.

53. The encoding method of claim 52.

54. The first filtering process is a downsampling filtering process.

53. The encoding method of claim 52.

55. The encoding method comprises: and performing a first filtering process on values ​​of first color component sample points in the neighboring region of the current block according to color format information to obtain filtered sample values ​​of the first color component in the neighboring region of the current block.

53. The encoding method of claim 52.

56. The first filtering process includes: If the color format information indicates 4:2:0 sampling, the method further includes performing downsampling filtering on values ​​of the first color component sample points in the neighboring region of the current block, where the downsampling rate is an inverse of a positive integer multiple of 2; 56. The encoding method of claim 55.

57. The encoding method comprises: Comparing L to a preset number; According to a comparison result between L and a preset number, performing a second filtering process on the filtered sample values ​​of the first color component in the adjacent region of the current block and the values ​​of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values ​​of the first color component of the current block and the filtered adjacent sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of a first color component of the current block and the filtered neighboring sample values ​​of a second color component of the current block.

54. The encoding method of claim 53.

58. performing a second filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; If L is greater than the preset number, performing a first sub-filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; If L is smaller than the preset number, performing a second sub-filtering process on the filtered sample values ​​of the first color component in the neighboring region of the current block and the values ​​of the second color component sample points in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

58. The encoding method of claim 57.

59. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a third filtering process on values ​​of second color component sample points in the neighboring area of ​​the current block to obtain filtered sample values ​​of the second color component in the neighboring area of ​​the current block; determining target information of the current block based on the filtered sample values ​​of the second color component in an adjacent region of the current block; 51. The encoding method of claim 50.

60. A quantity of the filtered sample values ​​of the second color component in the neighboring region of the current block is equal to K, where K represents a quantity of values ​​of the first color component sample points in the neighboring region of the current block, and K is a positive integer.

60. The encoding method of claim 59.

61. the third filtering process is an upsampling filtering process; 60. The encoding method of claim 59.

62. The encoding method comprises: and performing a third filtering process on values ​​of second color component sample points in the neighboring region of the current block according to color format information to obtain filtered sample values ​​of the second color component in the neighboring region of the current block.

60. The encoding method of claim 59.

63. The third filtering process includes: If the color format information indicates 4:2:0 sampling, the method further includes performing upsampling filtering on values ​​of second color component sample points in the neighboring region of the current block, and the upsampling rate is a positive integer multiple of 2.

63. The encoding method of claim 62.

64. The encoding method comprises: Comparing K to a preset number; performing a fourth filtering process on the values ​​of the first color component sample points in the adjacent region of the current block and the filtered sample values ​​of the second color component in the adjacent region of the current block according to a comparison result between K and a preset number, to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of a first color component of the current block and the filtered neighboring sample values ​​of a second color component of the current block.

61. The encoding method of claim 60.

65. performing a fourth filtering process on values ​​of first color component sample points in the neighboring region of the current block and filtered sample values ​​of a second color component in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block and filtered neighboring sample values ​​of the second color component of the current block; If K is greater than the preset number, performing a first sub-filtering process on values ​​of first color component sample points in the neighboring region of the current block and filtered sample values ​​of a second color component in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block and filtered neighboring sample values ​​of the second color component of the current block; If K is smaller than the preset number, performing a second sub-filtering process on values ​​of the first color component sample points in the neighboring region of the current block and the filtered sample values ​​of the second color component in the neighboring region of the current block to determine the filtered neighboring sample values ​​of the first color component of the current block and the filtered neighboring sample values ​​of the second color component of the current block.

65. The encoding method of claim 64.

66. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: determining a quantity of values ​​of first color component sample points in an adjacent region of the current block as a first quantity; performing a fifth filtering process on values ​​of first color component sample points in the neighboring region of the current block according to a comparison result between the first quantity and a preset number to determine filtered neighboring sample values ​​of the first color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of the first color component of the current block; 50. The encoding method of claim 49.

67. performing a fifth filtering process on values ​​of first color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block; performing a first sub-filtering process on values ​​of first color component sample points in a neighboring region of the current block when the first quantity is greater than the preset number to determine a filtered neighboring sample value of the first color component of the current block; If the first quantity is smaller than the preset number, performing a second sub-filtering process on values ​​of first color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the first color component of the current block.

67. The encoding method of claim 66.

68. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: determining a quantity of values ​​of second color component sample points in the neighboring region of the current block as a second quantity; performing a sixth filtering process on values ​​of second color component sample points in the neighboring region of the current block according to a comparison result between the second quantity and a preset number to determine filtered neighboring sample values ​​of the second color component of the current block; determining target information of the current block based on the filtered neighboring sample values ​​of the second color component of the current block; 51. The encoding method of claim 50.

69. performing a sixth filtering process on values ​​of second color component sample points in a neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block; performing a first sub-filtering process on values ​​of second color component sample points in a neighboring region of the current block when the second quantity is greater than the preset number to determine filtered neighboring sample values ​​of the second color component of the current block; if the second quantity is less than the preset number, performing a second sub-filtering process on values ​​of second color component sample points in the neighboring region of the current block to determine filtered neighboring sample values ​​of the second color component of the current block.

69. The encoding method of claim 68.

70. The encoding method comprises: and setting a reference sample value of a second color component in the target information to a filtered neighboring sample value of the second color component of the current block.

70. An encoding method according to claim 57, 64 or 68.

71. The first sub-filtering process is a downsampling filtering process.

70. The encoding method of claim 58, 65, 67 or 69.

72. The first sub-filtering process includes: A fixed interval position selection method is adopted to perform the sub-filtering process; and and performing the sub-filtering process by adopting a successive position selection method.

70. The encoding method of claim 58, 65, 67 or 69.

73. the second sub-filtering process is an upsampling filtering process; 70. The encoding method of claim 58, 65, 67 or 69.

74. The second sub-filtering process includes: performing sub-filtering processing by adopting a fixed interval position interpolation method; 70. The encoding method of claim 58, 65, 67 or 69.

75. The step of filtering at least a portion of the reference information of the current block to determine target information of the current block includes the steps of: performing a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; determining target information of the current block based on the filtered sample values ​​of first reference color component sample points in the current block; 58. An encoding method according to claim 50 or 57.

76. performing a seventh filtering process on the reconstructed values ​​of the first reference color component sample points in the current block to determine filtered sample values ​​of the first reference color component sample points in the current block; determining a first width and a first height based on the reconstructed values ​​of first reference color component sample points in the current block; performing a third sub-filtering process on the reconstructed values ​​of the first reference color component sample points in the current block when the first width is greater than the width of the prediction block or when the first height is greater than the height of the prediction block, to determine filtered sample values ​​of the first reference color component sample points in the current block; performing a fourth sub-filtering process on the reconstructed value of the first reference color component sample point in the current block when the first width is smaller than the width of the prediction block or when the first height is smaller than the height of the prediction block, to determine a filtered sample value of the first reference color component sample point in the current block.

76. The encoding method of claim 75.

77. the third sub-filtering process is a downsampling filtering process; 77. The encoding method of claim 76.

78. The third sub-filtering process includes: performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing a downsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing a downsampling filtering process in a horizontal direction and then a downsampling filtering process in a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and performing a downsampling filtering operation in a vertical direction and then a downsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

78. The encoding method of claim 77.

79. the fourth sub-filtering process is an upsampling filtering process; 77. The encoding method of claim 76.

80. The fourth sub-filtering process includes: performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a horizontal direction; performing an upsampling filtering process on the reconstructed values ​​of the first reference color component sample points in the current block in a vertical direction; performing an upsampling filtering process in a horizontal direction and then a vertical direction on the reconstructed values ​​of the first reference color component sample points in the current block; and performing an upsampling filtering operation in a vertical direction and then performing an upsampling filtering operation in a horizontal direction on the reconstructed values ​​of the first reference color component sample points in the current block.

80. The encoding method of claim 79.

81. The encoding method comprises: and setting a reference sample value of the first color component in the target information to an absolute value of a difference between a value of a first color component sample point in an adjacent region of the current block and a reconstructed value of a first reference color component sample point in the current block.

76. The encoding method of claim 75.

82. The encoding method comprises: and setting a reference sample value of a first color component in the target information to an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of a first reference color component sample point in the current block.

76. The encoding method of claim 75.

83. Determining a weighting coefficient based on a reference sample value of a first color component in the target information includes: determining a value corresponding to a reference sample value of the first color component based on a preset mapping relationship; setting said weighting factor equal to said value.

49. The encoding method of claim 48.

84. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: determining a first factor; determining a first product value based on the first factor and a reference sample value of the first color component; determining a corresponding value of the first product value based on the predefined mapping relationship.

84. The encoding method of claim 83.

85. Determining the first factor comprises: The first factor may be a preset constant value.

85. The encoding method of claim 84.

86. Determining the first factor comprises: determining a value of the first factor based on a size parameter of the current block; the size parameters of the current block include at least one of a width of the current block and a height of the current block; 85. The encoding method of claim 84.

87. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: The pre-defined mapping relationship is a Softmax function.

84. The encoding method of claim 83.

88. Determining a value corresponding to a reference sample value of the first color component based on the preset mapping relationship includes: the preset mapping relationship is a weighting function having an inverse relationship with the reference sample value of the first color component; 84. The encoding method of claim 83.

89. determining a prediction block of a second color component of the current block based on the weighting coefficient and a reference sample value of a second color component in the target information; determining a reference sample value of the second color component and a corresponding weight value of the weighting coefficient; and setting a predicted value of a second color component sample point in the prediction block to a sum of N of the weighted values, where N represents a quantity of reference sample values ​​of the second color component, and N is a positive integer.

49. The encoding method of claim 48.

90. The encoding method comprises: performing a correction operation on a predicted value of a second color component sample point in the predicted block to determine a predicted block of a second color component of the current block; 90. The encoding method of claim 89.

91. The encoding method comprises: performing an enhanced filtering process on the predicted block; and using the processed predicted block as a predicted block of a second color component of the current block.

49. The encoding method of claim 48.

92. The encoding method comprises: determining a compensation value of a second color component of the prediction block according to reference sample values ​​in an adjacent region of the current block; and performing a correction process on a predicted value of a second color component sample point in the predicted block according to the compensation value to determine a predicted block of a second color component of the current block.

49. The encoding method of claim 48.

93. The encoding method comprises: performing a prediction process on second color component sample points in the prediction block according to at least one prediction mode to determine at least one initial predicted value of the second color component sample points in the prediction block; performing a weighted fusion process according to the at least one initial prediction value and a prediction value of a second color component sample point in the prediction block to determine a prediction block of a second color component of the current block; 49. The encoding method of claim 48.

94. determining a prediction difference value of a second color component sample point of the current block based on the prediction block, determining a predicted value of a second color component sample point of the current block based on the predicted block; determining a predicted difference value of the second color component sample point of the current block based on an original value of the second color component sample point of the current block and a predicted value of the second color component sample point of the current block; 49. The encoding method of claim 48.

95. The encoding method comprises: encoding a prediction difference value of a second color component sample point of the current block; and writing the resulting encoded bits into a bitstream.

95. The encoding method of claim 94.

96. An encoding device comprising a first determination unit, a first filtering unit, and a first prediction unit, The first determining unit is configured to determine reference information of a current block; The first filtering unit is configured to perform a filtering process on at least a portion of information of the reference information of the current block to determine target information of the current block; The first determining unit is further configured to determine a weighting coefficient based on a reference sample value of a first color component in the target information; The first prediction unit is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and a reference sample value of a second color component in the target information; The first determining unit is further configured to determine, based on the predictive block, a predicted difference value of a second color component sample point of the current block.

97. 1. 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; Encoding device, wherein the first processor is configured to execute the encoding method according to any one of claims 48 to 95 by executing the computer program.

98. A decoding device comprising a second determination unit, a second filtering unit, and a second prediction unit, The second determining unit is configured to determine reference information of a current block; The second filtering unit is configured to perform a filtering process on at least a portion of information of the reference information of the current block to determine target information of the current block; The second determining unit is further configured to determine a weighting coefficient based on a reference sample value of a first color component in the target information; The second prediction unit is configured to determine a prediction block of a second color component of the current block according to the weighting coefficient and a reference sample value of a second color component in the target information; The second determining unit is further configured to determine, based on the prediction block, a reconstructed value of a second color component sample point of the current block.

99. 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; 48. A decoding device, wherein the second processor is configured to execute the decoding method according to any one of claims 1 to 47 by executing the computer program.

100. A computer-readable storage medium having stored thereon a computer program for causing a decoding method according to any one of claims 1 to 47 or an encoding method according to any one of claims 48 to 95.

Citation Information

Patent Citations

  • Video coding device and video decoding device

    JP2020145488A

  • Video image component prediction method, apparatus and computer storage medium

    JP2022501863A

  • Video coding using cross-component linear models

    JP2022516808A

  • Video colour component prediction method and apparatus, and computer storage medium

    US20210160505A1

  • Video coding using cross-component linear model

    US20210337188A1