Symbolization / Decryption Method, Apparatus, Symbolization Machine, Decryption Machine, and Storage Medium
The proposed method optimizes chrominance prediction in H.266/VVC by determining reference values and weighting coefficients, addressing low accuracy and complexity issues to enhance video encoding/decoding efficiency.
Patent Information
- Application Number
- JP2024576936
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2025-07-03
AI Technical Summary
The Joint Video Exploration Team's H.266/VVC standard suffers from low prediction accuracy and degraded video quality due to deviations in inter-color-component prediction, leading to reduced encoding performance.
An encoding/decoding method that improves chrominance prediction accuracy and reduces computational complexity by determining reference values, weighting coefficients, and optimizing the calculation process using integer arithmetic based on color component reference information.
Enhances chrominance prediction accuracy while reducing calculation complexity, thereby improving encoding/decoding efficiency and performance.
Smart Images

Figure 2025520848000001_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of video encoding and decoding, and in particular, to an encoding / decoding method, apparatus, encoding device, decoding device, and storage medium.
Background Art
[0002] As people's requirements for video display quality increase, new video application formats such as high-definition and ultra-high-definition digital videos have emerged. The Joint Video Exploration Team (JVET) of the international standardization organizations 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 and the original value of the encoded block calculated by the inter-color-component prediction technique of H.266 / VVC, which results in low prediction accuracy, degraded quality of the decoded video, and reduced encoding performance.
Summary of the Invention
Means for Solving the Problems
[0004] The embodiments of the present application provide an encoding / decoding method, apparatus, encoding device, decoding device, and storage medium, which can not only improve the accuracy of chrominance prediction and reduce the computational complexity of chrominance prediction, but also improve the encoding / decoding performance.
[0005] The technical solution of the embodiments of the present application can be realized as follows.
[0006] In a first aspect, the embodiments of the present application provide a decoding method, the method comprising:
[0007] Determining a reference value of a first color component of a current block and a reference value of a second color component of the current block;
[0008] Determining a weighting coefficient according to the reference value of the first color component of the current block;
[0009] Determining a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value and the reference average value of the second color component of the current block;
[0010] Determining a predicted value of a second color component sampling point in the current block according to the reference average value, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient;
[0011] Determining a reconstructed value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block. The method includes the above steps.
[0012] In a second aspect, the embodiments of the present application provide an encoding method, the method includes:
[0013] Determining a reference value of a first color component of a current block and a reference value of a second color component of the current block;
[0014] Determining a weighting coefficient according to the reference value of the first color component of the current block;
[0015] Determining a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value and the reference average value of the second color component of the current block;
[0016] Determining a predicted value of a second color component sampling point in a current block according to a reference average value of a second color component of the current block, a reference sample value of the second color component of the current block, and a corresponding weighting coefficient;
[0017] Determining a predicted difference value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0018] In a third aspect, an embodiment of the present application provides an encoding device, and the encoding device includes a first determination unit, a first calculation unit, and a first prediction unit.
[0019] The first determination unit is configured to determine a reference value of a first color component of a current block and a reference value of a second color component of the current block, and determine a weighting coefficient according to the reference value of the first color component of the current block.
[0020] The first calculation unit is configured to determine a reference average value of a second color component of the current block according to the reference value of the second color component of the current block, and determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block.
[0021] The first prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and a corresponding weighting coefficient.
[0022] The first determination unit is further configured to determine a predicted difference value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0023] In a fourth aspect, an embodiment of the present application provides an encoding device, and the encoding device includes a first memory and a first processor.
[0024] The first memory is used to store a computer program executable on the first processor,
[0025] The first processor is used to execute the method described in the second aspect when executing the computer program.
[0026] In the fifth aspect, the embodiment of the present application provides a decoding device, and the decoding device includes a second determination unit, a second calculation unit, and a second prediction unit.
[0027] The second determination unit is configured to determine a reference value of a first color component of the current block and a reference value of a second color component of the current block, and determine a weighting coefficient according to the reference value of the first color component of the current block.
[0028] The second calculation unit is configured to determine a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block.
[0029] The second prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient.
[0030] The second determination unit is further configured to determine a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0031] In the sixth aspect, the embodiment of the present application provides a decoding device, and the decoding device includes a second memory and a second processor.
[0032] The second memory is used to store a computer program executable on the second processor.
[0033] The second processor is used to execute the method described in the first aspect when executing a computer program.
[0034] In a seventh aspect, the present application embodiment provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed, the method described in the first aspect or the method described in the second aspect is realized.
[0035] In the embodiments of the present application, an encoding / decoding method, apparatus, encoding device, decoding device, and storage medium are provided. Whether on the encoding side or the decoding side, a reference value of a first color component of a current block and a reference value of a second color component of the current block are determined. According to the reference value of the first color component of the current block, a weighting coefficient is determined. According to the reference value of the second color component of the current block, a reference average value of the second color component of the current block is determined. According to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, a reference sample value of the second color component of the current block is determined. According to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient, a predicted value of a second color component sampling point in the current block is determined. Thus, on the encoding side, according to the predicted value of the second color component sampling point in the current block, a predicted difference value of the second color component sampling point of the current block can be determined. Thereby, on the decoding side, according to the predicted value of the second color component sampling point in the current block, a reconstructed value of the second color component sampling point of the current block can be determined. That is, in order to be based on the color component reference information in the adjacent region of the current block and the color component reconstruction information in the current block, it is necessary to construct a luminance difference vector. Thereby, not only is the weighting coefficient determined, but it is also necessary to determine a chrominance average value according to the chrominance reference information, and determine a chrominance difference vector according to the chrominance reference information and the chrominance average value. Furthermore, according to the chrominance difference vector and the corresponding weighting coefficient, by adding the chrominance average value, a chrominance predicted value can be determined. In this way, by optimizing the calculation process of chrominance prediction based on weights, integer arithmetic can be completely adopted, and moreover, the characteristics of the weight model can be fully considered, and the integer arithmetic process can be reasonably optimized, fully guaranteeing the accuracy of chrominance prediction, while reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
Brief Description of the Drawings
[0036]
Figure 1
Figure 2
Figure 3
Figure 4A
Figure 4B
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Embodiments for Carrying Out the Invention
[0037] To more comprehensively understand the features and technical content of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, the accompanying drawings are only for reference and explanation purposes and do not limit the embodiments of the present application.
[0038] Unless otherwise defined, all technical and scientific terms used in this specification shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms used in this specification are for the purpose of describing only the embodiments of this application and are not intended to limit this application.
[0039] In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments. It is understood that "some embodiments" may be the same subset or a different subset of all possible embodiments, and may be combined with each other if there is no conflict. Note that the terms "first," "second," and "third" in the embodiments of this application are only for distinguishing similar objects and do not mean a specific order of the objects. It is understood that if the terms "first," "second," and "third" are permitted, the embodiments of this application described in this specification can be implemented in an order other than the order illustrated or described in this specification by mutually exchanging the specific order or priority.
[0040] In a video image, generally, a coding block (CB) is characterized using a first color component, a second color component, and a third color component. Here, these 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 symbol Y, the blue color component is usually represented by the symbol Cb or U, and the red color component is usually represented by the symbol Cr or V. Thus, the video image may be represented using the YCbCr format or the YUV format. In addition to the above, the video image may also be in the RGB format, the YCgCo format, etc., and the embodiments of this application are not limited to anything.
[0041] In the current video image or video encoding / decoding process, for the cross-component prediction technology, it mainly includes a cross-component linear model (CCLM) prediction mode and a multi-directional linear model (MDRM) prediction mode. Whether it is a model parameter derived based on the CCLM prediction mode or a model parameter derived based on the MDRM prediction mode, it is understood that the corresponding prediction model can realize predictions between color components such as from the first color component to the second color component, from the second color component to the first color component, from the first color component to the third color component, from the third color component to the first color component, from the second color component to the third color component, or from the third color component to the second color component.
[0042] JPEG2025520848000130.jpg68169
[0043] JPEG2025520848000131.jpg69169
[0044] For an encoding block, its adjacent region may be divided into five parts: a left adjacent region, an upper adjacent region, a lower left adjacent region, an upper left adjacent region, and an upper right adjacent region. H.266 / VVC includes three types of cross-component linear model prediction modes, namely, a left and upper adjacent intra CCLM prediction mode (which may be represented by INTRA_LT_CCLM), a left and lower left adjacent intra CCLM prediction mode (which may be represented by INTRA_L_CCLM), and an upper and upper right adjacent intra CCLM prediction mode (which may be represented by INTRA_T_CCLM). Among these three types of prediction modes, each prediction mode may select a preset number (for example, four) of reference pixels to derive the model parameters α and β. However, the biggest difference among these three types of prediction modes is that the selection regions corresponding to the reference pixels used to derive the model parameters α and β are different.
[0045] Specifically, assuming that the dimension of the encoded block corresponding to the chrominance component is W×H, while the upper selection region corresponding to the reference pixel is W’ and the left selection region corresponding to the reference pixel is H’,
[0046] For the INTRA_LT_CCLM mode, the reference pixel may be selected from the upper adjacent region and the left adjacent region, that is, W’ = W and H’ = H.
[0047] For the INTRA_L_CCLM mode, the reference pixel may be selected from the left adjacent region and the lower left adjacent region, that is, H’ = W + H, and W’ = 0 is set.
[0048] For the INTRA_T_CCLM mode, the reference pixel may be selected from the upper adjacent region and the upper right adjacent region, that is, W’ = W + H, and H’ = 0 is set.
[0049] Note that in VTM, for the upper right adjacent region, only pixel points within a maximum range of W are stored, and for the lower left adjacent region, only pixel points within a maximum range of H are stored. The range of the selection region for the INTRA_L_CCLM mode and the INTRA_T_CCLM mode is defined as W + H. However, in actual applications, the selection region of the INTRA_L_CCLM mode is restricted within H + H, and the selection region of the INTRA_T_CCLM mode is restricted within W + W. In this case,
[0050] For the INTRA_L_CCLM mode, the reference pixel may be selected from the left adjacent region and the lower left adjacent region, and H’ = min{W + H, H + H}.
[0051] For the INTRA_T_CCLM mode, the reference pixel may be selected from the upper adjacent region and the upper right adjacent region, and W’ = min{W + H, W + W}.
[0052] JPEG2025520848000132.jpg37169
[0053] As described above, based on FIG. 1, the selection regions for the three types of prediction modes are shown in FIG. 2. Here, in FIG. 2, (a) represents the selection region of the INTRA_LT_CCLM mode including the left adjacent region and the upper adjacent region, (b) represents the selection region of the INTRA_L_CCLM mode including the left adjacent region and the lower left adjacent region, and (c) represents the selection region of the INTRA_T_CCLM mode including the upper adjacent region and the upper right adjacent region. Thus, after the selection regions for the three types of prediction modes are determined, pixel selection for deriving model parameters may be performed within the selection regions. The pixels selected in this way may be referred to as reference pixels. Usually, the number of reference pixels is four. However, for a coded block with dimensions determined, i.e., with dimensions of W×H, the positions of the reference pixels are generally determined.
[0054] After obtaining a preset number of reference pixels, currently, chrominance prediction is performed according to the flowchart of the model parameter derivation scheme shown in FIG. 3. Assuming that the preset number is four according to the process shown in FIG. 3, the process may include the following steps.
[0055] S301, Obtain reference pixels in the selection region.
[0056] S302, Determine the number of valid reference pixels.
[0057] S303, If the number of valid reference pixels is 0, set the model parameter α to 0 and set β to the default value.
[0058] S304, Pad the default value to the chrominance prediction value.
[0059] S305, If the number of valid reference pixels is 4, obtain two reference pixels with relatively large values and two reference pixels with relatively small values among the luminance components by comparison.
[0060] S306, Calculate the average points corresponding to the relatively large values and the average points corresponding to the relatively small values.
[0061] S307. Derive model parameters α and β according to the two average points.
[0062] S308. Perform chromaticity prediction using the prediction model composed of α and β.
[0063] In VVC, the step where the valid reference pixels number are 0 is determined according to the validity of the adjacent region.
[0064] Note that the prediction model is constructed using the principle that "a straight line passing through two points is uniquely determined", and the two points here may be called fitting points. In the current technical solution, after obtaining four reference pixels, two reference pixels with relatively large values and two reference pixels with relatively small values among the luminance components are obtained by comparison. Next, according to the two reference pixels with relatively large values, an average point (which may be represented by mean max ) is obtained, and according to the two reference pixels with relatively small values, another average point (which may be represented by mean min ) is obtained. The two average points mean max and mean min are obtained, and then, mean max and mean min are used as the two fitting points to derive model parameters (represented by α and β), and finally, a prediction model is constructed according to α and β, and prediction processing of the chromaticity component is performed according to the prediction model.
[0065] JPEG2025520848000133.jpg223169
[0066] Based on this, the embodiments of the present application provide an encoding method, which determines a reference value of a first color component of a current block and a reference value of a second color component of the current block, determines a weighting coefficient according to the reference value of the first color component of the current block, determines a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, determines a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, determines a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient, and determines a predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0067] The embodiments of the present application provide a decoding method, which determines a reference value of a first color component of a current block and a reference value of a second color component of the current block, determines a weighting coefficient according to the reference value of the first color component of the current block, determines a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, determines a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, determines a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient, and determines a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0068] Thus, in order to determine the weighting coefficient based on the color component reference information in the adjacent area of the current block and the color component reconstruction information in the current block, it is necessary not only to construct a luminance difference vector, but also to determine a chrominance average value according to the chrominance reference information, and to determine a chrominance difference vector according to the chrominance reference information and the chrominance average value. Furthermore, according to the chrominance difference vector and the corresponding weighting coefficient, the chrominance prediction value can be determined by adding the chrominance average value. In this way, by optimizing the calculation process based on the chrominance prediction of the weight, integer arithmetic can be completely adopted, and moreover, the characteristics of the weight model can be fully considered, the integer arithmetic process can be reasonably optimized, the accuracy of chrominance prediction can be fully guaranteed, the calculation complexity can be reduced, the encoding / decoding efficiency can be improved, and furthermore, the encoding / decoding performance can be improved.
[0069] Hereinafter, each embodiment of the present application will be described in detail with reference to the drawings.
[0070] Referring to FIG. 4A, FIG. 4A is a diagram showing a configuration block diagram of an encoder according to an embodiment of the present application. As shown in FIG. 4A, an encoder (specifically, a “video encoder”) 100 may include a transform and quantization unit 101, an intra prediction 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 cache unit 110, etc. Here, the filtering unit 108 may implement deblocking filtering and sample adaptive offset (SAO) filtering. The encoding unit 109 may implement header information encoding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, by dividing a coding tree unit (CTU), a video coding block is obtained, and for the residual pixel information obtained by intra prediction or inter prediction, the transform and quantization unit 101 performs a transform on the video coding block including converting the residual information from the pixel domain to the transform domain, and further reduces the bit rate by quantizing the obtained transform coefficients. The intra prediction unit 102 and the intra prediction unit 103 are for performing intra prediction on the video coding block. Specifically, the intra prediction unit 102 and the intra prediction unit 103 are used to determine an intra prediction mode for encoding the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to provide temporal prediction information by performing inter prediction coding on one or more blocks of one or more reference frames of the received video coding block.The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors. The motion vectors estimate the motion of the video coding block. Then, the motion compensation unit 104 performs motion compensation based on the motion vectors determined by the motion estimation unit 105. After determining the intra prediction mode, the intra prediction unit 103 is used to further provide the selected intra prediction data to the coding unit 109, and the motion estimation unit 105 also transmits the calculated and determined motion vector data to the coding unit 109. Also, the inverse transform and inverse quantization unit 106 is for reconstructing the video coding block. It reconstructs the residual block in the pixel region. The reconstructed residual block has its block effect artifacts removed by the filter control analysis unit 107 and the filtering unit 108, and a reconstructed video coding block is generated by adding the reconstructed residual block to one of the predictive blocks in the frame of the decoded image cache unit 110. The coding unit 109 is for coding various coding parameters and the quantized transform coefficients. In the CABAC-based coding algorithm, the context content may be based on adjacent coding blocks, and it may be used to code the information indicating the determined intra prediction mode and output the code stream of the video signal. The decoded image cache unit 110 is for storing the reconstructed video coding blocks and is used for prediction reference. As the coding of the video image progresses, new reconstructed video coding blocks are continuously generated, and all of these reconstructed video coding blocks are stored in the decoded image cache unit 110.
[0071] Referring to FIG. 4B, FIG. 4B is a diagram showing a configuration block diagram of a decoder according to an embodiment of the present application. 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 cache unit 206. Here, the decoding unit 201 may implement header information decoding and CABAC decoding. The filtering unit 205 may implement deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process of FIG. 4A, a code stream of the video signal is output. The code stream is input to the decoder 200, and first, by passing through the decoding unit 201, decoded transform coefficients are obtained. The transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain. The intra prediction unit 203 may be used to generate prediction data for the current video decoding block based on the determined intra prediction mode and data that has passed through the previously decoded block from the current frame or picture. The motion compensation unit 204 analyzes the motion vector and other related syntax elements to determine prediction information for the video decoding block, and uses the prediction information to generate a predictive block of the video decoding block being decoded. By adding the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204, a decoded video block is formed. The decoded video signal can have block effect artifacts removed by the filtering unit 205, thereby improving the video quality. Then, the decoded video block is stored in the decoded image cache unit 206, and the decoded image cache unit 206 is used to store a reference image for subsequent intra prediction or motion compensation, and is also used for output of the video signal, that is, the original video signal that has been restored is obtained.
[0072] Note that the method of the embodiment of the present application is mainly applied to the part of the intra prediction unit 103 shown in FIG. 4A and the part of the intra prediction unit 203 shown in FIG. 4B. That is, the embodiment of the present application may be applied to both the encoder and 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 particularly limited.
[0073] Note that when applied to the part of the intra prediction unit 103, "the current block" specifically refers to the coded block that is the target of the current intra prediction. When applied to the part of the intra prediction unit 203, "the current block" specifically refers to the decoded block that is the target of the current intra prediction.
[0074] In the first aspect, the present application provides a decoding method, the method comprising: determining a reference value of a first color component of the current block and a reference value of a second color component of the current block; determining a weighting coefficient according to the reference value of the first color component of the current block; determining a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value and the reference average value of the second color component of the current block; determining a predicted value of a second color component sampling point in the current block according to the reference average value, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient; determining a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block; and the like. In the second aspect, the step of determining the reference value of the first color component of the current block and the reference value of the second color component of the current block comprises: determining the reference value of the first color component of the current block according to the values of the first color component sampling points in the adjacent region of the current block; determining the reference value of the second color component of the current block according to the values of the second color component sampling points in the adjacent region of the current block; including the adjacent region includes at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region, The method according to the first aspect. In the third aspect, the step of determining the reference value of the first color component of the current block according to the values of the first color component sampling points in the adjacent region of the current block comprises: performing a first filtering process on the values of the first color component sampling points in the adjacent region of the current block, and determining the reference value of the first color component of the current block, The method according to the second aspect. In the fourth aspect, the first filtering process is a downsampling filtering process. The method according to the third aspect. In the fifth item, the step of determining the reference value of the second color component of the current block according to the value of the second color component sampling point in the adjacent area of the current block is: including the step of performing a second filtering process on the value of the second color component sampling point in the adjacent area of the current block and determining the reference value of the second color component of the current block; The method according to item 2. In the sixth item, the second filtering process is an upsampling filtering process. The method according to item 5. In the seventh item, the step of determining the weighting coefficient according to the reference value of the first color component of the current block is: determining the reconstruction value of the first color component sampling point in the current block; determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block; determining the weighting coefficient according to the reference sample value of the first color component of the current block; and including. The method according to item 1. In the eighth item, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block is: determining the difference value between the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block; determining the reference sample value of the first color component of the current block according to the difference value; and including. The method according to item 7. In the ninth item, the step of determining the reference sample value of the first color component of the current block according to the difference value is: including the step of setting the reference sample value of the first color component of the current block to be equal to the absolute value of the difference value. The method according to item 8. In the tenth item, the step of determining the weighting coefficient according to the reference sample value of the first color component of the current block is: determining the weight index value according to the reference sample value of the first color component of the current block; determining the weighting coefficient using the first setting mapping relationship according to the weight index value; and including. The method according to item 7. In the 11th item, the step of determining the weight index value according to the reference sample value of the first color component of the current block includes: Determining the maximum weight index value and the minimum weight index value of the current block; Performing a correction process on the reference sample value of the first color component according to the maximum weight index value and the minimum weight index value, and determining the weight index value; Including: The method according to item 10. In the 12th item, the first setting mapping relationship is a numerical mapping look-up table of the weight index value and the weighting coefficient, The method according to item 10. In the 13th item, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value includes: Determining a first value corresponding to the weight index value under the first setting mapping relationship; Setting the weighting coefficient equal to the first value; Including: The method according to item 12. In the 14th item, the step of determining a first value corresponding to the weight index value under the first setting mapping relationship includes: Determining a first factor; Determining a second value using a second setting mapping relationship according to the weight index value; Calculating a first product value of the first factor and the second value; Setting the first value equal to the corresponding value under the first setting mapping relationship of the first product value; Including: The method according to item 13. In the 15th item, the second setting mapping relationship is an exponential function relationship based on n, where the value of n is equal to the weight index value, The method according to item 14. In the 16th item, including the step that the first factor is a preset constant value, The method according to item 14. In the 17th item, the step of determining the first factor includes: Determining the value of the first factor according to the dimension parameter of the current block, The dimension parameter of the current block includes at least one of the width of the current block and the height of the current block, The method according to item 14. In the 18th item, the step of determining the weight index value according to the reference sample value of the first color component of the current block includes: Determining a second factor; Determining the weight index value according to the reference sample value of the first color component of the current block and the second factor; including the method according to Item 10. In Item 19, including the step that the second factor is a preset constant value; the method according to Item 18. In Item 20, the step of determining the second factor includes determining the value of the second factor according to the dimension parameter of the current block; the dimension parameter of the current block includes at least one of the width of the current block and the height of the current block; the method according to Item 18. In Item 21, the step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor includes determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor; determining the maximum weight index value and the minimum weight index value of the current block; performing correction processing on the third value according to the maximum weight index value and the minimum weight index value to determine the weight index value; including the method according to Item 18. In Item 22, the step of determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor includes determining at least one shift array; determining a target offset amount from the at least one shift array according to the second factor; performing a right shift operation of the target offset amount on the reference sample value of the first color component to determine the third value; including the method according to Item 21. In Item 23, the step of determining the weighting factor using the first setting mapping relationship according to the weight index value includes determining a second product value according to the second factor and the weight index value; determining a corresponding fourth value of the second product value under the first setting mapping relationship; setting the weighting factor equal to the fourth value; including the method according to Item 18. In Item 24, the step of determining a corresponding fourth value of the second product value under the first setting mapping relationship includes determining a first factor; Determining a fifth value using a second setting mapping relationship according to the second product value; Calculating a third product value of the first factor and the fifth value; Setting the fourth value equal to the corresponding value under the first setting mapping relationship of the third product value; including The method according to clause 23. In clause 25, the step of determining a predicted value of a second color component sampling point in the current block according to a reference average value of the second color component of the current block, a reference sample value of the second color component of the current block, and the corresponding weighting coefficient is Determining a weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; Setting the total weighted value of the pixels to be predicted in the current block equal to the sum of the N weighted values, and setting the total coefficient value of the pixels to be predicted in the current block equal to the sum of the N weighting coefficients, where N represents the number of reference sample values of the second color component and N is a positive integer; Determining a sixth value using a fourth setting mapping relationship according to the total weighted value and the total coefficient value; Adding the reference average value of the second color component and the sixth value to obtain a predicted value of the second color component of the pixel to be predicted in the current block; Determining a predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block; including The method according to clause 1. In clause 26, the predicted value of the second color component of the pixel to be predicted includes predicted values of at least some of the second color component sampling points in the current block. The method according to clause 25. In clause 27, the step of determining a reference average value of the second color component of the current block according to a reference value of the second color component of the current block is including calculating an average value for N reference values of the second color component of the current block to obtain a reference average value of the second color component of the current block; The method according to clause 1. In clause 28, the method is Determining a block type index value according to the dimension parameter of the current block; Determining a value of N using a fifth setting mapping relationship according to the block type index value; further including The method according to clause 27. In Article 29, the fifth setting mapping relationship represents a numerical mapping lookup table between the block type index value and N, the method described in Article 28. In Article 30, the step of determining the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block is including the step of subtracting the reference value of the second color component of the current block from the reference average value of the second color component of the current block to obtain the reference sample value of the second color component of the current block, the method described in Article 1. In Article 31, the step of determining a sixth value using a fourth setting mapping relationship according to the weighted total value and the coefficient total value is the step of determining a setting offset amount, and determining a first numerical value using a sixth setting mapping relationship according to the coefficient total value, determining an array index value using a seventh setting mapping relationship according to the coefficient total value and the first numerical value, and determining a second numerical value using an eighth setting mapping relationship according to the array index value and the setting offset amount, when the array index value is equal to zero, determining a third numerical value according to the first numerical value, and determining a first offset amount according to the third numerical value and the setting offset amount, determining a fourth product value according to the second numerical value and the weighted total value, determining a setting addition value according to the third numerical value and the setting offset amount, performing an addition operation on the fourth product value and the setting addition value to obtain a target total value, performing a right shift operation of the first offset amount on the target total value to determine the sixth value, including, the method described in Article 25. In Article 32, the step of determining a first numerical value using a sixth setting mapping relationship according to the coefficient total value is including the step of setting the first numerical value to be equal to one less than the number of binary symbols required for the binary representation of the coefficient total value, the method described in Article 31. In Article 33, the step of determining an array index value using a seventh setting mapping relationship according to the coefficient total value and the first numerical value is including the step of using the coefficient total value and the first numerical value as inputs of a setting function relationship and outputting the array index value according to the setting function relationship, the method described in Article 31. In the 34th item, the step of determining the second numerical value using the eighth setting mapping relationship according to the array index value and the set offset amount is the step of determining an index indication value in an array mapping table according to the array index value, and the step of determining the second numerical value using the eighth setting mapping relationship according to the index indication value and the set offset amount, including the method described in the 31st item. In the 35th item, when it is determined whether the array index value is equal to zero, the step of determining the third numerical value according to the first numerical value is when the array index value is equal to zero, the step of setting the third numerical value equal to the first numerical value, and when the array index value is not equal to zero, the step of setting the third numerical value equal to the sum value of the first numerical value and 1, including the method described in the 31st item. In the 36th item, the method is further including the step of performing a correction operation on the predicted value of the second color component of the pixel to be predicted, and using the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block. the method described in the 35th item. In the 37th item, the step of determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block is including the step of performing filtering processing on the predicted value of the second color component of the pixel to be predicted, and determining the predicted value of the second color component sampling point in the current block. the method described in the 25th item. In the 38th item, the step of determining the reconstruction value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block is the step of determining the prediction difference value of the second color component sampling point in the current block, and the step of determining the reconstruction value of the second color component sampling point in the current block according to the prediction difference value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block, including the method described in any one of Items 1 to 33. In the 39th item, an encoding method is provided, and the method is the step of determining the reference value of the first color component of the current block and the reference value of the second color component of the current block, Determining a weighting coefficient according to a reference value of a first color component of the current block; Determining a reference average value of a second color component of the current block according to a reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block; Determining a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and a corresponding weighting coefficient; Determining a predicted difference value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block; including. In Article 40, the steps of determining a reference value of a first color component of the current block and a reference value of the second color component of the current block are: Determining a reference value of a first color component of the current block according to values of first color component sampling points in an adjacent region of the current block; Determining a reference value of a second color component of the current block according to values of second color component sampling points in an adjacent region of the current block; including, wherein the adjacent region includes at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region, The method according to Article 39. In Article 41, the step of determining a reference value of a first color component of the current block according to values of first color component sampling points in an adjacent region of the current block is: Performing a first filtering process on values of first color component sampling points in an adjacent region of the current block, and determining a reference value of a first color component of the current block, including. The method according to Article 40. In Article 42, the first filtering process is a downsampling filtering process. The method according to Article 41. In Article 43, the step of determining a reference value of a second color component of the current block according to values of second color component sampling points in an adjacent region of the current block is: Performing a second filtering process on values of second color component sampling points in an adjacent region of the current block, and determining a reference value of a second color component of the current block, including. The method according to Article 40. In the 44th item, the second filtering process is an upsampling filtering process. The method according to item 43. In the 45th item, the step of determining the weighting coefficient according to the reference value of the first color component of the current block is the step of determining the reconstruction value of the first color component sampling points in the current block, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block, the step of determining the weighting coefficient according to the reference sample value of the first color component of the current block, and includes the method according to item 39. In the 46th item, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block is the step of determining the difference value between the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block, the step of determining the reference sample value of the first color component of the current block according to the difference value, and includes the method according to item 45. In the 47th item, the step of determining the reference sample value of the first color component of the current block according to the difference value is the step of setting the reference sample value of the first color component of the current block to be equal to the absolute value of the difference value, and includes the method according to item 46. In the 48th item, the step of determining the weighting coefficient according to the reference sample value of the first color component of the current block is the step of determining the weight index value according to the reference sample value of the first color component of the current block, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value, and includes the method according to item 45. In the 49th item, the step of determining the weight index value according to the reference sample value of the first color component of the current block is the step of determining the maximum weight index value and the minimum weight index value of the current block, the step of performing correction processing on the reference sample value of the first color component according to the maximum weight index value and the minimum weight index value, and determining the weight index value, and includes the method according to item 48. In Article 50, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value is The step including that the first setting mapping relationship is a numerical mapping lookup table of the weight index value and the weighting coefficient. The method described in Article 48. In Article 51, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value is The step of determining a first value corresponding to the weight index value under the first setting mapping relationship, and The step of setting the weighting coefficient equal to the first value, and Including The method described in Article 48. In Article 52, the step of determining a first value corresponding to the weight index value under the first setting mapping relationship is The step of determining a first factor, and The step of determining a second value using a second setting mapping relationship according to the weight index value, and The step of calculating a first product value of the first factor and the second value, and The step of setting the first value equal to the corresponding value under the first setting mapping relationship of the first product value, and Including The method described in Article 51. In Article 53, the second setting mapping relationship is an exponential function relationship based on n, where the value of n is equal to the weight index value. The method described in Article 52. In Article 54, the first factor is a preset constant value. The method described in Article 52. In Article 55, the step of determining the first factor is The step of determining the value of the first factor according to the dimension parameter of the current block, including The dimension parameter of the current block includes at least one of the width of the current block and the height of the current block. The method described in Article 52. In Article 56, the step of determining the weight index value according to the reference sample value of the first color component of the current block is The step of determining a second factor, and The step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor, and Including The method described in Article 48. In Article 57, the second factor is a preset constant value. The method described in Article 56. In Article 58, the step of determining the second factor is The step of determining the value of the second factor according to the dimension parameter of the current block, including The dimension parameters of the current block include at least one of the width of the current block and the height of the current block. The method according to item 56. In item 59, the step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor includes: Determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor; Determining the maximum weight index value and the minimum weight index value of the current block; Performing a correction process on the third value according to the maximum weight index value and the minimum weight index value to determine the weight index value. Including. The method according to item 56. In item 60, the step of determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor includes: Determining at least one shift array; Determining a target offset amount from the at least one shift array according to the second factor; Performing a right shift operation on the reference sample value of the first color component by the target offset amount to determine the third value. Including. The method according to item 59. In item 61, the step of determining the weighting coefficient using a first setting mapping relationship according to the weight index value includes: Determining a second product value according to the second factor and the weight index value; Determining a corresponding fourth value of the second product value under the first setting mapping relationship; Setting the weighting coefficient equal to the fourth value. Including. The method according to item 56. In item 62, the step of determining a corresponding fourth value of the second product value under the first setting mapping relationship includes: Determining a first factor; Determining a fifth value using a second setting mapping relationship according to the second product value; Calculating a third product value of the first factor and the fifth value; Setting the fourth value equal to a corresponding value of the third product value under the first setting mapping relationship. Including. The method according to item 61. In Article 63, the step of determining the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient is as follows: Determining the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; Setting the total weighted value of the pixel to be predicted in the current block to be equal to the sum of the N weighted values, and setting the total coefficient value of the pixel to be predicted in the current block to be equal to the sum of the N weighting coefficients, where N represents the number of reference sample values of the second color component and N is a positive integer; Determining a sixth value using a fourth setting mapping relationship according to the total weighted value and the total coefficient value; Adding the reference average value of the second color component and the sixth value to obtain the predicted value of the second color component of the pixel to be predicted in the current block; Determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block; Including: The method described in Article 39. In Article 64, the predicted value of the second color component of the pixel to be predicted includes the predicted values of at least some of the second color component sampling points in the current block. The method described in Article 63. In Article 65, the step of determining the reference average value of the second color component of the current block according to the reference value of the second color component of the current block is as follows: Including the step of calculating the average value for N reference values of the second color component of the current block to obtain the reference average value of the second color component of the current block. The method described in Article 39. In Article 66, the method is as follows: Determining a block type index value according to the dimension parameter of the current block; Determining the value of N using a fifth setting mapping relationship according to the block type index value; Further including: The method described in Article 65. In Article 67, the fifth setting mapping relationship represents a numerical mapping lookup table between the block type index value and N. The method described in Article 66. In Article 68, the step of determining the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block is as follows: It includes the step of subtracting the reference value of the second color component of the current block from the reference average value of the second color component of the current block to obtain the reference sample value of the second color component of the current block. The method described in Article 39. In Article 69, the step of determining the sixth value using the fourth setting mapping relationship according to the weighted total value and the coefficient total value is as follows: The step of determining the setting offset amount; According to the coefficient total value, determining the first numerical value using the fourth setting mapping relationship, determining the array index value using the seventh setting mapping relationship according to the coefficient total value and the first numerical value, and determining the second numerical value using the eighth setting mapping relationship according to the array index value and the setting offset amount; When the array index value is equal to zero, determining the third numerical value according to the first numerical value, and determining the first offset amount according to the third numerical value and the setting offset amount; Determining the fourth product value according to the second numerical value and the weighted total value, determining the setting addition value according to the third numerical value and the setting offset amount, performing an addition operation on the fourth product value and the setting addition value to obtain the target total value; Performing a right shift operation of the first offset amount on the target total value to determine the sixth value; Including: The method described in Article 63. In Article 70, the step of determining the first numerical value using the fourth setting mapping relationship according to the coefficient total value is as follows: It includes the step of setting the first numerical value to be equal to the number of bits of the binary symbols required for the binary representation of the coefficient total value minus 1. The method described in Article 69. In Article 71, the step of determining the array index value using the seventh setting mapping relationship according to the coefficient total value and the first numerical value is as follows: It includes the step of using the coefficient total value and the first numerical value as the input of the setting function relationship and outputting the array index value according to the setting function relationship. The method described in Article 69. In Article 72, the step of determining the second numerical value using the eighth setting mapping relationship according to the array index value and the setting offset amount is as follows: A step of determining an index indication value in an array mapping table according to the array index value; A step of determining the second numerical value using the eighth setting mapping relationship according to the index indication value and the set offset amount; Including The method according to clause 69. In clause 73, when determining whether the array index value is equal to zero, the step of determining a third numerical value according to the first numerical value is When the array index value is equal to zero, setting the third numerical value equal to the first numerical value; When the array index value is not equal to zero, setting the third numerical value equal to the sum of the first numerical value and 1; Including The method according to clause 69. In clause 74, the method is Further including a step of performing a correction operation on the predicted value of the second color component of the pixel to be predicted, and setting the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block; The method according to clause 63. In clause 75, when determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block, the step is Performing a filtering process on the predicted value of the second color component of the pixel to be predicted, and including a step of determining the predicted value of the second color component sampling point in the current block; The method according to clause 63. In clause 76, when determining the predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block, the step is A step of obtaining the original value of the second color component sampling point in the current block; A step of determining the predicted difference value of the second color component sampling point in the current block according to the original value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block; Including The method according to any one of clauses 39 to 75. In clause 77, the method is Further including a step of encoding the predicted difference value of the second color component sampling point in the current block and writing the obtained encoded bits into the code stream; The method according to clause 76. In clause 78, the present application provides an encoding device, and the device includes A first determination unit, a first calculation unit, and a first prediction unit; The first determination unit is configured to determine a reference value of a first color component of the current block and a reference value of a second color component of the current block, and determine a weighting coefficient according to the reference value of the first color component of the current block. The first calculation unit is configured to determine a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block. The first prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient. The first determination unit is further configured to determine a predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block. In Article 79, the present application is a decoding device, and the device comprises a second determination unit, a second calculation unit, and a second prediction unit. The second determination unit is configured to determine a reference value of a first color component of the current block and a reference value of a second color component of the current block, and determine a weighting coefficient according to the reference value of the first color component of the current block. The second calculation unit is configured to determine a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block. The second prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient. The second determination unit is further configured to determine a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block. In Article 80, the present application is a decoding device, and the device The decoding device comprises a second memory and a second processor. The second memory is used to store a computer program executable on the second processor, and the second processor is used to execute the method described in any one of Articles 1 to 38 when executing the computer program. In Article 81, the present application provides an encoding device, and the device comprises a first memory and a first processor, wherein the first memory is used to store a computer program executable on the first processor, and the first processor is used to execute the method described in any one of Claims 39 to 77 when executing the computer program. In Article 82, the present application provides a computer-readable storage medium, wherein a code stream generated by the encoding method described in any one of Articles 39 to 77 is stored in the computer-readable storage medium. In one embodiment of the present application, referring to FIG. 5, FIG. 5 is a diagram showing a flowchart of a decoding method according to an embodiment of the present application. As shown in FIG. 5, the method may include the following steps.
[0075] S501. Determine a reference value of a first color component of the current block and a reference value of a second color component of the current block.
[0076] Note that the decoding method of the embodiment of the present application is applicable to a decoding device or a decoding device integrated with the decoding device (which can also be abbreviated as a "decoder"). Further, the decoding method of the embodiment of the present application may specifically refer to an intra prediction method, and more specifically, an integer operation method of weight-based chroma prediction (WCP).
[0077] In the embodiments of the present application, the video image may be divided into a plurality of decoded blocks, each decoded block may include a first color component, a second color component, and a third color component, and the current block here refers to the decoded block that is the object of performing the current intra prediction in the video image. Also, assuming that the current block performs prediction on the first color component and the first color component is a luminance component, that is, the component to be predicted is a luminance component, the current block may also be referred to as a luminance prediction block. Or, assuming that the current block performs prediction on the second color component and the second color component is a chrominance component, that is, the component to be predicted is a chrominance component, the current block may also be referred to as a chrominance prediction block.
[0078] Note that in the embodiments of the present application, the reference information of the current block may include the values of the first color component sampling points in the adjacent region of the current block and the values of the second color component sampling points in the adjacent region of the current block, and these sampling points (Samples) may be determined according to the 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 the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0079] Here, the entire upper adjacent region and the upper right adjacent region may be regarded as the upper region, and the entire left adjacent region and the lower left adjacent region may be regarded as the left region. In addition, as shown in FIG. 6, the adjacent region may further include the upper left region. Here, when performing prediction on the second color component for the current block, the upper region, the left region, and the upper left region of the current block may all be referred to as the reference region of the current block as the adjacent region, and the pixels in the reference region are all reconstructed reference pixels.
[0080] In some embodiments, the step of determining the reference value of the first color component of the current block and the reference value of the second color component of the current block may include the following steps.
[0081] Determine the reference value of the first color component of the current block according to the value of the first color component sampling points in the adjacent area of the current block.
[0082] Determine the reference value of the second color component of the current block according to the value of the second color component sampling points in the adjacent area of the current block.
[0083] Note that in the embodiments of the present application, the reference pixel of the current block may refer to the reference pixel points adjacent to the current block, and may also be called the first color component sampling point and the second color component sampling point in the adjacent area of the current block, and is represented by Neighboring Sample or Reference Sample. The adjacent here may be spatial adjacency, but is not limited thereto. For example, the adjacency may be temporal domain adjacency, spatial and temporal domain adjacency. Furthermore, the reference pixel of the current block may be a reference pixel obtained after performing some processing on the reference pixel points of spatial adjacency, temporal domain adjacency, and spatial and temporal domain adjacency, etc., and the embodiments of the present application are not limited in any way.
[0084] Note that in the embodiments of the present application, assuming that the first color component is the luminance component and the second color component is the chrominance component, the value of the first color component sampling points in the adjacent area of the current block is represented as the reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sampling points in the adjacent area of the current block is represented as the reference chrominance information corresponding to the reference pixel of the current block.
[0085] In the embodiments of the present application, the value of the first color component sampling point or the value of the second color component sampling point is determined from the adjacent region of the current block. Here, the adjacent region may include only the upper adjacent region, or may include only the left adjacent region, or may include the upper adjacent region and the upper right adjacent region, or may include the left adjacent region and the lower left adjacent region, or may include the upper adjacent region and the left adjacent region, or may further include the upper adjacent region, the upper right adjacent region, and the left adjacent region, etc., but the embodiments of the present application are not limited to anything.
[0086] In the embodiments of the present application, the adjacent region may be determined according to the prediction mode of the current block. In a specific embodiment, when the prediction mode of the current block is the upper adjacent mode, it may be determined that the adjacent region of the current block includes the upper adjacent region and / or the upper right adjacent region, and when the prediction mode of the current block is the left adjacent mode, it may be determined that the adjacent region of the current block includes the left adjacent region and / or the lower left adjacent region. Here, the upper adjacent mode includes a prediction mode using an upper adjacent reference sampling point, and the left adjacent mode includes a prediction mode using a left adjacent reference sampling point.
[0087] Exemplarily, when the prediction mode of the current block is the vertical mode among the upper adjacent modes, only the upper adjacent region and / or the upper right adjacent region may be selected as the adjacent region in the chrominance component prediction based on weights. When the prediction mode of the current block is the horizontal mode among the left adjacent modes, only the left adjacent region and / or the lower left adjacent region may be selected as the adjacent region in the chrominance component prediction based on weights.
[0088] Furthermore, in some embodiments, the step of determining the reference pixel of the current block may include performing a selection process on the pixels in the adjacent region of the current block to determine the reference pixel.
[0089] Specifically, in the embodiments of the present application, when constructing the first reference pixel set according to the pixels in the adjacent region of the current block, a screening process may be performed on the first reference pixel set to determine the reference pixels. Here, the number of reference pixels may be M, and M is a positive integer. That is, M reference pixels may be selected from the pixels in the adjacent region. Here, the value of M may usually be 4, but it is not specifically limited.
[0090] Note that among the pixels in the adjacent region of the current block, there may be some pixels that are not important (for example, the correlation of these pixels is low) or some abnormal pixels. In order to ensure the prediction accuracy and obtain effective reference pixels, it is necessary to remove these pixels. Therefore, in a specific embodiment, the step of performing a screening process on the pixels in the adjacent region to determine the reference pixels may include the following steps.
[0091] Determine the position of the pixel to be selected based on the position and / or color component intensity of the pixels in the adjacent region.
[0092] Determine the reference pixels from the pixels in the adjacent region according to the position of the pixel to be selected.
[0093] In the embodiments of the present application, the color component intensity may be represented by color component information such as reference luminance information and reference chrominance information. Here, the larger the value of the color component information, the higher the color component intensity. In this way, screening the pixels in the adjacent region may be performed according to the position of the pixels or according to the color component intensity, so that the reference pixels of the current block are determined according to the screened pixels, and further, the value of the first color component sampling point in the adjacent region of the current block and the value of the second color component sampling point in the adjacent region of the current block may be determined. Then, according to the value of the first color component sampling point in the adjacent region of the current block, the reference value of the first color component of the current block is determined, and according to the value of the second color component sampling point in the adjacent region of the current block, the reference value of the second color component of the current block is determined.
[0094] In some embodiments, the step of determining the reference value of the first color component of the current block according to the values of the first color component sampling points in the adjacent region of the current block may include performing a first filtering process on the values of the first color component sampling points in the adjacent region of the current block to determine the reference value of the first color component of the current block.
[0095] In the embodiments of the present application, the first filtering process is a downsampling filtering process. Here, the first color component is the luminance component. In this case, by performing a downsampling filtering process on the reference luminance information, the spatial resolution of the filtered reference luminance information and the reference chrominance information may be made the same. Exemplarily, when the size of the current block is 2M×2N and the number of reference luminance information is 2M + 2N, after performing the downsampling filtering process, it may be converted to M + N to obtain the reference value of the first color component of the current block.
[0096] In some embodiments, the step of determining the reference value of the second color component of the current block according to the values of the second color component sampling points in the adjacent region of the current block may include performing a second filtering process on the values of the second color component sampling points in the adjacent region of the current block to determine the reference value of the second color component of the current block.
[0097] In the embodiments of the present application, the second filtering process is an upsampling filtering process. Here, the upsampling rate is a positive integer multiple of 2.
[0098] That is, the first color component is a luminance component, and the second color component is a chrominance component. In the embodiments of the present application, the filtered reference chrominance information may be upsampled and filtered with respect to the reference chrominance information, so that the spatial resolution of the filtered reference chrominance information is the same as the spatial resolution of the reference luminance. Exemplarily, when the reference luminance information is 2M + 2N and the reference chrominance information is M + N, after performing upsampling filtering on the reference chrominance information, it may be converted to 2M + 2N to obtain the reference value of the second color component of the current block.
[0099] S502. Determine a weighting coefficient according to the reference value of the first color component of the current block.
[0100] In addition, in the embodiments of the present application, the reference information of the current block may further include the reconstructed value of the first color component sampling point in the current block. Assuming that the first color component is a luminance component, the reconstructed value of the first color component sampling point in the current block is the reconstructed luminance information of the current block.
[0101] In some embodiments, the step of determining the weighting coefficient according to the reference value of the first color component of the current block may further include the following steps.
[0102] Determine the reconstructed value of the first color component sampling point in the current block.
[0103] Determine the reference sample value of the first color component of the current block according to the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block.
[0104] Determine the weighting coefficient according to the reference sample value of the first color component of the current block.
[0105] In a possible embodiment, the step of determining the reference sample value of the first color component of the current block according to the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block may include the following steps.
[0106] Determine the difference value between the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block.
[0107] Determine the reference sample value of the first color component of the current block according to the difference value.
[0108] In the embodiment of the present application, the reference sample value of the first color component of the current block may be set equal to the absolute value of the difference value. Further, the step of determining the reference sample value of the first color component of the current block according to the difference value may further include squaring the difference value, or determining the reference sample value of the first color component of the current block by performing several related processes and mappings on the difference value, etc., but it is not limited here.
[0109] In another possible embodiment, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block may include the following steps.
[0110] Perform a third filtering process on the reconstruction value of the first color component sampling point in the current block to obtain the filtered sample value of the first color component sampling point in the current block.
[0111] Determine the reference sample value of the first color component of the current block according to the filtered sample value of the first color component sampling point in the current block and the reference value of the first color component.
[0112] In the embodiment of the present application, the third filtering process is a downsampling filtering process. Here, the first color component is a luminance component. In this case, a downsampling filtering process may also be performed on the reconstructed luminance information in the current block. Exemplarily, when the number of reconstructed luminance information in the current block is 2M×2N, it can be converted to M×N after performing the downsampling filtering process.
[0113] In the embodiment of the present application, the step of determining the reference sample value of the first color component of the current block according to the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block may be to determine the reference sample value of the first color component of the current block according to the difference between the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block. More specifically, it may be to determine the reference sample value of the first color component of the current block according to the absolute value of the difference between the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block. However, nothing is limited here either.
[0114] After determining the reference sample value of the first color component of the current block, it is understood that the embodiment of the present application can further determine the weighting coefficient. Here, the reference sample value of the first color component of the current block may be the absolute value of the difference between the reconstruction value of the first color component sampling point in the current block and the reference value of the first color component of the current block.
[0115] In a possible implementation manner, 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 predicts 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 chrominance difference (represented by |ΔC k |) between its reconstructed chrominance and the reference chrominance in the adjacent region is calculated. There are differences in the chrominance differences in the adjacent regions of the pixels to be predicted at different positions. The reference pixel position with the smallest chrominance difference follows the change of the pixel to be predicted in the current block. Usually, the magnitude of the chrominance difference represents the degree of similarity between chrominances. When |ΔC k | is small, it indicates a strong similarity in chrominance values, and the corresponding weighting coefficient (represented by w k ) may be given a large weight. Conversely, when |ΔC k | is large, it indicates a weak similarity in chrominance values, and w k may be given a small weight. That is, wk and |△C k The relationship between them approximately exhibits inverse proportionality. Thus, for |△C k a mapping relationship w k = f(|△C k |) may be established. However, |△C k represents the reference sample value of the first color component, f(|△C k |) represents the value corresponding to the reference sample value of the first color component under the preset mapping relationship, and w k represents the weighting coefficient, that is, w k is set equal to f(|△C k |).
[0116] In another possible implementation manner, assuming that the first color component is the luminance component and the second color component is the chrominance component, in this case, at least one predicted pixel in the current block may be selected, and the chrominance difference (represented by |△Y k |) between its reconstructed chrominance and the reference chrominance in the adjacent region may be calculated respectively. Here, when |△Y k | is small, it indicates that the similarity of the luminance values is strong, and the corresponding weighting coefficient (represented by w k |) may be given a large weight. Conversely, when |△Y k | is large, it indicates that the similarity of the luminance values is weak, and w k may be given a small weight. Thus, when calculating the weighting coefficient, the reference sample value of the first color component may also be |△Y k |, and the weighting coefficient may be calculated according to w k = f(|△Y k |).
[0117] In addition, when predicting the chrominance component of the predicted pixel in the current block, since the chrominance component value of the predicted pixel cannot be directly determined, the chrominance difference |△C k | between the reference pixel and the predicted pixel cannot be directly obtained either. However, in the local region of the current block, there is a strong correlation between the components. In this case, according to the luminance difference |△Y k | between the reference pixel and the predicted pixel, |△C kIt may be derived. That is, |△Y k |△C may be obtained according to the product of | and the model factor. k |△Y may be obtained in this way. Thus, the product is equal to the product of the model factor and |△Y k |△C may be, that is, the absolute value of the chromaticity difference, or |△Y k | may be, that is, the absolute value of the luminance difference, or |α△Y k | may be, that is, the product of the absolute value of the luminance difference and a preset multiplier, etc. The preset multiplier here is the model factor described in the embodiments of the present application. k
[0118] Furthermore, for the model factor, in a specific embodiment, the method may further include the step of performing a least-squares calculation according to the first color component value and the second color component value of the reference pixel to determine the model factor.
[0119] 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 chromaticity information of the current block. Then, a least-squares calculation can be performed on the chromaticity component values and luminance component values of the N reference pixels to obtain the model factor. Exemplarily, the calculation of the least-squares regression is as shown in the following formula (1).
[0120] JPEG2025520848000134.jpg2856
[0121] However, L k represents the luminance component value of the k-th reference pixel, C k represents the chromaticity component value of the k-th reference pixel, N represents the number of reference pixels. α represents the model factor, which is obtained using the calculation of the least-squares regression. Note that the model factor may be a fixed value, or may be finely adjusted based on a fixed value, etc., but the embodiments of the present application are not particularly limited.
[0122] In another possible embodiment, the reference sample value of the first color component of the current block may be the absolute difference between the luminance reconstruction information (represented by recY) in the current block and the reference luminance information (represented by refY) of the inSize number. Here, for the pixel C pred [i][j] to be predicted in the current block, the corresponding luminance difference vector diffY[i][j][k] may be obtained by subtracting the corresponding luminance reconstruction information recY[i][j] from the reference luminance information refY[k] of the inSize number and taking the absolute value. That is, in the embodiment of the present application, the reference sample value of the first color component of the current block may be represented by diffY[i][j][k].
[0123] Furthermore, in some embodiments, the step of determining the weighting coefficient according to the reference sample value of the first color component of the current block may include the step of determining a weight index value according to the reference sample value of the first color component of the current block and determining the weighting coefficient using the first setting mapping relationship according to the weight index value.
[0124] In a specific embodiment, the step of determining the weight index value according to the reference sample value of the first color component of the current block may include the following steps.
[0125] Determine the maximum weight index value and the minimum weight index value of the current block.
[0126] According to the maximum weight index value and the minimum weight index value, perform correction processing on the reference sample value of the first color component to determine the weight index value.
[0127] Note that in the embodiment of the present application, the maximum weight index value may be represented by theMaxPos, the minimum weight index value may be represented by zero, and the weight index value may be represented by index. Here, the weight index value is limited between theMaxPos and zero. Exemplarily, the weight index value may be calculated according to the following formula (2).
[0128] JPEG2025520848000135.jpg27169
[0129] JPEG2025520848000136.jpg77169
[0130] In a specific embodiment, the maximum weight index value may be related to the bit depth of the color component (represented by BitDepth). Exemplarily, the maximum weight index value may be calculated according to the following formula (3).
[0131] JPEG2025520848000137.jpg30168
[0132] Note that in the embodiments of the present application, the value of theMaxPos includes but is not limited to those calculated according to formula (3), and may also be determined from the core parameters of the WCP.
[0133] Furthermore, regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship is a numerical mapping look-up table of the weight index value and the weighting coefficient. That is, in the embodiments of the present application, the decoding side may preset the corresponding look-up table (Look Up Table, LUT). To determine the corresponding weighting coefficient by the look-up table, it may be combined with the index. Exemplarily, the weighting coefficient cWeightInt[i][j][k] may be represented by the mapping relationship shown in the following formula (4).
[0134] JPEG2025520848000138.jpg28169
[0135] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship may be a setting function relationship. In some embodiments, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value may include determining a first value corresponding to the weight index value under the first setting mapping relationship, and setting the weighting coefficient equal to the first value.
[0136] In a specific embodiment, the step of determining the first value corresponding to the weight index value under the first setting mapping relationship may include the following steps.
[0137] Determine the first factor.
[0138] Determine a second value using a second setting mapping relationship according to the weight index value.
[0139] Calculate a first product value of the first factor and the second value.
[0140] Set the first value equal to the corresponding value under the first setting mapping relationship of the first product value.
[0141] In the embodiments of the present application, the first factor may be represented by ModelScale, and the weight index value may be represented by index. Exemplarily, the weighting coefficient cWeightInt[i][j][k] may also be represented by a functional relationship shown in the following formula (5).
[0142] JPEG2025520848000139.jpg27169
[0143] Here, the second setting mapping relationship may be an exponential function relationship based on n, for example, e -n It may be. However, the value of n is equal to the weight index value, that is, n = 0, 1,..., theMaxPos. In this way, when the value of n is equal to index, the second value is equal to e -index And the first product value is e -indexIt is equal to ×ModelScale. Also, the first setting mapping relationship may be set in Round(x). Then, when x is equal to the first product value, the value of Round(x) is the first value, that is, the weighting coefficient cWeightInt[i][j][k].
[0144] In addition, in the embodiments of the present application, the first setting mapping relationship may be represented by the following formula (6).
[0145] JPEG2025520848000140.jpg29169
[0146] JPEG2025520848000141.jpg32169
[0147] Furthermore, for the first factor, in some embodiments, the value of the first factor may be a preset constant value. That is, the first factor may be a preset constant and has no relation with the block size parameter.
[0148] For the first factor, in some embodiments, the value of the first factor may further be related to the block size parameter. In a specific embodiment, the step of determining the first factor may include the step of determining the value of the first factor according to the size parameter of the current block. Here, the size parameter of the current block includes at least one parameter of the width of the current block and the height of the current block. That is, the embodiments of the present application may fix the value of the first factor using a classification method. For example, the size parameters corresponding to the current block are classified into three categories, and the value of the first factor corresponding to each category is determined. In this case, the embodiments of the present application may store in advance a mapping lookup table between the size parameter of the current block and the value of the first factor, and determine the value of the first factor according to the lookup table.
[0149] Exemplarily, W represents the width of the current block, and H represents the height of the current block. When the dimension parameter of the current block satisfies the first setting condition, i.e., Min(W, H) <= 4, the value of the first factor is set to the first value. When the dimension parameter of the current block satisfies the second setting condition, i.e., 4 < Min(W, H) <= 16, the value of the first factor is set to the second value. When the dimension parameter of the current block satisfies the third setting condition, i.e., Min(W, H) > 16, the value of the first factor is set to the third value. Briefly speaking, in the embodiments of the present application, the first factor may be a preset constant, may be determined according to the dimension parameter of the current block, or may be determined by other methods (e.g., according to the BitDepth of the color component, etc.), but is not limited here.
[0150] Furthermore, in some embodiments, the step of determining the weight index value according to the reference sample value of the first color component of the current block may include the step of determining a second factor and determining the weight index value according to the reference sample value of the first color component of the current block and the second factor.
[0151] In addition, in the embodiments of the present application, the weighting coefficient may be adjusted according to the control parameter among the core parameters of WCP under specific conditions. Here, the second factor is the control parameter described in this embodiment (also called "scale parameter", "scale factor", etc.) and is represented by S. Exemplarily, when the flexibility of the dimension of the current block is good, the weighting coefficient may be adjusted according to the second factor. Taking a non-linear function (e.g., Softmax function) as an example, different second factors may be selected according to the difference in the category of the block classification to which the current block belongs to adjust the function, and the weighting coefficient may be determined according to the adjusted function.
[0152] Regarding the second factor, in some embodiments, the second factor may be a preset constant value. That is, in this case, for S, according to the characteristic that the chromaticity is relatively flat, by adjusting the weighting coefficient distribution of adjacent chromaticities, a weighting coefficient distribution suitable for natural image chromaticity prediction may be captured. To determine the parameter S suitable for natural image chromaticity prediction, traverse the given set of S, and determine the suitability of S based on the difference between the predicted chromaticity and the original chromaticity under different S. Exemplarily, S may take 2 -ε where ε ∈ {1, 0, -1, -2, -3}. Through experiments, it can be found that the optimal value of S in this set of S is 4. Therefore, in a specific embodiment, S may be set to 4, but the embodiments of the present application are not particularly limited.
[0153] Regarding the second factor, in some embodiments, the value of the second factor may be further related to the block size parameter. In a specific embodiment, the step of determining the second factor may include the step of determining the value of the second factor according to the size parameter of the current block. Here, the size parameter of the current block includes at least one parameter of the width of the current block and the height of the current block.
[0154] In one possible implementation, the step of determining the value of the second factor according to the size parameter of the current block may include the following steps.
[0155] When the minimum value of the height and width of the current block is 4 or less, it is determined that the second factor is 8.
[0156] When the minimum value of the height and width of the current block is greater than 4 and less than or equal to 16, it is determined that the second factor is 12.
[0157] When the minimum value of the height and width of the current block is greater than 16, it is determined that the second factor is 16.
[0158] Note that in the embodiments of the present application, the value of the second factor may be fixed using a classification method. For example, the dimensional parameters corresponding to the current block are classified into three categories, and the value of the second factor corresponding to each category is determined. In this case, the embodiments of the present application may pre-store a mapping lookup table between the dimensional parameters of the current block and the value of the second factor, and the value of the second factor may be determined according to the lookup table. Exemplarily, Table 1 shows the correspondence between the second factor according to the embodiments of the present application and the dimensional parameters of the current block.
[0159]
Table 1
[0160] In another possible implementation manner, in the adjustment of the weighting coefficient, the correspondence between the above-mentioned second factor and the dimensional parameters of the current block may be finely adjusted. Table 2 shows the correspondence between another second factor according to the embodiments of the present application and the dimensional parameters of the current block.
[0161]
Table 2
[0162] In yet another possible implementation manner, in the adjustment of the weighting coefficient, the value of the above-mentioned second factor may be finely adjusted. In some embodiments, the step of determining the value of the second factor according to the dimensional parameters of the current block may include the following steps.
[0163] When the minimum value of the height and width of the current block is 4 or less, it is determined that the second factor is 7.
[0164] When the minimum value of the height and width of the current block is greater than 4 and less than or equal to 16, it is determined that the second factor is 11.
[0165] When the minimum value of the height and width of the current block is greater than 16, it is determined that the second factor is 15.
[0166] That is, by finely adjusting the value of the second factor described above, Table 3 shows the correspondence between another second factor according to the embodiment of the present application and the dimension parameters of the current block.
[0167] [Table 3]
[0168] In the embodiment of the present application, in the step of classifying the dimension parameters corresponding to the current block into three categories, different dimension parameters may be indicated by the block type index value (represented by wcpSizeId). In another possible implementation manner, in the step of determining the value of the second factor according to the dimension parameters of the current block, the step of determining the value of the second factor according to the block type index value may be included.
[0169] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W, H) <= 4. When the block type index value is equal to 1, it indicates the current block where Min(W, H) > 4 && Min(W, H) <= 16. When the block type index value is equal to 2, it indicates the current block where Min(W, H) > 16. In this case, Table 4 above shows the correspondence between the second factor according to the embodiment of the present application and the block type index value.
[0170] [Table 4]
[0171] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W,H) < 128. When the block type index value is equal to 1, it indicates the current block where Min(W,H) >= 128 && Min(W,H) <= 256. When the block type index value is equal to 2, it indicates the current block where Min(W,H) > 256. In this case, Table 5 shows the correspondence between another second factor according to the embodiment of the present application and the block type index value.
[0172]
Table 5
[0173] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W,H) < 64. When the block type index value is equal to 1, it indicates the current block where Min(W,H) >= 64 && Min(W,H) <= 512. When the block type index value is equal to 2, it indicates the current block where Min(W,H) > 512. In this case, Table 6 shows the correspondence between yet another second factor according to the embodiment of the present application and the block type index value.
[0174]
Table 6
[0175] Note that for the second factor, in some embodiments, the second factor may be classified according to the number of reference pixels of the current block. In a specific another embodiment, the step of determining the second factor may include the step of determining the value of the second factor according to the number of reference pixels of the current block. Here, N represents the number of reference pixels.
[0176] In a possible implementation manner, the step of determining the value of the second factor according to the number of reference pixels of the current block may include the following steps.
[0177] When the value of N is less than 16, it is determined that the second factor is 8.
[0178] When the value of N is 16 or more and less than 32, it is determined that the second factor is 12.
[0179] When the value of N is 32 or more, it is determined that the second factor is 16.
[0180] That is, classification is performed according to the number of reference pixels of the current block, and Table 7 shows the correspondence between the second factor according to the embodiment of the present application and the number of reference pixels.
[0181]
Table 7
[0182] Note that whether it is Table 1, Table 2, Table 3, or Table 4, Table 5, Table 6, Table 7, etc., these are merely exemplary lookup tables here, but the embodiments of the present application are not particularly limited.
[0183] Furthermore, in some embodiments, the step of determining the weight index value according to the reference sample value of the first color component and the second factor of the current block may include the following steps.
[0184] Determine a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor.
[0185] Determine the maximum weight index value and the minimum weight index value of the current block.
[0186] Perform correction processing on the third value according to the maximum weight index value and the minimum weight index value to determine the weight index value.
[0187] In the embodiments of the present application, the maximum weight index value may be represented by theMaxPos, the minimum weight index value may be represented by zero, and the weight index value may be represented by index. Here, the weight index value is limited between theMaxPos and zero, and the third value is f(S, diffY[i][j][k]). Exemplarily, the weight index value may be calculated according to the following formula (7).
[0188] JPEG2025520848000149.jpg28168
[0189] JPEG2025520848000150.jpg108169
[0190] Regarding the third setting mapping relationship, f() refers to a function of the second factor S and the luminance difference vector diffY[i][j][k]. In a possible implementation manner, f(S, diffY[i][j][k]) may be implemented according to the following formula (8).
[0191] JPEG2025520848000151.jpg29147
[0192] In another possible implementation manner, f(S, diffY[i][j][k]) may be implemented by the following operations. In some embodiments, according to the reference sample value of the first color component and the second factor, the step of determining the third value using the third setting mapping relationship may include the following steps.
[0193] Determine at least one shift array.
[0194] Determine a target offset amount from at least one shift array according to the second factor.
[0195] Perform a right shift operation on the reference sample value of the first color component by the target offset amount to determine the third value.
[0196] Here, since different second factors S can each use their own LUT[S], the embodiments of the present application only store several basic LUTs. For example, when S = {2, 4, 8}, only the LUT for the case where S = 2 is stored. For other second factors S, they may be obtained by shift operations. In this case, f(S, diffY[i][j][k]) may be realized by the following formula (9).
[0197] JPEG2025520848000152.jpg28168
[0198] However, the definition of the shift array LUTshift[S] is as shown in the following formula (10).
[0199] JPEG2025520848000153.jpg3353
[0200] In the embodiments of the present application, when the second factor is equal to 2, the target offset amount is equal to 0; when the second factor is equal to 4, the target offset amount is equal to 1; when the second factor is equal to 8, the target offset amount is equal to 2. And to determine the third value, a right shift operation of the target offset amount may be performed on the reference sample value of the first color component.
[0201] Note that for f(S, diffY[i][j][k]), its implementation method is not limited to formula (8) or formula (9), and other implementation methods may also be used, and the embodiments of the present application are not limited either.
[0202] Furthermore, in some embodiments, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value may include the following steps.
[0203] Determine a second product value according to the second factor and the weight index value.
[0204] Determine the corresponding fourth value under the first setting mapping relationship of the second product value, and set the weighting coefficient equal to the fourth value.
[0205] In a specific embodiment, the step of determining the corresponding fourth value under the first setting mapping relationship of the second product value may include the following steps.
[0206] Determine the first factor.
[0207] According to the second product value, use the second setting mapping relationship to determine the fifth value.
[0208] Calculate the third product value of the first factor and the fifth value.
[0209] Set the fourth value equal to the corresponding value under the preset mapping relationship of the third product value.
[0210] In addition, in the embodiments of the present application, the first factor may be represented by ModelScale, the second factor may be represented by S, and the weight index value may be represented by index.
[0211] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship is a numerical mapping lookup table of the second factor, the weight index value, and the weighting coefficient. That is, in the embodiments of the present application, the decoding side may preset the corresponding lookup table (Look Up Table, LUT). By this lookup table, it may be combined with index to determine the corresponding weighting coefficient. Exemplarily, the weighting coefficient cWeightInt[i][j][k] may be represented by the mapping relationship shown in the following formula (11).
[0212] JPEG2025520848000154.jpg30160
[0213] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship may be a setting function relationship. The inputs of the function are index and S, and the output is the weighting coefficient. Exemplarily, the weighting coefficient cWeightInt[i][j][k] may be represented by the function relationship shown in the following formula (12).
[0214] JPEG2025520848000155.jpg28128
[0215] JPEG2025520848000156.jpg111170
[0216] Briefly speaking, in the embodiment of the present application, the weighting coefficient cWeightInt[i][j][k] is determined using a LUT. Here, the number of elements included in the LUT is theMaxPos, and as shown in Equation (3), theMaxPos is related to the bit depth of luminance or chrominance. As shown in Equations (4) and (11), all elements in the LUT are constant values. It may be stored and realized in the decoder, or may be calculated before encoding or decoding. It can be said that it is determined according to the exponential function relationship with an exponent of n as shown in Equation (5) or Equation (12). As shown in Equations (4) and (11), the index parameter of the LUT is determined according to diffY[i][j][k], and what the LUT stores is cWeightInt[i][j][k] corresponding to different index parameters.
[0217] S503. According to the reference value of the second color component of the current block, determine the reference average value of the second color component of the current block, and according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, determine the reference sample value of the second color component of the current block.
[0218] Note that in the embodiment of the present application, the number of input reference pixels predicted based on the weight may be represented by N or may be represented by inSize. Here, the number of input reference pixels predicted based on the weight is the same as the number of reference sample values of the second color component. It can also be said that N represents the number of reference sample values of the second color component, and N is a positive integer.
[0219] In some embodiments, the step of determining the reference average value of the second color component of the current block according to the reference value of the second color component of the current block may include calculating the average value for the reference values of the second color components of N current blocks to obtain the reference average value of the second color component of the current block.
[0220] In the embodiments of the present application, the reference value of the second color component of the current block is represented by refC[k], and the reference average value of the second color component of the current block is represented by avgC, where k = 0, 1, …, N−1 may be used. The calculation of avgC is as shown in the following formula (13).
[0221] JPEG2025520848000157.jpg2856
[0222] Regarding the value of N, in some embodiments, the method may further include determining a block type index value according to the dimension parameter of the current block, and determining the value of N using a fifth setting mapping relationship according to the block type index value.
[0223] In a specific embodiment, the fifth setting mapping relationship represents a numerical mapping lookup table between the block type index value and N.
[0224] In the embodiments of the present application, the block type index value may be represented by wcpSizeId. For different block type index values, the number of input reference pixels predicted based on the weight also differs, that is, the value of N or (inSize) is different.
[0225] Exemplarily, for the current block where Min(W,H) <= 4, it is determined that the block type index value is equal to 0. For the current block where Min(W,H) > 4 && Min(W,H) <= 16, it is determined that the block type index value is equal to 1. For the current block where Min(W,H) > 16, it is determined that the block type index value is equal to 2. Or, for the current block where Min(W,H) < 128, it is determined that the block type index value is equal to 0. For the current block where Min(W,H) >= 128 && Min(W,H) <= 256, it is determined that the block type index value is equal to 1. For the current block where Min(W,H) > 256, it is determined that the block type index value is equal to 2. It is not limited to this.
[0226] In one possible implementation, Table 8 shows the correspondence between the block type index value according to the embodiments of the present application and the value of N(inSize).
[0227]
Table 8
[0228] In another possible implementation, Table 9 shows the correspondence between another block type index value according to the embodiments of the present application and the value of N(inSize).
[0229]
Table 9
[0230] Furthermore, for the reference sample value of the second color component of the current block, in some embodiments, the step of determining the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block may include the following steps.
[0231] Subtract the reference value of the second color component of the current block from the reference average value of the second color component of the current block to obtain the reference sample value of the second color component of the current block.
[0232] In the embodiment of the present application, for N pieces of reference chromaticity information refC, its average value avgC is calculated, and by subtracting the N pieces of reference chromaticity information refC from the average value avgC, a reference chromaticity difference vector diffC is obtained. Specifically, the calculation of diffC is as shown in the following formula (14).
[0233] JPEG2025520848000160.jpg30121
[0234] However, k = 0, 1,..., N - 1.
[0235] S504. Determine the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient.
[0236] S505. Determine the reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0237] Note that after determining the reference average value avgC of the second color component of the current block, the reference sample value diffC[k] of the second color component of the current block, and the corresponding weighting coefficient cWeightInt[i][j][k], the predicted value of the second color component sampling point in the current block can be further determined.
[0238] In some embodiments, the step of determining the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient may include the following steps.
[0239] Determine the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient.
[0240] Set the weighted sum value of the pixel to be predicted in the current block equal to the sum of N weighting values, and set the coefficient sum value of the pixel to be predicted in the current block equal to the sum of N weighting coefficients. Here, N represents the number of reference sample values of the second color component, and N is a positive integer.
[0241] Determine the sixth value using the fourth setting mapping relationship according to the weighted sum value and the coefficient sum value.
[0242] Add the reference average value of the second color component and the sixth value to obtain the predicted value of the second color component of the pixel to be predicted in the current block.
[0243] Determine the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block.
[0244] In the embodiments of the present application, when the number of reference sample values of the second color component is N, first, determine the weighting value (i.e., subC[i][j][k]) of each reference sample value of the second color component and the corresponding weighting coefficient, and then perform an addition operation on these N weighting values to obtain the weighted sum value of the pixel to be predicted in the current block, which may be represented by calVal. Specifically, the calculation formula is as shown in the following formulas (15) and (16).
[0245] JPEG2025520848000161.jpg26167
[0246] JPEG2025520848000162.jpg2670
[0247] However, (i,j) represents the position information of the pixel to be predicted in the current block, k represents the k-th reference sample value of the second color component used in the WCP calculation process, and k = 0,..., N - 1.
[0248] In the embodiment of the present application, for the N weighted coefficients corresponding to the pixel to be predicted in the current block, an addition operation may be performed on these N weighted coefficients to obtain the total coefficient value of the pixel to be predicted in the current block, which may be represented by sum. Specifically, the calculation formula is as shown in the following formula (17).
[0249] JPEG2025520848000163.jpg2579
[0250] Furthermore, in some embodiments, the step of determining the sixth value using the fourth setting mapping relationship according to the weighted total value and the total coefficient value may include the following steps.
[0251] Determine the setting offset amount.
[0252] According to the total coefficient value, use the sixth setting mapping relationship to determine the first numerical value, according to the total coefficient value and the first numerical value, use the seventh setting mapping relationship to determine the array index value, and according to the array index value and the setting offset amount, use the eighth setting mapping relationship to determine the second numerical value.
[0253] If the array index value is equal to zero, determine the third numerical value according to the first numerical value, and determine the first offset amount according to the third numerical value and the setting offset amount.
[0254] Determine the fourth product value according to the second numerical value and the weighted total value, determine the setting addition value according to the third numerical value and the setting offset amount, perform an addition operation on the fourth product value and the setting addition value to obtain the target total value.
[0255] Perform a right shift operation of the first offset amount on the target total value to determine the sixth value.
[0256] In addition, in the embodiments of the present application, the set offset amount may be represented by Shift, the array index value may be represented by normDiff, the first numerical value may be represented by x, the second value may be represented by v, the third value may be represented by y, and the set addition value may be represented by add. In a specific embodiment, the value of Shift may be set to 5, but it is not particularly limited.
[0257] In addition, in the embodiments of the present application, for the calculation of the first numerical value, the sixth set mapping relationship may be represented by the following formula (18).
[0258] JPEG2025520848000164.jpg29105
[0259] In a possible implementation manner, for the calculation of the first numerical value, according to the mathematical direct description, it may include determining the logarithm value with base 2 of the coefficient total value and determining the largest integer value less than or equal to the logarithm value. Here, the determined largest integer value is the first numerical value.
[0260] In another possible implementation manner, for the calculation of the first numerical value, when described according to the calculation result, it may include setting the first numerical value to be equal to the number of bits of the binary symbol required for the binary representation of the coefficient total value minus 1.
[0261] In yet another possible implementation manner, for the calculation of the first numerical value, when described according to the possible integerization embodiment (text description), perform a binary right shift operation on the coefficient total value, determine the number of right shift bits when the numerical value after the right shift is equal to 0, and set the first numerical value to be equal to the number of right shift bits minus 1.
[0262] In yet another possible implementation manner, for the calculation of the first numerical value, when described according to the possible integerization embodiment (pseudo-code description), as shown in formula (18), it may include the following. x = 0 while (sum!= 0) { sum = sum >> 1; x++; } x = x - 1
[0263] Equivalently, the pseudo-code may also be described as follows. x = 0 while (sum > 1) { sum = sum >> 1; x++; }
[0264] Alternatively, the pseudo-code may be further described as follows. x = 0 while (sum != 1) { sum = sum >> 1; x++; }
[0265] Note that in the description of the pseudo-code, the symbols according to the embodiments of the present application are understood according to the C language.
[0266] In some embodiments, the step of determining the array index value using the seventh setting mapping relationship according to the coefficient total value and the first numerical value may include the step of using the coefficient total value and the first numerical value as inputs to a setting function relationship and outputting an array index value according to the setting function relationship.
[0267] In the embodiments of the present application, the calculation of the array index value may be represented by the following formula (19).
[0268] JPEG2025520848000165.jpg28114
[0269] However, sum represents the coefficient total value, x represents the first numerical value, and normDiff represents the index value of the array. Here, Func() is a function related to Shift. Exemplarily, one specific form of Func() is as shown in the following formula (20).
[0270] JPEG2025520848000166.jpg23167
[0271] Correspondingly, when Shift = 5, normDiff = ((sum << 5) >> x) & 31.
[0272] In some embodiments, the step of determining the second numerical value using the eighth setting mapping relationship according to the array index value and the set offset amount may include the following steps.
[0273] Determine an index indication value in the array mapping table according to the array index value.
[0274] Determine the second numerical value using the eighth setting mapping relationship according to the index indication value and the set offset amount.
[0275] In the embodiments of the present application, the array mapping table is represented by DivSigTable. In that case, the corresponding index indication value in DivSigTable for the array index value normDiff is DivSigTable[normDiff]. Exemplarily, according to DivSigTable[normDiff] and Shift, the eighth setting mapping relationship is as shown in the following formula (21).
[0276] JPEG2025520848000167.jpg30167
[0277] Correspondingly, when Shift = 5, v = DivSigTable[normDiff] | 32. Here, the operator "|" represents a bitwise OR operation, that is, v is obtained by performing a bitwise OR operation on DivSigTable[normDiff] and 32.
[0278] In some embodiments, the step of determining the third numerical value according to the first numerical value when the array index value is equal to zero may include the following steps.
[0279] When the array index value is equal to zero, set the third numerical value equal to the first numerical value.
[0280] If the array index value is not equal to zero, set the third numerical value to be equal to the sum value of the first numerical value and 1.
[0281] In the embodiment of the present application, the first numerical value is represented by x, and the third numerical value is represented by y. Exemplarily, it may be represented by the following formula (22).
[0282] JPEG2025520848000168.jpg2975
[0283] However, the operator "==" represents an equivalence operation, and the operator "!=" represents a non-equivalence operation.
[0284] In the embodiment of the present application, for the set addition value, the step of determining the set addition value according to the third numerical value and the set offset amount is such that its calculation formula is as shown in the following formula (23).
[0285] JPEG2025520848000169.jpg29122
[0286] In the embodiment of the present application, the first offset amount is determined by the third numerical value and the set offset amount. Exemplarily, by performing an addition operation on the third numerical value and the set offset amount, the first offset amount is obtained. That is, the first offset amount may be y + Shift.
[0287] Thus, assuming that the sixth value is represented by C, the sixth value may be represented by the following formula (24).
[0288] JPEG2025520848000170.jpg25122
[0289] However, the operator "<<" represents a left shift operation, and the operator ">>" represents a right shift operation.
[0290] Furthermore, regarding the determination of the predicted value of the second color component of the pixel to be predicted in the current block, assuming that the pixel to be predicted is (i, j), the predicted value of the second color component of the pixel to be predicted in the current block is C pred [i][j], and in this case, an addition operation may be performed according to the reference average value and the sixth value of the second color component to obtain the predicted value of the second color component of the pixel to be predicted in the current block. Its calculation formula is as shown in the following formula (25).
[0291] JPEG2025520848000171.jpg31149
[0292] Furthermore, in the embodiment of the present application, C pred [i][j] usually needs to be limited within a preset range. Therefore, in some embodiments, the method may further include a step of performing a correction operation on the predicted value of the second color component of the pixel to be predicted and using the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block.
[0293] Note that in the embodiment of the present application, the preset range may be between 0 and (1 << BitDepth)-1. However, 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, for C pred [i][j], a clamp operation may be performed, specifically as follows.
[0294] C pred If the value of [i][j] is less than 0, set it to 0.
[0295] C pred If the value of [i][j] is greater than or equal to 0 and less than or equal to (1 << BitDepth)-1, it is equal to C pred [i][j].
[0296] C predIf the value of [i][j] is greater than (1<<BitDepth)-1, set it to (1<<BitDepth)-1.
[0297] In this way, after performing the correction process on the predicted value, it can be guaranteed that the predicted values of the second color components of the pixels to be predicted in the current block are all between 0 and (1<<BitDepth)-1.
[0298] Furthermore, after determining the predicted value, under specific conditions, it is necessary to perform a post-processing operation and then use the final chrominance predicted value as the final chrominance predicted value. Therefore, in some embodiments, the step of determining the predicted value of the second color component sampling points in the current block according to the predicted value of the second color component of the pixel to be predicted may include the following steps.
[0299] Perform filtering processing on the predicted value of the second color component of the pixel to be predicted to determine the predicted value of the second color component sampling points in the current block.
[0300] In the embodiments of the present application, the predicted value of the second color component of the pixel to be predicted includes the predicted values of at least some of the second color component sampling points in the current block. In other words, according to the first prediction block composed of the predicted value of the second color component of the pixel to be predicted, the first prediction block includes the predicted values of at least some of the second color component sampling points in the current block.
[0301] Note that in the embodiments of the present application, when the first prediction block includes the predicted values of some of the second color component sampling points in the current block, it is necessary to perform upsampling filtering on the first prediction block to obtain the final second prediction block. Therefore, in some embodiments, the method may further include the step of performing upsampling filtering processing on the first prediction block to determine the second prediction block of the second color component of the current block.
[0302] In the embodiments of the present application, the number of predicted values of the second color component included in the first prediction block is the same as the number of second color component sampling points included in the current block. However, if the predicted values of the second color component sampling points of the current block are not included, it is necessary to enhance the predicted values using filtering in order to obtain the final second prediction block. Therefore, in some embodiments, the method may further include performing a filtering enhancement process on the first prediction block and determining a second prediction block of the second color component of the current block.
[0303] In the embodiments of the present application, when the first prediction block includes the predicted values of all the second color component sampling points in the current block, there is no need to perform any processing on the first prediction block, and the first prediction block may be directly used as the final second prediction block.
[0304] That is, the first prediction block may include the predicted values of at least some of the second color component sampling points in the current block. Here, when the first prediction block includes the predicted values of all the second color component sampling points in the current block, the predicted values of the second color component sampling points in the current block may be set equal to the values of the first prediction block. When the first prediction block includes the predicted values of some of the second color component sampling points in the current block, upsampling filtering may be performed on the values of the first prediction block, and the predicted values of the second color component sampling points in the current block may be set equal to the output values after the upsampling filtering.
[0305] Thus, after the above operations, the second prediction block includes the predicted values of all the second color component sampling points in the current block. Thus, for the weighted chrominance prediction output predWcp, under specific conditions, post-processing is required to obtain the final chrominance prediction value predSamples; otherwise, the final chrominance prediction value predSamples is predWcp.
[0306] In some embodiments, after determining the predicted value of the second color component sampling point in the current block, the step of determining the reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block may include the following steps.
[0307] Determine the predicted difference value of the second color component sampling point in the current block.
[0308] Determine the reconstructed value of the second color component sampling point in the current block according to the predicted difference value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block.
[0309] In a specific embodiment, the step of determining the reconstructed value of the second color component sampling point in the current block includes performing an addition operation on the predicted difference value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block, and determining the reconstructed value of the second color component sampling point in the current block.
[0310] Note that in the embodiments of the present application, the step of determining the predicted difference value (residual) of the second color component sampling point in the current block may be to analyze the code stream and determine the predicted difference value of the second color component sampling in the current block.
[0311] In this way, taking the chrominance component as an example, by analyzing the code stream, the chrominance predicted difference value of the current block is determined, and after determining the chrominance predicted value of the current block, the chrominance predicted value and the chrominance predicted difference value are added to obtain the chrominance reconstructed value of the current block.
[0312] It is understood that the embodiment of the present application is the optimization of floating-point operations in the WCP prediction technology process and is realized using integer operations. On the one hand, it fully utilizes the content characteristics of the current block to adaptively select the optimal integer operation displacement amount. On the other hand, it fully guarantees the accuracy of the WCP prediction technology. On the other hand, it fully considers the characteristics of the weight model and rationally designs the integer operation process. Thereby, on the premise of ensuring the accuracy of the WCP prediction technology to a certain extent, the calculation complexity of the WCP prediction technology can be reduced.
[0313] This embodiment provides a decoding method, which determines the reference value of the first color component of the current block and the reference value of the second color component of the current block, determines a weighting coefficient according to the reference value of the first color component of the current block, and determines the reference average value of the second color component of the current block according to the reference value of the second color component of the current block. According to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block is determined. According to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient, the predicted value of the second color component sampling point in the current block is determined. According to the predicted value of the second color component sampling point in the current block, the reconstructed value of the second color component sampling point in the current block is determined. Thus, to be based on the color component reference information in the adjacent area of the current block and the color component reconstruction information in the current block, it is necessary to construct a luminance difference vector. Thereby, not only the weighting coefficient is determined, but also it is necessary to determine the chrominance average value according to the chrominance reference information, and determine the chrominance difference vector according to the chrominance reference information and the chrominance average value. Furthermore, according to the chrominance difference vector and the corresponding weighting coefficient, the chrominance prediction value can be determined by adding the chrominance average value. In this way, by optimizing the calculation process of chrominance prediction based on weights, integer operations can be fully adopted, and moreover, the characteristics of the weight model can be fully considered, and the integer operation process can be rationally optimized, fully guaranteeing the accuracy of chrominance prediction, reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
[0314] In another embodiment of the present application, based on the decoding method described in the above embodiment, taking the current block performing chrominance prediction as an example, when performing chrominance prediction on the current block, the reconstructed luminance information of the current block, the reference luminance information of the adjacent region, and the reference chrominance information are all decoded reference information. Therefore, the embodiment of the present application provides a chrominance prediction technique based on weights using the above information, and all operations in the realization process of the technique use integer operations. The technical solution of the embodiment of the present application mainly provides using integer operations instead of floating-point operations. Here, the detailed steps of the chrominance prediction process of the WCP prediction technique are as follows.
[0315] Input of WCP mode: The position (xTbCmp, yTbCmp) of the current block, the width nTbW of the current block, and the height nTbH of the current block.
[0316] Output of WCP mode: The predicted value predSamples[x][y] of the current block, where the upper left corner position within the current block is used as the coordinate origin, and x = 0,..., nTbW - 1, y = 0,..., nTbH - 1.
[0317] Here, the prediction process of the WCP prediction technique may include steps such as determining WCP core parameters, obtaining input information, chrominance prediction based on weights, and a post-processing process. After these steps, the chrominance prediction value of the current block can be obtained.
[0318] In a specific embodiment, referring to FIG. 7, FIG. 7 is a diagram showing a flowchart of another decoding method according to an embodiment of the present application. As shown in FIG. 7, the method may include the following steps.
[0319] S701, Determine WCP core parameters.
[0320] Regarding S701, the step of determining the core parameters related to the WCP may be to obtain or infer the WCP core parameters by a certain configuration or method. For example, on the decoding side, the WCP core parameters are obtained from the code stream.
[0321] Here, the WCP core parameters include, but are not limited to, the control parameter (S), the number of weight-based chrominance prediction inputs (inSize), the number of weight-based chrominance prediction outputs (arranged in predSizeW×predSizeH), the weight model LUT, and the maximum weight index value theMaxPos of the weight model LUT. Here, the first prediction block of the weight-based chrominance prediction output may be represented by predWcp. Here, the number of weight-based chrominance prediction outputs may be set to the same value (for example, predSizeW = predSizeH = S / 4), or may be related to the dimension parameters of the current block (for example, predSizeW = nTbW, predSizeH = nTbH). Here, the control parameter (S) may be used to adjust the non-linear function in the subsequent stage, or may be used to adjust the data related to the subsequent stage. Here, the weight model LUT may be predefined or may be calculated in real time according to different WCP control parameters (S). The maximum weight index value theMaxPos of the weight model LUT may be adjusted according to different weight model LUTs or may be fixed.
[0322] The determination of the WCP core parameters is affected by the block size, or the block content, or the number of pixels in the block under specific conditions. For example,
[0323] For the current block, it may be classified according to its block size, or block content, or the number of pixels in the block, and the same or different core parameters may be determined according to different categories. That is, the control parameter(s) corresponding to different categories, or the number of chrominance prediction inputs inSize based on weights, or the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) may be the same or different. Note that predSizeW and predSizeH may also be the same or different.
[0324] If there are many types of block sizes to which the WCP is applied, or the differences between the block sizes to which the WCP is applied are large, or the differences in block content to which the WCP is applied are large, or the differences in the number of pixels in the block to which the WCP is applied are large, for the current block, it may be classified according to its block size, or block content, or the number of pixels in the block, and the same or different core parameters may be determined according to different categories. That is, the control parameter(s) corresponding to different categories, or the number of chrominance prediction inputs inSize based on weights, or the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) may be the same or different. Note that predSizeW and predSizeH may also be the same or different.
[0325] Hereinafter, in order to better explain the determination of core parameters, two simple classifications will be described as examples.
[0326] Classification Example 1: The WCP may classify the current block according to the width and height of the current block. The wcpSizeId is used to represent the type of block, and is also called the block type index value. 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) may be the same or different. Here, one example of classification into three categories will be described.
[0327] According to the current block's width and height, the current block is classified into three categories, and the control parameter(s) for different categories may be set differently, and the inSize and the number of chrominance prediction outputs based on weights (arranged in predSizeW×predSizeH) for different categories may be set the same. nTbW is the width of the current block, nTbH is the height of the current block, and the definition of the block type wcpSizeId is as follows.
[0328] wcpSizeId = 0 represents the current block where min(nTbW, nTbH) <= 4. Here, the control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the chrominance prediction value is the chrominance prediction output with nTbH×nTbW pieces based on weights.
[0329] wcpSizeId = 1 represents the current block where 4 < min(nTbW, nTbH) <= 16. Here, the control parameter(s) is 12, inSize is (2×nTbH + 2×nTbW), and the chrominance prediction value is the chrominance prediction output with nTbH×nTbW pieces based on weights.
[0330] wcpSizeId = 2 represents the current block where min(nTbW, nTbH) > 16. Here, the control parameter(s) is 16, inSize is (2×nTbH + 2×nTbW), and the chrominance prediction value is the chrominance prediction output with nTbH×nTbW pieces based on weights.
[0331] As shown in Table 10, the quantitative relationship of the above WCP core parameters is represented in tabular form.
[0332]
Table 10
[0333] The classification into three categories may be explained with another example.
[0334] According to the current block's width and height, the current block is classified into three categories, and the control parameter(s) for different categories may be set differently, and the number of chrominance prediction outputs based on inSize and weights (arranged in predSizeW×predSizeH) for different categories may be set the same. nTbW is the width of the current block, nTbH is the height of the current block, and the definition of the block type wcpSizeId is as follows.
[0335] wcpSizeId = 0: Represents the current block where min(nTbW, nTbH) <= 4. Here, the control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the chrominance prediction value with the number of chrominance prediction outputs based on weights being nTbH×nTbW.
[0336] wcpSizeId = 1: Represents the current block where 4 < min(nTbW, nTbH) <= 16. Here, the control parameter(s) is 12, inSize is (1.5×nTbH + 1.5×nTbW), and the chrominance prediction value with the number of chrominance prediction outputs based on weights being nTbH / 2×nTbW / 2.
[0337] wcpSizeId = 2: Represents the current block where min(nTbW, nTbH) > 16. Here, the WCP control parameter(s) is 16, inSize is (nTbH + nTbW), and the chrominance prediction value with the number of chrominance prediction outputs based on weights being nTbH / 4×nTbW / 4.
[0338] As shown in Table 11, the quantitative relationship of the above core parameters is represented in tabular form.
[0339]
Table 11
[0340] Classification Example 2: The WCP mode may classify the current block according to the number of pixels in the current block. The block type is represented by wcpSizeId. For blocks of different block types, the control parameter(s), the number of weight-based chrominance prediction inputs inSize, and the number of weight-based chrominance prediction outputs (arranged in predSizeW × predSizeH) may be the same or different. Here, an example of classification into three categories will be described.
[0341] The current block is classified into three categories according to the number of pixels in the current block. The control parameter(s) for different categories may be set to different values, and the inSize and the number of weight-based chrominance prediction outputs (arranged in predSizeW × predSizeH) for different categories may be set to the same values. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW × nTbH represents the number of pixels in the current block. The definition of the block type wcpSizeId is as follows.
[0342] wcpSizeId = 0: Represents the current block where (nTbW × nTbH) < 128. Here, the control parameter(s) is 10, inSize is (2 × nTbH + 2 × nTbW), and the chrominance prediction output based on weights is the chrominance prediction value with nTbH × nTbW.
[0343] wcpSizeId = 1: Represents the current block where 128 <= (nTbW × nTbH) <= 256. Here, the control parameter(s) is 8, inSize is (2 × nTbH + 2 × nTbW), and the chrominance prediction output based on weights is the chrominance prediction value with nTbH × nTbW.
[0344] wcpSizeId = 2: Represents the current block where (nTbW × nTbH) > 256. Here, the control parameter(s) is 1, inSize is (2 × nTbH + 2 × nTbW), and the chrominance prediction output based on weights is the chrominance prediction value with nTbH × nTbW.
[0345] As shown in Table 12, the quantitative relationship of the above core parameters is represented in tabular form.
[0346]
Table 12
[0347] The classification into three categories may be described with another example.
[0348] According to the number of pixels of the current block, the current block is classified into three categories, and the control parameter(s) for different categories may be set differently, and the number of chrominance prediction outputs based on inSize and weight (arranged in predSizeW×predSizeH) for different categories may be set 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 definition of the block type wcpSizeId is as follows.
[0349] wcpSizeId = 0: Represents the current block where (nTbW×nTbH) < 64. Here, the control parameter(s) is 16, inSize is (2×nTbH + 2×nTbW), and the chrominance prediction output based on weight is the chrominance prediction value with nTbH×nTbW pieces.
[0350] wcpSizeId = 1: Represents the current block where 64 <= (nTbW×nTbH) <= 512. Here, the control parameter(s) is 4, inSize is (1.5×nTbH + 1.5×nTbW), and the chrominance prediction output based on weight is the chrominance prediction value with nTbH / 2×nTbW / 2 pieces.
[0351] wcpSizeId = 2: Represents the current block where (nTbW×nTbH) > 512. Here, the control parameter(s) is 1, inSize is (nTbH + nTbW), and the chrominance prediction output based on weight is the chrominance prediction value with nTbH / 4×nTbW / 4 pieces.
[0352] As shown in Table 13, the quantitative relationship of the above core parameters is represented in tabular form.
[0353]
Table 13
[0354] Note that for Tables 11 and 13, predSizeW×predSizeH is calculated by chrominance prediction based on weights. However, when wcpSizeId = 1, only some chrominance prediction values, that is, the chrominance prediction values of nTbH / 2×nTbW / 2, are calculated according to the WCP. When wcpSizeId = 2, only some chrominance prediction values, that is, the chrominance prediction values of nTbH / 4×nTbW / 4, are calculated according to the WCP. The remaining part of the chrominance prediction values is obtained by performing filtering processing on the chrominance prediction values calculated according to the WCP. The filtering processing here may be an interpolation filtering method, an upsampling filtering method, etc., but is not limited to these.
[0355] S702. Obtain input information according to the WCP core parameters.
[0356] Note that for S702, the input information may include reference chrominance information (refC), reference luminance information (refY), and reconstructed luminance information (recY). Here, regarding the acquisition of input information, when predicting the current block, the upper region, upper-left region, and left region of the current block are regarded as the adjacent regions of the current block (also called "reference regions"). As shown in FIG. 6 above, the pixels in the adjacent regions are all reconstructed reference pixels.
[0357] Note that reference chrominance information refC and reference luminance information refY are obtained from adjacent regions. The obtained reference chrominance information includes, but is not limited to, the reference chrominance reconstruction value of the upper region of the selected current block and / or the reference chrominance reconstruction value of the left region. The obtained reference luminance information includes, but is not limited to, the corresponding reference luminance information obtained according to the position of the reference chrominance information.
[0358] In the step of obtaining the reconstructed luminance information recY of the current block, the obtaining method includes, but is not limited to, obtaining the corresponding reconstructed luminance information as the reconstructed luminance information of the current block according to the position of the chrominance information in the current block.
[0359] The acquisition of the input information includes the acquisition of inSize amount of reference chrominance information refC (after the preprocessing operation if preprocessing is required), the acquisition of inSize amount of reference luminance information refY (after the preprocessing operation if preprocessing is required), and the luminance reconstruction information recY of the current prediction block (after the preprocessing operation if preprocessing is required).
[0360] S703. According to the input information, perform chrominance prediction calculation based on weights to determine the chrominance prediction value of the current block.
[0361] Note that for S703, the chrominance prediction value C pred [i][j], where i = 0…predSizeW - 1 and j = 0…predSizeH - 1, are obtained one by one. Note that predSizeH and predSizeW are determined WCP core parameters, which may be the same as or different from the height nTbH or width nTbW of the current prediction target chrominance block. Thus, under specific conditions, the following calculation may be performed only on some of the prediction target pixels in the current block.
[0362] The chromaticity prediction calculation of WCP includes an operation of preprocessing with reference chromaticity information, an operation of obtaining a weight vector, performing a weighted prediction according to the weight vector to obtain a chromaticity prediction value based on the weight, and an operation of correcting. Here, the preprocessing process of the reference information includes calculating an average value and constructing a reference chromaticity difference vector, and the process of obtaining the weight vector includes constructing a luminance difference vector and calculating the weight vector.
[0363] The detailed calculation process is as follows.
[0364] Calculate the average value avgC of the reference chromaticity information
[0365] For k = 0, 1…inSize - 1
[0366] Construct the reference chromaticity difference vector diffC
[0367] For i = 0…predSizeW - 1, j = 0…predSizeH - 1
[0368] For k = 0, 1…inSize - 1
[0369] Construct each element diffY[i][j][k] in the luminance difference vector
[0370] Calculate each element cWeightInt[i][j][k] in the weight vector, and calculate the chromaticity prediction value C pred [i][j] by cWeightInt[i][j], diffC, and avgC.
[0371] In a specific embodiment, referring to FIG. 8, FIG. 8 is a diagram showing a flowchart of another decoding method according to an embodiment of the present application. As shown in FIG. 8, the method may include the following steps.
[0372] S801. For the current block, calculate a chromaticity average value using the obtained reference chromaticity information, and construct a reference chromaticity difference vector using the chromaticity average value.
[0373] Note that S801 is mainly the pre - processing of the reference chrominance information. Here, the average value avgC is calculated for the inSize number of reference chrominance information refC, and the inSize number of reference chrominance information refC is subtracted from the average value avgC to obtain the reference chrominance difference vector diffC.
[0374] JPEG2025520848000176.jpg3067
[0375] JPEG2025520848000177.jpg30121
[0376] For S802, for each pixel to be predicted, a luminance difference vector is constructed using the reference luminance information and the luminance reconstruction information of the current block.
[0377] Note that S802 is mainly to construct the luminance difference vector. Here, for each pixel C pred [i][j] to be predicted within the dimensions specified by the WCP core parameter, the absolute value is taken after subtracting its corresponding luminance reconstruction information refY[i][j] from the inSize number of reference luminance information refY to obtain the luminance difference vector diffY[i][j].
[0378] JPEG2025520848000178.jpg28162
[0379] Under specific conditions, linear or non - linear numerical processing may be performed on the luminance difference vector of the pixel to be predicted. For example, according to the WCP control parameter S in the WCP core parameter, the numerical value of the luminance difference vector of the pixel to be predicted may be scaled.
[0380] For S803, for each pixel to be predicted, a weight vector is determined according to the obtained luminance difference vector and the weight model LUT.
[0381] Note that S803 is mainly to calculate the weight vector. Here, using the LUT of the non - linear weight model, for each pixel Cpred Processing is performed on the luminance difference vector diffY[i][j] corresponding to [i][j], and the corresponding integer weight vector cWeightInt[i][j] can be obtained.
[0382] Exemplarily, in one possible implementation, a non-linear Softmax function may be used as the weight model. In this case, the method for obtaining the weight model LUT includes, but is not limited to, the following methods.
[0383] JPEG2025520848000179.jpg27149
[0384] Here, the value of theMaxPos includes, but is not limited to, the value calculated according to Equation (29). The value of theMaxPos may be a parameter determined from the WCP core parameters.
[0385] For n = 0, 1…theMaxPos
[0386] JPEG2025520848000180.jpg30153
[0387] However, the value of ModelScale includes, but is not limited to, the parameter determined from the WCP core parameters. The value of ModelScale represents the magnification factor of the weight coefficient and is a preset constant.
[0388] For k = 0, 1…inSize - 1
[0389] JPEG2025520848000181.jpg25167
[0390] JPEG2025520848000182.jpg28146
[0391] Exemplarily, in another possible implementation, under specific conditions, the weight model may be adjusted according to the WCP control parameter (S) in the core parameters.
[0392] When the current block size is flexible, the weight model LUT may be adjusted according to the WCP control parameter(s). Taking the non-linear Softmax function as an example, different control parameters may be selected according to the differences in the categories of the block types to which the current block belongs to adjust the function. In this case, the acquisition method of the weight model LUT includes, but is not limited to, the following methods.
[0393] Here, the value of theMaxPos includes, but is not limited to, those calculated according to Equation (29). The value of theMaxPos may be a parameter determined from the WCP core parameters, and different values, i.e., theMaxPos[S], may be assigned to different WCP control parameter(s).
[0394] For n = 0, 1…theMaxPos
[0395] JPEG2025520848000183.jpg30153
[0396] However, the value of ModelScale includes, but is not limited to, the parameters determined from the WCP core parameters. The value of ModelScale represents the magnification factor of the weight coefficient.
[0397] For k = 0, 1…inSize - 1
[0398] JPEG2025520848000184.jpg30167
[0399] JPEG2025520848000185.jpg30152
[0400] However, f() means a function of the WCP control parameter S and the luminance difference diffY[i][j][k], and its output is the weight index value of the LUT. Here, f() includes, but is not limited to, the implementation methods of the following examples.
[0401] JPEG2025520848000186.jpg30153
[0402] However,
[0403] JPEG2025520848000187.jpg34116
[0404] JPEG2025520848000188.jpg2976
[0405] Floor(x) represents the largest integer less than or equal to x.
[0406] Log2(x) represents the logarithm to the base 2.
[0407] JPEG2025520848000189.jpg3476
[0408] JPEG2025520848000190.jpg29165
[0409] For each pixel to be predicted in S804, a chrominance prediction value is calculated using the product of the obtained reference chrominance difference vector and the obtained weight vector and the chrominance average value.
[0410] Note that for S804, mainly the chrominance prediction value is calculated. Here, according to the integer weight vector cWeightInt[i][j] corresponding to each pixel to be predicted, the reference chrominance difference vector diffC, and the average value of the reference chrominance information, the chrominance prediction value of the pixel to be predicted is calculated. Specifically, the reference chrominance difference vector diffC is multiplied one by one with the weight vector elements corresponding to each pixel to be predicted to obtain subC[i][j], the multiplication results are accumulated and divided by the sum of the integer weight vectors cWeightInt[i][j] corresponding to each pixel to be predicted, and then the average value of the reference chrominance information is added, and the chrominance prediction value C pred [i][j] can be obtained. Here, in the embodiments of the present application, all division operations use right shift operations, and the specific process is as follows.
[0411] For k = 0, 1…inSize - 1
[0412] JPEG2025520848000191.jpg26167
[0413] For i = 0…predSizeW - 1, j = 0…predSizeH - 1
[0414] JPEG2025520848000192.jpg25164
[0415] However
[0416] JPEG2025520848000193.jpg27164
[0417] JPEG2025520848000194.jpg29165
[0418] JPEG2025520848000195.jpg25134
[0419] JPEG2025520848000196.jpg3092
[0420] JPEG2025520848000197.jpg28117
[0421] Here, the acquisition method of Shift includes, but is not limited to, the parameters determined from the WCP Core parameters. In the decoding specification text, the value of Shift may be assigned to 5
[0422] Also, regarding the calculation formula of x, it corresponds to x = Floor(Log2(sum)) in the decoding specification text
[0423] Regarding the calculation formula of v, it corresponds to divSigTable[normDiff]|32 when Shift = 5 in the decoding specification text
[0424] Regarding the calculation formula of normDiff, it corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decryption specification text.
[0425] Regarding the calculation formula of y, it corresponds to x += (normDiff!= 0)? 1 : 0 in the decryption specification text.
[0426] Regarding the calculation formula of add, it corresponds to add = 1 << x << 4 when Shift = 5 in the decryption specification text.
[0427] Note that in the embodiments of the present application, DivSigTable is a predefined array related to Shift, and DivSigTable corresponds to divSigTable[] = {0, 15, 14, 13, 12, 12, 11, 10, 10, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0} in the decryption specification text.
[0428] Note that in the embodiments of the present application, Func() is a function related to Shift. The input is the sum of the weight vectors and the calculated x, and the output is the array index value of DivSigTable[]. Exemplarily, the specific form of Func() may be represented as in the following formula (48).
[0429] JPEG2025520848000198.jpg30167
[0430] Here, formula (48) corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decryption specification text.
[0431] S805. For each pixel to be predicted, perform a correction process on the calculated chrominance prediction value to determine the chrominance prediction value of the current block.
[0432] Regarding S805, it mainly performs a correction operation on the chrominance prediction value in the first prediction block predWcp. Here, the chrominance prediction value in predWcp should be limited within a preset range. When it exceeds the preset range, it is necessary to perform the corresponding correction operation. For example,
[0433] C pred [i][j], a clamping operation may be performed on the chrominance prediction value, specifically as follows.
[0434] C pred If the value of [i][j] is less than 0, set it to 0.
[0435] C pred If the value of [i][j] is greater than (1<<BitDepth)-1, set it to (1<<BitDepth)-1.
[0436] However, BitDepth is the bit depth required for the chrominance component, thereby ensuring that all chrominance prediction values in predWcp are between 0 and (1<<BitDepth)-1. That is, as shown in the following formula (49).
[0437] JPEG2025520848000199.jpg29166
[0438] S704 performs a post-processing operation on the chrominance prediction value to determine the target chrominance prediction value of the current block.
[0439] Regarding S704, the chrominance prediction output predWcp based on weights needs to be post-processed to be the final target chrominance prediction value predSamples under specific conditions. Otherwise, the final target chrominance prediction value predSamples is predWcp.
[0440] Exemplarily, in order to reduce the instability due to independent parallel prediction for each pixel of WCP, smoothing may be performed on predWcp, and it may be used as the final chromaticity prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, a position-related correction process may be performed on predWcp. For example, using reference pixels with close spatial positions, a chromaticity correction value is calculated for each pixel to be predicted, and this chromaticity correction value is used to correct predWcp, and the corrected prediction value is used as the final chromaticity prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, the chromaticity prediction value calculated by another chromaticity prediction mode and the chromaticity prediction value predWcp calculated by WCP are weighted and fused, and this fusion result is used as the final chromaticity prediction value predSamples. For example, the chromaticity prediction value obtained by the prediction of the CCLM mode and the chromaticity prediction value predWcp calculated by WCP may be weighted equally or unequally, and the weighted result may be used as the final chromaticity prediction value predSamples. Alternatively, in order to improve the WCP prediction performance, a neural network model may be used to correct the prediction output predWcp of WCP, etc., but the embodiments of the present application are not limited thereto at all.
[0441] In the embodiments of the present application, regarding the acquisition of the weight vector, here, since the derivation of the LUT and index of the weight model having the WCP control parameter(s) still occupies a large storage space, it is understood that the embodiments of the present application can further correct the weight model LUT having the WCP control parameter(s) and the others remain unchanged. The specific steps are as follows.
[0442] Under specific conditions, the weight model LUT may be adjusted according to the WCP control parameter(s) (S) in the WCP core parameters. Exemplarily, when the size of the current block is flexible, the weight model may be adjusted according to the WCP control parameter(s) (S). Taking the non-linear Softmax function as an example, different control parameters may be selected and the function may be adjusted according to the differences in the categories of block types to which the current prediction block belongs. In this case, the acquisition method of the weight model LUT includes, but is not limited to, the following methods.
[0443] JPEG2025520848000200.jpg25136
[0444] Here, the value of theMaxPos includes, but is not limited to, the one calculated according to Equation (50). The value of theMaxPos may be a parameter determined from the WCP core parameters, and different values, i.e., theMaxPos[S], may be assigned to different WCP control parameter(s) (S).
[0445] For n = 0, 1…theMaxPos
[0446] JPEG2025520848000201.jpg30103
[0447] However, the value of ModelScale includes, but is not limited to, the parameter determined from the WCP core parameters. The value of ModelScale represents the magnification factor of the weight coefficient.
[0448] Since different WCP control parameter(s) (S) use their respective LUT[S], here, only some basic LUTs may be memorized. For example, when S = {2, 4, 8}, only the LUT for the case of S = 2 is memorized. The code in this case is as follows.
[0449] For k = 0, 1…inSize - 1
[0450] JPEG2025520848000202.jpg28167
[0451] JPEG2025520848000203.jpg30133
[0452] However, f() means a function of the WCP control parameter (S) and the luminance difference vector diffY[i][j][k], and its output is the weight index value of the LUT. Here, f() includes, but is not limited to, the implementation methods of the following examples.
[0453] JPEG2025520848000204.jpg29167
[0454] However, the definition of the array LUTshift in Equation (54) is as follows.
[0455] JPEG2025520848000205.jpg3858
[0456] For example, when S = {8, 12, 16}, only the LUT for the case of S = 12 is memorized. The code in this case is as follows.
[0457] For k = 0, 1…inSize - 1
[0458] JPEG2025520848000206.jpg28168
[0459] JPEG2025520848000207.jpg29137
[0460] However, f() means a function of the WCP control parameter (S) and the luminance difference vector diffY[i][j][k], and its output is the weight index value of the LUT. Here, f() includes, but is not limited to, the implementation methods of the following examples.
[0461] JPEG2025520848000208.jpg29164
[0462] Note that Equation (58) corresponds to (baseDiffL+(blockIndex&1)*(baseDiffL>>1)-(blockIndex&2)*(baseDiffL>>2)+indexOffset[cnt]) in the decoding specification text.
[0463] The wcpSizeId in Equation (58) is a variable for determining the WCP core parameters. Also, the calculation method of indexOffset is as shown in the following Equation (59).
[0464] JPEG2025520848000209.jpg24166
[0465] Note that Equation (59) corresponds to indexOffset[cnt]=((blockIndex&1)-(blockIndex&2))*(baseDiffY[cnt]&1) in the decoding specification text.
[0466] In a specific or another embodiment, based on the decoding method described in the above embodiment, the specific description of the decoding specification text according to the embodiments of the present application is as follows.
[0467] It is a specification description regarding the INTRAL_WCP intra prediction mode.
[0468] The input of the process includes the following.
[0469] - The identifier predModeIntra of the intra prediction mode.
[0470] - With respect to the upper left sample position (xTbC, yTbC) of the current picture of the upper left sample position of the current conversion block.
[0471] - The variable nTbW representing the width of the conversion block.
[0472] - The variable nTbH representing the height of the conversion block.
[0473] - The variable cIdx representing the color component of the current block.
[0474] - The adjacent chrominance samples p[x][y], where x = -1, y = -1…2*nTbH - 1 and x = 0…2*nTbW - 1, y = -1.
[0475] The output of this process is the predicted samples predSamples[x][y], where x = 0…nTbW - 1, y = 0…nTbH - 1.
[0476] The derivation of the luminance position (xTbY, yTbY) corresponding to the current block is as follows.
[0477] (xTbY, yTbY) = (xTbC << (SubWidthC - 1), yTbC << (SubHeightC - 1))
[0478] The derivation of the variables availL and availT is as follows.
[0479] - When calling the derivation process of the availability of the specified adjacent blocks in the second part, the luminance position (xCurr, yCurr) of the current block is set equal to the adjacent luminance position (xTbY - 1, yTbY) of (xTbY, yTbY), checkPredModeY is set to FALSE, cIdx is used as the input, and the output is assigned to availableL.
[0480] - When calling the derivation process of the availability of the specified adjacent blocks in the second part, the luminance position (xCurr, yCurr) of the current block is set equal to the adjacent luminance position (xTbY, yTbY - 1) of (xTbY, yTbY), checkPredModeY is set to FALSE, cIdx is used as the input, and the output is assigned to availT.
[0481] The number numTopRight of available top - right adjacent chrominance samples is as shown below.
[0482] - The variable numTopRight is set to 0 and availableTR is set to TRUE.
[0483] - When predModeIntra is equal to INTRA_WCP, the following is applied for x = nTbW…2*nTbW - 1 until availTR becomes equal to FALSE.
[0484] - When calling the process for deriving the availability of the specified adjacent blocks in the (2) part, the current luminance position (xCurr, yCurr) is set equal to the (xTbY, yTbY) adjacent luminance position (xTbY + x*SubWidthC, yTbY - 1), checkPredModeY is set to FALSE, cIdx is used as input, and the output is assigned to availableTR.
[0485] - When availTR is equal to TRUE, numTopRight is incremented by 1.
[0486] The number numleftbellow of available lower - left adjacent chrominance samples is as follows.
[0487] - The variable numleftbellow is set to 0 and availableLB is set to TRUE.
[0488] - When predModeIntra is equal to INTRA_WCP, the following is applied for y = nTbH…2*nTbH - 1 until availB becomes equal to FALSE.
[0489] - When calling the process for deriving the availability of the specified adjacent blocks in the (2) part, the current luminance position (xCurr, yCurr) is set equal to the adjacent luma position (xTbY - 1, yTbY + y*SubweightC) of (xTbY, yTbY), checkPredModeY is set to FALSE, cIdx is used as input, and the output is assigned to AvailLB.
[0490] - If availLB is equal to TRUE, numLeftBelow is incremented by 1.
[0491] The derivation of the number of available adjacent chrominance samples numSampT above and top - right, and the number of available adjacent chrominance samples numSampL left and left - below is as follows.
[0492] - If predModeIntra is equal to INTRA_WCP, the following cases apply.
[0493] numSampT = availT? (nTbW + numTopRight) : 0
[0494] numSampL = availL? (nTbH + numLeftBelow) : 0
[0495] The derivation of the number numSamp of all available adjacent chrominance samples and the variable enableWcp is as follows.
[0496] - If predModeIntra is equal to INTRA_WCP, the following cases apply.
[0497] numSamp = numSampT + numSampL
[0498] enableWcp = numSamp? true : false
[0499] The derivation of the prediction samples predSamples[x][y] for x = 0…nTbW - 1, y = 0…nTbH - 1 is as follows.
[0500] - If enableWcp is equal to FALSE, the following content applies.
[0501] predSamples[x][y]=1<<(BitDepth - 1)
[0502] - Otherwise, perform according to the following step procedure.
[0503] The luminance samples pY[x][y] with x = 0…nTbW*SubWidthC-1 and y = 0…nTbH*SubHeightC-1 are set equal to the reconstructed luminance samples before the decoding filtering process at the position (xTbY+x, yTbY+y).
[0504] The derivation of the adjacent luminance samples pY[x][y] is as follows.
[0505] - When availL is equal to TRUE, the adjacent luminance samples pY[x][y] with x = -3…-1 and y = (availT?-1:0)…SubHeightC*Max(nTbH,numSampL)-1 are set to the reconstructed luminance samples before the decoding filtering process at the position (xTbY+x, yTbY+y).
[0506] - When availT is equal to FALSE, the adjacent luminance samples pY[x][y] with x = -2…SubWidthC*nTbW-1 and y = -2…-1 are set equal to the reconstructed luminance sample pY[x][0].
[0507] - When availT is equal to TRUE, the adjacent luminance samples pY[x][y] with x = (availL?-1:0)…SubWidthC*Max(nTbW,numSampT)-1 and y = -3…-1 are set equal to the reconstructed luminance samples before the decoding filtering process at the position (xTbY+x, yTbY+y).
[0508] - When avillL is equal to FALSE, the adjacent luminance samples pY[x][y] with x = -1 and y = -2…SubHeightC*nTbH-1 are set equal to the reconstructed luminance sample pY[0][y].
[0509] 3. The derivation of the downsampled co-located luminance samples pDsY[x][y] with x = 0…nTbW-1 and y = 0…nTbH-1 is as follows.
[0510] - If both SubWidthC and SubHeightC are equal to 1, the following items apply.
[0511] pDsY[x][y] = pY[x][y]
[0512] - Otherwise, if SubHeightC is equal to 1, the following content applies.
[0513] JPEG2025520848000210.jpg36145
[0514] - Otherwise, (SubHeightC is not equal to 1), the following applies.
[0515] - If sps_chroma_vertical_collocated_flag is equal to 1, the following cases apply.
[0516] JPEG2025520848000211.jpg48166
[0517] - Otherwise (sps_chroma_vertical_collocated_flag is equal to 0), the following applies.
[0518] JPEG2025520848000212.jpg55166
[0519] 4. When numSampT is greater than 0, the adjacent upper chroma sample refC[idx] is set equal to p[idx][-1], where idx = 0…numSampT - 1, and the downsampled adjacent upper luminance samples refY[idx], idx = 0…numSampT - 1, are defined as follows.
[0520] If both SubWidthC and SubHeightC are equal to 1, the following cases apply.
[0521] refY[idx] = pY[idx][-1]
[0522] Otherwise, the following content applies.
[0523] If SubHeightC is not equal to 1 and bCTUboundary is equal to FALSE, the following cases apply.
[0524] If sps_chroma_vertical_collocated_flag is equal to 1, the following cases apply.
[0525] JPEG2025520848000213.jpg58153
[0526] Otherwise (if sps_chroma_vertical_collocated_flag is equal to 0), the following content applies.
[0527] JPEG2025520848000214.jpg68158
[0528] Otherwise (if SubHeightC is equal to 1 or bCTUboundary is equal to TRUE), the following cases apply.
[0529] JPEG2025520848000215.jpg38162
[0530] 5. When numSampL is greater than 0, the adjacent left chroma sample refC[idx] is set equal to p[-1][idx - numSampT], provided that idx = numSampT…numSamp - 1, and the derivation of the downsampled adjacent left luminance sample refY[idx], provided that idx = numSampT…numSamp - 1, is as follows.
[0531] If both SubWidthC and SubHeightC are equal to 1, the following cases apply.
[0532] refY[idx] = pY[-1][y]
[0533] Otherwise, if SubHeightC is equal to 1, the following content applies.
[0534] JPEG2025520848000216.jpg30122
[0535] Otherwise, the following content applies.
[0536] If sps_chroma_vertical_collocated_flag is equal to 1, the following cases apply.
[0537] JPEG2025520848000217.jpg48160
[0538] Otherwise (if sps_chroma_vertical_collocated_flag is equal to 0), the following content applies.
[0539] JPEG2025520848000218.jpg57166
[0540] 6. The derivation of the difference refDiffC[idx] between the variable avgC and the chrominance reference sample, where idx = 0...numSamp - 1, is as follows.
[0541] JPEG2025520848000219.jpg12146
[0542] JPEG2025520848000220.jpg14122
[0543] JPEG2025520848000221.jpg13170
[0544] JPEG2025520848000222.jpg13112
[0545] 7. The derivation of the variables minBlockSize, blockIndex, the difference baseDiffY[cnt] between the luminance reference sample and the reconstructed sample, where cnt = 0…numSamp - 1, the variable indexDiffY[cnt], where cnt = 0…numSamp - 1, the variable indexOffset[cnt], where cnt = 0…numSamp - 1, the variable LUTindex[cnt], where cnt = 0…numSamp - 1, and the final predicted sample predSamples[x][y], where x = 0…nTbW - 1, y = 0…nTbH - 1, is as follows.
[0546] JPEG2025520848000223.jpg11113
[0547] If minBlockSize is equal to 2 or 4, blockIndex is set equal to 0.
[0548] If minBlockSize is equal to 8 or 16, blockIndex is set equal to 1.
[0549] If minBlockSize is greater than 16, blockIndex is set equal to 2.
[0550] JPEG2025520848000224.jpg11160
[0551] JPEG2025520848000225.jpg8166
[0552] JPEG2025520848000226.jpg11165
[0553] However, WCP_LUT_Max_Index is equal to 49.
[0554] 8. The derivation of the variable numerator[cnt], where cnt = 0...numSamp - 1, and the variables sum and finalVal of predSamples[x][y] for sample prediction, where x = 0...nTbW - 1 and y = 0...nTbH - 1, is as follows.
[0555] JPEG2025520848000227.jpg11141
[0556] JPEG2025520848000228.jpg15165
[0557] JPEG2025520848000229.jpg978
[0558] JPEG2025520848000230.jpg10116
[0559] JPEG2025520848000231.jpg1265
[0560] JPEG2025520848000232.jpg1195
[0561] JPEG2025520848000233.jpg1073
[0562] JPEG2025520848000234.jpg946
[0563] JPEG2025520848000235.jpg9165
[0564] JPEG2025520848000236.jpg10142
[0565] JPEG2025520848000237.jpg7166
[0566] 9. The derivation of the prediction sample predSamples[x][y], where x = 0...nTbW - 1 and y = 0...nTbH - 1, is as follows.
[0567] JPEG2025520848000238.jpg10126
[0568] JPEG2025520848000239.jpg12116
[0569] (2) Specification description regarding the derivation process of the availability of adjacent blocks
[0570] The input of this process is
[0571] - The sample at the upper left of the current block, the luminance position (xCurr, yCurr) with respect to the sample at the upper left of the current picture, and
[0572] - The luminance positions (xNbY, yNbY) included in the adjacent block, where the position is with respect to the luminance sample at the upper left position of the current picture, the luminance positions (xNbY, yNbY), and
[0573] - The variable checkPredModeY used to identify whether the availability depends on the prediction mode, and
[0574] - The variable cIdx representing the color component of the current block.
[0575] The output of this process is the availability of the adjacent block including the position (xNbY, yNbY), represented by availableN.
[0576] The derivation of the availability availableN of the adjacent block is as follows.
[0577] - If one or more of the following conditions are TRUE, availableN is set to FALSE.
[0578] - xNbY is less than 0.
[0579] - yNbY is less than 0.
[0580] -xNbY is greater than or equal to pps_pic_width_in_luma_samples.
[0581] -yNbY is greater than or equal to pps_pic_height_in_luma_samples.
[0582] -(xNbY >> CtbLog2SizeY) is greater than (xCurr >> CtbLog2SizeY), and (yNbY >> CtbLog2SizeY) is greater than or equal to (yCurr >> CtbLog2SizeY).
[0583] -(yNbY >> CtbLog2SizeY) is greater than or equal to (yCurr >> CtbLog2SizeY) + 1.
[0584] -IsAvailable[cIdx][xNbY][yNbY] is equal to FALSE.
[0585] -The adjacent block is included in a different slice from the current block.
[0586] -The adjacent block is included in a different tile from the current block.
[0587] -sps_entropy_coding_sync_enabled_flag is equal to 1, and (xNbY >> CtbLog2SizeY) is greater than or equal to (xCurr >> CtbLog2SizeY) + 1.
[0588] -Otherwise, availableN is set equal to TRUE.
[0589] If all of the following conditions are true, availableN is set equal to FALSE.
[0590] -checkPredModeY is equal to TRUE.
[0591] -CuPredMode[0][xNbY][yNbY] is not equal to CuPredMode[0][xCurr][yCurr].
[0592] This embodiment provides a decoding method, and according to the above embodiment, the specific implementation of the above embodiment will be described in detail. According to the technical solution of the above embodiment, it can be seen that the optimization of the floating-point operation in the WCP prediction technology process is realized by using integer operations. On the one hand, the content characteristics of the current block are fully utilized to adaptively select the optimal integer operation displacement amount. On the other hand, the accuracy of the WCP prediction technology is fully guaranteed. On the other hand, the characteristics of the weight model are fully considered, and the integer operation process is reasonably designed. That is, by optimizing the calculation process based on the chroma prediction of the weight in the WCP prediction technology, this technical solution completely adopts integer operations, and at the same time, can adaptively select information such as the optimal displacement amount required for integerization, further reducing the complexity of the calculation. In addition, since all the calculation methods adopted by the WCP prediction technology are integer operations, it is extremely favorable for the realization of hardware. In this way, on the premise of ensuring the accuracy of the WCP prediction technology to a certain extent, the calculation complexity of the WCP prediction technology can be reduced, and the encoding / decoding performance can be improved.
[0593] In still another embodiment of the present application, referring to FIG. 9, FIG. 9 is a diagram showing a flowchart of an encoding method according to an embodiment of the present application. As shown in FIG. 9, the method may include the following steps.
[0594] S901, determine the reference value of the first color component of the current block and the reference value of the second color component of the current block.
[0595] It should be noted that the encoding method of the embodiment of the present application is applicable to an encoding device or an encoding device integrated with the encoding device (which can also be abbreviated as an "encoder"). In addition, the encoding method of the embodiment of the present application may specifically refer to an intra prediction method, and more specifically, it is an integer operation method of weight-based chroma prediction (WCP).
[0596] In the embodiments of the present application, the video image may be divided into a plurality of encoding blocks, and each encoding block may include a first color component, a second color component, and a third color component. Here, the current block refers to the encoding block that is the target for performing the current intra prediction in the video image. Further, assuming that the current block performs prediction on the first color component and the first color component is the luminance component, that is, the prediction target component is the luminance component, the current block may also be referred to as a luminance prediction block. Or, assuming that the current block performs prediction on the second color component and the second color component is the chrominance component, that is, the prediction target component is the chrominance component, the current block may also be referred to as a chrominance prediction block.
[0597] Note that in the embodiments of the present application, the reference information of the current block may include the values of the first color component sampling points in the adjacent region of the current block and the values of the second color component sampling points in the adjacent region of the current block. These sampling points may be determined according to the encoded 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 the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0598] Here, the entire upper adjacent region and the upper right adjacent region may be regarded as the upper region, and the entire left adjacent region and the lower left adjacent region may be regarded as the left region. In addition, as shown in FIG. 6 above, the adjacent region may further include the upper left region. Here, when performing prediction on the second color component for the current block, the upper region, the left region, and the upper left region of the current block may all be referred to as the reference region of the current block as the adjacent region and the pixels in the reference region are all reconstructed reference pixels.
[0599] In some embodiments, the step of determining the reference value of the first color component of the current block and the reference value of the second color component of the current block may include the following steps.
[0600] Determine the reference value of the first color component of the current block according to the value of the first color component sampling points in the adjacent area of the current block.
[0601] Determine the reference value of the second color component of the current block according to the value of the second color component sampling points in the adjacent area of the current block.
[0602] In the embodiments of the present application, the reference pixel of the current block may refer to the reference pixel points adjacent to the current block, and may also be called the first color component sampling point and the second color component sampling point in the adjacent area of the current block, and is represented by Neighboring Sample or Reference Sample. The adjacent here may be spatial adjacency, but is not limited thereto. For example, the adjacency may be temporal domain adjacency, spatial and temporal domain adjacency. Further, the reference pixel of the current block may be a reference pixel obtained after performing some processing on the reference pixel points of spatial adjacency, temporal domain adjacency, and spatial and temporal domain adjacency, etc., and the embodiments of the present application are not limited in any way.
[0603] In the embodiments of the present application, assuming that the first color component is the luminance component and the second color component is the chrominance component, the value of the first color component sampling points in the adjacent area of the current block is represented as the reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sampling points in the adjacent area of the current block is represented as the reference chrominance information corresponding to the reference pixel of the current block.
[0604] In the embodiments of the present application, the value of the first color component sampling point or the value of the second color component sampling point is determined from the adjacent region of the current block. Here, the adjacent region may include only the upper adjacent region, or may include only the left adjacent region, or may include the upper adjacent region and the upper right adjacent region, or may include the left adjacent region and the lower left adjacent region, or may include the upper adjacent region and the left adjacent region, or may further include the upper adjacent region, the upper right adjacent region, and the left adjacent region, etc., but the embodiments of the present application are not limited to anything.
[0605] Furthermore, in some embodiments, the step of determining the reference pixel of the current block may include a step of performing a selection process on the pixels in the adjacent region of the current block to determine the reference pixel.
[0606] Specifically, in the embodiments of the present application, when constructing the first reference pixel set according to the pixels in the adjacent region of the current block, a selection process may be performed on the first reference pixel set to determine the reference pixel. Here, the number of reference pixels may be M, and M is a positive integer. That is, M reference pixels may be selected from the pixels in the adjacent region. Here, the value of M may usually be 4, but is not specifically limited.
[0607] Note that among the pixels in the adjacent region of the current block, there may be some unimportant pixels (for example, the correlation of these pixels is low) or some abnormal pixels. In order to ensure the accuracy of prediction and obtain effective reference pixels, it is necessary to remove these pixels. Therefore, in a specific embodiment, the step of performing a selection process on the pixels in the adjacent region to determine the reference pixel may include the following steps.
[0608] Determine the position of the pixel to be selected based on the position and / or color component intensity of the pixels in the adjacent region.
[0609] According to the selected pixel position, a reference pixel is determined from the pixels in the adjacent region.
[0610] In the embodiments of the present application, the color component intensity may be represented by color component information such as reference luminance information and reference chrominance information. Here, the larger the value of the color component information, the higher the color component intensity. Thus, sorting the pixels in the adjacent region may be sorting according to the position of the pixels or sorting according to the color component intensity. Thereby, the reference pixel of the current block is determined according to the sorted pixels, and further, the value of the first color component sampling point in the adjacent region of the current block and the value of the second color component sampling point in the adjacent region of the current block may be determined. Then, according to the value of the first color component sampling point in the adjacent region of the current block, the reference value of the first color component of the current block is determined, and according to the value of the second color component sampling point in the adjacent region of the current block, the reference value of the second color component of the current block is determined.
[0611] In some embodiments, the step of determining the reference value of the first color component of the current block according to the value of the first color component sampling point in the adjacent region of the current block may include performing a first filtering process on the value of the first color component sampling point in the adjacent region of the current block to determine the reference value of the first color component of the current block.
[0612] In the embodiments of the present application, the first filtering process is a downsampling filtering process. Here, the first color component is a luminance component. In this case, by performing a downsampling filtering process on the reference luminance information, the spatial resolution of the filtered reference luminance information and the reference chrominance information may be made the same. Exemplarily, when the size of the current block is 2M×2N and the reference luminance information is 2M + 2N, after performing the downsampling filtering process, it may be converted into M + N to obtain the reference value of the first color component of the current block.
[0613] In some embodiments, the step of determining the reference value of the second color component of the current block according to the values of the second color component sampling points in the adjacent region of the current block may include performing a second filtering process on the values of the second color component sampling points in the adjacent region of the current block to determine the reference value of the second color component of the current block.
[0614] In the embodiments of the present application, the second filtering process is an upsampling filtering process. Here, the upsampling rate is a positive integer multiple of 2.
[0615] That is, the first color component is a luminance component, the second color component is a chrominance component, and the embodiments of the present application may further perform upsampling filtering on the reference chrominance information to make the spatial resolution of the filtered reference chrominance information the same as the spatial resolution of the reference luminance. Exemplarily, when the reference luminance information is 2M + 2N and the reference chrominance information is M + N, after performing upsampling filtering on the reference chrominance information, it may be converted to 2M + 2N to obtain the reference value of the second color component of the current block.
[0616] S902. Determine a weighting coefficient according to the reference value of the first color component of the current block.
[0617] In the embodiments of the present application, the reference information of the current block may further include the reconstructed value of the first color component sampling points in the current block. Assuming that the first color component is a luminance component, the reconstructed value of the first color component sampling points in the current block is the reconstructed luminance information of the current block.
[0618] In some embodiments, the step of determining a weighting coefficient according to the reference value of the first color component of the current block may further include the following steps.
[0619] Determine the reconstructed value of the first color component sampling points in the current block.
[0620] According to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block, determine the reference sample value of the first color component of the current block.
[0621] Determine a weighting coefficient according to the reference sample value of the first color component of the current block.
[0622] In a possible embodiment, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block may include the following steps.
[0623] Determine the difference value between the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block.
[0624] Determine the reference sample value of the first color component of the current block according to the difference value.
[0625] In the embodiment of the present application, the reference sample value of the first color component of the current block may be set equal to the absolute value of the difference value. Further, the step of determining the reference sample value of the first color component of the current block according to the difference value may further include squaring the difference value, or determining the reference sample value of the first color component of the current block by performing some related processing and mapping on the difference value, etc., but is not limited here.
[0626] In another possible embodiment, the step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block may include the following steps.
[0627] Perform a third filtering process on the reconstruction value of the first color component sampling points in the current block to obtain a filtered sample value of the first color component sampling points in the current block.
[0628] According to the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component, determine the reference sample value of the first color component of the current block.
[0629] In the embodiment of the present application, the third filtering process is a downsampling filtering process. Here, the first color component is a luminance component. In this case, a downsampling filtering process may also be performed on the reconstructed luminance information in the current block. Exemplarily, when the number of reconstructed luminance information in the current block is 2M×2N, it can be converted to M×N after performing the downsampling filtering process.
[0630] In the embodiment of the present application, the step of determining the reference sample value of the first color component of the current block according to the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block may be to determine the reference sample value of the first color component of the current block according to the difference between the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block. More specifically, it may be to determine the reference sample value of the first color component of the current block according to the absolute value of the difference between the filtering sample value of the first color component sampling point in the current block and the reference value of the first color component of the current block, but nothing is limited here either.
[0631] After determining the reference sample value of the first color component of the current block, it is understood that the embodiment of the present application can further determine the weighting coefficient. Here, the reference sample value of the first color component of the current block may be the absolute value of the difference between the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block.
[0632] In the embodiment of the present application, the reference sample value of the first color component of the current block may also be the absolute difference between the luminance reconstruction information (represented by recY) in the current block and the reference luminance information (represented by refY) of the inSize number. Here, the pixel C to be predicted in the current blockpred For [i] and [j], the corresponding luminance difference vector diffY[i][j][k] may be obtained by subtracting the corresponding luminance reconstruction information recY[i][j] from the reference luminance information refY[k] of the inSize number and taking the absolute value. That is, in the embodiments of the present application, the reference sample value of the first color component of the current block may be represented by diffY[i][j][k].
[0633] Furthermore, in some embodiments, the step of determining the weighting coefficient according to the reference sample value of the first color component of the current block may include the step of determining a weight index value according to the reference sample value of the first color component of the current block, and determining the weighting coefficient using a first setting mapping relationship according to the weight index value.
[0634] In a specific embodiment, the step of determining the weight index value according to the reference sample value of the first color component of the current block may include the following steps.
[0635] Determine the maximum weight index value and the minimum weight index value of the current block.
[0636] Perform correction processing on the reference sample value of the first color component according to the maximum weight index value and the minimum weight index value, and determine the weight index value.
[0637] In the embodiments of the present application, the maximum weight index value may be represented by theMaxPos, the minimum weight index value may be represented by zero, and the weight index value may be represented by index. Here, the weight index value is limited between theMaxPos and zero. Exemplarily, the weight index value may be calculated according to the above formula (2).
[0638] JPEG2025520848000240.jpg78168
[0639] In a specific embodiment, the maximum weight index value may be related to the bit depth (represented by BitDepth) of luminance or chrominance. Exemplarily, the maximum weight index value may be calculated according to the above formula (3).
[0640] Note that in the embodiments of the present application, the value of theMaxPos includes, but is not limited to, the value calculated according to formula (3), and may also be determined from the core parameters of the WCP.
[0641] Furthermore, regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship is a numerical mapping look-up table of the weight index value and the weighting factor. That is, in the embodiments of the present application, the decoding side may preset the corresponding look-up table (Look Up Table, LUT). The corresponding weighting factor may be determined by combining with the index according to the look-up table. Exemplarily, the weighting factor cWeightInt[i][j][k] may be represented by the mapping relationship shown in the above formula (4).
[0642] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship may be a setting function relationship. In some embodiments, the step of determining the weighting factor using the first setting mapping relationship according to the weight index value may include the step of determining a first value corresponding to the weight index value under the first setting mapping relationship, and setting the weighting factor equal to the first value.
[0643] In a specific embodiment, the step of determining a first value corresponding to the weight index value under the first setting mapping relationship may include the following steps.
[0644] Determine the first factor.
[0645] Determine a second value using a second setting mapping relationship according to the weight index value.
[0646] Calculate the first product value of the first factor and the second value.
[0647] Set the first value equal to the corresponding value under the first setting mapping relationship of the first product value.
[0648] In the embodiments of the present application, the first factor may be represented by ModelScale, and the weight index value may be represented by index. Exemplarily, the weighting coefficient cWeightInt[i][j][k] may be represented by the functional relationship shown in the above formula (5).
[0649] Here, the second setting mapping relationship may be an exponential function relationship based on n, for example, e -n It may be. However, the value of n is equal to the weight index value, that is, n = 0, 1,..., theMaxPos. In this way, when the value of n is equal to index, the second value is e -index is equal to, and the first product value is e -index ×ModelScale is equal to. Also, the first setting mapping relationship may be set to Round(x). Then, when x is equal to the first product value, the value of Round(x) is the first value, that is, the weighting coefficient cWeightInt[i][j][k]. In the embodiments of the present application, the first setting mapping relationship may also be as shown in the above formula (6).
[0650] Furthermore, for the first factor, in some embodiments, the value of the first factor may be a preset constant value. That is, the first factor may be a preset constant and has no relation with the block size parameter.
[0651] Regarding the first factor, in some embodiments, the value of the first factor may further be related to the block size parameter. In a specific embodiment, the step of determining the first factor may include the step of determining the value of the first factor according to the size parameter of the current block. Here, the size parameter of the current block includes at least one parameter of the width of the current block and the height of the current block. That is, the embodiments of the present application may fix the value of the first factor using a classification method. For example, the size parameters corresponding to the current block are classified into three categories, and the value of the first factor corresponding to each category is determined. In this case, the embodiments of the present application may pre-store a mapping look-up table between the size parameter of the current block and the value of the first factor, and may determine the value of the first factor according to the look-up table. Exemplarily, when the size parameter of the current block meets the first setting condition, that is, Min(W, H) <= 4, the value of the first factor is set to the first value. When the size parameter of the current block meets the second setting condition, that is, Min(W, H) > 4 && Min(W, H) <= 16, the value of the first factor is set to the second value. When the size parameter of the current block meets the third setting condition, that is, Min(W, H) > 16, the value of the first factor is set to the third value. Here, W represents the width of the current block, and H represents the height of the current block.
[0652] The step of determining the weight index value according to the reference sample value of the first color component of the current block may include the step of determining the second factor and determining the weight index value according to the reference sample value of the first color component of the current block and the second factor.
[0653] In addition, in the embodiments of the present application, under specific conditions, the weighting coefficient may be adjusted according to the control parameter among the core parameters of the WCP. Here, the second factor is the control parameter described in this embodiment (also referred to as "scale parameter", "scale factor", etc.), and is represented by S. Exemplarily, when the flexibility of the size of the current block is good, the weighting coefficient may be adjusted according to the second factor. Taking a non-linear function (for example, the Softmax function) as an example, different second factors are selected according to the difference in the category of block classification to which the current block belongs, and the function is adjusted, so that the weighting coefficient may be determined according to the adjusted function.
[0654] Regarding the second factor, in some embodiments, the second factor may be a preset constant value. That is, in this case, for S, according to the characteristic that the chromaticity is relatively flat, the weighting coefficient distribution of adjacent chromaticities may be adjusted to capture the weighting coefficient distribution suitable for natural image chromaticity prediction. To determine the parameter S suitable for natural image chromaticity prediction, a given set of S is traversed, and the suitability of S is determined by the difference between the predicted chromaticity and the original chromaticity under different S. Exemplarily, S may take 2 -ε but ε ∈ {1, 0, -1, -2, -3}. Experiments show that in this set of S, the optimal value of S is 4. Therefore, in a specific embodiment, S may be set to 4, but the embodiments of the present application are not particularly limited.
[0655] Regarding the second factor, in some embodiments, the value of the second factor may be further related to the block size parameter. In a specific embodiment, the step of determining the second factor may include the step of determining the value of the second factor according to the size parameter of the current block. Here, the size parameter of the current block includes at least one parameter of the width of the current block and the height of the current block.
[0656] In one possible implementation manner, the step of determining the value of the second factor according to the size parameter of the current block may include the following steps.
[0657] When the minimum value of the height and width of the current block is 4 or less, it is determined that the second factor is 8.
[0658] When the minimum value of the height and width of the current block is greater than 4 and 16 or less, it is determined that the second factor is 12.
[0659] When the minimum value of the height and width of the current block is greater than 16, it is determined that the second factor is 16.
[0660] In addition, in the embodiments of the present application, the value of the second factor may be fixed using a classification method. For example, the dimensional parameters corresponding to the current block are classified into three categories, and the value of the second factor corresponding to each category is determined. In this case, the embodiments of the present application may store in advance a mapping lookup table between the dimensional parameters of the current block and the value of the second factor, and may determine the value of the second factor according to the lookup table. Exemplarily, Table 1 above shows the correspondence between the second factor according to the embodiments of the present application and the dimensional parameters of the current block.
[0661] In another possible implementation, in the adjustment of the weighting factor, the correspondence between the second factor and the dimensional parameters of the current block may be finely adjusted. Table 2 above shows the correspondence between another second factor according to the embodiments of the present application and the dimensional parameters of the current block.
[0662] In yet another possible implementation, in the adjustment of the weighting factor, the value of the second factor may be finely adjusted. In some embodiments, the step of determining the value of the second factor according to the dimensional parameters of the current block may include the following steps.
[0663] When the minimum value of the height and width of the current block is 4 or less, it is determined that the second factor is 7.
[0664] When the minimum value of the height and width of the current block is greater than 4 and 16 or less, it is determined that the second factor is 11.
[0665] When the minimum value of the height and width of the current block is greater than 16, it is determined that the second factor is 15.
[0666] That is, by finely adjusting the value of the second factor described above, Table 3 above shows the correspondence between another second factor according to the embodiment of the present application and the dimension parameters of the current block.
[0667] In the embodiment of the present application, in the step of classifying the dimension parameters corresponding to the current block into three categories, different dimension parameters may be indicated by the block type index value (represented by wcpSizeId). In yet another possible implementation manner, in the step of determining the value of the second factor according to the dimension parameters of the current block, the step of determining the value of the second factor according to the block type index value may be included.
[0668] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W, H) <= 4. When the block type index value is equal to 1, it indicates the current block where Min(W, H) > 4 && Min(W, H) <= 16. When the block type index value is equal to 2, it indicates the current block where Min(W, H) > 16. In this case, Table 4 above shows the correspondence between the second factor according to the embodiment of the present application and the block type index value.
[0669] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W, H) < 128. When the block type index value is equal to 1, it indicates the current block where Min(W, H) >= 128 && Min(W, H) <= 256. When the block type index value is equal to 2, it indicates the current block where Min(W, H) > 256. In this case, Table 5 above shows the correspondence between another second factor according to the embodiment of the present application and the block type index value.
[0670] Exemplarily, when the block type index value is equal to 0, it indicates the current block where Min(W,H) < 64. When the block type index value is equal to 1, it indicates the current block where Min(W,H) >= 64 && Min(W,H) <= 512. When the block type index value is equal to 2, it indicates the current block where Min(W,H) > 512. In this case, Table 6 above shows the correspondence between another second factor according to the embodiments of the present application and the block type index value.
[0671] Regarding the second factor, in some embodiments, the second factor may be classified according to the number of reference pixels of the current block. In a specific another embodiment, the step of determining the second factor may include the step of determining the value of the second factor according to the number of reference pixels of the current block. Here, N represents the number of reference pixels.
[0672] In a possible implementation manner, the step of determining the value of the second factor according to the number of reference pixels of the current block may include the following steps.
[0673] When the value of N is less than 16, it is determined that the second factor is 8.
[0674] When the value of N is greater than or equal to 16 and less than 32, it is determined that the second factor is 12.
[0675] When the value of N is greater than or equal to 32, it is determined that the second factor is 16.
[0676] That is, it is classified according to the number of reference pixels of the current block, and Table 7 above shows the correspondence between the second factor according to the embodiments of the present application and the number of reference pixels.
[0677] Furthermore, in some embodiments, the step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor may include the following steps.
[0678] Determine a third value using a third setting mapping relationship according to a reference sample value of a first color component and a second factor.
[0679] Determine a maximum weight index value and a minimum weight index value of the current block.
[0680] Perform correction processing on the third value according to the maximum weight index value and the minimum weight index value, and determine a weight index value.
[0681] In the embodiments of the present application, the maximum weight index value may be represented by theMaxPos, the minimum weight index value may be represented by zero, and the weight index value may be represented by index. Here, the weight index value is limited between theMaxPos and zero, but the third value is f(S, diffY[i][j][k]). Exemplarily, the weight index value may be calculated according to the above formula (7).
[0682] JPEG2025520848000241.jpg113169
[0683] Regarding the third setting mapping relationship, f() refers to a function of the second factor S and the luminance difference vector diffY[i][j][k]. In a possible implementation manner, f(S, diffY[i][j][k]) may be realized according to the formula shown in the above formula (8).
[0684] In another possible implementation manner, f(S, diffY[i][j][k]) may be realized by the following operations. In some embodiments, the step of determining a third value using a third setting mapping relationship according to a reference sample value of a first color component and a second factor may include the following steps.
[0685] Determine at least one shift array.
[0686] Determine a target offset amount from at least one shift array according to the second factor.
[0687] A right shift operation of the target offset amount is performed on the reference sample value of the first color component to determine a third value.
[0688] Here, since different second factors S can each use their own LUT[S], the embodiments of the present application only store several basic LUTs. For example, when S = {2, 4, 8}, only the LUT when S = 2 is stored. For other second factors S, they may be obtained by a shift operation. In this case, f(S, diffY[i][j][k]) may be realized by the formulas shown in the above formulas (9) and (10).
[0689] In the embodiments of the present application, when the second factor is equal to 2, the target offset amount is equal to 0; when the second factor is equal to 4, the target offset amount is equal to 1; when the second factor is equal to 8, the target offset amount is equal to 2. And in order to determine the third value, a right shift operation of the target offset amount may be performed on the reference sample value of the first color component.
[0690] Note that for f(S, diffY[i][j][k]), its implementation method is not limited to formula (8) or formula (9), and other implementation methods may also be used, and the embodiments of the present application are not limited either.
[0691] Furthermore, in some embodiments, the step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value may include the following steps.
[0692] Determine a second product value according to the second factor and the weight index value.
[0693] Determine the corresponding fourth value under the first setting mapping relationship of the second product value, and set the weighting coefficient equal to the fourth value.
[0694] In a specific embodiment, the step of determining the corresponding fourth value under the first setting mapping relationship of the second product value may include the following steps.
[0695] Determine the first factor.
[0696] Determine the fifth value using the second setting mapping relationship according to the second product value.
[0697] Calculate the third product value of the first factor and the fifth value.
[0698] Set the fourth value equal to the corresponding value under the preset mapping relationship of the third product value.
[0699] In the embodiments of the present application, the first factor may be represented by ModelScale, the second factor may be represented by S, and the weight index value may be represented by index.
[0700] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship is a numerical mapping lookup table of the second factor, the weight index value, and the weighting factor. That is, in the embodiments of the present application, the decoding side may preset the corresponding lookup table (Look Up Table, LUT). In combination with index, the corresponding weighting factor may be determined by the lookup table. Exemplarily, the weighting factor cWeightInt[i][j][k] may be represented by the mapping relationship shown in the above formula (11).
[0701] Regarding the first setting mapping relationship, in some embodiments, the first setting mapping relationship may be a setting function relationship. The inputs of the function are index and S, and the output is the weighting factor. Exemplarily, the weighting factor cWeightInt[i][j][k] may be represented by the function relationship shown in the above formula (12).
[0702] JPEG2025520848000242.jpg112168
[0703] S903. Determine the reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block.
[0704] In the embodiments of the present application, the number of input reference pixels predicted based on the weight may be represented by N or may be represented by inSize. Here, the number of input reference pixels predicted based on the weight is the same as the number of reference sample values of the second color component, and it can also be said that N represents the number of reference sample values of the second color component, and N is a positive integer.
[0705] In some embodiments, the step of determining the reference average value of the second color component of the current block according to the reference value of the second color component of the current block may include the step of calculating the average value for the reference values of the second color components of N current blocks to obtain the reference average value of the second color component of the current block.
[0706] In the embodiments of the present application, the reference value of the second color component of the current block may be represented by refC[k], the reference average value of the second color component of the current block may be represented by avgC, and the calculation of avgC is as shown in the above formula (13).
[0707] Regarding the value of N, in some embodiments, the method may further include the step of determining the block type index value according to the dimension parameter of the current block, and determining the value of N using the fifth setting mapping relationship according to the block type index value.
[0708] In a specific embodiment, the fifth setting mapping relationship represents a numerical mapping look-up table between the block type index value and N.
[0709] In addition, in the embodiments of the present application, the block type index value may be represented by wcpSizeId. For different block type index values, there are also differences in the number of input reference pixels predicted based on the weights, that is, the values of N or (inSize) are different.
[0710] Exemplarily, for the current block where Min(W,H) <= 4, it is determined that the block type index value is equal to 0. For the current block where Min(W,H) > 4 && Min(W,H) <= 16, it is determined that the block type index value is equal to 1. For the current block where Min(W,H) > 16, it is determined that the block type index value is equal to 2. Or, for the current block where Min(W,H) < 128, it is determined that the block type index value is equal to 0. For the current block where Min(W,H) >= 128 && Min(W,H) <= 256, it is determined that the block type index value is equal to 1. For the current block where Min(W,H) > 256, it is determined that the block type index value is equal to 2. This is not limited to anything. Exemplarily, Table 8 and Table 9 above show the correspondence between the block type index value and the value of N (inSize), respectively.
[0711] Furthermore, for the reference sample value of the second color component of the current block, in some embodiments, the step of determining the reference sample value of the second color component of the current block according to the reference value and the reference average value of the second color component of the current block may include the following steps.
[0712] Subtract the reference value of the second color component of the current block from the reference average value of the second color component of the current block to obtain the reference sample value of the second color component of the current block.
[0713] In the embodiments of the present application, for N pieces of reference chromaticity information refC, its average value avgC is calculated, and then the reference chromaticity difference vector diffC is obtained by subtracting the N pieces of reference chromaticity information refC from the average value avgC. Specifically, the calculation of diffC is as shown in the above formula (14).
[0714] S904. Determine the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient.
[0715] S905. Determine the predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0716] Note that after determining the reference average value avgC of the second color component of the current block, the reference sample value diffC[k] of the second color component of the current block, and the corresponding weighting coefficient cWeightInt[i][j][k], the predicted value of the second color component sampling point in the current block can be further determined.
[0717] In some embodiments, the step of determining the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient may include the following steps.
[0718] Determine the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient.
[0719] Set the total weighted value of the pixel to be predicted in the current block to be equal to the sum of the N weighted values, and set the total coefficient value of the pixel to be predicted in the current block to be equal to the sum of the N weighting coefficients. Here, N represents the number of reference sample values of the second color component, and N is a positive integer.
[0720] Determine the sixth value using the fourth setting mapping relationship according to the total weighted value and the total coefficient value.
[0721] Add the reference average value of the second color component and the sixth value to obtain the predicted value of the second color component of the pixel to be predicted in the current block.
[0722] According to the predicted value of the second color component of the pixel to be predicted in the current block, determine the predicted value of the second color component sampling point in the current block.
[0723] In the embodiment of the present application, when the number of reference sample values of the second color component is N, first, determine the weighted value (i.e., subC[i][j][k]) of the weighted coefficient corresponding to each reference sample value of the second color component. Next, perform an addition operation on these N weighted values to obtain the total weighted value of the pixel to be predicted in the current block, which may be represented by calVal. Specifically, the calculation formula is as shown in the above formulas (15) and (16).
[0724] In the embodiment of the present application, for the N weighted coefficients corresponding to the pixel to be predicted in the current block, perform an addition operation on these N weighted coefficients to obtain the total coefficient value of the pixel to be predicted in the current block, which may be represented by sum. Specifically, the calculation formula is as shown in the above formula (17).
[0725] Furthermore, in some embodiments, the step of determining the sixth value using the fourth setting mapping relationship according to the total weighted value and the total coefficient value may include the following steps.
[0726] Determine the setting offset amount.
[0727] According to the total coefficient value, determine the first numerical value using the sixth setting mapping relationship. According to the total coefficient value and the first numerical value, determine the array index value using the seventh setting mapping relationship. According to the array index value and the setting offset amount, determine the second numerical value using the eighth setting mapping relationship.
[0728] When the array index value is equal to zero, determine the third numerical value according to the first numerical value, and determine the first offset amount according to the third numerical value and the setting offset amount.
[0729] Determine a fourth product value according to the second numerical value and the weighted total value, determine a set addition value according to the third numerical value and the set offset amount, perform an addition operation on the fourth product value and the set addition value, and obtain a target total value.
[0730] Perform a right shift operation on the target total value by the first offset amount to determine a sixth value.
[0731] In the embodiments of the present application, the set offset amount may be represented by Shift, the array index value may be represented by normDiff, the first numerical value may be represented by x, the second value may be represented by v, the third value may be represented by y, and the set addition value may be represented by add. In a specific embodiment, the value of Shift may be set to 5, but it is not particularly limited.
[0732] In the embodiments of the present application, for the calculation of the first numerical value, the sixth setting mapping relationship may be as shown in the above formula (18).
[0733] Here, for the calculation of the first numerical value, first, determine the logarithm value with base 2 of the coefficient total value, and then determine the largest integer value less than or equal to the logarithm value. The largest integer value determined here may be the first numerical value, or the first numerical value may be set equal to the number obtained by subtracting 1 from the number of binary symbols required for the binary representation of the coefficient total value, or perform a binary right shift operation on the coefficient total value, determine the right shift bit number when the numerical value after the right shift is equal to 0, and then the first numerical value may be set equal to the number obtained by subtracting 1 from the right shift bit number, etc., but the embodiments of the present application are not limited to anything.
[0734] In some embodiments, the step of determining the array index value using the seventh setting mapping relationship according to the coefficient total value and the first numerical value may include using the coefficient total value and the first numerical value as inputs to a setting function relationship and outputting the array index value according to the setting function relationship.
[0735] In the embodiment of the present application, the calculation of the array index value may be represented by the above formula (19). However, Func() is a function related to Shift, and the above formula (20) shows one specific form of Func().
[0736] In some embodiments, the step of determining the second numerical value using the eighth setting mapping relationship according to the array index value and the set offset amount may include the following steps.
[0737] According to the array index value, determine an index indication value in the array mapping table.
[0738] According to the index indication value and the set offset amount, determine the second numerical value using the eighth setting mapping relationship.
[0739] In the embodiment of the present application, the array mapping table is represented by DivSigTable. In that case, the corresponding index indication value of the array index value normDiff in DivSigTable is DivSigTable[normDiff]. Exemplarily, according to DivSigTable[normDiff] and Shift, the eighth setting mapping relationship is as shown in the above formula (21).
[0740] In some embodiments, when determining whether the array index value is equal to zero, the step of determining the third numerical value according to the first numerical value may include the following steps.
[0741] When the array index value is equal to zero, set the third numerical value equal to the first numerical value.
[0742] When the array index value is not equal to zero, set the third numerical value equal to the sum of the first numerical value and 1.
[0743] In the embodiment of the present application, the first numerical value is represented by x, and the third numerical value is represented by y. Exemplarily, it may be represented by the above formula (22).
[0744] In the embodiments of the present application, for the set addition value, in the step of determining the set addition value according to the third numerical value and the set offset amount, the calculation formula thereof is as shown in the above formula (23).
[0745] In the embodiments of the present application, the first offset amount is determined by the third numerical value and the set offset amount. Exemplarily, the first offset amount is obtained by performing an addition operation on the third numerical value and the set offset amount. That is, the first offset amount may be y + Shift.
[0746] Thus, assuming that the sixth value is represented by C, the sixth value may be represented by the above formula (24).
[0747] Furthermore, regarding the determination of the predicted value of the second color component of the pixel to be predicted in the current block, assuming that the pixel to be predicted is (i, j), the predicted value of the second color component of the pixel to be predicted in the current block is C pred [i][j]. In this case, an addition operation may be performed according to the reference average value of the second color component and the sixth value to obtain the predicted value of the second color component of the pixel to be predicted in the current block. The calculation formula thereof is as shown in the above formula (25).
[0748] Furthermore, in the embodiments of the present application, C pred [i][j] generally needs to be limited within a preset range. Therefore, in some embodiments, the method may further include the step of performing a correction operation on the predicted value of the second color component of the pixel to be predicted and using the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block.
[0749] In the embodiments of the present application, the preset range may be between 0 and (1 << BitDepth) - 1. However, BitDepth is the bit depth required for the chrominance component. When the predicted value exceeds the value within the preset range, it is necessary to perform a corresponding correction operation on the predicted value. Exemplarily, C predA clamping operation may be performed on [i][j], specifically as follows.
[0750] C pred If the value of [i][j] is less than 0, set it to 0.
[0751] C pred If the value of [i][j] is greater than or equal to 0 and less than or equal to (1<<BitDepth)-1, it is equal to C pred equal to [i][j].
[0752] C pred If the value of [i][j] is greater than (1<<BitDepth)-1, set it to (1<<BitDepth)-1.
[0753] In this way, after performing the correction process on the predicted value, it can be guaranteed that all the predicted values of the second color component of the pixels to be predicted in the current block are between 0 and (1<<BitDepth)-1.
[0754] Furthermore, after determining the predicted value, under specific conditions, in order to obtain the final chrominance predicted value, it is necessary to perform a post-processing operation and then use it as the final chrominance predicted value. Therefore, in some embodiments, the step of determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted may include the following steps.
[0755] Perform filtering processing on the predicted value of the second color component of the pixel to be predicted to determine the predicted value of the second color component sampling point in the current block.
[0756] In the embodiments of the present application, the predicted value of the second color component of the pixel to be predicted includes the predicted values of at least some of the second color component sampling points in the current block. In other words, according to the first predicted block constituted by the predicted value of the second color component of the pixel to be predicted, the first predicted block includes the predicted values of at least some of the second color component sampling points in the current block.
[0757] In addition, in the embodiments of the present application, when the first prediction block includes prediction values of some second color component sampling points in the current block, in order to obtain the final second prediction block, it is necessary to perform upsampling filtering on the first prediction block. Therefore, in some embodiments, the method may further include performing an upsampling filtering process on the first prediction block and determining a second prediction block of the second color component of the current block.
[0758] In addition, in the embodiments of the present application, the number of prediction values of the second color component included in the first prediction block is the same as the number of second color component sampling points included in the current block. However, when the prediction values of the second color component sampling points of the current block are not included, it is necessary to enhance the prediction values using filtering in order to obtain the final second prediction block. Therefore, in some embodiments, the method may further include performing a filtering enhancement process on the first prediction block and determining a second prediction block of the second color component of the current block.
[0759] In addition, in the embodiments of the present application, when the first prediction block includes prediction values of all second color component sampling points in the current block, there is no need to perform any processing on the first prediction block, and the first prediction block may be directly used as the final second prediction block.
[0760] That is, the first prediction block may include prediction values of at least some second color component sampling points in the current block. Here, when the first prediction block includes prediction values of all second color component sampling points in the current block, the prediction values of the second color component sampling points in the current block may be set equal to the values of the first prediction block. When the first prediction block includes prediction values of some second color component sampling points in the current block, upsampling filtering may be performed on the values of the first prediction block, and the prediction values of the second color component sampling points in the current block may be set equal to the output values after the upsampling filtering.
[0761] Thus, after the above operations, the second prediction block includes the predicted values of all the second color component sampling points in the current block. Thus, the weight-based chrominance prediction output predWcp needs to be post-processed to be the final chrominance prediction value predSamples under specific conditions; otherwise, the final chrominance prediction value predSamples is predWcp.
[0762] In some embodiments, after determining the predicted values of the second color component sampling points in the current block, the step of determining the prediction difference values of the second color component sampling points in the current block according to the predicted values of the second color component sampling points in the current block may include the following steps.
[0763] Obtain the original values of the second color component sampling points in the current block.
[0764] Determine the prediction difference values of the second color component sampling points in the current block according to the original values of the second color component sampling points in the current block and the predicted values of the second color component sampling points in the current block.
[0765] Furthermore, in some embodiments, the method may further include the step of encoding the prediction difference values of the second color component sampling points in the current block and writing the obtained encoded bits into the code stream.
[0766] In the embodiments of the present application, after determining the predicted value of the second color component sampling point in the current block, the predicted difference value of the second color component sampling point can be determined according to the original value of the second color component sampling point and the predicted value of the second color component sampling point. Specifically, the predicted difference value of the second color component sampling point in the current block can be determined by subtracting the original value of the second color component sampling point from the predicted value of the second color component sampling point. In this way, after writing the predicted difference value of the second color component sampling point into the code stream, on the decoding side, by decoding, the predicted difference value of the second color component sampling point can be obtained, and thereby, the reconstructed value of the second color component sampling point in the current block can be restored.
[0767] It is understood that the embodiments of the present application further provide a code stream, which is generated by bit encoding according to the information to be encoded, and the information to be encoded includes at least the predicted difference value of the second color component sampling point in the current block.
[0768] It is understood that the embodiments of the present application are the optimization of floating-point operations in the WCP prediction technology process and are realized using integer operations. On the one hand, the optimal integer operation displacement amount is adaptively selected by fully utilizing the content characteristics of the current block. On the other hand, the accuracy of the WCP prediction technology is fully guaranteed. On the other hand, the characteristics of the weight model are fully considered and the integer operation process is reasonably designed. Thereby, on the premise of ensuring the accuracy of the WCP prediction technology to a certain extent, the calculation complexity of the WCP prediction technology can be reduced.
[0769] The embodiment of the present application further provides an encoding method, which determines the reference value of the first color component of the current block and the reference value of the second color component of the current block, determines a weighting coefficient according to the reference value of the first color component of the current block, determines the reference average value of the second color component of the current block according to the reference value of the second color component of the current block, determines the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, and determines the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient. By determining the predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block, it is necessary to construct a luminance difference vector based on the color component reference information in the adjacent area of the current block and the color component reconstruction information in the current block. Thus, not only is the weighting coefficient determined, but it is also necessary to determine the chromaticity average value according to the chromaticity reference information, determine the chromaticity difference vector according to the chromaticity reference information and the chromaticity average value, and further determine the chromaticity predicted value by adding the chromaticity average value according to the chromaticity difference vector and the corresponding weighting coefficient. In this way, by optimizing the calculation process of chromaticity prediction based on weights, integer arithmetic can be fully adopted, and moreover, the characteristics of the weight model can be fully considered, the integer arithmetic process can be reasonably optimized, the accuracy of chromaticity prediction can be fully guaranteed, the calculation complexity can be reduced, the encoding / decoding efficiency can be improved, and further the encoding / decoding performance can be improved.
[0770] In still another embodiment of the present application, based on the same inventive concept as the above embodiment, referring to FIG. 10, FIG. 10 is a diagram showing the configuration structure of an encoding apparatus 310 according to an embodiment of the present application. As shown in FIG. 10, the encoding apparatus 310 may include a first determination unit 3101, a first calculation unit 3102, and a first prediction unit 3103. Here,
[0771] The first determination unit 3101 is configured to determine a reference value of a first color component of a current block and a reference value of a second color component of the current block, and determine a weighting coefficient according to the reference value of the first color component of the current block.
[0772] The first calculation unit 3102 is configured to determine a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block.
[0773] The first prediction unit 3103 is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient.
[0774] The first determination unit 3101 is further configured to determine a predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0775] In some embodiments, the first determination unit 3101 is further configured to obtain an original value of the second color component sampling point in the current block, and determine a predicted difference value of the second color component sampling point in the current block according to the original value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block.
[0776] In some embodiments, referring to FIG. 10, the encoding device 310 may further include an encoding unit 3104. The encoding unit 3104 is configured to encode the predicted difference value of the second color component sampling point in the current block and write the obtained encoded bits into the code stream.
[0777] In the embodiments of the present application, it is understood that the "unit" may be some circuits, some processors, some programs or software, etc. Of course, it may also be a module or non-modularized. Furthermore, each component in this embodiment may be integrated into one processing unit, each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be realized in the form of hardware or in the form of a software function module.
[0778] If the above integrated unit is not sold or used as an independent product but is realized in the form of a software function module, it may be stored in a computer-readable storage medium. Based on such an understanding, the part that essentially contributes to the prior art in the technical solution of this embodiment, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium, and the storage medium contains several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The above storage medium includes various media that can store program codes, such as a USB disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0779] Therefore, the embodiments of the present application provide a computer-readable storage medium applied to the encoding device 310, in which a computer program is stored, and when the computer program is executed by a first processor, the steps of the method described in any of the above embodiments are realized.
[0780] Based on the configuration of the above-described encoding device 310 and the computer-readable storage medium, referring to FIG. 11, FIG. 11 is a diagram showing the configuration structure of an encoding device 320 according to an embodiment of the present application. As shown in FIG. 11, the encoding device 320 may include a first communication interface 3201, a first memory 3202, and a first processor 3203. Each assembly is coupled via a first bus system 3204. It is understood that the first bus system 3204 is used to realize connection communication between these assemblies. The first bus system 3204 includes a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clear explanation, in FIG. 11, various buses are denoted as the first bus system 3204. Here,
[0781] The first communication interface 3201 is used to receive and transmit signals in the process of sending and receiving information with other external network elements.
[0782] The first memory 3202 is used to store a computer program executable on the first processor 3203.
[0783] When the computer program is executed, the first processor 3203
[0784] determines a reference value of a first color component of the current block and a reference value of a second color component of the current block,
[0785] determines a weighting coefficient according to the reference value of the first color component of the current block, and
[0786] determines a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determines a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, and
[0787] Determining a predicted value of a second color component sampling point in a current block according to a reference average value of a second color component of the current block, a reference sample value of the second color component of the current block, and a corresponding weighting coefficient;
[0788] Determining a predicted difference value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block, and being used to execute the above.
[0789] It is understood that the first memory 3202 in the embodiments of the present application may be a volatile memory, a non-volatile memory, or may include both a volatile memory and a 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 limitation, many forms of RAM can be used, 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 (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synch link dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM). The first memory 3202 of the systems and methods described in the present application is intended to include these and any other suitable types of memory, but is not limited thereto.
[0790] The first processor 3203 may be an integrated circuit chip having a signal processing function. In the implementation process, each step of the above method may be completed by a hardware integrated logic circuit or an instruction in software form in the first processor 3203. The first processor 3203 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware assembly. Each method, step, and logic block diagram disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor, or the processor may be any ordinary processor or the like. When combined with the steps of the method disclosed in the embodiments of the present application, it may be directly embodied by a hardware decoding processor, or the execution may be completed by using a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in this field such as a random memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the first memory 3202, and the first processor 3203 reads the information in the first memory 3202 and combines it with its hardware to complete the steps of the above method.
[0791] It is understood that these embodiments described in the present application may be implemented using hardware, software, firmware, middleware, microcode, or combinations thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processor devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or combinations thereof. For software implementation, the techniques described in the present application may be implemented by modules (e.g., procedures, functions, etc.) for performing the functions described in the present application. The software code may be stored in a memory and executed by a processor. The memory may be implemented within the processor or externally to the processor.
[0792] Optionally, as another embodiment, the first processor 3203 is further configured to execute the method described in any of the above embodiments when executing the computer program.
[0793] This embodiment provides an encoding device, which may further include the encoding apparatus 310 described in the above embodiment. For the encoding device, in order to be based on the color component reference information in the adjacent region of the current block and the color component reconstruction information in the current block, it is necessary to construct a luminance difference vector. Thereby, not only determining the weighting coefficient, but also it is necessary to determine the chrominance average value according to the chrominance reference information, and determine the chrominance difference vector according to the chrominance reference information and the chrominance average value. Further, according to the chrominance difference vector and the corresponding weighting coefficient, by adding the chrominance average value, the chrominance prediction value can be determined. In this way, by optimizing the calculation process of chrominance prediction based on weights, integer arithmetic can be fully adopted, and moreover, the characteristics of the weight model can be fully considered, and the integer arithmetic process can be reasonably optimized, fully guaranteeing the accuracy of chrominance prediction, while reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
[0794] Based on the same inventive concept as the above embodiment, referring to FIG. 12, FIG. 12 is a diagram showing the configuration structure of a decoding apparatus 330 according to an embodiment of the present application. As shown in FIG. 12, the decoding apparatus 330 may include a second determination unit 3301, a second calculation unit 3302, and a second prediction unit 3303. Here,
[0795] The second determination unit 3301 is configured to determine the reference value of the first color component of the current block and the reference value of the second color component of the current block, and determine the weighting coefficient according to the reference value of the first color component of the current block.
[0796] The second calculation unit 3302 is configured to determine the reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determine the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block.
[0797] The second prediction unit 3303 is configured to determine a predicted value of a second color component sampling point in the current block according to a reference average value of the second color component of the current block, a reference sample value of the second color component of the current block, and a corresponding weighting coefficient.
[0798] The second determination unit 3301 is further configured to determine a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block.
[0799] In some embodiments, the second determination unit 3301 is further configured to determine a predicted difference value of the second color component sampling point in the current block, and determine a reconstructed value of the second color component sampling point in the current block according to the predicted difference value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block.
[0800] In some embodiments, referring to FIG. 12, the decoding device 330 may further include a decoding unit 3304. The decoding unit 3304 is configured to analyze the code stream and determine a predicted difference value of the second color component sampling point in the current block.
[0801] In the embodiments of the present application, it is understood that the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc. Of course, it may also be a module or a non-module. Further, each component in this embodiment may be integrated into one processing unit, each unit may exist physically independently, or two or more units may be integrated into one unit. The above integrated unit may be realized in the form of hardware or in the form of a software function module.
[0802] If the above integrated unit is not sold or used as an independent product but is implemented in the form of a software functional module, it may be stored in a computer-readable storage medium. Based on such an understanding, this embodiment provides a computer-readable storage medium applied to the decoding device 330. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a second processor, the steps of the method described in any of the above embodiments are realized.
[0803] Based on the above configuration of the decoding device 330 and the computer-readable storage medium, referring to FIG. 13, FIG. 13 is a diagram showing the configuration structure of a decoding device 340 according to an embodiment of the present application. As shown in FIG. 13, the decoding device 340 may include a second communication interface 3401, a second memory 3402, and a second processor 3403. Each assembly is coupled via a second bus system 3404. It is understood that the second bus system 3404 is used to realize connection communication between these assemblies. The second bus system 3404 includes a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clear description, in FIG. 13, various buses are denoted as the second bus system 3404. Here,
[0804] The second communication interface 3401 is used to receive and transmit signals in the process of sending and receiving information with other external network elements.
[0805] The second memory 3402 is used to store a computer program executable on the second processor 3403.
[0806] The second processor 3403, when the computer program is executed,
[0807] determining a reference value of the first color component of the current block and a reference value of the second color component of the current block,
[0808] Determining a weighting coefficient according to a reference value of a first color component of a current block,
[0809] Determining a reference average value of a second color component of the current block according to a reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block,
[0810] Determining a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and a corresponding weighting coefficient,
[0811] Determining a reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block, and is used to execute.
[0812] Optionally, as another embodiment, the second processor 3403 is further configured to execute the method described in any of the above embodiments when executing the computer program.
[0813] The second memory 3402 has the same hardware functions as the first memory 32 02, and it is understood that the second processor 3403 has the same hardware functions as the first processor 32 03, and this will not be repeated here.
[0814] This embodiment provides a decoding device, and the decoding device is the decoding device 3 described in the above embodiment 30It may further include. For the decoding device, in order to be based on the color component reference information in the adjacent area of the current block and the color component reconstruction information in the current block, it is necessary to construct a luminance difference vector. Thereby, not only determine the weighting coefficient, but also it is necessary to determine the chromaticity average value according to the chromaticity reference information, and determine the chromaticity difference vector according to the chromaticity reference information and the chromaticity average value. Furthermore, according to the chromaticity difference vector and the corresponding weighting coefficient, the chromaticity prediction value can be determined by adding the chromaticity average value. In this way, by optimizing the calculation process of chromaticity prediction based on weights, integer arithmetic can be completely adopted, and moreover, the characteristics of the weight model can be fully considered, the integer arithmetic process can be reasonably optimized, the accuracy of chromaticity prediction can be fully guaranteed, while reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
[0815] In still another embodiment of the present application, referring to FIG. 14, FIG. 14 is a diagram showing the configuration structure of an encoding / decoding system according to an embodiment of the present application. As shown in FIG. 14, the encoding / decoding system 350 may include an encoder 3501 and a decoder 3502. Here, the encoder 3501 may be a device in which the encoding device 310 described in the above embodiment is integrated, or may be the encoding device 320 described in the above embodiment. The decoder 3502 may be a device in which the decoding device 330 described in the above embodiment is integrated, or may be the decoding device 340 described in the above embodiment.
[0816] In the embodiment of the present application, in the encoding / decoding system 350, whether it is the encoder 3501 or the decoder 3502, by optimizing the calculation process of chromaticity prediction based on weights, integer arithmetic can be completely adopted, and moreover, the characteristics of the weight model can be fully considered, the integer arithmetic process can be reasonably optimized, the accuracy of chromaticity prediction can be fully guaranteed, while reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
[0817] In this application, terms such as "comprise" and "include" or any other arbitrary variations are intended to include non-exclusive inclusion, such that a process, method, article, or apparatus that includes a series of elements includes not only these elements but also other elements not explicitly listed or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element limited by the description "including one..." does not exclude the existence of other identical elements in the process, method, article, or apparatus that includes the said element.
[0818] The numbers of the above-mentioned embodiments of this application are for illustrative purposes only and do not represent the superiority or inferiority of the embodiments.
[0819] The methods disclosed in some method embodiments provided by this application may, in the absence of conflicts, be arbitrarily combined to obtain new method embodiments.
[0820] The features disclosed in some product embodiments provided by this application may, in the absence of conflicts, be arbitrarily combined to obtain new product embodiments.
[0821] The features disclosed in some method embodiments or device embodiments provided by this application may, in the absence of conflicts, be arbitrarily combined to obtain new method embodiments or device embodiments.
[0822] The above are only specific embodiments of this application, and the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of this application are all included within the technical scope of this application. Therefore, the protection scope of this application shall be based on the scope described in the claims.
Industrial Applicability
[0823] In the embodiments of the present application, whether it is the encoding side or the decoding side, the reference value of the first color component of the current block and the reference value of the second color component of the current block are determined. According to the reference value of the first color component of the current block, a weighting coefficient is determined. According to the reference value of the second color component of the current block, the reference average value of the second color component of the current block is determined. According to the reference value of the second color component of the current block and the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block is determined. According to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient, the predicted value of the second color component sampling point in the current block is determined. Thus, on the encoding side, according to the predicted value of the second color component sampling point of the current block, the predicted difference value of the second color component sampling point in the current block can be determined. Thereby, on the decoding side, after decoding and obtaining the predicted difference value of the second color component sampling point of the current block, it can be combined with the predicted value of the second color component sampling point in the current block to determine the reconstructed value of the second color component sampling point of the current block. That is, to be based on the color component reference information in the adjacent region of the current block and the color component reconstruction information within the current block, it is necessary to construct a luminance difference vector. Thereby, not only the weighting coefficient is determined, but also it is necessary to determine the chrominance average value according to the chrominance reference information, and determine the chrominance difference vector according to the chrominance reference information and the chrominance average value. Furthermore, according to the chrominance difference vector and the corresponding weighting coefficient, by adding the chrominance average value, the chrominance predicted value can be determined. In this way, by optimizing the calculation process of chrominance prediction based on weights, integer arithmetic can be fully adopted. Moreover, the characteristics of the weight model can be fully considered, and the integer arithmetic process can be reasonably optimized, fully guaranteeing the accuracy of chrominance prediction, while reducing the calculation complexity, improving the encoding / decoding efficiency, and further improving the encoding / decoding performance.
Claims
1. A decoding method, comprising: determining a reference value of a first color component of a current block and a reference value of a second color component of the current block; determining a weighting coefficient according to the reference value of the first color component of the current block; determining a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block; determining a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient; determining a reconstructed value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block; and a decoding method.
2. The step of determining a reference value of a first color component of a current block and a reference value of a second color component of the current block includes: determining a reference value of the first color component of the current block according to the values of first color component sampling points in an adjacent region of the current block; determining a reference value of the second color component of the current block according to the values of second color component sampling points in an adjacent region of the current block; and the adjacent region includes at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region. The method according to Claim 1.
3. The step of determining a reference value of the first color component of the current block according to the values of first color component sampling points in an adjacent region of the current block includes: performing a first filtering process on the values of first color component sampling points in an adjacent region of the current block, and determining a reference value of the first color component of the current block. The method according to Claim 2.
4. The first filtering process is a downsampling filtering process. The method according to Claim 3.
5. The step of determining a reference value of the second color component of the current block according to the values of second color component sampling points in an adjacent region of the current block includes: A step of performing a second filtering process on the value of the second color component sampling point in the adjacent area of the current block and determining a reference value of the second color component of the current block is included. The method according to claim 2.
6. The second filtering process is an upsampling filtering process. The method according to claim 5.
7. The step of determining a weighting coefficient according to the reference value of the first color component of the current block includes: a step of determining a reconstructed value of the first color component sampling point in the current block; a step of determining a reference sample value of the first color component of the current block according to the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block; a step of determining the weighting coefficient according to the reference sample value of the first color component of the current block. It includes. The method according to claim 1.
8. The step of determining a reference sample value of the first color component of the current block according to the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block includes: a step of determining a difference value between the reconstructed value of the first color component sampling point in the current block and the reference value of the first color component of the current block; a step of determining a reference sample value of the first color component of the current block according to the difference value. It includes. The method according to claim 7.
9. The step of determining a reference sample value of the first color component of the current block according to the difference value includes: a step of setting the reference sample value of the first color component of the current block to be equal to the absolute value of the difference value. The method according to claim 8.
10. The step of determining a weighting coefficient according to the reference sample value of the first color component of the current block includes: a step of determining a weight index value according to the reference sample value of the first color component of the current block; a step of determining the weighting coefficient using a first setting mapping relationship according to the weight index value. It includes. The method according to claim 7.
11. The step of determining a weight index value according to the reference sample value of the first color component of the current block includes: a step of determining the maximum weight index value and the minimum weight index value of the current block. performing a correction process on the reference sample value of the first color component according to the maximum weight index value and the minimum weight index value, and determining the weight index value; including the method according to claim 10.
12. The step of determining the weighting factor using the first setting mapping relationship according to the weight index value includes: the step that the first setting mapping relationship is a numerical mapping lookup table of the weight index value and the weighting factor; the method according to claim 10.
13. The step of determining the weighting factor using the first setting mapping relationship according to the weight index value includes: determining a first value corresponding to the weight index value under the first setting mapping relationship; setting the weighting factor equal to the first value; including the method according to claim 10.
14. The step of determining a first value corresponding to the weight index value under the first setting mapping relationship includes: determining a first factor; determining a second value using a second setting mapping relationship according to the weight index value; calculating a first product value of the first factor and the second value; setting the first value equal to the corresponding value under the first setting mapping relationship of the first product value; including the method according to claim 13.
15. The second setting mapping relationship is an exponential function relationship based on n, where the value of n is equal to the weight index value; the method according to claim 14.
16. The step of determining a first factor includes: the step that the first factor is a preset constant value; the method according to claim 14.
17. The step of determining a first factor includes: determining the value of the first factor according to the dimension parameter of the current block; the dimension parameter of the current block includes at least one of the width of the current block and the height of the current block; the method according to claim 14.
18. The step of determining the weight index value according to the reference sample value of the first color component of the current block includes: determining a second factor; determining the weight index value according to the reference sample value of the first color component of the current block and the second factor; including The method according to claim 10.
19. The step of determining the second factor includes the step that the second factor is a preset constant value. The method according to claim 18.
20. The step of determining the second factor includes the step of determining the value of the second factor according to the dimension parameters of the current block, wherein the dimension parameters of the current block include at least one of the width of the current block and the height of the current block. The method according to claim 18.
21. The step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor includes the step of determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor, the step of determining the maximum weight index value and the minimum weight index value of the current block, and the step of performing a correction process on the third value according to the maximum weight index value and the minimum weight index value to determine the weight index value. and includes The method according to claim 18.
22. The step of determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor includes the step of determining at least one shift array, the step of determining a target offset amount from the at least one shift array according to the second factor, and the step of performing a right shift operation of the target offset amount on the reference sample value of the first color component to determine the third value. and includes The method according to claim 21.
23. The step of determining the weighting coefficient using a first setting mapping relationship according to the weight index value includes the step of determining a second product value according to the second factor and the weight index value, the step of determining a corresponding fourth value of the second product value under the first setting mapping relationship, and the step of setting the weighting coefficient equal to the fourth value. and includes The method according to claim 18.
24. The step of determining a corresponding fourth value of the second product value under the first setting mapping relationship includes the step of determining a first factor, the step of determining a fifth value using a second setting mapping relationship according to the second product value, and the step of calculating a third product value of the first factor and the fifth value. a step of setting the fourth value equal to a corresponding value under the first setting mapping relationship of the third product value; including the method according to claim 23.
25. The step of determining a predicted value of a second color component sampling point in the current block according to a reference average value of a second color component of the current block, a reference sample value of the second color component of the current block, and the corresponding weighting coefficient includes: a step of determining a weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; a step of setting a total weighted value of a pixel to be predicted in the current block equal to the sum of the N weighted values, and setting a total coefficient value of the pixel to be predicted in the current block equal to the sum of the N weighting coefficients, where N represents the number of reference sample values of the second color component, and N is a positive integer; a step of determining a sixth value using a fourth setting mapping relationship according to the total weighted value and the total coefficient value; a step of adding the reference average value of the second color component and the sixth value to obtain a predicted value of the second color component of the pixel to be predicted in the current block; a step of determining a predicted value of a second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block; including the method according to claim 1.
26. The predicted value of the second color component of the pixel to be predicted includes predicted values of at least some second color component sampling points in the current block. the method according to claim 25.
27. The step of determining a reference average value of a second color component of the current block according to a reference value of the second color component of the current block includes: a step of calculating an average value for N reference values of the second color component of the current block to obtain the reference average value of the second color component of the current block. the method according to claim 1.
28. The method includes a step of determining a block type index value according to a dimension parameter of the current block; a step of determining a value of N using a fifth setting mapping relationship according to the block type index value; further includes the method according to claim 27.
29. The fifth setting mapping relationship represents a numerical mapping look-up table between the block type index value and N. the method according to claim 28.
30. The step of determining the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block is as follows: It includes the step of subtracting the reference value of the second color component of the current block from the reference average value of the second color component of the current block to obtain the reference sample value of the second color component of the current block. The method according to claim 1.
31. The step of determining the sixth value using the fourth setting mapping relationship according to the weighted total value and the coefficient total value is as follows: The step of determining the setting offset amount; According to the coefficient total value, use the sixth setting mapping relationship to determine the first numerical value, according to the coefficient total value and the first numerical value, use the seventh setting mapping relationship to determine the array index value, and according to the array index value and the setting offset amount, use the eighth setting mapping relationship to determine the second numerical value; When the array index value is equal to zero, determine the third numerical value according to the first numerical value, and determine the first offset amount according to the third numerical value and the setting offset amount; Determine the fourth product value according to the second numerical value and the weighted total value, determine the setting addition value according to the third numerical value and the setting offset amount, perform an addition operation on the fourth product value and the setting addition value to obtain the target total value; Perform a right shift operation of the first offset amount on the target total value to determine the sixth value; It includes; The method according to claim 25.
32. The step of determining the first numerical value using the sixth setting mapping relationship according to the coefficient total value is as follows: It includes the step of setting the first numerical value equal to one less than the number of bits of the binary symbol required for the binary representation of the coefficient total value. The method according to claim 31.
33. The step of determining the array index value using the seventh setting mapping relationship according to the coefficient total value and the first numerical value is as follows: It includes the step of using the coefficient total value and the first numerical value as the input of the setting function relationship and outputting the array index value according to the setting function relationship. The method according to claim 31.
34. The step of determining the second numerical value using the eighth setting mapping relationship according to the array index value and the setting offset amount is as follows: A step of determining an index indication value in an array mapping table according to the array index value; A step of determining the second numerical value using the eighth setting mapping relationship according to the index indication value and the set offset amount; including The method according to claim 31.
35. When it is determined whether the array index value is equal to zero, the step of determining a third numerical value according to the first numerical value is When the array index value is equal to zero, setting the third numerical value equal to the first numerical value; When the array index value is not equal to zero, setting the third numerical value equal to the sum value of the first numerical value and 1; including The method according to claim 31.
36. The method is further including a step of performing a correction operation on the predicted value of the second color component of the pixel to be predicted, and setting the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block. The method according to claim 25.
37. When determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block, the step is including a step of performing filtering processing on the predicted value of the second color component of the pixel to be predicted, and determining the predicted value of the second color component sampling point in the current block. The method according to claim 25.
38. When determining the reconstructed value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block, the step is a step of determining the predicted difference value of the second color component sampling point in the current block; a step of determining the reconstructed value of the second color component sampling point in the current block according to the predicted difference value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block; including The method according to any one of claims 1 to 33.
39. An encoding method, a step of determining a reference value of the first color component of the current block and a reference value of the second color component of the current block; a step of determining a weighting coefficient according to the reference value of the first color component of the current block; Determining a reference average value of a second color component of the current block according to a reference value of the second color component of the current block, and determining a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block; Determining a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and a corresponding weighting coefficient; Determining a predicted difference value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block; including an encoding method. [
40. ] The steps of determining a reference value of a first color component of the current block and a reference value of the second color component of the current block include: determining a reference value of the first color component of the current block according to values of first color component sampling points in an adjacent region of the current block; determining a reference value of the second color component of the current block according to values of second color component sampling points in an adjacent region of the current block; including the adjacent region includes at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region. The method according to claim 39. [
41. ] The step of determining a reference value of the first color component of the current block according to values of first color component sampling points in an adjacent region of the current block includes: performing a first filtering process on values of first color component sampling points in an adjacent region of the current block, and determining a reference value of the first color component of the current block. The method according to claim 40. [
42. ] The first filtering process is a downsampling filtering process. The method according to claim 41. [
43. ] The step of determining a reference value of the second color component of the current block according to values of second color component sampling points in an adjacent region of the current block includes: performing a second filtering process on values of second color component sampling points in an adjacent region of the current block, and determining a reference value of the second color component of the current block. The method according to claim 40. [
44. ] The second filtering process is an upsampling filtering process. The method according to claim 43.
45. The step of determining the weighting coefficient according to the reference value of the first color component of the current block includes: determining a reconstruction value of the first color component sampling points in the current block; determining a reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block; determining the weighting coefficient according to the reference sample value of the first color component of the current block. The method according to claim 39.
46. The step of determining the reference sample value of the first color component of the current block according to the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block includes: determining a difference value between the reconstruction value of the first color component sampling points in the current block and the reference value of the first color component of the current block; determining the reference sample value of the first color component of the current block according to the difference value. The method according to claim 45.
47. The step of determining the reference sample value of the first color component of the current block according to the difference value includes: setting the reference sample value of the first color component of the current block to be equal to the absolute value of the difference value. The method according to claim 46.
48. The step of determining the weighting coefficient according to the reference sample value of the first color component of the current block includes: determining a weight index value according to the reference sample value of the first color component of the current block; determining the weighting coefficient using a first set mapping relationship according to the weight index value. The method according to claim 45.
49. The step of determining the weight index value according to the reference sample value of the first color component of the current block includes: determining the maximum weight index value and the minimum weight index value of the current block; performing a correction process on the reference sample value of the first color component according to the maximum weight index value and the minimum weight index value, and determining the weight index value. The method according to claim 49.
50. The step of determining the weighting coefficient using a first set mapping relationship according to the weight index value is: The step that the first setting mapping relationship is a numerical mapping look-up table of the weight index value and the weighting coefficient is included. The method according to claim 48.
51. The step of determining the weighting coefficient using the first setting mapping relationship according to the weight index value includes: Determining a first value corresponding to the weight index value under the first setting mapping relationship; Setting the weighting coefficient equal to the first value; and includes. The method according to claim 48.
52. The step of determining a first value corresponding to the weight index value under the first setting mapping relationship includes: Determining a first factor; Determining a second value using a second setting mapping relationship according to the weight index value; Calculating a first product value of the first factor and the second value; Setting the first value equal to the corresponding value under the first setting mapping relationship of the first product value; and includes. The method according to claim 51.
53. The second setting mapping relationship is an exponential function relationship based on n, where the value of n is equal to the weight index value. The method according to claim 52.
54. The step of determining a first factor includes: The step that the first factor is a preset constant value. The method according to claim 52.
55. The step of determining a first factor includes: Determining the value of the first factor according to the dimension parameter of the current block, The dimension parameter of the current block includes at least one of the width of the current block and the height of the current block. The method according to claim 52.
56. The step of determining the weight index value according to the reference sample value of the first color component of the current block includes: Determining a second factor; Determining the weight index value according to the reference sample value of the first color component of the current block and the second factor; and includes. The method according to claim 48.
57. The step of determining a second factor includes: The step that the second factor is a preset constant value. The method according to claim 56.
58. The step of determining a second factor includes: Determining the value of the second factor according to the dimension parameter of the current block, The dimension parameters of the current block include at least one of the width of the current block and the height of the current block. The method according to claim 56.
59. The step of determining the weight index value according to the reference sample value of the first color component of the current block and the second factor includes: Determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor; Determining the maximum weight index value and the minimum weight index value of the current block; Performing a correction process on the third value according to the maximum weight index value and the minimum weight index value to determine the weight index value. Including The method according to claim 56.
60. The step of determining a third value using a third setting mapping relationship according to the reference sample value of the first color component and the second factor includes: Determining at least one shift array; Determining a target offset amount from the at least one shift array according to the second factor; Performing a right shift operation of the target offset amount on the reference sample value of the first color component to determine the third value. Including The method according to claim 59.
61. The step of determining the weighting coefficient using a first setting mapping relationship according to the weight index value includes: Determining a second product value according to the second factor and the weight index value; Determining a corresponding fourth value of the second product value under the first setting mapping relationship; Setting the weighting coefficient equal to the fourth value. Including The method according to claim 56.
62. The step of determining a corresponding fourth value of the second product value under the first setting mapping relationship includes: Determining a first factor; Determining a fifth value using a second setting mapping relationship according to the second product value; Calculating a third product value of the first factor and the fifth value; Setting the fourth value equal to a corresponding value of the third product value under the first setting mapping relationship. Including The method according to claim 61.
63. The step of determining the predicted value of the second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient is as follows: Determining the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; Setting the total weighted value of the pixels to be predicted in the current block to be equal to the sum of the N weighted values, and setting the total coefficient value of the pixels to be predicted in the current block to be equal to the sum of the N weighting coefficients, where N represents the number of reference sample values of the second color component, and N is a positive integer; Determining a sixth value using a fourth setting mapping relationship according to the total weighted value and the total coefficient value; Adding the reference average value of the second color component and the sixth value to obtain the predicted value of the second color component of the pixel to be predicted in the current block; Determining the predicted value of the second color component sampling point in the current block according to the predicted value of the second color component of the pixel to be predicted in the current block; including: The method according to claim 39.
64. The predicted value of the second color component of the pixel to be predicted includes the predicted values of at least some of the second color component sampling points in the current block. The method according to claim 63.
65. The step of determining the reference average value of the second color component of the current block according to the reference value of the second color component of the current block includes: Calculating the average value of the N reference values of the second color component of the current block to obtain the reference average value of the second color component of the current block. The method according to claim 39.
66. The method further includes: Determining a block type index value according to the dimension parameter of the current block; Determining the value of N using a fifth setting mapping relationship according to the block type index value. further including: The method according to claim 65.
67. The fifth setting mapping relationship represents a numerical mapping lookup table between the block type index value and N. The method according to claim 66.
68. The step of determining the reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block is as follows: A step of subtracting a reference value of a second color component of the current block from a reference average value of the second color component of the current block to obtain a reference sample value of the second color component of the current block is included. The method according to claim 39.
69. The step of determining a sixth value using a fourth setting mapping relationship according to the weighted total value and the coefficient total value includes: A step of determining a setting offset amount; According to the coefficient total value, determining a first numerical value using a sixth setting mapping relationship, and according to the coefficient total value and the first numerical value, determining an array index value using a seventh setting mapping relationship, and according to the array index value and the setting offset amount, determining a second numerical value using an eighth setting mapping relationship; When the array index value is equal to zero, determining a third numerical value according to the first numerical value, and determining a first offset amount according to the third numerical value and the setting offset amount; Determining a fourth product value according to the second numerical value and the weighted total value, determining a setting addition value according to the third numerical value and the setting offset amount, performing an addition operation on the fourth product value and the setting addition value to obtain a target total value; Performing a right shift operation of the first offset amount on the target total value to determine the sixth value; Including The method according to claim 63.
70. The step of determining a first numerical value using a sixth setting mapping relationship according to the coefficient total value includes: The step of setting the first numerical value to be equal to one less than the number of bits of the binary symbols required for the binary representation of the coefficient total value. The method according to claim 69.
71. The step of determining an array index value using a seventh setting mapping relationship according to the coefficient total value and the first numerical value includes: Using the coefficient total value and the first numerical value as inputs of a setting function relationship, and outputting the array index value according to the setting function relationship. The method according to claim 69.
72. The step of determining a second numerical value using an eighth setting mapping relationship according to the array index value and the setting offset amount includes: According to the array index value, determining an index indication value in an array mapping table; Determining the second numerical value using the eighth setting mapping relationship according to the index indication value and the set offset amount; comprising The method according to claim 69.
73. When it is determined whether the array index value is equal to zero, the step of determining a third numerical value according to the first numerical value When the array index value is equal to zero, setting the third numerical value equal to the first numerical value; When the array index value is not equal to zero, setting the third numerical value equal to the sum of the first numerical value and 1; comprising The method according to claim 69.
74. The method further includes performing a correction operation on the predicted value of the second color component of the pixel to be predicted, and using the corrected predicted value as the predicted value of the second color component of the pixel to be predicted in the current block. The method according to claim 63.
75. According to the predicted value of the second color component of the pixel to be predicted in the current block, the step of determining the predicted value of the second color component sampling point in the current block including performing a filtering process on the predicted value of the second color component of the pixel to be predicted, and determining the predicted value of the second color component sampling point in the current block. The method according to claim 63.
76. According to the predicted value of the second color component sampling point in the current block, the step of determining the predicted difference value of the second color component sampling point in the current block obtaining the original value of the second color component sampling point in the current block; determining the predicted difference value of the second color component sampling point in the current block according to the original value of the second color component sampling point in the current block and the predicted value of the second color component sampling point in the current block; comprising The method according to any one of claims 39 to 75.
77. The method further includes encoding the predicted difference value of the second color component sampling point in the current block, and writing the obtained encoded bits into the code stream. The method according to claim 76.
78. An encoding device, The encoding device includes a first determination unit, a first calculation unit, and a first prediction unit. The first determination unit determines a reference value of a first color component of the current block and a reference value of a second color component of the current block, and is configured to determine a weighting coefficient according to the reference value of the first color component of the current block. The first calculation unit determines a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and is configured to determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block. The first prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to the reference average value of the second color component of the current block, the reference sample value of the second color component of the current block, and the corresponding weighting coefficient. The first determination unit is further configured to determine a predicted difference value of the second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block. Encoding device.
79. An encoding device, wherein the encoding device includes a first memory and a first processor, the first memory is used to store a computer program executable on the first processor, and the first processor is used to execute the method according to any one of Claims 39 to 77 when executing the computer program. Encoding device.
80. A decoding device, wherein the decoding device includes a second determination unit, a second calculation unit, and a second prediction unit, the second determination unit determines a reference value of a first color component of the current block and a reference value of a second color component of the current block, and is configured to determine a weighting coefficient according to the reference value of the first color component of the current block. The second calculation unit determines a reference average value of the second color component of the current block according to the reference value of the second color component of the current block, and is configured to determine a reference sample value of the second color component of the current block according to the reference value of the second color component of the current block and the reference average value of the second color component of the current block. The second prediction unit is configured to determine a predicted value of a second color component sampling point in the current block according to a reference average value of a second color component of the current block, a reference sample value of the second color component of the current block, and the corresponding weighting coefficient. The second determination unit is further configured to determine a reconstructed value of a second color component sampling point in the current block according to the predicted value of the second color component sampling point in the current block. Decoding device. **Claim 81** A decoding device, wherein the decoding device includes a second memory and a second processor, the second memory is used for storing a computer program executable on the second processor, and the second processor is used for executing the method according to any one of claims 1 to 38 when executing the computer program. Decoding device. **Claim 82** A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 38 or the method according to any one of claims 39 to 77 is realized. Computer-readable storage medium.
Citation Information
Patent Citations
Method for decoding an encoded data stream representing an image sequence and method for encoding an image sequence
JP2013500661A
Video image component prediction method, apparatus and computer storage medium
JP2022501863A
Chroma block prediction method and apparatus
JP2022516180A
Video colour component prediction method and apparatus, and computer storage medium
US20210160505A1
Chroma block prediction method and apparatus
US20210329261A1