Coding method and apparatus, encoding device, decoding device, and storage medium
By determining reference sample values and weighting coefficients for color components in the H.266/VVC video coding standard, the method improves prediction accuracy and coding performance, addressing the limitations of existing cross-color component prediction techniques.
Patent Information
- Application Number
- JP2024559106
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-04-16
- Estimated Expiration
- 2042-04-12
AI Technical Summary
The existing H.266/VVC video coding standard experiences poor prediction accuracy and reduced coding performance due to large deviations between predicted and original values in cross-color component prediction techniques.
The proposed solution involves a decoding method and encoding method that determine the reference sample value of the first color component, calculate weighting coefficients, and use these to predict the second color component, with filtering performed to improve prediction accuracy and bitrate efficiency.
This approach enhances the accuracy of saturation prediction, reduces bitrate, and improves overall coding performance by effectively utilizing reference samples and weighting coefficients.
Smart Images

Figure 2025511695000001_ABST
Abstract
Description
[Technical field]
[0001] TECHNICAL FIELD Embodiments of the present application relate to the field of video coding technology, and in particular to a coding method and apparatus, an encoding device, a decoding device, and a storage medium. [Background technology]
[0002] As people's demands for video display quality increase, new video application forms such as high definition video and super high definition video have been born. The joint video exploration team (JVET) of the International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) and the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T) proposed the next-generation video coding standard, H.266 / versatile video coding (VVC).
[0003] H.266 / VVC includes cross-color component prediction technology. However, there is a large discrepancy between the predicted value of the coding block calculated by the cross-color component prediction technology in H.266 / VVC and the original value, resulting in low prediction accuracy, poor decoded video quality, and poor coding performance. Summary of the Invention
[0004] The embodiments of the present application provide a coding method and apparatus, an encoding device, a decoding device, and a storage medium, which can improve the accuracy of chroma prediction and save bit rate, as well as improve coding performance.
[0005] The technical solutions of the embodiments of the present application can be realized as follows.
[0006] In a first aspect, an embodiment of the present application provides a decoding method, which includes: determining a reference sample value of a first color component of a current block; determining a weighting coefficient according to the reference sample value of the first color component of the current block; determining a first predicted block of a second color component of the current block according to the weighting coefficient and the reference sample value of a second color component of the current block; a number of predicted values of the second color component included in the first predicted block is greater than a number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; determining a reconstructed value of a second color component sample of the current block according to the second predicted block.
[0007] In a second aspect, an embodiment of the present application provides an encoding method, which includes the following: determining a reference sample value of a first color component of a current block; determining a weighting coefficient according to the reference sample value of the first color component of the current block; determining a first predicted block of a second color component of the current block according to the weighting coefficient and the reference sample value of a second color component of the current block; a number of predicted values of the second color component included in the first predicted block is greater than a number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; determining a residual value of a second color component sample of the current block according to the second predicted block.
[0008] In a third aspect, an embodiment of the present application provides an encoding device, the encoding device comprising: a first determination unit, a first prediction unit, and a first filtering unit. The first determining unit is configured to determine a reference sample value of a first color component of the current block, and determine a weighting coefficient based on the reference sample value of the first color component of the current block. The first prediction unit is configured to determine a first prediction block of a second color component of the current block based on the weighting coefficient and the reference sample values of the second color component of the current block, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The first filtering unit is configured to perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block. The first determining unit is further configured to determine, based on the second predicted block, a residual value of the second color component sample of the current block.
[0009] In a fourth aspect, an embodiment of the present application provides an encoding device, comprising a first memory and a first processor, the first memory configured to store a computer program executable by the first processor, the first processor configured to perform the method according to the second aspect when executing the computer program.
[0010] In a fifth aspect, an embodiment of the present application provides a decoding device, the decoding device comprising: a second determination unit, a second prediction unit, and a second filtering unit. The second determining unit is configured to determine a reference sample value of a first color component of the current block, and determine a weighting coefficient based on the reference sample value of the first color component of the current block. The second prediction unit is configured to determine a first prediction block of a second color component of the current block based on the weighting coefficients and the reference sample values of the second color component of the current block, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The second filtering unit is configured to perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block. The second determining unit is further configured to determine, based on the second predicted block, a reconstructed value of a second color component sample of the current block.
[0011] In a sixth aspect, an embodiment of the present application provides a decoding device, comprising a second memory and a second processor. The second memory is configured to store a computer program executable by the second processor. The second processor is configured to perform the method according to the first aspect when executing the computer program.
[0012] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed, realizes the method according to the first aspect or realizes the method according to the second aspect.
[0013] The embodiments of the present application provide a coding method and apparatus, an encoding device, a decoding device, and a storage medium. At either the encoding side or the decoding side, a reference sample value of a first color component of a current block is determined. A weighting coefficient is determined according to the reference sample value of the first color component of the current block. A first predicted block of a second color component of the current block is determined according to the weighting coefficient and the reference sample value of the second color component of the current block. The number of predicted values of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. A first filtering is performed on the first predicted block to determine a second predicted block of the second color component of the current block. In this way, at the encoding side, a residual value of the second color component sample of the current block can be determined according to the second predicted block, and at the decoding side, a reconstructed value of the second color component sample of the current block can be determined according to the second predicted block. In this way, by using the reference samples adjacent to the current block and color component information in the current block, a more accurate nonlinear mapping model is established based on not only fully considering the existing color component information but also not losing the luma information, and weights are assigned to each reference sample value of the chroma component to perform weighted prediction. In addition, the first filtering is performed by fully considering different color format information and performing sampling filtering of chroma and / or luma based on the different color format information. This ensures that the spatial resolution of the chroma component and the spatial resolution of the luma component are always consistent, and not only ensures the accuracy of the existing luma information but also improves the accuracy of chroma prediction when chroma component prediction is performed using lossless luma information, thereby saving the bit rate and further improving the coding performance. [Brief description of the drawings]
[0014] [Figure 1] FIG. 1 is a schematic diagram showing the distribution of effective adjacent regions. [Diagram 2]FIG. 2 is a schematic diagram showing the distribution of selected regions under different prediction modes. [Diagram 3] FIG. 3 is a flow chart showing the model parameter derivation scheme. [Figure 4A] FIG. 4A is a block diagram illustrating the structure of an encoder according to an embodiment of the present application. [Figure 4B] FIG. 4B is a block diagram illustrating the structure of a decoder according to an embodiment of the present application. [Diagram 5] FIG. 5 is a flow chart 1 illustrating a decoding method according to an embodiment of the present application. [Figure 6A] FIG. 6A is a schematic diagram showing a reference region of a current block according to an embodiment of the present application. [Figure 6B] FIG. 6B is a schematic diagram illustrating upsampling interpolation with respect to reference chroma information according to an embodiment of the present application. [Figure 7] FIG. 7 is a schematic diagram illustrating weighted prediction based on weight-based chroma prediction (WCP) mode and other prediction modes according to an embodiment of the present application. [Figure 8] FIG. 8 is a schematic diagram illustrating the framework of a WCP according to an embodiment of the present application. [Figure 9] FIG. 9 is a flow chart 2 illustrating a decoding method according to an embodiment of the present application. [Figure 10] FIG. 10 is a flow chart 3 illustrating a decoding method according to an embodiment of the present application. [Figure 11] FIG. 11 is a flow chart 4 illustrating a decoding method according to an embodiment of the present application. [Figure 12] FIG. 12 is a schematic diagram 1 illustrating a process of upsampling interpolation according to an embodiment of the present application. [Figure 13] FIG. 13 is a schematic diagram 2 illustrating the process of upsampling interpolation according to an embodiment of the present application. [Figure 14] FIG. 14 is a schematic diagram illustrating weight values in upsampling interpolation according to an embodiment of the present application. [Figure 15] FIG. 15 is a schematic diagram 3 illustrating the process of upsampling interpolation according to an embodiment of the present application. [Figure 16] FIG. 16 is a flow chart 5 illustrating a decoding method according to an embodiment of the present application. [Figure 17] FIG. 17 is a flow chart 6 illustrating a decoding method according to an embodiment of the present application. [Figure 18] FIG. 18 is a flow chart 1 illustrating an encoding method according to an embodiment of the present application. [Figure 19] FIG. 19 is a flow chart 2 illustrating an encoding method according to an embodiment of the present application. [Figure 20] FIG. 20 is a schematic diagram showing the structure of an encoding device according to an embodiment of the present application. [Figure 21] FIG. 21 is a schematic diagram illustrating a specific hardware structure of an encoding device according to an embodiment of the present application. [Figure 22] FIG. 22 is a schematic diagram showing the structure of a decoding device according to an embodiment of the present application. [Diagram 23] FIG. 23 is a schematic diagram illustrating a specific hardware structure of a decoding device according to an embodiment of the present application. [Figure 24] FIG. 24 is a schematic diagram showing the structure of a coding system according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] In order to more fully understand the characteristics and technical contents 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. The accompanying drawings are only used for explanation purposes and are not intended to limit the embodiments of the present application.
[0016] All technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains, unless otherwise defined. The terms used herein are for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0017] In the following description, although "some embodiments" are used, which describes a subset of all possible embodiments, it can be understood that "some embodiments" may be the same or different subsets of all possible embodiments, which may be combined with each other unless there is a contradiction. It should also be noted that the terms "first / second / third" in the embodiments of the present application merely distinguish similar objects and do not imply a specific order of objects. "First / second / third" may be interchanged with a specific order or priority when permitted, so that the embodiments of the present application described herein may be implemented in an order other than the order illustrated or described herein.
[0018] In a video image, a coding block (CB) is usually represented using a first color component, a second color component and a third color component, where the three color components are one luma component, one blue chroma component and one red chroma component, respectively. Exemplarily, the luma component is usually represented by the code Y, the blue chroma component is usually represented by the code Cb or U, and the red chroma component is usually represented by the code Cr or V. In this way, the video image can be represented in a YCbCr format, and can also be represented in a YUV format. In addition, the video image can be represented in an RGB format, a YCgCo format, etc. The embodiments of the present application do not make any restrictions.
[0019] As can be seen, in the current video image or video coding process, the cross-component prediction technology mainly includes a cross-component linear model (CCLM) prediction mode and a multi-directional linear model (MDLM) prediction mode. Regardless of the model parameters derived based on the CCLM prediction mode or the model parameters derived based on the MDLM prediction mode, the corresponding prediction model can realize cross-color component prediction such as from the first color component to the second color component, from the second color component to the first color component, from the first color component to the third color component, from the third color component to the first color component, from the second color component to the third color component, or from the third color component to the second color component.
[0020] JPEG2025511695000002.jpg43167
[0021] JPEG2025511695000003.jpg45167
[0022] The neighboring region of a coding block can be divided into five parts: a left neighboring region, an upper neighboring region, a lower left neighboring region, an upper left neighboring region, and an upper right neighboring region. H.266 / VVC includes three cross-component linear model prediction modes, which are a left and upper neighboring intra CCLM prediction mode (which can be represented by INTRA_LT_CCLM), a left and lower left neighboring intra CCLM prediction mode (which can be represented by INTRA_L_CCLM), and an upper and upper right neighboring intra CCLM prediction mode (which can be represented by INTRA_T_CCLM). For each of the three prediction modes, a preset number (e.g., four) of reference samples can be selected and used to derive the model parameters α and β. The biggest difference between the three prediction modes is that the selected regions corresponding to the reference samples for deriving the model parameters α and β are different.
[0023] Specifically, for a coding block of size W×H corresponding to chroma components, assume that the upper selection area corresponding to the reference samples is W′ and the left selection area corresponding to the reference samples is H′. In INTRA_LT_CCLM mode, the reference samples can be selected from the upper and left adjacent regions, i.e., W'=W and H'=H. In INTRA_L_CCLM mode, the reference samples can be selected from the left adjacent region and the lower left adjacent region, i.e., H'=W+H and W'=0. In INTRA_T_CCLM mode, the reference samples can be selected from the upper neighboring region and the upper right neighboring region, i.e., W'=W+H, and H'=0 is set.
[0024] JPEG2025511695000004.jpg75165
[0025] Referring to Figure 1, Figure 1 is a schematic diagram showing the distribution of valid neighboring regions. In Figure 1, the left neighboring region, the lower left neighboring region, the upper neighboring region, and the upper right neighboring region are all valid. Furthermore, the gray blocks are samples waiting to be predicted, whose position coordinates in the coding block are (i, j).
[0026] Thus, based on FIG. 1, the selection regions for the three prediction modes are shown in FIG. 2. In FIG. 2, (a) represents the selection region for the INTRA_LT_CCLM mode, which includes the left adjacent region and the upper adjacent region, (b) represents the selection region for the INTRA_L_CCLM mode, which includes the left adjacent region and the lower left adjacent region, and (c) represents the selection region for the INTRA_T_CCLM mode, which includes the upper adjacent region and the upper right adjacent region. After the selection regions for the three prediction modes are thus determined, samples for model parameter derivation can be selected from the selection regions. The samples selected in this way are called reference samples, and the number of reference samples is usually four. Also, for a coding block with a determined size W×H, the positions of the reference samples are generally determined.
[0027] After obtaining the preset number of reference samples, currently perform saturation prediction according to the flow chart of the model parameter derivation scheme shown in Figure 3. According to the process shown in Figure 3, assuming that the preset number is 4, the process may include the following contents:
[0028] S301: Obtain a reference sample from a selected region.
[0029] S302: Determine the number of valid reference samples.
[0030] S303: If the number of valid reference samples is 0, set the model parameter α to 0 and β to a default value.
[0031] S304: The saturation prediction value is set to a default value.
[0032] S305: If the number of valid reference samples is 4, obtain two reference samples with relatively large luminance component values and two reference samples with relatively small luminance component values for comparison.
[0033] S306: A mean point corresponding to a relatively large value and a mean point corresponding to a relatively small value are calculated.
[0034] S307: Derive model parameters α and β based on the two average points.
[0035] S308: Chroma prediction is performed using the prediction model constructed from α and β.
[0036] Note that in VVC, the step where the number of valid reference samples is 0 is determined based on the validity of the neighboring regions.
[0037] In addition, the prediction model is constructed according to the principle of "determining one straight line with two points". The two points here can be called fitting points. In the current technical proposal, after obtaining four reference samples, two reference samples with relatively large values of luminance components and two reference samples with relatively small values of luminance components are obtained by comparison. One mean point is determined based on the two reference samples with relatively large values. max , and another mean score based on two reference samples with relatively small values. min Then, we calculate the mean of the two points. max and mean min You can get the mean max and mean min As two fitting points, the model parameters (represented by α and β) can be derived. Finally, a prediction model is constructed based on α and β, and saturation component prediction is performed based on the prediction model.
[0038] JPEG2025511695000005.jpg143168
[0039] Based on the above, an embodiment of the present application provides an encoding method. Determine a reference sample value of a first color component of a current block. Determine a weighting factor according to the reference sample value of the first color component of the current block. Determine a first predicted block of a second color component of the current block according to the weighting factor and the reference sample value of a second color component of the current block. The number of predicted values of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block. Determine a residual value of the second color component sample of the current block according to the second predicted block.
[0040] An embodiment of the present application further provides a decoding method, comprising: determining a reference sample value of a first color component of a current block; determining a weighting factor according to the reference sample value of the first color component of the current block; determining a first predicted block of a second color component of the current block according to the weighting factor and the reference sample value of a second color component of the current block; a number of predicted values of the second color component included in the first predicted block is greater than a number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; determining a reconstructed value of the second color component sample of the current block based on the second predicted block.
[0041] In this way, by using the reference samples adjacent to the current block and the color component information in the current block, a more accurate nonlinear mapping model can be established based on not only fully considering the existing color component information but also not losing the luminance information, and a weight can be assigned to each reference sample value of the chroma component to perform weighted prediction. In addition, the first filtering fully considers different color format information, and performs sampling filtering of chroma and / or luminance based on the different color format information. This can ensure that the spatial resolution of the chroma component and the spatial resolution of the luminance component are always consistent, and not only can the accuracy of the existing luminance information be ensured, but also the accuracy and stability of the nonlinear mapping model can be improved based on the accurate luminance information when performing chroma component prediction using lossless luminance information, improving the accuracy of chroma prediction, saving bit rate, improving coding efficiency, and further improving coding performance.
[0042] Hereinafter, each embodiment of the present application will be described in detail with reference to the drawings.
[0043] Referring to FIG. 4A, FIG. 4A is a block diagram showing a structure 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 estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, a coding unit 109, and a decoding image buffer unit 110. The filtering unit 108 may realize deblocking filtering and Sample Adaptive Offset (SAO) filtering. The coding unit 109 may realize header information coding and Context-based Adaptive Binary Arithmetic Coding (CABAC). For an input original video signal, one video coding block may be obtained by dividing a coding tree block (Coding Tree Unit, CTU). Then, the transform and quantization unit 101 performs a transform on the video coding block for the residual sample information obtained by performing the intra prediction or inter prediction, for example, includes transforming the residual information from the sample domain to the transform domain, and quantizes the obtained transform coefficients to further reduce the bit rate. The intra estimation unit 102 and the intra prediction unit 103 are used to perform intra prediction on the video coding block. Specifically, the intra estimation unit 102 and the intra prediction unit 103 are used to determine an intra prediction mode for coding the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter prediction coding of the received video coding block with respect to one or more blocks in one or more reference images to provide temporal prediction information.The motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, which can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105. After the intra prediction mode is determined, the intra prediction unit 103 is further used to provide the selected intra prediction data to the coding unit 109, and the motion estimation unit 105 sends the calculated motion vector data to the coding unit 109. Furthermore, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block and reconstruct a residual block in the sample domain. The reconstructed residual block is filtered by the filter control analysis unit 107 and the filtering unit 108 to remove blocking effect artifacts, and then the reconstructed residual block is added to one prediction block in the image of the decoding image buffer unit 110 to generate a reconstructed video coding block. The coding unit 109 is used to code various coding parameters and quantized transform coefficients. In a coding algorithm based on CABAC, the context content may be used to code information indicating a specified intra-prediction mode based on neighboring coding blocks, and output a bitstream of the video signal. The decoding picture buffer unit 110 is used to store reconstructed video coding blocks for prediction reference. With the execution of video image coding, new reconstructed video coding blocks are continuously generated, and all these reconstructed video coding blocks are stored in the decoding picture buffer unit 110.
[0044] Referring to FIG. 4B, FIG. 4B is a block diagram showing a structure 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 decoding image buffer unit 206. The decoding unit 201 can realize header information decoding and CABAC decoding. The filtering unit 205 can realize deblocking filtering and SAO filtering. After the input video signal is coded as shown in FIG. 4A, a bitstream of the video signal is output. The bitstream is input to the decoder 200, which first obtains transform coefficients after decoding by the decoding unit 201, and the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the sample domain. The intra prediction unit 203 may be used to generate prediction data for a current video decoding block based on the identified intra prediction mode and data from a previously decoded block of the current frame or image. The motion compensation unit 204 identifies prediction information for the video decoding block by analyzing the motion vectors and other related syntax elements, and uses the prediction information to generate a prediction block for the video decoding block being decoded. A decoded video block is formed by adding the residual block from the inverse transform and inverse quantization unit 202 and the corresponding prediction block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal is filtered by the filtering unit 205 to remove block effect artifacts, thereby improving video quality.Then, the decoded video block is stored in a decoding image buffer unit 206, which is used to store reference images for subsequent intra prediction or motion compensation, and output a video signal at the same time to obtain a restored original video signal.
[0045] It should be noted that the method in the embodiment of the present application is mainly applied to the intra prediction unit 103 shown in Fig. 4A and the intra prediction unit 203 shown in Fig. 4B. That is, the embodiment of the present application may be applied to the encoder, the decoder, or both the encoder and the decoder. There is no particular limitation in the embodiment of the present application.
[0046] Note that, when applied to the intra prediction unit 103, the "current block" specifically refers to an encoding block on which intra prediction is currently being performed, and when applied to the intra prediction unit 203, the "current block" specifically refers to a decoding block on which intra prediction is currently being performed.
[0047] In one embodiment of the present application, refer to Fig. 5, which is a flow chart 1 illustrating a decoding method according to an embodiment of the present application. As shown in Fig. 5, the method may include the following contents:
[0048] S501: Determine the reference sample value of the first color component of the current block.
[0049] In addition, the decoding method of the embodiment of the present application is applied to a decoding apparatus or a decoding device (also called a "decoder") in which the decoding apparatus is integrated. In addition, the decoding method of the embodiment of the present application specifically refers to an intra prediction method, and more specifically, may refer to a weight-based chroma prediction (WCP) method.
[0050] In an embodiment of the present application, a video image may be divided into a plurality of decoding blocks, and each decoding block may include a first color component, a second color component, and a third color component. The current block here refers to a decoding block in a video image on which intra prediction is currently performed. Also, assuming that a prediction is performed on a first color component of the current block, and the first color component is a luma component, that is, the component to be predicted is a luma component, the current block may also be called a luma prediction block. Or, assuming that a prediction is performed on a second color component of the current block, and the second color component is a chroma component, that is, the component to be predicted is a chroma component, the current block may also be called a chroma prediction block.
[0051] Also, in an embodiment of the present application, the reference information of the current block may include values of the first color component samples in the neighboring regions of the current block and values of the second color component samples in the neighboring regions of the current block. These samples may be determined based on the decoded samples in the neighboring regions of the current block. In some embodiments, the neighboring regions of the current block may include at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region.
[0052] Here, the upper neighboring region and the upper right neighboring region can be regarded as a top region as a whole, and the left neighboring region and the lower left neighboring region can be regarded as a left region as a whole. In addition, the neighboring regions can further include a top left region, as shown in detail in FIG. 6. When making predictions for the second color component of the current block, the top region, the left region and the top left region of the current block are regarded as neighboring regions, and may all be referred to as the reference region of the current block, and the samples in the reference region are all decoded reference samples.
[0053] In addition, in the embodiment of the present application, the adjacent region of the current block may include multiple rows or multiple columns adjacent to the current block. For example, the left region may include one or more columns, the top region may include one or more rows, and the number of rows or columns may increase or decrease. The embodiment of the present application does not impose any restrictions.
[0054] In some embodiments, determining the reference sample value of the first color component of the current block may include determining the reference sample value of the first color component of the current block based on values of first color component samples in adjacent regions of the current block.
[0055] It should be noted that in the embodiment of the present application, the reference sample of the current block may refer to a reference sample adjacent to the current block, and may also be called a first color component sample, a second color component sample in a neighboring region of the current block, and is represented as a Neighboring Sample or a Reference Sample. The neighbor here may be, but is not limited to, a spatial neighbor. For example, the neighbor may be a temporal neighbor, or a spatial and temporal neighbor. Furthermore, the reference sample of the current block may be a spatially adjacent reference sample, a temporally adjacent reference sample, or a reference sample obtained after performing some processing on the spatially and temporally adjacent reference sample, etc. The embodiment of the present application does not impose any limitations.
[0056] In addition, in the embodiment of the present application, the first color component is a luma component and the second color component is a chroma component, in which case the value of the first color component sample in the neighboring region of the current block is represented as reference luma information corresponding to the reference sample of the current block, and the value of the second color component sample in the neighboring region of the current block is represented as reference chroma information corresponding to the reference sample of the current block.
[0057] Also, in the embodiment of the present application, the value of the first color component sample is determined from the neighboring region of the current block, where the neighboring region may include only the upper neighboring region, or may include only the left neighboring region, or may include the upper neighboring region and the upper right neighboring region, or may include the left neighboring region and the lower left neighboring region, or may include the upper neighboring region and the left neighboring region, or may include the upper neighboring region, the upper right neighboring region and the left neighboring region. The embodiment of the present application does not impose any limitation.
[0058] In addition, in an embodiment of the present application, the neighboring region may be determined based on a prediction mode of the current block. In a specific embodiment, the following content may be included: if the prediction mode of the current block is a horizontal mode, the reference sample is determined based on samples in the upper neighboring region and / or the upper right neighboring region; if the prediction mode of the current block is a vertical mode, the reference sample is determined based on samples in the left neighboring region and / or the lower left neighboring region.
[0059] Exemplarily, if the prediction mode of the current block is a horizontal mode, only the upper neighboring region and / or the upper right neighboring region may be selected as the neighboring region for chroma component prediction, and if the prediction mode of the current block is a vertical mode, only the left neighboring region and / or the lower left neighboring region may be selected as the neighboring region for chroma component prediction.
[0060] Further, in some embodiments, for determining a value of the first color component sample, the method may further include determining the value of the first color component sample by selecting from among the first color component samples in adjacent regions.
[0061] It should be noted that the first color component samples in the neighboring regions may contain some insignificant samples (e.g., the correlation between these samples is poor) or abnormal samples. In order to ensure the accuracy of prediction, these samples need to be removed, so as to obtain a valid first color component sample value. That is, in the embodiment of the present application, a first sample set is formed based on the first color component samples in the neighboring regions of the current block. In this case, the value of the first color component sample can be determined by selecting from the first sample set.
[0062] In a specific embodiment, determining a value of the first color component sample by selecting from the first color component samples in the adjacent region may include: determining a sample position to be selected based on a position and / or a color component intensity of the first color component sample in the adjacent region; determining a value of the first color component sample from the adjacent region based on the sample position to be selected.
[0063] It should be noted that in the embodiment of the present application, the color component intensity can be represented by color component information such as reference luminance information, reference chroma information, etc. A larger value of the color component information indicates a higher color component intensity. In this way, the first color component samples in the neighboring region can be selected based on the sample position or based on the color component intensity. A valid first color component sample is determined based on the selected sample, and a value of the first color component sample is further determined.
[0064] In some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a second filtering on the value of the first color component sample to obtain a filtered adjacent sample value of the first color component of the current block; and determining the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block.
[0065] In an embodiment of the present application, the number of filtered neighboring sample values of the first color component of the current block is greater than the number of values of the first color component sample.
[0066] In the embodiment of the present application, the second filtering may be upsampling filtering. The first color component is a luminance component. In order to ensure that there is no loss in the reference luminance information, the reference luminance information may be left unchanged, or the reference luminance information may be subjected to upsampling filtering. For example, if the size of the current block is 2M×2N and the number of reference luminance information is 2M+2N, it may be converted to 4M+4N after upsampling filtering.
[0067] In some embodiments, determining the reference sample value of the first color component of the current block may further include determining the reference sample value of the first color component of the current block based on a reconstructed value of the first reference color component sample in the current block.
[0068] It should be noted that in the embodiment of the present application, the first reference color component may be a luminance component, in which case the reconstructed value of the first reference color component sample in the current block is the reconstructed luminance information of the current block.
[0069] Furthermore, in some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a third filtering on the reconstructed value of the first reference color component sample in the current block to obtain a filtered sample value of the first reference color component sample in the current block; and determining the reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.
[0070] In an embodiment of the present application, the number of filtered sample values of the first reference color component sample in the current block is greater than the number of reconstructed values of the first reference color component sample in the current block.
[0071] In the embodiment of the present application, the third filtering may be upsampling filtering. The first reference color component is a luminance component. In order to ensure that the reconstructed luminance information in the current block has no loss and obtain a more accurate chroma prediction value, the reconstructed luminance information in the current block may be left unchanged, or may be upsampling filtered on the reconstructed luminance information in the current block. For example, if the number of reconstructed luminance information in the current block is 2M×2N, it may be converted to 4M×4N after upsampling filtering.
[0072] In the embodiment of the present application, the filtering of the reference information before the weighted prediction may be filtering of only the reference luminance information, may be filtering of only the reconstructed luminance information, or may be filtering of both the reference luminance information and the reconstructed luminance information. No limitations are imposed in this specification. And, for the calculation of the luminance difference, the luminance difference may be the absolute value of the difference between the reference luminance information and the reconstructed luminance information, may be the absolute value of the difference between the filtered reference luminance information and the reconstructed luminance information, may be the absolute value of the difference between the reference luminance information and the filtered reconstructed luminance information, or may be the absolute value of the difference between the filtered reference luminance information and the filtered reconstructed luminance information.
[0073] In addition, in the embodiment of the present application, the reference sample value of the first color component of the current block can also be set to the luminance difference information. Thus, in one possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.
[0074] In another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.
[0075] In yet another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.
[0076] In a further possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.
[0077] That is, while keeping the luminance information lossless, the reference luminance information in the neighboring region of the current block may be upsampled and filtered, the reconstructed luminance information in the current block may be upsampled and filtered, or both the reference luminance information and the reconstructed luminance information may be upsampled and filtered, or both the reference luminance information and the reconstructed luminance information may not be upsampled and filtered. Then, the luminance difference information is determined according to different combinations, and the luminance difference information is used as the reference sample value of the first color component of the current block.
[0078] S502: Determine a weighting coefficient based on the reference sample value of the first color component of the current block.
[0079] It should be noted that in an embodiment of the present application, determining a weighting coefficient based on the reference sample value of the first color component of the current block may include: determining a value corresponding to the reference sample value of the first color component in a preset mapping; setting the weighting coefficient equal to the value;
[0080] As can be understood, in the embodiment of the present application, the reference sample value of the first color component may be an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of the first reference color component sample in the current block, where the first reference color component is a first color component, and the first color component is a color component different from the second color component to be predicted in the embodiment of the present application.
[0081] JPEG2025511695000006.jpg84165
number
[0082] In addition, in the embodiment of the present application, when the number of reference sample values of the second color component is N, the number of weighting coefficients is also N, where the sum of the N weighting coefficients is equal to 1, and each weighting coefficient is greater than or equal to 0 and less than or equal to 1, i.e. 0≦w k ≦1. However, "the sum of the N weighting coefficients is equal to 1" is only a theoretical concept, and in an actual fixed-point realization, the absolute value of the weighting coefficients may be greater than 1.
[0083] JPEG2025511695000009.jpg74168
number
[0084] JPEG2025511695000011.jpg39167
number
[0085] JPEG2025511695000013.jpg24169
number
[0086] According to Equation 4, in some embodiments, determining a value in the preset mapping corresponding to the reference sample value of the first color component may include: determining a first factor; determining a first product value based on the first factor and the reference sample value of the first color component; determining a value in the preset mapping corresponding to the first product value.
[0087] JPEG2025511695000015.jpg30169
[0088] In a particular embodiment, determining the first factor may include the first factor being a preset constant value.
[0089] JPEG2025511695000016.jpg70168
[0090] In another specific embodiment, determining the first factor may include determining a value of the first factor based on a size parameter of the current block.
[0091] Moreover, in some embodiments, the method may further include determining a value of the first factor based on a pre-configured mapping look-up table between a size parameter of the current block and a value of the first factor.
[0092] Here, the size parameter of the current block may include at least one parameter of the width of the current block, the height of the current block, and the product of the width and height of the current block.
[0093] It should be noted that in the embodiment of the present application, a classification method can be adopted to determine the value of the first factor. For example, according to the size parameter of the current block, the size parameter of the current block is classified into three categories, and the value of the first factor corresponding to each category is determined. In this case, in the embodiment of the present application, a mapping lookup table between the size parameter of the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on the lookup table. Illustratively, Table 1 shows the correspondence relationship between the first factor and the size parameter of the current block according to the embodiment of the present application. It should be noted that Table 1 is merely an exemplary lookup table and is not intended to be limiting.
[0094] [Table 1]
[0095] In yet another specific embodiment, determining the first factor may include determining a value of the first factor based on a number of reference samples of the current block.
[0096] Furthermore, in some embodiments, the method may further include determining a value of the first factor based on a preset mapping lookup table between the number of reference samples of the current block and the value of the first factor.
[0097] It should be noted that in the embodiment of the present application, the number of reference samples can be classified into three categories, and the value of the first factor can still be determined by adopting a classification method. For example, according to the number of reference samples of the current block, the number of reference samples of the current block can be classified into three categories, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiment of the present application, a mapping lookup table between the number of reference samples of the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on the lookup table. Illustratively, Table 2 shows the correspondence relationship between the first factor and the number of reference samples of the current block according to the embodiment of the present application. It should be noted that Table 2 is merely an exemplary lookup table, and is not intended to be limiting.
[0098] [Table 2]
[0099] Furthermore, for the first product value, determining the first product value based on the first factor and the reference sample value of the first color component may include: the first product value is set equal to the product of the first factor and the reference sample value of the first color component; or the first product value is set equal to a value obtained by performing a bit right shift on the reference sample value of the first color component, where the number of right shifted bits is equal to the first factor; or the first product value is set to a value obtained by performing an addition and bit shift operation on the reference sample value of the first color component based on the first factor.
[0100] For example, assuming that the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref, the first product value is equal to 0.25×Ref, which can also be represented as Ref / 4, i.e., Ref>>2. Also, during fixed-point calculation, floating-point numbers can be converted into addition and shift operations. That is, there is no restriction on the calculation method of the first product value.
[0101] JPEG2025511695000019.jpg59170
[0102] JPEG2025511695000020.jpg51166
[0103] JPEG2025511695000021.jpg31163
[0104] Further, for the second factor, in a specific embodiment, the method may further include determining the second factor by performing a least squares calculation based on the first color component value of the reference sample and the second color component value of the reference sample.
[0105] That is, assuming that the number of reference samples is N, the first color component value of the reference sample is reference luminance information of the current block, and the second color component value of the reference sample is reference chroma information of the current block, the second factor can be obtained by performing least squares calculation on the chroma component values and luminance component values of the N reference samples. Exemplarily, the least squares regression calculation is as follows:
number
[0106] Also, for the preset mapping, the preset mapping may be a preset functional relationship. In some embodiments, the preset mapping may be a Softmax function. Although the Softmax function is a normalized exponential function, in embodiments of the present application, normalization may not be required, and its value range is not limited to [0,1].
[0107] JPEG2025511695000023.jpg23168
number
number
[0108] Exemplarily, the value of S is related to the size parameters of the current block. The size parameters of the current block include the width and height of the current block. In one possible embodiment, if the minimum value of the width and height is less than or equal to 4, the value of S is equal to 8. If the minimum value of the width and height is greater than 4 and less than or equal to 16, the value of S is equal to 12. If the minimum value of the width and height is greater than 16, the value of S is equal to 16. In another possible embodiment, if the minimum value of the width and height is less than or equal to 4, the value of S is equal to 7. If the minimum value of the width and height is greater than 4 and less than or equal to 16, the value of S is equal to 11. If the minimum value of the width and height is greater than 16, the value of S is equal to 15. Or, the value of S is related to the number of reference samples (R) of the current block. In one possible embodiment, if R is less than 16, the value of S is equal to 8. If R is greater than or equal to 16 and less than 32, the value of S is equal to 12. If R is greater than or equal to 16, the value of S is equal to 16. The embodiments of the present application do not impose any limitations thereon.
[0109] Also, in addition to the Softmax function, in other embodiments, the pre-defined mapping may be a weighting function that is inversely proportional to the reference sample value of the first color component.
[0110] JPEG2025511695000027.jpg17168
number
number
[0111] In this way, when the preset mapping is a preset functional relationship, the preset mapping may be that shown in Equation 4, that shown in Equation 6 or Equation 7, that shown in Equation 8 or Equation 9, or may be another function model of weighting coefficients constructed by fitting a tendency that the stronger the similarity between the reference luminance value of the reference sample and the reconstructed luminance value of the sample to be predicted in the current block, the higher the importance of the reference chroma value of the reference sample to the sample to be predicted in the current block. The embodiments of the present application are not particularly limited.
[0112] Furthermore, in some embodiments, the preset mapping may be in the form of a preset look-up table. That is, in the embodiments of the present application, the operation can be simplified, for example, by adopting the form of an array element look-up table, which simplifies part of the calculation operation. For the preset mapping, the array element value can be determined according to the preset mapping look-up table of the reference sample value of the first color component, the first factor, and the array element, and then the value corresponding to the array element value in the preset mapping can be determined, and then the weighting coefficient can be set equal to the value.
[0113] JPEG2025511695000030.jpg62164
[0114] It should be noted that in the embodiment of the present application, each storage can be divided into a complete storage or a partial storage.
[0115] JPEG2025511695000031.jpg46169
[0116] JPEG2025511695000032.jpg35166
number
[0117] In this case, the calculation of the weighting coefficients in Equation 7 can be simplified to:
number
[0118] Thus, the elements in the two-dimensional array storMole[index 1][index 2] are shown in Table 3.
[0119] [Table 3]
[0120] JPEG2025511695000036.jpg29166
number
[0121] In this case, the calculation of the weighting coefficients in Equation 7 can be simplified to:
number
[0122] Thus, the elements in the one-dimensional array ostorMole[index] are as shown in Table 4.
[0123] [Table 4]
[0124] JPEG2025511695000040.jpg49169
[0125] JPEG2025511695000041.jpg46162
number
[0126] In this case, the calculation of the weighting coefficients in Equation 7 can be simplified to:
number
[0127] Thus, the elements in the two-dimensional array partstorMole[index 1][index 2] are shown in Table 5.
[0128] [Table 5]
[0129] JPEG2025511695000045.jpg57167
[0130] JPEG2025511695000046.jpg53165
[0131] S503: Determine a first prediction block of the second color component of the current block according to the weighting coefficient and the reference sample value of the second color component of the current block.
[0132] However, in the embodiment of the present application, in order to avoid loss of luma information, in this case, chroma prediction is performed for each reconstructed luma position in the current block, so that the size of the obtained first predicted block is larger than the original size of the current block, that is, the number of predicted values of the second color component contained in the first predicted block is larger than the number of second color component samples contained in the current block.
[0133] In addition, in an embodiment of the present application, for determining the reference sample value of the second color component of the current block, the method may further include determining the reference sample value of the second color component of the current block based on the value of the second color component sample in an adjacent region of the current block.
[0134] Here, the neighboring region may include at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region.
[0135] In a specific embodiment, the method may further include: performing a fourth filtering on the values of the second color component samples in the neighboring region of the current block to obtain filtered neighboring sample values of the second color component of the current block; determining a reference sample value of the second color component of the current block according to the filtered neighboring sample values of the second color component of the current block.
[0136] In an embodiment of the present application, the number of filtered neighboring sample values of the second color component of the current block is greater than the number of values of the second color component samples in the neighboring region of the current block.
[0137] In an embodiment of the present application, the fourth filtering is up-sampling filtering, and the up-sampling rate is a positive integer multiple of two.
[0138] That is, the first color component is a luminance component, and the second color component is a chroma component. In order to ensure that there is no loss in the reference luminance information, upsampling filtering can be performed on the reference chroma information. For example, for a current block of 2M×2N in YUV420 format, the size of the chroma block is M×N, and the number of reference chroma information in the neighboring region is M+N. After upsampling filtering, 2M+2N chroma reference sample values can be obtained, and then 2M×2N chroma predicted values can be obtained by weighted prediction, and then downsampling filtering can be performed to obtain M×N chroma predicted values as the final predicted values. Note that for a current block of 2M×2N in YUV420 format, the size of the chroma block is M×N, and the number of reference chroma information in the neighboring region is M+N. Using only these M+N reference chroma information, 2M×2N chroma predicted values can be obtained by using weighted coefficients, and then downsampling filtering can be performed to obtain M×N chroma predicted values as the final predicted values.
[0139] Furthermore, for a current block of 2M×2N in YUV420 format, the size of its chroma block is M×N, the number of reference chroma information of adjacent regions is M+N, and 4M+4N chroma reference sample values are obtained after upsampling filtering. Or, for a current block of 2M×2N in YUV444 format, the size of its chroma block is 2M×2N, the number of reference chroma information of adjacent regions is 2M×2N, and 4M+4N chroma reference sample values are obtained after upsampling filtering. Then, based on these chroma reference sample values, M×N chroma prediction values can be obtained as final prediction values using the weighted prediction and downsampling filtering method. The embodiment of the present application does not make any restrictions thereon.
[0140] In addition, in the embodiment of the present application, whether the second filtering is performed on the value of the first color component sample in the neighboring region, the third filtering is performed on the reconstructed value of the first reference color component sample in the current block, or the fourth filtering is performed on the value of the second color component sample in the neighboring region, all of these three filterings may be upsampling filtering. The second filtering may be performed using the first filter, the third filtering may be performed using the second filter, and the fourth filtering may be performed using the third filter. For these three filters, the first filter, the second filter, and the third filter may all be upsampling filters. Since the data to be processed are different, the upsampling rates of these filters may also be different. Therefore, these three filters may be the same or different. Furthermore, the first filter, the second filter, and the third filter may all be neural network filters. The embodiment of the present application does not impose any restrictions thereon.
[0141] As can be understood, assuming that the first color component is a luma component and the second color component is a chroma component, the spatial resolution of the value of the first color component sample in the neighboring region (i.e., reference luma information), the spatial resolution of the value of the second color component sample in the neighboring region (i.e., reference chroma information), and the spatial resolution of the reconstructed value of the first reference color component sample in the current block (i.e., reconstructed luma information) are all affected by the color format information. Therefore, the second filtering, the third filtering, or the fourth filtering can also be performed based on the current color format information. Hereinafter, taking the fourth filtering as an example, in some embodiments, the method further includes: performing a fourth filtering on the value of the second color component sample in the neighboring region of the current block based on the color format information to obtain a filtered neighboring sample value of the second color component of the current block.
[0142] In a specific embodiment, the fourth filtering may further include the following content: When the color format information indicates 4:2:0 sampling, perform upsampling filtering on the value of the second color component sample in the adjacent area of the current block. The upsampling rate is a positive integer multiple of 2.
[0143] It should be noted that in the embodiment of the present application, the color format information may include 4:4:4 sampling, 4:2:2 sampling, 4:1:1 sampling, 4:2:0 sampling, etc. If the color format information indicates a video with 4:4:4 sampling (also represented as YUV444), i.e., the spatial resolution of luma and the spatial resolution of chroma are equal, there is no need to perform any processing on the reference chroma information. If the color format information indicates a video with chroma sub-sampling characteristics, such as 4:2:2 sampling (also represented as YUV422), or 4:1:1 sampling (also represented as YUV411), or 4:2:0 sampling (also represented as YUV420), i.e., the spatial resolution of luma and the spatial resolution of chroma are not consistent, and the spatial resolution of the chroma component is smaller than the spatial resolution of the luma component, there is a need to perform upsampling filtering on the reference chroma information obtained from the adjacent region.
[0144] As described above, for the upsampling filtering of the reference chroma information, the upsampling filtering method may be any one of linear interpolation methods, for example, nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, mean interpolation, median interpolation, copy interpolation, etc. Alternatively, the upsampling filtering method may be any one of nonlinear interpolation methods, for example, wavelet transform-based interpolation algorithm, edge information-based interpolation algorithm, etc. Alternatively, the upsampling filtering may be performed based on a convolutional neural network. No limitations are imposed in the embodiment of the present application. For example, a YUV420 video format and copy interpolation will be described as an example with reference to FIG. 6B. Here, an example of 4×1 reference chroma information and 8×2 reference luma information is shown. The 8×2 shaded blocks are reference luma information, and the 4×1 grid shaded blocks are collocated reference chroma information, and each sample in the 4×1 grid shaded blocks corresponds to the upper left corner sample of each 2×2 sub-block in the 8×2 chroma block after upsampling filtering, that is, the sample value of each chroma sample in the 2×2 sub-block after copy interpolation is the same. Specifically, for each 2×2 sub-block, the other three chroma samples (dot shaded blocks) are all obtained by copying the upper left corner sample (grid shaded block).
[0145] Furthermore, after determining the reference sample value of the second color component of the current block, in some embodiments, for S503, determining a first predicted block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block may include: determining a weighting value obtained by multiplying the reference sample value of the second color component by the corresponding weighting coefficient; setting a predicted value of the second color component sample in the first predicted block equal to the sum of N weighting values, where N indicates the number of reference sample values of the second color component, and N is a positive integer.
[0146] That is, when the number of reference sample values of the second color component is N, first, a weighting value (w k C k ) is determined, and then the sum of these N weighted values is the predicted value of the second color component sample in the predicted block. Specifically, the calculation formula is as follows:
number
[0147] For example, first, an absolute luma difference is calculated based on the reconstructed luma information at the position (i, j) in the current block and the reference luma information in the neighboring region, then a weighting coefficient is calculated according to the Softmax function, and the predicted value of the chroma component at the position (i, j) in the predicted block can be obtained using Equation 16. In particular, this method is advantageous for parallel processing and can increase the calculation speed.
[0148] As can be further understood, when performing upsampling filtering on both the reference luma information and the reference chroma information in the neighboring region of the current block, the following contents may be further included: based on the color format information, performing second filtering on the values of the first color component samples in the neighboring region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; performing fourth filtering on the values of the second color component samples in the neighboring region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered neighboring sample values of the second color component of the current block.
[0149] In one possible embodiment, the method may further include: If the color format information indicates 4:4:4 sampling, determine that the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, determine that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:0 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.
[0150] It should be noted that in the embodiment of the present application, upsampling filtering is performed on the reference luma information. In this case, there is no loss of luma information. In this case, since the spatial resolution of the luma component is always equal to or greater than the spatial resolution of the chroma component in YUV video, it is necessary to perform upsampling filtering on the reference chroma information to make the spatial resolution of the reference chroma information match the spatial resolution of the reference luma information. In this case, it is necessary to determine the spatial upsampling rate (second horizontal upsampling factor and second vertical upsampling factor) of the reference chroma information according to the YUV video format and the spatial upsampling rate (first horizontal upsampling factor and first vertical upsampling factor) of the reference luma information.
[0151] The first horizontal upsampling factor is represented by S_Hor_RefLuma, the first vertical upsampling factor is represented by S_Ver_RefLuma, the second horizontal upsampling factor is represented by S_Hor_RefChroma, and the second vertical upsampling factor is represented by S_Ver_RefChroma. Thus, for video in YUV444 format, S_Hor_RefChroma can be set equal to S_Hor_RefLuma, and S_Ver_RefChroma can be set equal to S_Ver_RefLuma. For video in YUV422 format, S_Hor_RefChroma can be set equal to twice S_Hor_RefLuma, and S_Ver_RefChroma can be set equal to S_Ver_RefLuma. For video in YUV411 format, S_Hor_RefChroma can be set equal to four times S_Hor_RefLuma, and S_Ver_RefChroma can be set equal to S_Ver_RefLuma. For video in YUV420 format, S_Hor_RefChroma may be set equal to twice S_Hor_RefLuma, and S_Ver_RefChroma may be set equal to twice S_Ver_RefLuma.
[0152] As can be further understood, when no upsampling filtering is performed on the reconstructed luminance information in the current block, the size of the first prediction block may be estimated according to a YUV video format. Therefore, in another possible embodiment, the method may further include: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:2:0 sampling, determine that the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to twice the height of the current block.
[0153] It should be noted that in the embodiment of the present application, the size parameters of the first predicted block include width and height. The width of the first predicted block is represented by predSizeW, and the height of the first predicted block is represented by predSizeH. The size parameters of the current block also include width and height, and the width of the current block is represented by nTbW, and the height of the current block is represented by nTbH. Thus, for a video in YUV444 format, the spatial resolution of the luma component and the spatial resolution of the chroma component are equal, in this case, predSizeW can be set equal to nTbW, and predSizeH can be set equal to nTbH. For a video in YUV422 format, the vertical resolution of the luma component and the vertical resolution of the chroma component are equal, but the horizontal resolution of the chroma component is 1 / 2 of the horizontal resolution of the luma component, in this case, predSizeW can be set equal to twice nTbW, and predSizeH can be set equal to nTbH. For videos in YUV411 format, the vertical resolution of the luma component and the vertical resolution of the chroma component are the same, but the horizontal resolution of the chroma component is 1 / 4 of the horizontal resolution of the luma component, in which case predSizeW can be set equal to four times nTbW and predSizeH can be set equal to nTbH. For videos in YUV420 format, the horizontal resolution of the chroma component is 1 / 2 of the horizontal resolution of the luma component and the vertical resolution of the chroma component is 1 / 2 of the vertical resolution of the luma component, in which case predSizeW can be set equal to twice nTbW and predSizeH can be set equal to twice nTbH.
[0154] As can be further understood, when performing upsampling filtering on the reconstructed luma information in the current block, after performing luma upsampling on the current block, it is necessary to estimate the size of the first prediction block according to the YUV video format and the spatial upsampling rate of luma of the current block. In this case, the following contents may be included: According to the color format information, perform third filtering on the reconstructed values of the first reference color component samples in the current block using a third horizontal upsampling factor and a third vertical upsampling factor to obtain filtered sample values of the first reference color component samples in the current block.
[0155] In yet another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:2:0 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to twice the product of the height of the current block and the third vertical upsampling factor.
[0156] It should be noted that in the embodiment of the present application, the third horizontal upsampling factor is represented by S_Hor_RecLuma, and the third vertical upsampling factor is represented by S_Ver_RecLuma. According to S_Hor_RecLuma and S_Ver_RecLuma, perform upsampling filtering on the reconstructed luma information in the current block. In this case, for the size of the first prediction block, for the video in YUV444 format, the spatial resolution of the luma component and the spatial resolution of the chroma component are equal, in this case, predSizeW can be set equal to the product of S_Hor_RecLuma and nTbW, and predSizeH can be set equal to the product of S_Ver_RecLuma and nTbH. For a video in YUV422 format, the vertical resolution of the luma component and the vertical resolution of the chroma component are the same, but the horizontal resolution of the chroma component is 1 / 2 that of the luma component, in which case predSizeW can be set equal to twice the product of S_Hor_RecLuma and nTbW, and predSizeH can be set equal to the product of S_Ver_RecLuma and nTbH. For a video in YUV411 format, the vertical resolution of the luma component and the vertical resolution of the chroma component are the same, but the horizontal resolution of the chroma component is 1 / 4 that of the luma component, in which case predSizeW can be set equal to four times the product of S_Hor_RecLuma and nTbW, and predSizeH can be set equal to the product of S_Ver_RecLuma and nTbH. For video in YUV420 format, the horizontal resolution of the chroma component is 1 / 2 of the horizontal resolution of the luma component, and the vertical resolution of the chroma component is 1 / 2 of the vertical resolution of the luma component, in which case predSizeW can be set equal to twice the product of S_Hor_RecLuma and nTbW, and predSizeH can be set equal to twice the product of S_Ver_RecLuma and nTbH.
[0157] It should be noted that in an embodiment of the present application, predSizeH is greater than or equal to the height nTbH of the current block, or predSizeW is greater than or equal to the width nTbW of the current block, so that the number of predicted values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block.
[0158] S504: Perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0159] S505: Determine a reconstructed value of a second color component sample of the current block based on the second predicted block.
[0160] However, in the embodiment of the present application, the first filtering may be downsampling filtering. In this way, for the second prediction block that has been downsampling filtered, the number of predicted values of the second color component included in the second prediction block is the same as the number of second color component samples included in the current block.
[0161] In one possible embodiment, performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include: performing downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block.
[0162] In addition, in the embodiment of the present application, the preset filter may be a downsampling filter. Furthermore, the downsampling filter here may be a neural network filter. In the embodiment of the present application, there is no limitation thereon.
[0163] In another possible embodiment, performing first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include: determining a horizontal downsampling factor and a vertical downsampling factor; performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block.
[0164] In a specific embodiment, performing downsampling filtering on the first predicted block according to a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block of a second color component of the current block may include: if the horizontal downsampling factor is greater than 1, or if the vertical downsampling factor is greater than 1, performing downsampling filtering on the first predicted block to obtain a second predicted block.
[0165] In an embodiment of the present application, performing downsampling filtering on the first prediction block includes: performing downsampling filtering on the first predicted block in a horizontal direction; performing vertical downsampling filtering on the first predicted block; performing downsampling filtering on the first predicted block in a horizontal direction and then in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; may include at least one of:
[0166] Here, first, a horizontal downsampling factor can be calculated according to the width of the first predicted block and the width of the current block, and a vertical downsampling factor can be calculated according to the height of the first predicted block and the height of the current block; then, downsampling filtering is performed on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor. Specifically, when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, the first predicted block needs to be downsampled only in the horizontal direction. When the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, the first predicted block needs to be downsampled only in the vertical direction. When the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, the first predicted block needs to be downsampled in both the horizontal and vertical directions. Downsampling can be performed in the horizontal direction and then in the vertical direction, or downsampling can be performed in the vertical direction and then in the horizontal direction; further, the downsampling operation here can be replaced by a convolution operation in a neural network structure. The embodiments of the present application do not impose any limitations.
[0167] In addition, the first filtering may be downsampling filtered at a sampling interval, for example, a two-dimensional filter, a one-dimensional filter, etc. In the case of a one-dimensional filter, it may be performed "first vertically, then horizontally", or "first horizontally, then vertically", and may be performed in a fixed filtering order, or may be performed in a flexibly adjustable filtering order (for example, a filtering order indicated by identification information, an order associated with a prediction mode or a block size, etc.). The embodiment of the present application does not impose any restrictions thereon.
[0168] In some embodiments, performing first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include: the first filtering includes downsampling filtering, an input of the downsampling filtering is a first downsampling input block, and an output of the downsampling filtering is a first downsampling output block.
[0169] Further, in some embodiments, the upsampling filtering may include: determining a downsampling factor, the downsampling factor including at least one of a horizontal downsampling factor and a vertical downsampling factor; performing downsampling filtering on the first downsampling input block based on the downsampling factor to obtain a first downsampling output block.
[0170] In one possible embodiment, performing downsampling filtering on the first downsampling input block based on a downsampling factor to obtain a first downsampling output block may include: when the horizontal downsampling factor is greater than 1, or when the vertical downsampling factor is greater than 1, performing downsampling filtering on the first downsampling input block to obtain a first downsampling output block.
[0171] In an embodiment of the present application, performing downsampling filtering on the first downsampling input block includes: performing horizontal downsampling filtering on a first downsampled input block; performing vertical downsampling filtering on a first downsampled input block; performing downsampling filtering in the horizontal direction and then in the vertical direction on a first downsampling input block; performing vertical downsampling filtering on a first downsampling input block and then horizontal downsampling filtering on the first downsampling input block; may include at least one of:
[0172] Here, a horizontal downsampling factor can be calculated according to the width of the first downsampling input block and the width of the first downsampling output block, and a vertical downsampling factor can be calculated according to the height of the first downsampling input block and the height of the first downsampling output block. Then, downsampling filtering is performed on the first downsampling input block according to the horizontal downsampling factor and the vertical downsampling factor. Specifically, when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling only needs to be performed on the first downsampling input block in the horizontal direction. When the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling only needs to be performed on the first downsampling input block in the vertical direction. When the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling needs to be performed on the first downsampling input block in both the horizontal and vertical directions. Downsampling can be performed in the horizontal direction and then in the vertical direction, or downsampling can be performed in the vertical direction and then in the horizontal direction, and the convolution operation in the neural network structure can replace the downsampling filtering operation here. The embodiments of this application do not impose any limitations.
[0173] In another possible embodiment, the second predicted block is determined by performing downsampling filtering on the first predicted block, in which case the method may further include: the first predicted block is a first downsampling input block, and the first downsampling output block is a second predicted block of a second color component of the current block.
[0174] In another possible embodiment, the first prediction block is first subjected to enhancement filtering and then subjected to downsampling filtering to determine the second prediction block. In this case, the method may further include the following: Perform enhancement filtering on the first prediction block to determine a first enhanced prediction block; The first enhanced prediction block is a first downsampling input block; and The first downsampling output block is a second prediction block of a second color component of the current block.
[0175] In yet another possible embodiment, the first prediction block is first down-sampling filtered and then enhanced filtered to determine a second prediction block, in which the method may further include: the first prediction block is a first down-sampling input block; the first down-sampling output block is a first down-sampling filtered prediction block; and the first down-sampling filtered prediction block is subjected to enhanced filtering to determine a second prediction block of a second color component of the current block.
[0176] In another possible embodiment, the first prediction block is first subjected to enhanced filtering, then subjected to downsampling filtering, and then subjected to enhanced filtering to determine a second prediction block. In this case, the method may further include the following: Perform a first filtering enhancement on the first prediction block to determine a second enhanced prediction block; The second enhanced prediction block is a first downsampling input block; The first downsampling output block is a second downsampling filtered prediction block; Perform a second filtering enhancement on the second downsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0177] In addition to the above, in some embodiments, performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may further include: performing a weighted sum calculation for each of a preset number of predicted values of the second color component of the first predicted block in the horizontal direction and / or the vertical direction according to a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block.
[0178] In a possible embodiment, performing a weighted sum calculation for each of the predetermined number of predicted values of the second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block may include: performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of the second color component of the first predicted block in the horizontal direction to obtain the second predicted block.
[0179] In another possible embodiment, performing a weighted sum calculation for each of the predetermined number of predicted values of the second color component of the first prediction block in the horizontal direction and / or the vertical direction to obtain the second prediction block may include: performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction to obtain the second prediction block.
[0180] In yet another possible embodiment, performing a weighted sum calculation for each of the predetermined number of predicted values of the second color component of the first prediction block in the horizontal direction and / or the vertical direction to obtain the second prediction block may include: performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of the second color component of the first prediction block in the horizontal direction, and performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction to obtain the second prediction block.
[0181] That is, in the embodiment of the present application, the weighted sum calculation is performed for each of a preset number of saturation prediction values in the direction (vertical or horizontal) in which downsampling is required, without considering the horizontal downsampling factor and the vertical downsampling factor. In the special case in which the weights of the saturation prediction values are equal, the weighted sum calculation for each of the preset number of saturation prediction values can be regarded as calculating the average value of the preset number of saturation prediction values, and the average value is used as the prediction value after downsampling filtering.
[0182] In addition, in some embodiments, the method may further include: determining a weighting factor based on the reference sample values of a first color component of some samples in the first prediction block; and determining a second prediction block of a second color component of the current block based on the weighting factor and the reference sample values of a second color component of some samples in the first prediction block.
[0183] In a specific embodiment, determining the second prediction block of the second color component of the current block according to the weighting coefficient and the reference sample value of the second color component of some samples in the first prediction block may include the following content: According to the weighting coefficient, perform a weighting calculation on the reference sample value of the second color component of the sample at the position (i, j) in the first prediction block to obtain a prediction value of the second color component of the sample at the position (x, y) in the current block, where i, j, x, and j are all integers equal to or greater than 0.
[0184] It should be noted that in the embodiment of the present application, in order to reduce the computational complexity, upsampling filtering is not performed on the reconstructed luma information in the current block. In this case, instead of performing prediction of collocated chroma samples for the reconstructed luma information at all luma positions in the current block, some luma positions may be selected to perform prediction of collocated chroma samples. As a result, after obtaining the predicted block, downsampling filtering is not required, and the accuracy of the existing luma information can be ensured. The accurate luma information is favorable for improving the accuracy and stability of the nonlinear mapping model, and as a result, the accuracy of the chroma prediction value can be improved.
[0185] In this embodiment, in order to reduce the subsequent upsampling or downsampling operation for the prediction block, the corresponding position can be selected according to the characteristics of the YUV video format to perform chroma prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample that needs to perform chroma prediction is CurPredChroma(x, y). In this case, in some embodiments, the method may further include the following contents: If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j. If the color format information indicates 4:2:2 sampling, then set x equal to i times 2 and y equal to j. If the color format information indicates 4:1:1 sampling, then set x equal to i times 4 and y equal to j. If the color format information indicates 4:2:0 sampling, then set x equal to i times 2 and set y equal to j times 2.
[0186] Moreover, in some embodiments, the method may further include: determining a horizontal sampling position factor and a vertical sampling position factor; setting x equal to the product of i and the horizontal sampling position factor, and setting y equal to the product of j and the vertical sampling position factor.
[0187] That is, to further reduce the computational complexity during prediction, fewer collocated chroma samples can be selected to perform prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample on which chroma prediction needs to be performed is CurPredChroma(x, y). Suppose the horizontal sampling position factor of the reconstructed luma information in the current block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the position of the current luma sample and the position of the sample on which chroma prediction needs to be performed is as follows: If the color format information indicates a video in YUV444 format / YUV422 format / YUV411 format / YUV420 format, x can be set equal to the product of i and S_Pos_Hor, and y can be set equal to the product of j and S_Pos_Ver.
[0188] Furthermore, after determining the second predicted block, perform post-processing on the second predicted block under certain conditions to obtain a final second predicted block. Thus, in some embodiments, the method may further include: after determining the second predicted block of the second color component of the current block, perform related processing on the second predicted block, and the processed second predicted block is the second predicted block.
[0189] In an embodiment of the present application, performing related processing on the second predicted block includes: performing third filtering on the second predicted block; and Refine the second prediction block using a preset compensation value; and performing weighted fusion on a second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; Includes at least one of the following:
[0190] However, in one possible embodiment, the third filtering can be smoothing filtering.Exemplarily, in WCP mode, in order to reduce the instability caused by parallel prediction for each sample, for example, smoothing filtering can be performed on the second prediction block, and then the second prediction block after processing can be the final second prediction block.
[0191] In another possible embodiment, a preset compensation value of the second color component of the second predicted block is determined based on a reference sample value in an adjacent region of the current block, and the predicted value of the second color component sample in the second predicted block is improved based on the preset compensation value to determine the final second predicted block. Exemplarily, to further improve the prediction accuracy of the WCP mode, position-related refinement can be performed on the second predicted block. For example, a reference sample having a close spatial position is used to calculate a saturation compensation value of each second color component sample to be predicted, the saturation compensation value is used to refine the second color component sample in the second predicted block, and the final predicted value of the second color component sample is determined based on the improved predicted value, and the final second predicted block is obtained.
[0192] In yet another possible embodiment, a second color component sample in a second prediction block is predicted based on at least one prediction mode to determine at least one initial predicted value of the second color component sample in the second prediction block, and a final second prediction block is determined by performing a weighted fusion of the at least one initial predicted value and the predicted value of the second color component sample in the second prediction block.
[0193] In addition, in order to further improve the prediction accuracy of the WCP mode, a weighted fusion may be performed on the chroma predicted value calculated under the other prediction mode and the chroma predicted value calculated under the WCP mode, and a final chroma predicted block may be determined based on the fusion result. Exemplarily, as shown in FIG. 7, the other prediction modes may include a planar mode, a direct current (DC) mode, a vertical mode, a horizontal mode, and a CCLM mode, and each prediction mode corresponds to a switch, and the switch is used to control whether the chroma predicted value under the prediction mode is involved in the weighted fusion. It is assumed that the weight value corresponding to the planar mode is W_Planar, the weight value corresponding to the DC mode is W_DC, the weight value corresponding to the vertical mode is W_Ver, the weight value corresponding to the horizontal mode is W_Hor, the weight value corresponding to the CCLM mode is W_CCLM, and the weight value corresponding to the WCP mode is W_Wcp. For the chroma prediction value under Planar mode, the chroma prediction value under DC mode, the chroma prediction value under vertical mode, the chroma prediction value under horizontal mode, and the chroma prediction value under CCLM mode, if only the switch corresponding to CCLM mode is in an on state, a weighted fusion can be performed for the chroma prediction value under CCLM mode and the chroma prediction value under WCP mode according to W_CCLM and W_Wcp, and whether to perform an equal weighted fusion or an unequal weighted fusion can be determined according to the values of W_CCLM and W_Wcp. The weighted result is the final chroma prediction value of the second color component sample, thereby obtaining a final second prediction block.
[0194] In some embodiments, after determining the second predicted block, determining a reconstructed value of the second color component sample of the current block based on the second predicted block may include: determining a residual value of the second color component sample of the current block; determining a predicted value of the second color component sample of the current block based on the second predicted block; determining a reconstructed value of the second color component sample of the current block based on the residual value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.
[0195] In addition, in an embodiment of the present application, determining the residual value of the second color component sample of the current block may also be determining the residual value of the second color component sample of the current block by analyzing the bitstream.
[0196] In addition, in an embodiment of the present application, determining the predicted value of the second color component sample of the current block based on the second predicted block may be: setting the predicted value of the second color component sample of the current block equal to the value of the second predicted block, or performing upsampling filtering on the value of the second predicted block and setting the predicted value of the second color component sample of the current block equal to the output value after upsampling filtering.
[0197] In this way, taking the chroma component as an example, a chroma residual value of the current block can be determined by analyzing the bitstream, and then a chroma prediction value of the current block can be determined based on the second prediction block, and further, an addition can be performed on the chroma prediction value and the chroma residual value to obtain a chroma reconstruction value of the current block.
[0198] It can be seen that in the embodiment of the present application, the use of lossless luma information to perform chroma prediction during prediction in WCP mode mainly includes the following three aspects: On the one hand, the luma information of the reference sample and the current block is fully utilized to realize the calculation of the weighting coefficient of the chroma of the reference sample; On the other hand, the importance of the existing luma information is fully taken into account, and a more accurate nonlinear mapping model is established based on not losing the luma information to assign weights to the reference chroma samples to perform weighted prediction; In addition, when upsampling the reference chroma and performing collocated chroma prediction based on the position of each luma sample of the current block, the characteristics of various YUV video formats are fully taken into account, and based on the chroma subsampling formats and luma upsampling situations of different YUV videos, the spatial resolution of the chroma component and the spatial resolution of the luma component are always consistent, and the existing lossless luma information is fully utilized to perform collocated chroma prediction, thereby improving the accuracy of the chroma prediction value in WCP mode.
[0199] JPEG2025511695000048.jpg62165
[0200] This embodiment provides a decoding method. Determine a reference sample value of a first color component of a current block. Determine a weighting factor according to the reference sample value of the first color component of the current block. Determine a first predicted block of a second color component of the current block according to the weighting factor and the reference sample value of the second color component of the current block. The number of predicted values of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block. Determine a reconstructed value of the second color component sample of the current block based on the second predicted block. In this way, by using the reference samples adjacent to the current block and the color component information in the current block, a more accurate nonlinear mapping model can be established based on not only fully considering the existing color component information but also not compromising the luminance information, so as to assign a weight to each reference sample value of the chroma component to perform weighted prediction. In addition, the first filtering fully considers different color format information, and performs sampling filtering of chroma and / or luminance based on the different color format information. This ensures that the spatial resolution of the chroma component and the spatial resolution of the luma component are always consistent, and not only can it ensure the accuracy of the existing luma information, but also, when using lossless luma information to predict chroma components, it can improve the accuracy and stability of the nonlinear mapping model based on accurate luma information, improve the accuracy of chroma prediction, save bitrate, improve coding efficiency, and further improve coding performance.
[0201] In another embodiment of the present application, take chroma prediction for a current block according to the decoding method described in the above embodiment as an example. In the embodiment of the present application, the reconstructed luma information of the current block, the reference luma information and the reference chroma information in the neighboring region are all decoded reference information. Therefore, in the embodiment of the present application, a WCP technique is proposed using the above information, and based on this, in order to ensure that the reference luma information and the reconstructed luma information in the current block are not lost, the spatial resolution of the reference chroma is matched with the spatial resolution of the reference luma, and the spatial resolution of the currently predicted chroma is matched with the spatial resolution of the existing reconstructed luma, and under the matching, the predicted chroma is downsampled and filtered, and finally the chroma prediction value is post-processed.
[0202] It should be noted that the embodiment of this application mainly proposes to further improve the accuracy of chroma prediction without compromising luminance information based on WCP prediction technology. Here, the detailed steps of the chroma prediction process according to WCP mode are as follows:
[0203] WCP mode input: current block position (xTbCmp, yTbCmp), current block width nTbW, and current block height nTbH.
[0204] Output of WCP mode: Predicted values of the current block, predSamples[x][y]. The top left corner of the current block is the origin, x=0, ..., nTbW-1, and y=0, ..., nTbH-1.
[0205] The prediction process in WCP mode may include steps such as determining core parameters, upsampling filtering on reference chroma information, obtaining target information, WCP, downsampling filtering on the currently predicted chroma, and post-processing. After these steps, the chroma prediction value of the current block can be obtained.
[0206] In one specific embodiment, refer to Figure 9, which is a flow chart 2 showing a decoding method according to an embodiment of the present application. As shown in Figure 9, the method may include the following contents:
[0207] S901: Determine core parameters for WCP mode.
[0208] In addition, in S901, regarding determining the core parameters related to the WCP mode, the core parameters of the WCP mode can be obtained or estimated by setting or by some other method, for example, the core parameters are obtained from the bitstream at the decoding side.
[0209] Here, the core parameters of the WCP mode include, but are not limited to, a control parameter (S), the number of WCP inputs (inSize), and the number of WCP outputs (arranged as predSizeW×predSizeH). The first predicted block output based on the WCP can be represented as predWcp. The number of WCP outputs can be set to the same value (e.g., predSizeW=predSizeH=T / 4) or related to the size parameter of the current block (e.g., predSizeW=nTbW, predSizeH=nTbH). The control parameter (S) can be used to adjust a nonlinear function in a subsequent operation or to adjust data related to the subsequent operation.
[0210] Under certain conditions, the determination of the core parameters is affected by the block size, the block content, or the number of samples in the block. For example, when the block sizes to which the WCP mode is applied are diverse, or the difference between the block sizes is large, or the difference between the block contents is large, or the difference between the number of samples in the block is large, the current block can be classified according to its block size, block content, or the number of samples in the block, and the same or different core parameters can be determined according to different categories. That is, the control parameters (S) corresponding to different categories, or the number of WCP inputs inSize, or the number of WCP outputs (arranged as predSizeW×predSizeH) can be the same or different. Note that predSizeW and the height predSizeH can be the same or different.
[0211] In the following, two simple classifications are taken as examples to more clearly explain the determination of core parameters.
[0212] Classification example 1: In WCP mode, the current block can be classified according to its width and height, and the category of the block is represented by wcpSizeId. The control parameters (S), the number of WCP inputs inSize, and the number of WCP outputs (arranged as predSizeW x predSizeH) corresponding to blocks of different categories may be the same or different. Here, an example of classification into three categories will be described.
[0213] The current block is classified into three categories according to the width and height of the current block. The control parameter (S) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arranged as predSizeW x predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and the category wcpSizeId of the block is defined as follows:
[0214] wcpSizeId = 0 represents the current block where min(nTbW, nTbH) <= 4. The control parameter (S) is 8, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0215] wcpSizeId = 1 represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter (S) is 12, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0216] wcpSizeId = 2 represents the current block where min(nTbW, nTbH) > 16. The control parameter (S) is 16, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0217] The numerical relationships between the above core parameters are represented in a table, for example, as shown in Table 6.
[0218]
Table 6
[0219] Another example can be described by classifying into three categories.
[0220] The current block is classified into three categories according to the width and height of the current block. The control parameter (S) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arranged in predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and the block category wcpSizeId is defined as follows.
[0221] wcpSizeId = 0 represents the current block where min(nTbW, nTbH) <= 4. The control parameter(s) is 8, inSize is (2 × nTbH + 2 × nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH × nTbW.
[0222] wcpSizeId = 1 represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter(s) is 12, inSize is (1.5 × nTbH + 1.5 × nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH / 2 × nTbW / 2.
[0223] wcpSizeId = 2 represents the current block where min(nTbW, nTbH) > 16. The control parameter(s) of WCP is 16, inSize is (nTbH + nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH / 4 × nTbW / 4.
[0224] The numerical relationships among the above core parameters are represented in a table, for example, as shown in Table 7.
[0225] [Table 7]
[0226] Classification Example 2: In the WCP mode, the current block can also be classified according to the width and height of the current block, and the block category is represented by wcpSizeId. The control parameter(s) (S), the number of WCP inputs inSize, and the number of WCP outputs (arranged in predSizeW × predSizeH) corresponding to blocks of different categories may be the same or different. Here, an example of classification into three categories will be described.
[0227] The current block is classified into three categories according to the width and height of the current block. The control parameter (S) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arranged as predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW×nTbH represents the number of samples of the current block. The block category wcpSizeId is defined as follows:
[0228] wcpSizeId=0: represents the current block where (nTbWnTbH)<128. The control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0229] wcpSizeId=1: represents the current block where 128<=(nTbWnTbH)<=256. The control parameter (S) is 8, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0230] wcpSizeId=2: represents the current block where (nTbWnTbH) > 256. The control parameter (S) is 1, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0231] The numerical relationships between the above core parameters may be tabulated, for example as shown in Table 8.
[0232] [Table 8]
[0233] This can also be illustrated with other examples that fall into three categories.
[0234] The current block is classified into three categories according to the width and height of the current block. The control parameter (S) corresponding to different categories can be set differently, and the inSize and the number of WCP outputs (arranged as predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW×nTbH represents the number of samples of the current block. The block category wcpSizeId is defined as follows:
[0235] wcpSizeId=0: represents the current block where (nTbWnTbH)<64. The control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0236] wcpSizeId=1: represents the current block where 64<=(nTbWnTbH)<=512. The control parameter (S) is 4, inSize is (1.5×nTbH+1.5×nTbW), and the number of chroma predictors is the number of WCP outputs, nTbH / 2×nTbW / 2.
[0237] wcpSizeId=2: represents the current block where (nTbWnTbH)>512. The control parameter (S) is 1, inSize is (nTbH+nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH / 4×nTbW / 4.
[0238] The numerical relationships between the above core parameters may be tabulated, for example as shown in Table 9.
[0239] [Table 9]
[0240] S902: Perform upsampling filtering on the reference chroma information without compromising the reference luma information to maintain the same spatial resolution as the reference luma information.
[0241] In addition, for S902, when predicting the current block, the top region, the top left region, and the left region of the current block are considered to be adjacent regions (which may also be called "reference regions") of the current block, and all samples in the adjacent regions are decoded reference samples, as shown in Figure 6A above.
[0242] Here, the reference chroma information refC and the reference luma information refY can be obtained from the adjacent region. Human eyes are relatively sensitive to luma information, and in the embodiment of the present application, the existing luma information is mainly used to build a model to perform chroma prediction, so that the reference luma information is considered from the perspective of not compromising, and upsampling filtering is performed on the reference chroma information for different YUV video formats to achieve matching between the spatial resolution of the reference chroma information and the spatial resolution of the reference luma information. In a specific embodiment, as shown in FIG. 10, step S902 may include the following contents:
[0243] S1001: There is no loss in reference luminance information.
[0244] S1002: The reference luminance information is not changed.
[0245] S1003: Upsampling filtering is performed on the reference luminance information.
[0246] S1004: If the reference luminance information is not changed, the reference chroma information is not changed.
[0247] S1005: If the reference luma information is not changed, upsampling filtering is performed on the reference chroma information.
[0248] S1006: When upsampling filtering is performed on the reference luminance information, upsampling filtering is performed on the reference chroma information.
[0249] Furthermore, while ensuring that there is no loss in the reference luma information, it can be divided into two cases: (1) the reference luma information is not changed; and (2) upsampling filtering is performed on the reference luma information. Case (1) can be further divided into two subcases: (a) the reference chroma information is not changed; and (b) upsampling filtering is performed on the reference chroma information. For case (2), there is no subcase where the reference chroma information is not changed, so upsampling filtering needs to be performed on the reference chroma information.
[0250] In case (1), i.e., step S1002, the reference luma information is not changed, so there is no loss of luma information. In this case, due to the diversity of YUV video formats, the reference chroma information needs to be processed in different subcases.
[0251] Sub-case 1: For videos in YUV444 format, the spatial resolution of the luma component and the spatial resolution of the chroma component are equal, in which case there is no need to perform any processing on the reference chroma component.
[0252] Subcase 2: For videos with chroma subsampling characteristics such as YUV422, YUV411, and YUV420, the spatial resolution of the luma component is not consistent with the spatial resolution of the chroma component, and the spatial resolution of the chroma component is smaller than the spatial resolution of the luma component. In this case, it is necessary to perform upsampling filtering on the reference chroma component based on the YUV video format. The upsampling filtering method may be any one of linear interpolation methods, such as nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, average interpolation, median interpolation, copy interpolation, etc. Or, the upsampling filtering method may be any one of nonlinear interpolation methods, such as an interpolation algorithm based on wavelet transform, an interpolation algorithm based on edge information, etc. Or, the upsampling filtering may be performed based on a convolutional neural network. No limitations are imposed in the embodiments of the present application. Here, the YUV420 video format and copy interpolation are described as an example, and FIG. 6B shows an interpolation method of reference chroma copy for 4×1 reference chroma information and 8×2 reference luma information. As shown in Figure 6B, the 8x2 shaded block is the reference luma information, the 4x1 grid shaded block is the collocated reference chroma information, and each sample in the 4x1 grid shaded block corresponds to the upper left corner sample of each 2x2 sub-block in the 8x2 chroma block after upsampling filtering, that is, the sample value of each chroma sample in the 2x2 sub-block after copy interpolation is the same. Specifically, for each 2x2 sub-block, the other three chroma samples (dot shaded blocks) are all obtained by copying the upper left corner sample (grid shaded block).
[0253] In case (2), that is, in step S1003, upsampling filtering is performed on the reference luma information. In this case, there is no loss of luma information. In this case, since the spatial resolution of the luma component is always equal to or greater than the spatial resolution of the chroma component in the YUV format video, it is necessary to perform upsampling filtering on the reference chroma information so as to make the spatial resolution of the reference chroma information consistent with that of the reference luma information. In this case, it is necessary to determine the spatial upsampling rate of the reference chroma information according to the YUV video format and the spatial upsampling rate of the reference luma information. Here, the horizontal upsampling rate of the reference luminance information (i.e., the first horizontal upsampling factor in the aforementioned embodiment) is denoted as S_Hor_RefLuma, the vertical upsampling rate of the reference luminance information (i.e., the first vertical upsampling factor in the aforementioned embodiment) is denoted as S_Ver_RefLuma, the horizontal upsampling rate of the reference chroma information (i.e., the second horizontal upsampling factor in the aforementioned embodiment) is denoted as S_Hor_RefChroma, and the vertical upsampling rate of the reference chroma information (i.e., the second vertical upsampling factor in the aforementioned embodiment) is denoted as S_Ver_RefChroma.
[0254] For video in YUV444 format, S_Hor_RefChroma = S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV422 format video, S_Hor_RefChroma = 2 * S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV411 format video, S_Hor_RefChroma = 4 * S_Hor_RefLuma and S_Ver_RefChroma = S_Ver_RefLuma. For YUV420 format video, S_Hor_RefChroma=2*S_Hor_RefLuma and S_Ver_RefChroma=2*S_Ver_RefLuma.
[0255] S903: Determine target information of the current block according to the core parameters.
[0256] Note that in S903, the target information of the current block may include reference chroma information (refC), reference luma information (refY), and reconstructed luma information (recY). The reference chroma information refC and the reference luma information refY are obtained from the reference area of FIG. 6A. Note that the obtained reference chroma information includes, but is not limited to, corresponding reference chroma information obtained based on the position of the reference luma information. The obtained reference luma information includes, but is not limited to, a reference reconstructed luma value selected from the top area of the current block and a reference reconstructed luma value selected from the left area of the current block.
[0257] In addition, in an embodiment of the present application, refC, refY, or recY can be pre-processed under certain conditions and then used as input for WCP.
[0258] For example, for a current block having a different size, different filtering may be performed on refC, refY, or recY. Obtaining target information may include the following: Obtaining reference chroma information refC, whose number is inSize. Here, refC may be upsampling filtered or may not be upsampling filtered. If preprocessing such as filtering is required, refC is obtained after preprocessing.
[0259] Obtaining the target information may include the following: Obtain reference luminance information refY, the number of which is inSize. Here, refY may be upsampling filtered or may not be upsampling filtered. If preprocessing such as filtering is required, refY is obtained after preprocessing.
[0260] In addition, obtaining the target information may further include: obtaining reconstructed luminance information recY in the current block, which will be detailed in the following steps;
[0261] S904: Perform WCP based on the target information without losing the reconstructed luminance information in the current block to obtain a first predicted block of the current block.
[0262] In addition, in order not to damage the reconstructed luminance information in the current block, the acquired reconstructed luminance information recY may not be processed or may be up-sampling filtered. As shown in Fig. 11, acquiring the reconstructed luminance information may include the following steps:
[0263] S1101: There is no loss in reconstructed luminance information in the current block.
[0264] S1102: The reconstructed luminance information in the current block is not changed.
[0265] S1103: Upsampling filtering is performed on the reconstructed luminance information in the current block.
[0266] That is, in order to obtain a more accurate chroma prediction value, in the embodiment of the present application, for each luminance sample in the current block, the difference between the luminance value of the luminance sample and the reference luminance is calculated to obtain a luminance difference, and the weight of the collocated reference chroma of each reference luminance is obtained based on the luminance difference, and finally, weighted prediction is performed based on the weight to obtain the WCP value of each collocated chroma. In this way, the spatial resolution of the prediction block obtained through the above process is consistent with the spatial resolution of the current block. Therefore, the reconstructed luminance information in the current block can be operated according to the following two cases.
[0267] In case 1 (ie, in step S1102), if no processing is performed on the reconstructed luminance information in the current block, it is necessary to estimate the size of the first predicted block to be output according to the YUV video format. For video in YUV444 format, the spatial resolution of the luma and chroma components is equal, in which case predSizeW=nTbW and predSizeH=nTbH. For video in YUV422 format, the luma and chroma components have the same vertical resolution, but the horizontal resolution of the chroma component is 1 / 2 that of the luma component, in which case predSizeW=2×nTbW and predSizeH=nTbH. For video in YUV411 format, the luma and chroma components have the same vertical resolution, but the horizontal resolution of the chroma component is 1 / 4 of that of the luma component, in which case predSizeW=4×nTbW and predSizeH=nTbH. For video in YUV420 format, the horizontal resolution of the chroma component is 1 / 2 that of the luma component, and the vertical resolution of the chroma component is 1 / 2 that of the luma component, in which case predSizeW=2×nTbW and predSizeH=2×nTbH.
[0268] In case 2 (i.e., in step S1103), when upsampling filtering is performed on the reconstructed luminance information in the current block, the manner of upsampling filtering may be any one of linear interpolation methods, for example, nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, average interpolation, median interpolation, copy interpolation, etc. Or, the manner of upsampling filtering may be any one of nonlinear interpolation methods, for example, an interpolation algorithm based on wavelet transform, an interpolation algorithm based on edge information, etc. Or, the upsampling filtering may be performed based on a convolutional neural network. After upsampling filtering is performed on the reconstructed luminance information in the current block, the size of the output first prediction block needs to be estimated based on the YUV video format and the spatial upsampling rate of the reconstructed luminance information. The horizontal upsampling rate of the reconstructed luminance information (i.e., the third horizontal upsampling factor in the above embodiment) is denoted as S_Hor_RecLuma, and the vertical upsampling rate of the reconstructed luminance information (i.e., the third vertical upsampling factor in the above embodiment) is denoted as S_Ver_RecLuma.
[0269] For video in YUV444 format, the spatial resolution of the luma and chroma components is equal, in which case predSizeW=S_Hor_RecLuma×nTbW and predSizeH=S_Ver_RecLuma×nTbH. For video in YUV422 format, the luma and chroma components have the same vertical resolution, but the horizontal resolution of the chroma component is 1 / 2 that of the luma component, in which case predSizeW=2×nTbW×S_Hor_RecLuma and predSizeH=nTbH×S_Ver_RecLuma. For video in YUV411 format, the luma and chroma components have the same vertical resolution, but the horizontal resolution of the chroma component is 1 / 4 of the horizontal resolution of the luma component, in which case predSizeW=4×nTbW×S_Hor_RecLuma and predSizeH=nTbH×S_Ver_RecLuma. For video in YUV420 format, the horizontal resolution of the chroma component is 1 / 2 that of the luma component, and the vertical resolution of the chroma component is 1 / 2 that of the luma component, in which case predSizeW=2×nTbW×S_Hor_RecLuma and predSizeH=2×nTbH×S_Ver_RecLuma.
[0270] For example, assuming that the horizontal upsampling rate of the reconstructed luminance information S_Hor_RecLuma is abbreviated as upHor and the vertical upsampling rate of the reconstructed luminance information S_Ver_RecLuma is abbreviated as upVer, the reconstructed luminance information recY is subjected to upsampling filtering to generate the input reconstructed luminance information in_recY. An example of the interpolation process is as follows.
[0271] First, the upper reference reconstructed luminance sample refY_T is filled in the upper row in_recY[x][-1] of the reconstructed luminance information to be input, and the left reference reconstructed luminance sample refY_L is filled in the left column in_recY[-1][y] of the reconstructed luminance information to be input. x=0, ..., predSizeW-1, y=0, ..., predSizeH-1. In this case, recY is filled in the corresponding position ((x+1) x upHor-1, (y+1) x upVer-1) in in_recY based on the following formula:
number
[0272] It can be understood as follows: in_recY is evenly divided into recSizeW×recSizeH sub-blocks, and the filled position is the lower right corner of each sub-block. Referring to FIG. 12, for example, predSizeW=8, predSizeH=8, and the current block size is 4×4, the shaded area is the reference reconstructed luminance sample refY_T on the upper side, the vertical line area is the reference reconstructed luminance sample refY_L on the left side, and the grid area is the area filled with the reconstructed luminance information recY of the current block.
[0273] If the horizontal upsampling factor upHor is greater than 1, the upsampling is performed horizontally first, and the upsampling process is given by:
number
number
[0274] This process can be seen in Figure 13. Take predSizeW=8, predSizeH=8, and the current block size is 4x4 as an example, when performing horizontal upsampling, among the left reference luminance samples refY_L, the samples corresponding to the horizontal positions filled with rec_Y are also used as reference samples for upsampling, and are indicated by grid lines. In this case, all the samples marked with grid lines are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two grid lines on the horizontal direction are indicated by horizontal lines.
[0275] Upsampling is performed by linear interpolation. That is, the value of each interpolated sample (filled with horizontal lines) between two reference luma samples (filled with grids) for upsampling is the weighted average value of the two reference luma samples for upsampling. According to Equation 18 and Equation 19, the weight of the left reference chroma sample for upsampling is (upHor-dX) / upHor, and the weight of the right reference chroma sample for upsampling is dX / upHor, where dX=1, ..., upHor-1, and dx is the distance between the current interpolated sample and the left reference sample. Thus, when interpolating in the horizontal direction, the weight is related only to the horizontal upsampling rate upHor. FIG. 14 shows an example of the weight. In this example, upHor=4. For the first interpolated sample in FIG. 14, the weight of the left reference chroma sample for upsampling is 3 / 4, and the weight of the right reference chroma sample for upsampling is 1 / 4. For the second interpolated sample in Figure 14, the weight of the left reference chroma sample for upsampling is 2 / 4 and the weight of the right reference chroma sample for upsampling is 2 / 4. For the third interpolated sample in Figure 14, the weight of the left reference chroma sample for upsampling is 1 / 4 and the weight of the right reference chroma sample for upsampling is 3 / 4.
[0276] When the vertical upsampling factor upVer is greater than 1, vertical upsampling is required, and the process is similar to that of horizontal upsampling. The specific process is shown in the following equation:
number
number
[0277] This process can be seen in Figure 15. Taking predSizeW=8, predSizeH=8, and the current block size is 4x4 as an example, after completing the horizontal upsampling shown in Figure 13, all the existing samples in the upper reference luma samples refY_T and in_recY are used as reference samples for vertical upsampling, which are indicated by grid lines. In this case, all the samples marked with grid lines are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two grid lines on the vertical direction are indicated by horizontal lines.
[0278] Upsampling is performed by linear interpolation. According to Equation (20) and Equation (21), the weight of the upper reference sample for upsampling is (upVer-dY) / upVer, and the weight of the lower reference sample is dY / upVer, where dY=1, ..., upVer-1, and dY is the distance between the current interpolated sample and the upper reference sample. Thus, when performing vertical interpolation, the weight is related only to the vertical upsampling rate upVer.
[0279] In this way, the final in_recY can be obtained by the above process. In addition to using the "first horizontal, then vertical" upsampling method, the above interpolation process can also use the "first vertical, then horizontal" upsampling method. Furthermore, the reconstructed luminance value obtained by the "first horizontal, then vertical" upsampling and the reconstructed luminance value obtained by the "first vertical, then horizontal" upsampling can be averaged to obtain the final reconstructed luminance value in_recY to be input. Also, instead of the upsampling operation, a convolution operation in a neural network can be used. The embodiments of the present application do not make any limitations thereon.
[0280] Thus, the finally obtained input target information may include reference chroma information refC, the number of which is inSize, reference luma information refY, the number of which is inSize, and reconstructed luma information recY in the current block.
[0281] JPEG2025511695000058.jpg107168
[0282] In a specific embodiment, after obtaining the reconstructed brightness information, as shown in FIG. 16, the method may further include:
[0283] S1601: For a sample waiting to be predicted at each luminance position, a luminance difference vector is constructed using reference chroma information, reference luminance information included in the target information, and reconstructed luminance information of the current block.
[0284] JPEG2025511695000059.jpg33169
number
[0285] In addition, under certain conditions, linear or nonlinear numerical processing can be performed on the luminance difference vector of the sample to be predicted. For example, the value of the luminance difference vector of the sample to be predicted can be scaled based on the control parameter S in the core parameters.
[0286] S1602: For samples awaiting prediction at each luminance position, a weight vector is calculated using a nonlinear function based on the luminance difference vector.
[0287] JPEG2025511695000062.jpg62169
[0288] JPEG2025511695000063.jpg35169
number
[0289] Under certain conditions, the weight model can also be adjusted based on the control parameter (S) in the core parameters. For example, if the size of the current block is flexible, the weight model can be adjusted based on the control parameter (S). Taking the nonlinear Softmax function as an example, different control parameters can be selected to adjust the function according to different block categories to which the current block belongs. In this case, the formula for calculating the weight vector corresponding to each sample waiting to be predicted is as follows:
number
[0290] In the embodiment of the present application, the weighting coefficient can also be subjected to fixed-point arithmetic. Thus, in some embodiments, the method further includes: if the weighting coefficient is a floating-point weighting factor, perform fixed-point arithmetic on the floating-point weighting coefficient to obtain a fixed-point weighting factor.
[0291] In this way, after completing the calculations based on Equation (23) or (24), fixed-point arithmetic can be performed on cWeightFloat as follows:
number
[0292] S1603: For samples waiting to be predicted at each luminance position, a weighting calculation is performed based on the weight vector and the reference chroma information included in the target information to obtain a chroma prediction value.
[0293] JPEG2025511695000068.jpg57166
[0294] In one possible embodiment, the method may include the following: performing a weighting calculation based on a floating-point weighting coefficient and reference chroma information to obtain an initial predicted value of the sample to be predicted; performing a fixed-point operation on the initial predicted value to obtain a target predicted value of the sample to be predicted.
[0295] Exemplarily, the calculation formula is as follows: For k=0, 1, ..., inSize-1,
number
number
number
number
[0296] In another possible embodiment, a weighting calculation is performed based on fixed-point weighting coefficients and reference chroma information to obtain an initial predicted value for the sample to be predicted, and fixed-point compensation is performed on the initial predicted value to obtain a target predicted value for the sample to be predicted.
[0297] Exemplarily, the calculation formula is as follows: For k = 0, 1, ..., inSize - 1,
Number
Number
[0298] S1604: For the samples waiting for prediction at each luminance position, improve the calculated chroma prediction value to determine the first prediction block of the current block.
[0299] JPEG2025511695000077.jpg70168
[0300] BitDepth is the bit depth required for the chroma sample values to ensure that all chroma prediction values within the prediction block are between 0 and (1 << BitDepth)-1. That is,
Number
Number
Number
[0301] S905: Perform downsampling filtering on the calculated first prediction block to determine the second prediction block of the current block. The chroma components of the second prediction block and the current block have the same spatial resolution.
[0302] In addition, in step S905, chroma prediction is performed on the reconstructed luminance information at each position in the current block to finally obtain a first predicted block whose size is predSizeW×predSizeH. In this case, since the size of the first predicted block is equal to or larger than the size of the current block, it is necessary to perform downsampling filtering on the first predicted block so as to restore it to the same size as the size of the current block.
[0303] First, a horizontal downsampling factor downHor is calculated based on the width predSizeW of the output first predicted block and the width nTbW of the current block. Similarly, a vertical downsampling factor downVer is calculated based on the height predSizeH of the output first predicted block and the height nTbH of the current block. The calculation method is as follows.
number
number
[0304] Then, perform downsampling filtering on the first prediction block predWcp and fill the sampled values into the second prediction block predSamples according to the following conditions:
[0305] (i) If downHor is greater than 1 and downVer is equal to 1, downsampling filtering needs to be performed only in the horizontal direction. The specific calculation formula is as follows:
number
[0306] (ii) If downHor is equal to 1 and downVer is greater than 1, downsampling should be performed only in the vertical direction. The specific calculation formula is as follows:
number
[0307] (iii) If both downHor and downVer are greater than 1, downsampling must be performed in both the horizontal and vertical directions. The specific calculation formula is as follows:
number
[0308] (iv) If downHor and downVer are both equal to 1, there is no need to perform downsampling in both the horizontal and vertical directions. The specific calculation formula is as follows:
number
[0309] S906: Perform post-processing on the chroma prediction value of the second prediction block to determine a target prediction block of the current block.
[0310] In addition, after outputting the chroma prediction value (predWcp) based on WCP in S906, under certain conditions, post-processing is required to obtain the final chroma prediction value (predSamples). Under conditions other than the above conditions, the final chroma prediction value predSamples is predWcp.
[0311] For example, in order to reduce instability due to parallel prediction for each sample in WCP, smooth filtering may be performed on predWcp, and the smooth filtered value may be used as the final chroma prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, position-related refinement may be performed on predWcp. For example, a chroma compensation value may be calculated for each sample waiting to be predicted using a reference sample that is close in spatial position, and predWcp may be improved using the chroma compensation value, and the improved prediction value may be used as the final chroma prediction value predSamples. Alternatively, in order to further improve the accuracy of the WCP prediction value, weighted fusion may be performed on the chroma prediction value calculated in another chroma prediction mode and the chroma prediction value predWcp calculated by WCP, and the fusion result may be used as the final chroma prediction value predSamples. For example, the chroma prediction value obtained by prediction in CCLM mode and the chroma prediction value predWcp calculated by WCP may be weighted equally or unequally, and the weighted result may be used as the final chroma prediction value predSamples. Alternatively, in order to improve the prediction performance of the WCP, a neural network model is used to improve the prediction output predWcp in the WCP. The embodiment of the present application does not impose any limitations thereon.
[0312] In addition, in the embodiment of the present application, in order to prevent the loss of luma information when performing chroma prediction, the reference luma information and the current reconstructed luma information are not downsampled and filtered, and the luma is left as it is or the luma is upsampled. Then, the absolute value of the difference between the current reconstructed luma information and the reference luma information of each luma sample is calculated, and the absolute value of the difference is nonlinearly mapped to obtain the weight of each reference luma sample, and all the reference luma samples are weighted to obtain the predicted value of the collocated chroma sample. In this way, since the number of chroma samples that need to be predicted is the same as the number of luma samples in the current reconstructed luma area, it is necessary to perform downsampled filtering on the chroma prediction block to restore it to the same size as the size of the original chroma block. Thereby, the accuracy of the existing luma information can be ensured, and the accurate luma information is favorable to improving the accuracy and stability of the nonlinear mapping model, so that the accuracy of the chroma prediction value can be improved.
[0313] In order to reduce the computational complexity, instead of performing upsampling filtering on the current reconstructed luma information and performing prediction of co-located chroma samples on the current reconstructed luma information at all luma positions, some luma positions can be selected to perform prediction of co-located chroma samples. In this way, downsampling filtering is not necessarily performed on the chroma prediction block later. In another specific embodiment, as shown in FIG. 17, the method may include the following contents.
[0314] S1701: There is no loss in reconstructed luminance information in the current block.
[0315] S1702: The reconstructed luminance information in the current block is not changed.
[0316] S1703: For samples waiting to be predicted at some luminance positions, a luminance difference vector is constructed using reference chroma information, reference luminance information included in the target information, and reconstructed luminance information of the current block.
[0317] S1704: For samples waiting to be predicted that are located at some luminance positions, a weight vector is calculated using a nonlinear function based on the luminance difference vector.
[0318] S1705: For samples waiting to be predicted at some luminance positions, weighting calculation is performed based on the weight vector and reference chroma information included in the target information to obtain a chroma prediction value.
[0319] S1706: For samples waiting to be predicted at some luminance positions, the calculated chroma prediction values are improved to determine the first prediction block of the current block.
[0320] Note that in the embodiment of the present application, each improvement includes clipping.
[0321] In addition, in the embodiment of the present application, some luma locations can be selected to predict the co-located chroma samples, the process of which is described below.
[0322] (i) In order to reduce the subsequent upsampling filtering or downsampling filtering operation for the chroma prediction block, the corresponding position can be selected based on the characteristics of the YUV video format to perform chroma prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample that needs to perform chroma prediction is CurPredChroma(x, y). The coordinate relationship between the positions of these two samples is as follows: If video in YUV444 format is shown, then x = i and y = j. If video in YUV422 format is presented, then x = 2xi and y = j. If video in YUV411 format is being shown, then x = 4 × i and y = j. If video in YUV420 format is presented, then x = 2 x i and y = 2 x j.
[0323] (ii) To further reduce the computational complexity during chroma prediction, fewer collocated chroma samples can be selected to perform prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample for which chroma prediction needs to be performed is CurPredChroma(x, y). Suppose the horizontal sampling position factor of the current luma block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the position of the current luma sample and the position of the sample for which chroma prediction needs to be performed is as follows: If video in YUV444 / YUV422 / YUV411 / YUV420 format is presented, then x=i×S_Pos_Hor and y=j×S_Pos_Ver.
[0324] It can be further understood that in the embodiment of the present application, not only can different downsampling filtering methods be adopted in different cases in the embodiment of the present application, but also can be adopted in all cases, that is, without considering the horizontal downsampling factor and the vertical downsampling factor, calculate the average value of these predicted values for each nTbW / predSizeW predicted value or each nTbH / predSizeH predicted value in the direction (vertical or horizontal) that needs downsampling filtering, and use the average value as the predicted value after downsampling. Or, the downsampling filtering operation can be replaced by the convolution and pooling operation in the neural network model. The embodiment of the present application does not make any restriction thereon.
[0325] JPEG2025511695000087.jpg153168
[0326] In another embodiment of the present application, refer to Fig. 18, which is a flow chart 1 illustrating an encoding method according to an embodiment of the present application. As shown in Fig. 18, the method may include the following contents:
[0327] S1801: Determine the reference sample value of the first color component of the current block.
[0328] In addition, the encoding method of the embodiment of the present application is applied to an encoding apparatus or an encoding device (also referred to as an "encoder") in which the encoding apparatus is integrated. In addition, the encoding method of the embodiment of the present application specifically refers to an intra prediction method, and more specifically, may refer to a weight-based chroma prediction (WCP) method.
[0329] In an embodiment of the present application, a 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. The current block here refers to an encoding block in a video image on which intra prediction is currently performed. Also, assuming that a prediction is performed on a first color component of the current block, and the first color component is a luma component, that is, the component to be predicted is a luma component, the current block may also be called a luma prediction block. Or, assuming that a prediction is performed on a second color component of the current block, and the second color component is a chroma component, that is, the component to be predicted is a chroma component, the current block may also be called a chroma prediction block.
[0330] In addition, in an embodiment of the present application, the reference information of the current block may include values of the first color component samples in the neighboring regions of the current block and values of the second color component samples in the neighboring regions of the current block. These samples may be determined based on the encoded samples in the neighboring regions of the current block. In some embodiments, the neighboring regions of the current block may include at least one of an upper neighboring region, an upper right neighboring region, a left neighboring region, and a lower left neighboring region.
[0331] In some embodiments, determining the reference sample value of the first color component of the current block may include determining the reference sample value of the first color component of the current block based on values of first color component samples in adjacent regions of the current block.
[0332] It should be noted that in the embodiment of the present application, the reference sample of the current block can refer to the reference sample adjacent to the current block, and may also be called the first color component sample and the second color component sample in the neighboring region of the current block, and is represented as Neighboring Sample or Reference Sample. In addition, in the embodiment of the present application, the first color component is a luminance component, and the second color component is a chroma component. In this case, the value of the first color component sample in the neighboring region of the current block is represented as reference luminance information corresponding to the reference sample of the current block, and the value of the second color component sample in the neighboring region of the current block is represented as reference chroma information corresponding to the reference sample of the current block.
[0333] In some embodiments, regarding determining a value of the first color component sample, the method may further include determining the value of the first color component sample by selecting from among the first color component samples in adjacent regions.
[0334] It should be noted that the first color component samples in the neighboring regions may contain some insignificant samples (e.g., the correlation between these samples is poor) or abnormal samples. In order to ensure the accuracy of prediction, these samples need to be removed, so as to obtain a valid first color component sample value. That is, in the embodiment of the present application, a first sample set is formed based on the first color component samples in the neighboring regions of the current block. In this case, the value of the first color component sample can be determined by selecting from the first sample set.
[0335] In a specific embodiment, determining a value of the first color component sample by selecting from the first color component samples in the adjacent region may include: determining a sample position to be selected based on a position and / or a color component intensity of the first color component sample in the adjacent region; determining a value of the first color component sample from the adjacent region based on the sample position to be selected.
[0336] It should be noted that in the embodiment of the present application, the color component intensity can be represented by color component information such as reference luminance information, reference chroma information, etc. A larger value of the color component information indicates a higher color component intensity. In this way, the first color component samples in the neighboring region can be selected based on the sample position or based on the color component intensity. A valid first color component sample is determined based on the selected sample, and a value of the first color component sample is further determined.
[0337] In some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a second filtering on the value of the first color component sample to obtain a filtered adjacent sample value of the first color component of the current block; and determining the reference sample value of the first color component of the current block based on the filtered adjacent sample value of the first color component of the current block. In an embodiment of the present application, the number of the filtered adjacent sample values of the first color component of the current block is greater than the number of values of the first color component sample.
[0338] In the embodiment of the present application, the second filtering can be upsampling filtering. The first color component is a luminance component. In order to ensure that there is no loss in the reference luminance information, the reference luminance information can be left unchanged here, or can be subjected to upsampling filtering on the reference luminance information.
[0339] In some embodiments, determining the reference sample value of the first color component of the current block may further include determining the reference sample value of the first color component of the current block based on a reconstructed value of the first reference color component sample in the current block.
[0340] In an embodiment of the present application, the first reference color component may be a luminance component, in which case the reconstructed value of the first reference color component sample in the current block is the reconstructed luminance information of the current block.
[0341] Furthermore, in some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a third filtering on the reconstructed value of the first reference color component sample in the current block to obtain a filtered sample value of the first reference color component sample in the current block; and determining the reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.
[0342] In an embodiment of the present application, the number of filtered sample values of the first reference color component sample in the current block is greater than the number of reconstructed values of the first reference color component sample in the current block.
[0343] In the embodiment of the present application, the third filtering can be upsampling filtering. The first reference color component is a luminance component. In order to ensure that the reconstructed luminance information in the current block has no loss and obtain a more accurate chroma prediction value, the reconstructed luminance information in the current block can be left unchanged here, or the reconstructed luminance information in the current block can be subjected to upsampling filtering.
[0344] As can be understood, in the embodiment of the present application, the reference sample value of the first color component of the current block can also be set to the luminance difference information. Thus, in one possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.
[0345] In another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.
[0346] In yet another possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.
[0347] In a further possible embodiment, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.
[0348] That is, while keeping the luminance information lossless, the reference luminance information in the neighboring region of the current block may be upsampled and filtered, the reconstructed luminance information in the current block may be upsampled and filtered, or both the reference luminance information and the reconstructed luminance information may be upsampled and filtered, or both the reference luminance information and the reconstructed luminance information may not be upsampled and filtered. Then, the luminance difference information is determined according to different combinations, and the luminance difference information is used as the reference sample value of the first color component of the current block.
[0349] S1802: Determine a weighting coefficient based on the reference sample value of the first color component of the current block.
[0350] It should be noted that in an embodiment of the present application, determining a weighting coefficient based on the reference sample value of the first color component of the current block may include: determining a value corresponding to the reference sample value of the first color component in a preset mapping; setting the weighting coefficient equal to the value;
[0351] As can be understood, in the embodiment of the present application, the reference sample value of the first color component may be an absolute value of a difference between a filtered adjacent sample value of the first color component of the current block and a filtered sample value of the first reference color component sample in the current block, where the first reference color component is a first color component, and the first color component is a color component different from the second color component to be predicted in the embodiment of the present application.
[0352] JPEG2025511695000088.jpg52169
[0353] Further, in some embodiments, determining a value in the preset mapping corresponding to the reference sample value of the first color component may include: determining a first factor; determining a first product value based on the first factor and the reference sample value of the first color component; and determining a value in the preset mapping corresponding to the first product value.
[0354] In a particular embodiment, determining the first factor may include the first factor being a preset constant value.
[0355] In another specific embodiment, determining the first factor may include determining a value of the first factor based on a size parameter of the current block.
[0356] Moreover, in some embodiments, the method may further include determining a value of the first factor based on a preset mapping lookup table between a size parameter of the current block and a value of the first factor.
[0357] Here, the size parameter of the current block may include at least one parameter of the width of the current block, the height of the current block, and the product of the width and height of the current block.
[0358] It should be noted that in the embodiment of the present application, a classification method can be adopted to determine the value of the first factor. For example, the size parameters of the current block are classified into three categories, and the values of the first factor corresponding to each category are determined. In this case, in the embodiment of the present application, a mapping lookup table between the size parameters of the current block and the values of the first factor can be stored in advance, and then the value of the first factor can be determined based on the lookup table. For example, the above Table 1 shows the correspondence relationship between the first factor and the size parameters of the current block.
[0359] In yet another specific embodiment, determining the first factor may include determining a value of the first factor based on a number of reference samples of the current block.
[0360] Furthermore, in some embodiments, the method may further include determining a value of the first factor based on a preset mapping lookup table between the number of reference samples of the current block and the value of the first factor.
[0361] It should be noted that in the embodiment of the present application, the number of reference samples can be classified into three categories, and the value of the first factor can still be determined by adopting a classification method. For example, the number of reference samples of the current block can be classified into three categories, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiment of the present application, a mapping lookup table between the number of reference samples of the current block and the value of the first factor can be stored in advance, and then the value of the first factor can be determined based on the lookup table. For example, the above Table 2 shows the correspondence relationship between the first factor and the number of reference samples of the current block.
[0362] Furthermore, for the first product value, determining the first product value based on the first factor and the reference sample value of the first color component may include: the first product value is set equal to the product of the first factor and the reference sample value of the first color component; or the first product value is set equal to a value obtained by performing a bit right shift on the reference sample value of the first color component, where the number of right shifted bits is equal to the first factor; or the first product value is set to a value obtained by performing an addition and bit shift operation on the reference sample value of the first color component based on the first factor.
[0363] For example, assume that the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref, the first product value is equal to 0.25×Ref, which can also be represented as Ref / 4, i.e., Ref>>2. Also, during fixed-point arithmetic, floating-point numbers may be converted into addition and shift operations, i.e., there is no restriction on the calculation method of the first product value.
[0364] JPEG2025511695000089.jpg58168
[0365] JPEG2025511695000090.jpg30168
[0366] Further, for the second factor, in a specific embodiment, the method may further include determining the second factor by performing a least squares calculation based on the first color component value of the reference sample and the second color component value of the reference sample.
[0367] That is, assuming that the number of reference samples is N, a first color component value of the reference samples is reference luminance information of the current block, and a second color component value of the reference samples is reference chroma information of the current block, the second factor can be obtained by performing a least squares regression calculation on the chroma component values and luminance component values of the N reference samples. Exemplarily, the least squares regression calculation is as shown in Equation 5 above, and the second factor can be calculated.
[0368] Also, regarding the preset mapping, in some embodiments, the preset mapping may be a Softmax function, such as that shown in the above-mentioned Equation 6 or Equation 7. Although the Softmax function is a normalized exponential function, in the embodiments of the present application, normalization may not be required, and the value range is not limited to [0, 1].
[0369] Furthermore, with regard to the preset mapping, in addition to the Softmax function, in other embodiments, the preset mapping may be a weighting function that is inversely proportional to the reference sample value of the first color component, such as that shown in the above-mentioned equation (8) or equation (9).
[0370] In this way, the preset mapping may be that shown in Equation 4, or that shown in Equation 6 or Equation 7, or that shown in Equation 8 or Equation 9, or may be another function model of weighting coefficients constructed by fitting a tendency that the stronger the similarity between the reference luminance value of the reference sample and the reconstructed luminance value of the sample to be predicted in the current block, the more important the reference chroma value of the reference sample is to the sample to be predicted in the current block. Furthermore, the operation can be simplified, for example, by adopting the method of an array element lookup table, a part of the calculation operation is simplified. The embodiment of the present application is not particularly limited.
[0371] JPEG2025511695000091.jpg39169
[0372] S1803: Determine a first prediction block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block.
[0373] However, in the embodiment of the present application, in order to avoid loss of luma information, in this case, chroma prediction is performed for each reconstructed luma position in the current block, so that the size of the obtained first predicted block is larger than the original size of the current block, that is, the number of predicted values of the second color component contained in the first predicted block is larger than the number of second color component samples contained in the current block.
[0374] In addition, in an embodiment of the present application, for determining the reference sample value of the second color component of the current block, the method may further include: determining the reference sample value of the second color component of the current block based on values of second color component samples in adjacent regions of the current block, where the adjacent regions may include at least one of an upper adjacent region, an upper right adjacent region, a left adjacent region, and a lower left adjacent region.
[0375] In a specific embodiment, the method may further include: performing a fourth filtering on the values of the second color component samples in the adjacent region of the current block to obtain filtered adjacent sample values of the second color component of the current block; determining a reference sample value of the second color component of the current block according to the filtered adjacent sample values of the second color component of the current block. In an embodiment of the present application, the number of the filtered adjacent sample values of the second color component of the current block is greater than the number of the values of the second color component samples in the adjacent region of the current block.
[0376] In an embodiment of the present application, the fourth filtering is an upsampling filtering, and the upsampling rate is a positive integer multiple of two.
[0377] Specifically, the first color component is a luminance component, and the second color component is a chroma component. In order to ensure that there is no loss in the reference luminance information, upsampling filtering can be performed on the reference chroma information. Exemplarily, for a current block of 2M×2N in YUV420 format, the size of its chroma block is M×N, and the number of reference chroma information in the neighboring region is M+N. After upsampling filtering, 2M+2N chroma reference sample values can be obtained, and then 2M×2N chroma predicted values can be obtained by weighted prediction, and then downsampling filtering can be performed to obtain M×N chroma predicted values as the final predicted values. Note that, for a current block of 2M×2N in YUV420 format, the size of its chroma block is M×N, and the number of reference chroma information in the neighboring region is M+N. Only using the M+N reference chroma information, 2M×2N chroma predicted values can be obtained by using weighted coefficients, and then downsampling filtering can be performed to obtain M×N chroma predicted values as the final predicted values. Furthermore, for a current block of 2M×2N in YUV420 format, the size of its chroma block is M×N, the number of reference chroma information of adjacent regions is M+N, and 4M+4N chroma reference sample values are obtained after upsampling filtering. Or, for a current block of 2M×2N in YUV444 format, the size of its chroma block is 2M×2N, the number of reference chroma information of adjacent regions is 2M×2N, and 4M+4N chroma reference sample values are obtained after upsampling filtering. Then, based on these chroma reference sample values, M×N chroma prediction values can be obtained as final prediction values using the weighted prediction and downsampling filtering method. The embodiment of the present application does not make any restrictions thereon.
[0378] In addition, in the embodiment of the present application, whether the second filtering is performed on the value of the first color component sample in the neighboring region, the third filtering is performed on the reconstructed value of the first reference color component sample in the current block, or the fourth filtering is performed on the value of the second color component sample in the neighboring region, all of these three filterings may be upsampling filtering. The second filtering may be performed using the first filter, the third filtering may be performed using the second filter, and the fourth filtering may be performed using the third filter. For these three filters, the first filter, the second filter, and the third filter may all be upsampling filters. Since the data to be processed are different, the upsampling rates of these filters may also be different. Therefore, these three filters may be the same or different. Furthermore, the first filter, the second filter, and the third filter may all be neural network filters. The embodiment of the present application does not impose any restrictions thereon.
[0379] As can be understood, the spatial resolution of the value of the first color component sample in the neighboring region (i.e., reference luma information), the spatial resolution of the value of the second color component sample in the neighboring region (i.e., reference chroma information), and the spatial resolution of the reconstructed value of the first reference color component sample in the current block (i.e., reconstructed luma information) are all affected by the color format information. Therefore, the second filtering, the third filtering, or the fourth filtering can also be performed based on the current color format information. Hereinafter, taking the fourth filtering as an example, in some embodiments, the method further includes: performing a fourth filtering on the value of the second color component sample in the neighboring region of the current block based on the color format information to obtain a filtered neighboring sample value of the second color component of the current block.
[0380] In a specific embodiment, the fourth filtering may further include the following content: When the color format information indicates 4:2:0 sampling, perform upsampling filtering on the value of the second color component sample in the adjacent area of the current block. The upsampling rate is a positive integer multiple of 2.
[0381] It should be noted that in the embodiment of the present application, if the color format information indicates that the spatial resolution of luma and the spatial resolution of chroma are equal (for example, YUV444 format, etc.), there is no need to perform any processing on the reference chroma information. If the color format information indicates that the spatial resolution of luma and the spatial resolution of chroma are not equal (for example, video with chroma subsampling characteristics, such as YUV422 format / YUV411 format / YUV420 format), and the spatial resolution of the chroma component is smaller than the spatial resolution of the luma component, it is necessary to perform upsampling filtering on the reference chroma information obtained from the adjacent region.
[0382] Further, after determining the reference sample value of the second color component of the current block, in some embodiments, for S1803, determining a first predicted block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block may include: determining a weighting value obtained by multiplying the reference sample value of the second color component by the corresponding weighting coefficient; setting a predicted value of the second color component sample in the first predicted block equal to the sum of N weighting values, where N indicates the number of reference sample values of the second color component, and N is a positive integer.
[0383] That is, when the number of reference sample values of the second color component is N, first, a weighting value (w k C k) is determined, and then the sum of these N weighted values is taken as the predicted value of the second color component sample in the predicted block. Specifically, the calculation formula is as shown in the above formula 16. Note that this method is advantageous for parallel processing, and can increase the calculation speed.
[0384] As can be further understood, when performing upsampling filtering on both the reference luma information and the reference chroma information in the neighboring region of the current block, the following contents may be further included: based on the color format information, performing second filtering on the values of the first color component samples in the neighboring region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; performing fourth filtering on the values of the second color component samples in the neighboring region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered neighboring sample values of the second color component of the current block.
[0385] In one possible embodiment, the method may further include: If the color format information indicates 4:4:4 sampling, determine that the second horizontal upsampling factor is equal to the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:2 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:1:1 sampling, determine that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor, and the second vertical upsampling factor is equal to the first vertical upsampling factor. If the color format information indicates 4:2:0 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor, and the second vertical upsampling factor is equal to twice the first vertical upsampling factor.
[0386] It should be noted that in the embodiment of the present application, upsampling filtering is performed on the reference luma information. In this case, there is no loss of luma information. In this case, since the spatial resolution of the luma component is always equal to or greater than the spatial resolution of the chroma component in YUV video, it is necessary to perform upsampling filtering on the reference chroma information to make the spatial resolution of the reference chroma information match the spatial resolution of the reference luma information. In this case, it is necessary to determine the spatial upsampling rate (second horizontal upsampling factor and second vertical upsampling factor) of the reference chroma information according to the YUV video format and the spatial upsampling rate (first horizontal upsampling factor and first vertical upsampling factor) of the reference luma information.
[0387] As can be further understood, when no upsampling filtering is performed on the reconstructed luminance information in the current block, the size of the first prediction block may be estimated according to a YUV video format. Therefore, in another possible embodiment, the method may further include: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the width of the current block, and the height of the first prediction block is equal to the height of the current block. If the color format information indicates 4:2:0 sampling, determine that the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to twice the height of the current block.
[0388] It can be further understood that when performing upsampling filtering on the reconstructed luminance information in the current block, after performing luminance upsampling on the current block, it is necessary to estimate the size of the first prediction block according to the YUV video format and the spatial upsampling rate of luminance of the current block, which may include the following: According to the color format information, perform third filtering on the reconstructed values of the first reference color component samples in the current block by using a third horizontal upsampling factor and a third vertical upsampling factor to obtain filtered sample values of the first reference color component samples in the current block.
[0389] In yet another possible embodiment, the method may further include the following: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and the third vertical upsampling factor. If the color format information indicates 4:2:0 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and the height of the first prediction block is equal to twice the product of the height of the current block and the third vertical upsampling factor.
[0390] It should be noted that in the embodiment of the present application, the width of the first prediction block is represented by predSizeW, and the height of the first prediction block is represented by predSizeH. The width of the current block is represented by nTbW, and the height of the current block is represented by nTbH. Thus, for the first prediction block obtained according to the above method, predSizeH is equal to or greater than the height nTbH of the current block, or predSizeW is equal to or greater than the width nTbW of the current block, that is, the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block.
[0391] S1804: Perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0392] S1805: Determine a residual value of a second color component sample of the current block based on the second predicted block.
[0393] However, in the embodiment of the present application, the first filtering may be downsampling filtering. In this way, for the second prediction block that has been downsampling filtered, the number of predicted values of the second color component included in the second prediction block is the same as the number of second color component samples included in the current block.
[0394] In one possible embodiment, performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include: performing downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block.
[0395] In addition, in the embodiment of the present application, the preset filter may be a downsampling filter. Furthermore, the downsampling filter here may be a neural network filter. In the embodiment of the present application, there is no limitation thereon.
[0396] In another possible embodiment, performing first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include: determining a horizontal downsampling factor and a vertical downsampling factor; performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block.
[0397] In a specific embodiment, performing downsampling filtering on the first predicted block according to a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block of a second color component of the current block may include: if the horizontal downsampling factor is greater than 1, or if the vertical downsampling factor is greater than 1, performing downsampling filtering on the first predicted block to obtain a second predicted block.
[0398] In an embodiment of the present application, performing downsampling filtering on the first prediction block includes: performing downsampling filtering on the first predicted block in a horizontal direction; performing vertical downsampling filtering on the first predicted block; performing downsampling filtering on the first predicted block in a horizontal direction and then in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; may include at least one of:
[0399] Here, first, a horizontal downsampling factor can be calculated according to the width of the first predicted block and the width of the current block, and a vertical downsampling factor can be calculated according to the height of the first predicted block and the height of the current block; then, downsampling filtering is performed on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor. Specifically, when the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, the first predicted block needs to be downsampled only in the horizontal direction. When the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, the first predicted block needs to be downsampled only in the vertical direction. When the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, the first predicted block needs to be downsampled in both the horizontal and vertical directions. Downsampling can be performed in the horizontal direction and then in the vertical direction, or downsampling can be performed in the vertical direction and then in the horizontal direction; further, the downsampling operation here can be replaced by a convolution operation in a neural network structure. The embodiments of the present application do not impose any limitations.
[0400] In addition, the first filtering may be down-sampling filtered at a sampling interval, for example, a two-dimensional filter, a one-dimensional filter, etc. In the case of a one-dimensional filter, it may be performed "vertically first, then horizontally", or "horizontally first, then vertically", and may be performed in a fixed filtering order, or may be performed in a flexibly adjustable filtering order (for example, a filtering order indicated by identification information, an order associated with a prediction mode or a block size, etc.). The embodiment of the present application does not impose any restrictions thereon.
[0401] In addition to the above, in some embodiments, performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block may further include: performing a weighted sum calculation for each of a preset number of predicted values of the second color component of the first predicted block in the horizontal direction and / or the vertical direction according to a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block.
[0402] Here, performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in a horizontal direction and / or a vertical direction to obtain a second predicted block includes: Performing a weighted sum calculation for each prediction of the number of horizontal downsampling factors of the second color component of the first prediction block in the horizontal direction to obtain a second prediction block; or Performing a weighted sum calculation for each prediction value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction to obtain a second prediction block; or performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in a horizontal direction, and performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in a vertical direction to obtain a second predicted block; Includes.
[0403] That is, in the embodiment of the present application, the weighted sum calculation is performed for each of a preset number of saturation prediction values in the direction (vertical or horizontal) in which downsampling is required, without considering the horizontal downsampling factor and the vertical downsampling factor. In the special case in which the weights of the saturation prediction values are equal, the weighted sum calculation for each of the preset number of saturation prediction values can be regarded as calculating the average value of the preset number of saturation prediction values, and the average value is used as the prediction value after downsampling filtering.
[0404] In addition, in some embodiments, the method may further include: determining a weighting factor based on the reference sample values of a first color component of some samples in the first prediction block; and determining a second prediction block of a second color component of the current block based on the weighting factor and the reference sample values of a second color component of some samples in the first prediction block.
[0405] In a specific embodiment, determining the second prediction block of the second color component of the current block according to the weighting coefficient and the reference sample value of the second color component of some samples in the first prediction block may include the following content: According to the weighting coefficient, perform a weighting calculation on the reference sample value of the second color component of the sample at the position (i, j) in the first prediction block to obtain a prediction value of the second color component of the sample at the position (x, y) in the current block, where i, j, x, and j are all integers equal to or greater than 0.
[0406] It should be noted that in the embodiment of the present application, in order to reduce the computational complexity, no upsampling filtering is performed on the reconstructed luma information in the current block. In this case, instead of performing prediction of the co-located chroma samples on the reconstructed luma information at all luma positions in the current block, some luma positions can be selected to perform prediction of the co-located chroma samples. Thereby, after obtaining the predicted block, there is no need to perform downsampling filtering, and the accuracy of the existing luma information can be ensured, and the accurate luma information is favorable to improving the accuracy and stability of the nonlinear mapping model, so that the accuracy of the chroma prediction value can be improved.
[0407] In this embodiment, in order to reduce the subsequent upsampling or downsampling operation for the prediction block, the corresponding position can be selected according to the characteristics of the YUV video format to perform chroma prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample that needs to perform chroma prediction is CurPredChroma(x, y). In this case, in some embodiments, the method may further include the following contents: If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j. If the color format information indicates 4:2:2 sampling, then set x equal to i times 2 and y equal to j. If the color format information indicates 4:1:1 sampling, then set x equal to i times 4 and y equal to j. If the color format information indicates 4:2:0 sampling, then set x equal to i times 2 and set y equal to j times 2.
[0408] Moreover, in some embodiments, the method may further include: determining a horizontal sampling position factor and a vertical sampling position factor; setting x equal to the product of i and the horizontal sampling position factor, and setting y equal to the product of j and the vertical sampling position factor.
[0409] That is, to further reduce the computational complexity during prediction, fewer collocated chroma samples can be selected to perform prediction. Suppose the position of the current luma sample is CurRecLuma(i, j), the position of the sample on which chroma prediction needs to be performed is CurPredChroma(x, y). Suppose the horizontal sampling position factor of the reconstructed luma information in the current block is S_Pos_Hor and the vertical sampling position factor is S_Pos_Ver, the relationship between the position of the current luma sample and the position of the sample on which chroma prediction needs to be performed is as follows: If the color format information indicates a video in YUV444 format / YUV422 format / YUV411 format / YUV420 format, x can be set equal to the product of i and S_Pos_Hor, and y can be set equal to the product of j and S_Pos_Ver.
[0410] Furthermore, after determining the second predicted block, perform post-processing on the second predicted block under certain conditions to obtain a final second predicted block. Thus, in some embodiments, the method may further include: after determining the second predicted block of the second color component of the current block, perform related processing on the second predicted block, and the processed second predicted block is the second predicted block.
[0411] In an embodiment of the present application, performing related processing on the second predicted block includes: performing third filtering on the second predicted block; and improving the second predicted block using a predetermined compensation value; and performing weighted fusion on a second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; Includes at least one of the following:
[0412] That is, in the related process for the second predicted block, smooth filtering may be performed on the second predicted block in order to reduce instability due to parallel prediction for each sample in the WCP, and the smooth filtered value may be used as the final chroma predicted value. Alternatively, position-related refinement may be performed on the second predicted block in order to further improve the accuracy of the WCP predicted value. For example, a chroma compensation value is calculated for each sample waiting to be predicted using a reference sample with a close spatial position, the predicted block is improved using the chroma compensation value, and the improved predicted value is used as the final chroma predicted value. Alternatively, in order to further improve the accuracy of the WCP predicted value, weighted fusion is performed on the chroma predicted value calculated in another chroma prediction mode and the chroma predicted value calculated by the WCP, and the fusion result is used as the final chroma predicted value. Alternatively, in order to improve the prediction performance of the WCP, a neural network model is used to refine the chroma predicted value calculated by the WCP. In the embodiment of the present application, no limitations are imposed thereon.
[0413] In some embodiments, after the second predicted block is determined, as shown in FIG. 19, after S1804, the following steps may be further included.
[0414] S1901: Determine a predicted value of a second color component sample of a current block based on a second predicted block.
[0415] S1902: Determine a residual value of the second color component sample of the current block based on the original value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.
[0416] S1903: Encode the residual values of the second color component samples of the current block, and write the resulting encoded bits into the bitstream.
[0417] It should be noted that in an embodiment of the present application, the predicted value of the second color component sample of the current block can be determined according to the second predicted block as follows: The predicted value of the second color component sample of the current block can be set equal to the value of the second predicted block; or, the value of the second predicted block can be subjected to upsampling filtering, and the predicted value of the second color component sample of the current block can be set equal to the output value after upsampling filtering.
[0418] In addition, after determining the predicted value of the second color component sample of the current block, a residual value of the second color component sample can be determined based on the original value of the second color component sample and the predicted value of the second color component sample. Specifically, the residual value of the second color component sample of the current block can be determined by performing subtraction on the original value of the second color component sample and the predicted value of the second color component sample. In this way, after the residual value of the second color component sample is written into the bitstream, the residual value of the second color component sample can be obtained by decoding at the decoding side, so that the reconstructed value of the second color component sample of the current block can be restored.
[0419] As can be seen from the above, using lossless luma information to perform chroma prediction during prediction in WCP mode mainly includes the following three aspects: On the one hand, fully utilize the luma information of the reference sample and the current block to realize the calculation of the weighting coefficient of the chroma of the reference sample; On the other hand, the importance of the existing luma information is fully taken into account, and a more accurate nonlinear mapping model is established based on not losing the luma information to assign weights to the reference chroma samples to perform weighted prediction; In addition, when upsampling the reference chroma and performing co-located chroma prediction based on the position of each luma sample of the current block, the characteristics of various YUV video formats are fully taken into account, and based on the chroma subsampling formats and luma upsampling situations of different YUV videos, the spatial resolution of the chroma component and the spatial resolution of the luma component are always consistent, and the existing lossless luma information is fully utilized to perform co-located chroma prediction, thereby improving the accuracy of the chroma prediction value in WCP mode.
[0420] The embodiment of the present application further provides an encoding method. Determine a reference sample value of a first color component of a current block. Determine a weighting coefficient based on the reference sample value of the first color component of the current block. Determine a first predicted block of a second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block. The number of predicted values of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block. Perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block. Determine a residual value of the second color component sample of the current block based on the second predicted block. In this way, by utilizing the reference samples adjacent to the current block and the color component information in the current block, a more accurate nonlinear mapping model can be established based on not only fully considering the existing color component information but also not compromising the luminance information, so as to assign a weight to each reference sample value of the chroma component to perform weighted prediction. In addition, the first filtering fully considers different color format information, and performs sampling filtering of chroma and / or luminance based on the different color format information. This ensures that the spatial resolution of the chroma component and the spatial resolution of the luma component are always consistent, and not only ensures the accuracy of the existing luma information, but also improves the accuracy and stability of the nonlinear mapping model based on accurate luma information when predicting chroma components using lossless luma information, improves the accuracy of chroma prediction, saves bitrate, and further improves coding performance.
[0421] In yet another embodiment of the present application, an embodiment of the present application further provides a bitstream, the bitstream being generated by performing bit encoding based on information to be encoded, where the information to be encoded includes residual values of second color component samples of the current block.
[0422] In the embodiment of the present application, after the residual value of the second color component sample of the current block is transmitted from the encoding side to the decoding side, the decoding side can obtain the residual value of the second color component sample by decoding, and restore the reconstructed value of the second color component sample of the current block according to the residual value and the predicted value of the second color component sample of the current block. In this way, not only the existing color component information is fully taken into consideration, but also the different color format information is fully taken into consideration. Thereby, not only can the accuracy of the existing luma information be ensured, but also, when the chroma component prediction is performed using the lossless luma information, the accuracy and stability of the nonlinear mapping model can be improved based on the accurate luma information, the accuracy of the chroma prediction can be improved, the bit rate can be saved, and the coding performance can be further improved.
[0423] In a further embodiment of the present application, based on the same inventive idea as the previous embodiment, refer to Fig. 20, which is a schematic diagram showing the structure of an encoding device 300 according to an embodiment of the present application. As shown in Fig. 20, the encoding device 300 can include a first determining unit 3001, a first predicting unit 3002 and a first filtering unit 3003. The first determining unit 3001 is configured to determine a reference sample value of a first color component of a current block, and determine a weighting coefficient according to the reference sample value of the first color component of the current block. The first prediction unit 3002 is configured to determine a first prediction block of a second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The first filtering unit 3003 is configured to perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block. The first determining unit 3001 is further configured to determine, based on the second predicted block, a residual value of the second color component sample of the current block.
[0424] In some embodiments, the number of predicted values of the second color component included in the second prediction block is the same as the number of second color component samples included in the current block.
[0425] In some embodiments, the first determining unit 3001 is further configured to determine the reference sample value of the first color component of the current block based on values of the first color component samples in neighboring regions of the current block, where the neighboring regions include at least one of an upper neighboring region, a top-right neighboring region, a left neighboring region, and a lower-left neighboring region.
[0426] In some embodiments, the first determining unit 3001 is further configured to determine a value of the first color component sample by selecting from the first color component samples in the adjacent region.
[0427] In some embodiments, the first determining unit 3001 further comprises: determining sample locations for selection based on the locations and / or color component intensities of the first color component samples within the adjacent regions; A value of the first color component sample from the adjacent region is then determined based on the sample location awaiting selection.
[0428] In some embodiments, the first filtering unit 3003 further comprises: performing a second filtering on the values of the first color component samples to obtain filtered adjacent sample values of the first color component of the current block; and determining a reference sample value of the first color component of the current block based on the filtered neighboring sample values of the first color component of the current block.
[0429] In some embodiments, the number of filtered neighboring sample values of the first color component of the current block is greater than the number of values of the first color component sample.
[0430] In some embodiments, the first determination unit 3001 is further configured to determine a reference sample value of the first color component of the current block based on a reconstructed value of the first reference color component sample in the current block.
[0431] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.
[0432] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.
[0433] In some embodiments, the first filtering unit 3003 further comprises: performing a third filtering on the reconstructed values of the first reference color component samples in the current block to obtain filtered sample values of the first reference color component samples in the current block; and determining a reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.
[0434] In some embodiments, the number of filtered sample values of the first reference color component sample in the current block is greater than the number of reconstructed values of the first reference color component sample in the current block.
[0435] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.
[0436] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.
[0437] In some embodiments, the first determination unit 3001 is further configured to determine a value corresponding to a reference sample value of the first color component in the preset mapping, and set the weighting coefficient equal to the value.
[0438] In some embodiments, the first determination unit 3001 is further configured to determine a first factor, determine a first product value based on the first factor and a reference sample value of the first color component, and determine a value corresponding to the first product value in a preset mapping.
[0439] In some embodiments, the first factor is a preset constant value.
[0440] In some embodiments, the first determining unit 3001 is further configured to determine the value of the first factor according to a size parameter of the current block, the size parameter of the current block including at least one of the following parameters: a width of the current block, a height of the current block.
[0441] In some embodiments, the pre-defined mapping is a Softmax function.
[0442] In some embodiments, the pre-defined mapping is a weighting function that is inversely proportional to the reference sample value of the first color component.
[0443] In some embodiments, the first determination unit 3001 is further configured to determine a reference sample value of the second color component of the current block based on values of the second color component samples in adjacent regions of the current block.
[0444] In some embodiments, the first filtering unit 3003 further comprises: performing fourth filtering on values of the second color component samples in the neighboring region of the current block to obtain filtered neighboring sample values of the second color component of the current block; and determining a reference sample value of the second color component of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0445] In some embodiments, the number of filtered neighboring sample values of the second color component of the current block is greater than the number of values of the second color component samples in the neighboring region of the current block.
[0446] In some embodiments, the fourth filtering is an upsampling filtering, the upsampling rate being a positive integer multiple of two.
[0447] In some embodiments, the first filtering unit 3003 is further configured to perform a fourth filtering on values of the second color component samples in the neighboring region of the current block based on the color format information to obtain filtered neighboring sample values of the second color component of the current block.
[0448] In some embodiments, the first filtering unit 3003 further comprises: It is configured to perform upsampling filtering on values of the second color component samples in the adjacent region of the current block if the color format information indicates 4:2:0 sampling. The upsampling rate is a positive integer multiple of two.
[0449] In some embodiments, the first filtering unit 3003 further comprises: performing a second filtering on values of the first color component samples in the neighboring region of the current block using the first horizontal upsampling factor and the first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; and performing a fourth filtering on values of the second color component samples in the adjacent region of the current block using the second horizontal upsampling factor and the second vertical upsampling factor to obtain filtered adjacent sample values of the second color component of the current block. The first determination unit 3001 further comprises: If the color format information indicates 4:4:4 sampling, determine that the second horizontal upsampling factor is equal to the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; If the color format information indicates 4:2:2 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; If the color format information indicates 4:1:1 sampling, determine that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; and determining, if the color format information indicates 4:2:0 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to twice the first vertical upsampling factor.
[0450] In some embodiments, the first determining unit 3001 further comprises: If the color format information indicates 4:4:4 sampling, determine that a width of the first predicted block is equal to a width of the current block and a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:2:2 sampling, determine that a width of the first predicted block is equal to twice the width of the current block and a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:1:1 sampling, determining that a width of the first predicted block is equal to four times a width of the current block and a height of the first predicted block is equal to a height of the current block; It is configured to determine that if the color format information indicates 4:2:0 sampling, the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to twice the height of the current block.
[0451] In some embodiments, the first filtering unit 3003 further comprises: A third filtering is performed on the reconstructed value of the first reference color component sample in the current block using a third horizontal upsampling factor and a third vertical upsampling factor to obtain a filtered sample value of the first reference color component sample in the current block. The first determination unit 3001 further comprises: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; and determining, if the color format information indicates 4:2:0 sampling, that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and that the height of the first prediction block is equal to twice the product of the height of the current block and the third vertical upsampling factor.
[0452] In some embodiments, the first prediction unit 3002 further comprises: determining a weighting value obtained by multiplying the reference sample value of the second color component by a corresponding weighting coefficient; The method is configured to set a predicted value of the second color component sample in the first prediction block equal to the sum of the N weighted values. N indicates the number of reference sample values of the second color component, and N is a positive integer.
[0453] In some embodiments, the first filtering is a downsampling filtering.
[0454] In some embodiments, the first filtering unit 3003 is further configured to perform downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block.
[0455] In some embodiments, the first filtering unit 3003 further comprises: Determine a horizontal downsampling factor and a vertical downsampling factor; The downsampling filtering is performed on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block.
[0456] In some embodiments, the first filtering unit 3003 further comprises: If the horizontal downsampling factor is greater than 1, or if the vertical downsampling factor is greater than 1, downsampling filtering is performed on the first predicted block to obtain a second predicted block.
[0457] In some embodiments, the first filtering unit 3003 further comprises: performing downsampling filtering on the first predicted block in a horizontal direction; performing vertical downsampling filtering on the first predicted block; performing downsampling filtering on the first predicted block in a horizontal direction and then in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; The method is configured to perform at least one of the following:
[0458] In some embodiments, the first filtering unit 3003 further comprises: The method is configured to perform a weighted sum calculation for a preset number of predicted values of a second color component of the first predicted block in the horizontal and / or vertical directions based on a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block.
[0459] In some embodiments, the first filtering unit 3003 further comprises: performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in the horizontal direction to obtain a second predicted block.
[0460] In some embodiments, the first filtering unit 3003 further comprises: performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in the vertical direction to obtain a second predicted block.
[0461] In some embodiments, the first filtering unit 3003 further comprises: A weighted sum calculation is performed for each predicted value of the number of horizontal downsampling factors of the second color component of the first prediction block in the horizontal direction, and a weighted sum calculation is performed for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction to obtain a second prediction block.
[0462] In some embodiments, the first filtering unit 3003 further comprises: Determine a weighting coefficient according to reference sample values of a first color component of some samples in the first prediction block; and determining a second prediction block of the second color component of the current block based on the weighting coefficients and the reference sample values of the second color component of some samples in the first prediction block.
[0463] In some embodiments, the first filtering unit 3003 is further configured to perform a weighting calculation on the reference sample value of the second color component of the sample at the position (i, j) in the first prediction block based on a weighting coefficient to obtain a prediction value of the second color component of the sample at the position (x, y) in the current block, where i, j, x, and j are all integers equal to or greater than 0.
[0464] In some embodiments, the first determining unit 3001 further comprises: If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j; If the color format information indicates 4:2:2 sampling, set x equal to i times 2 and set y equal to j; If the color format information indicates 4:1:1 sampling, set x equal to i times 4 and set y equal to j; If the color format information indicates 4:2:0 sampling, then set x equal to the product of i and 2, and set y equal to the product of j and 2.
[0465] In some embodiments, the first determining unit 3001 further comprises: Determine horizontal and vertical sampling position factors; It is constructed to set x equal to the product of i and the horizontal sampling position factor, and y equal to the product of j and the vertical sampling position factor.
[0466] In some embodiments, the first filtering unit 3003 further comprises: The method is configured to: determine a second predicted block of a second color component of the current block, and then perform related processing on the second predicted block, and obtain the processed second predicted block as the second predicted block. performing related processing on the second predicted block; performing third filtering on the second predicted block; and improving the second predicted block using a predetermined compensation value; and performing weighted fusion on a second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; Includes at least one of the following:
[0467] In some embodiments, the first determining unit 3001 further comprises: Determine a predicted value of a second color component sample of the current block according to the second predicted block; and determining a residual value of the second color component sample of the current block based on an original value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.
[0468] In some embodiments, referring to Fig. 20, the encoding apparatus 300 may further include an encoding unit 3004. The encoding unit 3004 is configured to encode residual values of the second color component samples of the current block and write the resulting encoded bits into a bitstream.
[0469] In the embodiments of the present application, it can be understood that a "unit" can be a part of a circuit, a part of a processor, a part of a program, or a part of software. Of course, a "unit" can be a module or a non-module. In addition, each constituent unit according to the present embodiment can be integrated into one processing unit, each unit can exist physically alone, and two or more units can be integrated into one unit. The integrated unit can be realized in the form of a hardware or software functional module.
[0470] When the integrated unit is implemented as a software function module, rather than being sold or used as an independent product, it may be stored in a computer-readable storage medium. According to this understanding, the essential part of the technical solution of the present application, or the part that can contribute to the prior art, or all or part of the technical solution may be expressed as a software product. The computer software product is stored in a storage medium and includes a plurality of 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 the present embodiment. The storage medium includes various kinds of media capable of storing program code, such as a universal serial bus (USB) flash disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0471] Therefore, an embodiment of the present application provides a computer-readable storage medium applied to the encoding device 300. The computer-readable storage medium stores a computer program, which, when executed by a first processor, performs the method according to any one of the previous embodiments.
[0472] Based on the above-mentioned configuration of the encoding apparatus 300 and the computer-readable storage medium, refer to FIG. 21, which is a schematic diagram showing a specific hardware structure of an encoding device 310 according to an embodiment of the present application. As shown in FIG. 21, the encoding device 310 may include a first communication interface 3101, a first memory 3102 and a first processor 3103. Each component is coupled together via a first bus system 3104. As can be understood, the first bus system 3104 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 3104 further includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 3104 in FIG. 21. The first communication interface 3101 is used for sending and receiving signals in the process of sending and receiving information to and from other external network elements. The first memory 3102 is used to store a computer program executable by the first processor 3103 . The first processor 3103, when executing a computer program, is used to perform the following: Determine the reference sample value of the first color component of the current block. A weighting coefficient is determined based on the reference sample value of the first color component of the current block. According to the weighting coefficient and the reference sample value of the second color component of the current block, a first prediction block of the second color component of the current block is determined, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. A first filtering is performed on the first predicted block to determine a second predicted block of a second color component of the current block. Determine a residual value of a second color component sample of the current block according to the second predicted block.
[0473] As can be understood, the first memory 3102 of the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) that functions as an external high-speed cache. By way of illustrative, but non-limiting example, various RAMs are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch-link DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DRRAM). The first memory 3102 of the systems and methods described herein may include, but is not limited to, these and any other suitable types of memory.
[0474] The first processor 3103 can be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the form of hardware of the first processor 3103 or by instructions in the form of software. The first processor 3103 can 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 component. The processor can realize or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any ordinary processor, etc. The steps of the methods disclosed in the embodiments of the present application can be directly performed and completed by a hardware decoding processor, or can be performed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well known in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the first memory 3102. The first processor 3103 reads the information in the first memory 3102 and completes the steps of the above method together with the hardware of the processor.
[0475] It may be understood that the embodiments described herein may be realized by hardware, software, firmware, middleware, microcode, or a combination thereof. When realized by hardware, the processing unit may be realized by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units, or a combination thereof, used to perform the functions described herein. When realized by software, the techniques described herein may be realized by modules (e.g., procedures, functions, etc.) for performing the functions described herein. The software code is stored in a memory and executed by a processor. The memory may be realized within the processor or external to the processor.
[0476] Optionally, as another embodiment, the first processor 3103 is further configured to execute the method according to any one of the above embodiments when executing a computer program.
[0477] This embodiment provides an encoding device, which may further include the encoding device 300 according to any one of the above embodiments. The encoding device not only fully considers existing color component information, but also fully considers different color format information, thereby not only ensuring the accuracy of existing luma information, but also improving the accuracy and stability of a nonlinear mapping model based on accurate luma information when using lossless luma information to predict chroma components, improving the accuracy of chroma prediction, saving bit rate, and further improving coding performance.
[0478] Based on the same inventive idea as the above embodiment, refer to Fig. 22, which is a schematic diagram showing the structure of a decoding device 320 according to an embodiment of the present application. As shown in Fig. 22, the decoding device 320 can include a second determination unit 3201, a second prediction unit 3202 and a second filtering unit 3203. The second determining unit 3201 is configured to determine a reference sample value of a first color component of the current block, and determine a weighting coefficient according to the reference sample value of the first color component of the current block. The second prediction unit 3202 is configured to determine a first prediction block of a second color component of the current block based on the weighting coefficient and the reference sample value of the second color component of the current block, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. The second filtering unit 3203 is configured to perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block. The second determining unit 3201 is further configured to determine, based on the second predicted block, a reconstructed value of a second color component sample of the current block.
[0479] In some embodiments, the number of predicted values of the second color component included in the second prediction block is the same as the number of second color component samples included in the current block.
[0480] In some embodiments, the second determining unit 3201 is further configured to determine a reference sample value of the first color component of the current block based on values of the first color component samples in adjacent regions of the current block, where the adjacent regions include at least one of an upper adjacent region, a top-right adjacent region, a left adjacent region, and a lower-left adjacent region.
[0481] In some embodiments, the second determining unit 3201 is further configured to determine a value of the first color component sample by selecting from the first color component samples in the adjacent region.
[0482] In some embodiments, the second determining unit 3201 further comprises: determining sample locations for selection based on the locations and / or color component intensities of the first color component samples within the adjacent regions; A value of the first color component sample from the adjacent region is then determined based on the sample location awaiting selection.
[0483] In some embodiments, the second filtering unit 3203 further comprises: performing a second filtering on the values of the first color component samples to obtain filtered adjacent sample values of the first color component of the current block; and determining a reference sample value of the first color component of the current block based on the filtered neighboring sample values of the first color component of the current block.
[0484] In some embodiments, the number of filtered neighboring sample values of the first color component of the current block is greater than the number of values of the first color component sample.
[0485] In some embodiments, the second determination unit 3201 is further configured to determine a reference sample value of the first color component of the current block based on a reconstructed value of the first reference color component sample in the current block.
[0486] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the reconstructed value of the first reference color component sample.
[0487] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the reconstructed value of the first reference color component sample.
[0488] In some embodiments, the second filtering unit 3203 further comprises: performing a third filtering on the reconstructed values of the first reference color component samples in the current block to obtain filtered sample values of the first reference color component samples in the current block; and determining a reference sample value of the first color component of the current block based on the filtered sample value of the first reference color component sample in the current block.
[0489] In some embodiments, the number of filtered sample values of the first reference color component sample in the current block is greater than the number of reconstructed values of the first reference color component sample in the current block.
[0490] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the filtered adjacent sample value of the first color component and the filtered sample value of the first reference color component sample.
[0491] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute value of the difference between the value of the first color component sample and the filtered sample value of the first reference color component sample.
[0492] In some embodiments, the second determining unit 3201 is further configured to determine a value corresponding to the reference sample value of the first color component in the preset mapping, and set the weighting coefficient equal to the value.
[0493] In some embodiments, the second determining unit 3201 further comprises: Determine the first factor, determining a first product value based on the first factor and the reference sample value of the first color component; The method is configured to determine a value in the preset mapping that corresponds to the first product value.
[0494] In some embodiments, the first factor is a preset constant value.
[0495] In some embodiments, the second determining unit 3201 is further configured to determine the value of the first factor according to a size parameter of the current block, the size parameter of the current block including at least one of the following parameters: a width of the current block, a height of the current block.
[0496] In some embodiments, the pre-defined mapping is a Softmax function.
[0497] In some embodiments, the pre-defined mapping is a weighting function that is inversely proportional to the reference sample value of the first color component.
[0498] In some embodiments, the second determination unit 3201 is further configured to determine a reference sample value of the second color component of the current block based on values of the second color component samples in adjacent regions of the current block.
[0499] In some embodiments, the second filtering unit 3203 further comprises: performing fourth filtering on values of the second color component samples in the neighboring region of the current block to obtain filtered neighboring sample values of the second color component of the current block; and determining a reference sample value of the second color component of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0500] In some embodiments, the number of filtered neighboring sample values of the second color component of the current block is greater than the number of values of the second color component samples in the neighboring region of the current block.
[0501] In some embodiments, the fourth filtering is an upsampling filtering, the upsampling rate being a positive integer multiple of two.
[0502] In some embodiments, the second filtering unit 3203 is further configured to perform fourth filtering on values of the second color component samples in the neighboring region of the current block based on the color format information to obtain filtered neighboring sample values of the second color component of the current block.
[0503] In some embodiments, the second filtering unit 3203 further comprises: It is configured to perform upsampling filtering on values of the second color component samples in the adjacent region of the current block if the color format information indicates 4:2:0 sampling. The upsampling rate is a positive integer multiple of two.
[0504] In some embodiments, the second filtering unit 3203 further comprises: performing a second filtering on values of the first color component samples in the neighboring region of the current block using the first horizontal upsampling factor and the first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; and performing a fourth filtering on values of the second color component samples in the adjacent region of the current block using the second horizontal upsampling factor and the second vertical upsampling factor to obtain filtered adjacent sample values of the second color component of the current block. The second determining unit 3201 further comprises: If the color format information indicates 4:4:4 sampling, determine that the second horizontal upsampling factor is equal to the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; If the color format information indicates 4:2:2 sampling, determine that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; If the color format information indicates 4:1:1 sampling, determine that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor and the second vertical upsampling factor is equal to the first vertical upsampling factor; and determining, if the color format information indicates 4:2:0 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to twice the first vertical upsampling factor.
[0505] In some embodiments, the second determining unit 3201 further comprises: If the color format information indicates 4:4:4 sampling, determine that a width of the first predicted block is equal to a width of the current block and a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:2:2 sampling, determine that a width of the first predicted block is equal to twice the width of the current block and a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:1:1 sampling, determining that a width of the first predicted block is equal to four times a width of the current block and a height of the first predicted block is equal to a height of the current block; It is configured to determine that if the color format information indicates 4:2:0 sampling, the width of the first prediction block is equal to twice the width of the current block, and the height of the first prediction block is equal to twice the height of the current block.
[0506] In some embodiments, the second filtering unit 3203 further comprises: and performing a third filtering on the reconstructed value of the first reference color component sample in the current block using a third horizontal upsampling factor and a third vertical upsampling factor to obtain a filtered sample value of the first reference color component sample in the current block. The second determining unit 3201 further comprises: If the color format information indicates 4:4:4 sampling, determine that the width of the first prediction block is equal to the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; If the color format information indicates 4:2:2 sampling, determine that the width of the first prediction block is equal to twice the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; If the color format information indicates 4:1:1 sampling, determine that the width of the first prediction block is equal to four times the product of the width of the current block and a third horizontal upsampling factor, and the height of the first prediction block is equal to the product of the height of the current block and a third vertical upsampling factor; and determining, if the color format information indicates 4:2:0 sampling, that the width of the first prediction block is equal to twice the product of the width of the current block and the third horizontal upsampling factor, and that the height of the first prediction block is equal to twice the product of the height of the current block and the third vertical upsampling factor.
[0507] In some embodiments, the second prediction unit 3202 further comprises: determining a weighting value obtained by multiplying the reference sample value of the second color component by a corresponding weighting coefficient; The method is configured to set a predicted value of the second color component sample in the first prediction block equal to the sum of the N weighted values. N indicates the number of reference sample values of the second color component, and N is a positive integer.
[0508] In some embodiments, the first filtering is a downsampling filtering.
[0509] In some embodiments, the second filtering unit 3203 is further configured to perform downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block.
[0510] In some embodiments, the second filtering unit 3203 further comprises: Determine a horizontal downsampling factor and a vertical downsampling factor; The downsampling filtering is performed on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block.
[0511] In some embodiments, the second filtering unit 3203 further comprises: If the horizontal downsampling factor is greater than 1, or if the vertical downsampling factor is greater than 1, downsampling filtering is performed on the first predicted block to obtain a second predicted block.
[0512] In some embodiments, the second filtering unit 3203 further comprises: performing downsampling filtering on the first predicted block in a horizontal direction; performing vertical downsampling filtering on the first predicted block; performing downsampling filtering on the first predicted block in a horizontal direction and then in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; The method is configured to perform at least one of the following:
[0513] In some embodiments, the second filtering unit 3203 further comprises: The method is configured to perform a weighted sum calculation for a preset number of predicted values of a second color component of the first predicted block in the horizontal and / or vertical directions based on a horizontal downsampling factor and a vertical downsampling factor to obtain a second predicted block.
[0514] In some embodiments, the second filtering unit 3203 further comprises: performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in the horizontal direction to obtain a second predicted block.
[0515] In some embodiments, the second filtering unit 3203 further comprises: performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in the vertical direction to obtain a second predicted block.
[0516] In some embodiments, the second filtering unit 3203 further comprises: A weighted sum calculation is performed for each predicted value of the number of horizontal downsampling factors of the second color component of the first prediction block in the horizontal direction, and a weighted sum calculation is performed for each predicted value of the number of vertical downsampling factors of the second color component of the first prediction block in the vertical direction to obtain a second prediction block.
[0517] In some embodiments, the second filtering unit 3203 further comprises: Determine a weighting coefficient according to reference sample values of a first color component of some samples in the first prediction block; and determining a second prediction block of the second color component of the current block based on the weighting coefficients and the reference sample values of the second color component of some samples in the first prediction block.
[0518] In some embodiments, the second filtering unit 3203 is further configured to perform a weighting calculation on the reference sample value of the second color component of the sample at the position (i, j) in the first prediction block based on a weighting coefficient to obtain a prediction value of the second color component of the sample at the position (x, y) in the current block, where i, j, x, and j are all integers equal to or greater than 0.
[0519] In some embodiments, the second determining unit 3201 further comprises: If the color format information indicates 4:4:4 sampling, set x equal to i and y equal to j; If the color format information indicates 4:2:2 sampling, set x equal to i times 2 and set y equal to j; If the color format information indicates 4:1:1 sampling, set x equal to i times 4 and set y equal to j; If the color format information indicates 4:2:0 sampling, then set x equal to the product of i and 2, and set y equal to the product of j and 2.
[0520] In some embodiments, the second determining unit 3201 further comprises: Determine horizontal and vertical sampling position factors; It is constructed to set x equal to the product of i and the horizontal sampling position factor, and y equal to the product of j and the vertical sampling position factor.
[0521] In some embodiments, the second filtering unit 3203 further comprises: The method is configured to: determine a second predicted block of a second color component of the current block, and then perform related processing on the second predicted block, and obtain the processed second predicted block as the second predicted block. performing related processing on the second predicted block; performing third filtering on the second predicted block; and improving the second predicted block using a predetermined compensation value; and performing weighted fusion on a second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; Includes at least one of the following:
[0522] In some embodiments, the second determining unit 3201 further comprises: Determine the residual value of the second color component sample of the current block; Determine a predicted value of a second color component sample of the current block according to the second predicted block; and determining a reconstructed value of the second color component sample of the current block based on a residual value of the second color component sample of the current block and the predicted value of the second color component sample of the current block.
[0523] In some embodiments, referring to Fig. 22, the decoding device 320 further includes a decoding unit 3204. The decoding unit 3204 is configured to analyze the bitstream to determine residual values of the second color component samples of the current block.
[0524] In the embodiments of the present application, it can be understood that a "unit" can be a part of a circuit, a part of a processor, a part of a program, or a part of software. Of course, a "unit" can be a module or a non-module. In addition, each constituent unit according to the present embodiment can be integrated into one processing unit, each unit can exist physically alone, and two or more units can be integrated into one unit. The integrated unit can be realized in the form of a hardware or software functional module.
[0525] When the integrated unit is implemented as a software functional module, rather than being sold or used as an independent product, it may be stored in a computer-readable storage medium. According to this understanding, the present embodiment provides a computer-readable storage medium applied to the decoder 320. The computer-readable storage medium stores a computer program. When the computer program is executed by the second processor, the method according to any one of the previous embodiments is performed.
[0526] Based on the above-mentioned configuration of the decoding apparatus 320 and the computer-readable storage medium, refer to FIG. 23, which is a schematic diagram showing a specific hardware structure of a decoding device 330 according to an embodiment of the present application. As shown in FIG. 23, the decoding device 330 can include a second communication interface 3301, a second memory 3302 and a second processor 3303. Each component is coupled together via a second bus system 3304. As can be understood, the second bus system 3304 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 3304 further includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 3304 in FIG. 23. The second communication interface 3301 is used for sending and receiving signals in the process of sending and receiving information to and from other external network elements. The second memory 3302 is used for storing a computer program executable by the second processor 3303 . The second processor 3303, when executing a computer program, is used to perform the following: Determine the reference sample value of the first color component of the current block. A weighting coefficient is determined based on the reference sample value of the first color component of the current block. According to the weighting coefficient and the reference sample value of the second color component of the current block, a first prediction block of the second color component of the current block is determined, and the number of prediction values of the second color component included in the first prediction block is greater than the number of second color component samples included in the current block. A first filtering is performed on the first predicted block to determine a second predicted block of a second color component of the current block. A reconstructed value of a second color component sample of the current block is determined based on the second predicted block.
[0527] Optionally, as another embodiment, the second processor 3303 is further configured to execute the method according to any one of the above embodiments when executing a computer program.
[0528] As can be understood, the second memory 3302 has similar hardware functions as the first memory 3102, and the second processor 3303 has similar hardware functions as the first processor 3103, which will not be detailed here.
[0529] This embodiment provides a decoding device, which may further include the decoding device 320 described in the above embodiment. The decoding device not only fully considers existing color component information, but also fully considers different color format information, so that the accuracy of existing luma information can be ensured, and when using lossless luma information to predict chroma components, the accuracy and stability of the nonlinear mapping model can be improved based on accurate luma information, the accuracy of chroma prediction can be improved, the bit rate can be saved, and the coding performance can be further improved.
[0530] In a further embodiment of the present application, refer to FIG. 24, which is a schematic diagram showing the structure of a coding system according to an embodiment of the present application. As shown in FIG. 24, the coding system 340 may include an encoder 3401 and a decoder 3402. The encoder 3401 may be a device integrated with the encoding device 300 described in the previous embodiment, or may be the encoding device 310 described in the previous embodiment. The decoder 3402 may be a device integrated with the decoding device 320 described in the previous embodiment, or may be the decoding device 330 described in the previous embodiment.
[0531] In the embodiment of the present application, in the coding system 340, whether the encoder 3401 or the decoder 3402 fully considers the existing color component information, and also fully considers different color format information, which not only ensures the accuracy of the existing luma information, but also improves the accuracy and stability of the nonlinear mapping model based on the accurate luma information when using lossless luma information to predict chroma components, improves the accuracy of chroma prediction, saves bit rate, and further improves coding performance.
[0532] It should be noted that in this application, terms such as "comprises," "comprising," or other variants are intended to cover and not exclude the inclusion of other components, so that a process, method, article, or apparatus that includes a set of elements may include not only those elements, but also other elements not expressly listed, or other elements inherent to the process, method, article, or apparatus. Unless more restrictive, a process, method, article, or apparatus that includes an element defined by the phrase "comprises..." does not exclude the presence of other identical elements.
[0533] The sequence numbers of the embodiments of the present application above are not used to indicate superiority or inferiority of the embodiments, but are used for explanation only.
[0534] The methods disclosed in the several method embodiments of the present application can be combined in any manner to arrive at new method embodiments, unless inconsistent.
[0535] The features disclosed in the various product embodiments of the present application can be combined in any manner, unless inconsistent, to arrive at new product embodiments.
[0536] The features disclosed in any method or apparatus embodiment of the present application may be combined in any manner, unless inconsistent, to arrive at new method or apparatus embodiments.
[0537] The above is only a specific embodiment of the present application, and the protection scope of the present application is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.
[0538] In the embodiment of the present application, either at the encoding side or the decoding side, a reference sample value of a first color component of a current block is determined; a weighting factor is determined according to the reference sample value of the first color component of the current block; a first predicted block of a second color component of the current block is determined according to the weighting factor and the reference sample value of the second color component of the current block; the number of predicted values of the second color component included in the first predicted block is greater than the number of second color component samples included in the current block; a first filtering is performed on the first predicted block to determine a second predicted block of the second color component of the current block. In this way, at the encoding side, a residual value of the second color component sample of the current block can be determined according to the second predicted block, and the residual value is written into the bitstream; at the decoding side, a reconstructed value of the second color component sample of the current block can be determined according to the second predicted block and the residual value obtained by decoding. In this way, by using the reference samples adjacent to the current block and the color component information in the current block, a more accurate nonlinear mapping model can be established based on not only fully considering the existing color component information but also not losing the luminance information, and a weight can be assigned to each reference sample value of the chroma component to perform weighted prediction. In addition, the first filtering fully considers different color format information, and performs sampling filtering of chroma and / or luminance based on the different color format information. This can ensure that the spatial resolution of the chroma component and the spatial resolution of the luminance component are always consistent, and not only can the accuracy of the existing luminance information be ensured, but also the accuracy and stability of the nonlinear mapping model can be improved based on the accurate luminance information when performing chroma component prediction using lossless luminance information, improving the accuracy of chroma prediction, saving bit rate, improving coding efficiency, and further improving coding performance.
Claims
1. A decoding method comprising the steps of: determining a reference sample value of a first color component of the current block; determining a weighting coefficient according to a reference sample value of a first color component of the current block; determining a first prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of the current block, where a number of prediction values of the second color component included in the first prediction block is greater than a number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; determining reconstructed values of the second color component samples of the current block based on the second predicted block; Including, 4. A decoding method comprising:
2. the number of predicted values of the second color component included in the second predicted block is equal to the number of second color component samples included in the current block; 2. The method of claim 1 .
3. determining a reference sample value of a first color component of the current block, determining a reference sample value of the first color component of the current block based on values of the first color component samples in an adjacent region of the current block; 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.
2. The method of claim 1 .
4. The method comprises: determining a value of the first color component sample by selecting from first color component samples in the adjacent regions.
4. The method according to claim 3 .
5. Determining a value of the first color component sample by selecting from first color component samples in the adjacent region includes: determining sample positions awaiting selection based on positions and / or color component intensities of first color component samples within the adjacent regions; determining values of the first color component samples from the adjacent regions based on the pending sample locations; Including, 5. The method of claim 4.
6. determining a reference sample value of a first color component of the current block, performing a second filtering on the first color component sample values to obtain filtered adjacent sample values of the first color component of the current block; determining a reference sample value of a first color component of the current block based on the filtered neighboring sample values of the first color component of the current block; Further comprising:
4. The method according to claim 3 .
7. a number of filtered adjacent sample values of a first color component of the current block is greater than a number of values of the first color component samples; 7. The method of claim 6.
8. determining a reference sample value of a first color component of the current block, determining a reference sample value of the first color component of the current block based on a reconstructed value of a first reference color component sample in the current block; 7. The method according to claim 3 or 6.
9. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a value of the first color component sample and a reconstructed value of the first reference color component sample.
9. The method of claim 8.
10. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a filtered adjacent sample value of the first color component and a reconstructed value of the first reference color component sample.
9. The method of claim 8.
11. determining a reference sample value of a first color component of the current block, performing a third filtering on the reconstructed values of the first reference color component samples in the current block to obtain filtered sample values of the first reference color component samples in the current block; determining a reference sample value of a first color component of the current block based on the filtered sample value of a first reference color component sample in the current block; Further comprising:
7. The method according to claim 3 or 6.
12. a number of filtered sample values of the first reference color component sample in the current block is greater than a number of reconstructed values of the first reference color component sample in the current block; 12. The method of claim 11 .
13. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a filtered adjacent sample value of the first color component and a filtered sample value of the first reference color component sample; 12. The method of claim 11 .
14. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a value of the first color component sample and a filtered sample value of the first reference color component sample.
12. The method of claim 11 .
15. determining a weighting coefficient based on the reference sample value of the first color component of the current block, determining a value in a preset mapping that corresponds to a reference sample value of the first color component; setting said weighting factor equal to said value; Including, 2. The method of claim 1 .
16. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: Determining the first factor; determining a first product value based on the first factor and a reference sample value of the first color component; determining a value in the predefined mapping that corresponds to the first product value; Including, 16. The method of claim 15 .
17. Determining the first factor comprises: The first factor is a preset constant value.
17. The method of claim 16.
18. Determining the first factor comprises: determining a value of the first factor based on a size parameter of the current block; The size parameters of the current block include at least one parameter of a width of the current block and a height of the current block.
17. The method of claim 16.
19. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: The predetermined mapping is a Softmax function.
16. The method of claim 15 .
20. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: the predefined mapping being a weighting function inversely proportional to a reference sample value of the first color component.
16. The method of claim 15 .
21. The method comprises: determining a reference sample value of the second color component of the current block based on values of second color component samples in adjacent regions of the current block; 2. The method of claim 1 .
22. The method comprises: performing a fourth filtering on values of second color component samples in a neighboring region of the current block to obtain filtered neighboring sample values of the second color component of the current block; determining a reference sample value of a second color component of the current block according to the filtered neighboring sample values of the second color component of the current block; Further comprising:
22. The method of claim 21 .
23. a number of filtered neighboring sample values of the second color component of the current block is greater than a number of values of the second color component samples in a neighboring region of the current block; 23. The method of claim 22.
24. The method comprises: The fourth filtering is an upsampling filtering. The upsampling rate is a positive integer multiple of 2.
23. The method of claim 22.
25. The method comprises: and performing a fourth filtering on values of the second color component samples in the neighboring region of the current block based on color format information to obtain filtered neighboring sample values of the second color component of the current block.
23. The method of claim 22.
26. The performing of the fourth filtering includes: If the color format information indicates 4:2:0 sampling, performing upsampling filtering on values of second color component samples in an adjacent region of the current block; The upsampling rate is a positive integer multiple of 2.
26. The method of claim 25.
27. The method comprises: performing a second filtering on values of the first color component samples in a neighboring region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; performing a fourth filtering on values of the second color component samples in the neighboring region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered neighboring sample values of the second color component of the current block; Accordingly, the method comprises: determining that the second horizontal upsampling factor is equal to the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor if the color format information indicates 4:4:4 sampling; determining, if the color format information indicates 4:2:2 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor; determining, if the color format information indicates 4:1:1 sampling, that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor; determining, if the color format information indicates 4:2:0 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to twice the first vertical upsampling factor; Further comprising:
23. The method of claim 22.
28. The method comprises: determining, if the color format information indicates 4:4:4 sampling, that a width of the first predicted block is equal to a width of the current block and that a height of the first predicted block is equal to a height of the current block; determining, if color format information indicates 4:2:2 sampling, that a width of the first predicted block is equal to twice the width of the current block and that a height of the first predicted block is equal to the height of the current block; determining, if color format information indicates 4:1:1 sampling, that a width of the first predicted block is equal to four times a width of the current block and that a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:2:0 sampling, determining that a width of the first predicted block is equal to twice the width of the current block and a height of the first predicted block is equal to twice the height of the current block; Further comprising:
9. The method of claim 8.
29. The method comprises: performing a third filtering on the reconstructed values of the first reference color component samples in the current block using a third horizontal upsampling factor and a third vertical upsampling factor to obtain filtered sample values of the first reference color component samples in the current block; Accordingly, the method comprises: if color format information indicates 4:4:4 sampling, determining that a width of the first predicted block is equal to a product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to a product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:2:2 sampling, determining that a width of the first predicted block is equal to twice the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to the product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:1:1 sampling, determining that a width of the first predicted block is equal to four times the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to the product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:2:0 sampling, determining that a width of the first predicted block is equal to twice the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to twice the product of a height of the current block and the third vertical upsampling factor; Further comprising:
12. The method of claim 11 .
30. determining a first prediction block of a second color component of the current block based on the weighting coefficient and a reference sample value of a second color component of the current block, determining a weighting value by multiplying the reference sample value of the second color component by a corresponding weighting coefficient; setting a predicted value of a second color component sample in the first prediction block equal to a sum of N of the weighted values; N indicates the number of reference sample values of the second color component, and N is a positive integer.
2. The method of claim 1 .
31. The first filtering is a downsampling filtering.
2. The method of claim 1 .
32. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; performing downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block; 32. The method of claim 31 .
33. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; Determining a horizontal downsampling factor and a vertical downsampling factor; performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block; Including, 32. The method of claim 31 .
34. performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block; performing downsampling filtering on the first predicted block to obtain the second predicted block if the horizontal downsampling factor is greater than 1 or if the vertical downsampling factor is greater than 1; 34. The method of claim 33.
35. performing downsampling filtering on the first predicted block, performing downsampling filtering on the first predicted block in a horizontal direction; performing downsampling filtering on the first predicted block in a vertical direction; performing downsampling filtering on the first predicted block in a horizontal direction and then performing downsampling filtering on the first predicted block in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; At least one of:
35. The method of claim 34.
36. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; performing a weighted sum calculation for each of a predetermined number of prediction values of a second color component of the first prediction block in a horizontal direction and / or a vertical direction according to the horizontal downsampling factor and the vertical downsampling factor to obtain the second prediction block.
34. The method of claim 33.
37. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in a horizontal direction to obtain the second predicted block; 37. The method of claim 36.
38. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in a vertical direction to obtain the second predicted block; 37. The method of claim 36.
39. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in a horizontal direction, and performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in a vertical direction to obtain the second predicted block.
37. The method of claim 36.
40. The method comprises: determining weighting coefficients according to reference sample values of a first color component of some samples in the first prediction block; determining a second prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of some samples in the first prediction block; Further comprising:
2. The method of claim 1 .
41. determining a second prediction block of a second color component of the current block based on the weighting coefficients and reference sample values of a second color component of some samples in the first prediction block, performing a weighting calculation on a reference sample value of a second color component of a sample at a position (i, j) in the first prediction block based on the weighting coefficient to obtain a prediction value of a second color component of a sample at a position (x, y) in the current block; i, j, x, and j are all integers of 0 or more.
41. The method of claim 40.
42. The method comprises: if the color format information indicates 4:4:4 sampling, setting x equal to i and y equal to j; if the color format information indicates 4:2:2 sampling, setting x equal to i times 2 and y equal to j; if the color format information indicates 4:1:1 sampling, then setting x equal to i times 4 and y equal to j; if the color format information indicates 4:2:0 sampling, setting x equal to i times 2 and y equal to j times 2; Further comprising:
42. The method of claim 41 .
43. The method comprises: Determining a horizontal sampling position factor and a vertical sampling position factor; setting x equal to the product of i and said horizontal sampling position factor and setting y equal to the product of j and said vertical sampling position factor.
42. The method of claim 41 .
44. The method comprises: After determining a second predicted block of a second color component of the current block, performing related processing on the second predicted block, and setting the processed second predicted block as the second predicted block; The step of performing related processing on the second predicted block includes: performing a third filtering on the second predicted block; improving the second predicted block using a predetermined compensation value; performing weighted fusion on the second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; At least one of:
2. The method of claim 1 .
45. determining reconstructed values of the second color component samples of the current block based on the second predicted block, determining residual values of the second color component samples of the current block; determining a predicted value of the second color component sample of the current block based on the second predicted block; determining a reconstructed value of the second color component sample of the current block based on a residual value of the second color component sample of the current block and a predicted value of the second color component sample of the current block; Including, 2. The method of claim 1 .
46. 1. A method of encoding, comprising: determining a reference sample value of a first color component of the current block; determining a weighting coefficient according to a reference sample value of a first color component of the current block; determining a first prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of the current block, where a number of prediction values of the second color component included in the first prediction block is greater than a number of second color component samples included in the current block; performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; determining residual values of the second color component samples of the current block according to the second predicted block; Including, 13. An encoding method comprising:
47. the number of predicted values of the second color component included in the second predicted block is equal to the number of second color component samples included in the current block; 47. The method of claim 46.
48. determining a reference sample value of a first color component of the current block, determining a reference sample value of the first color component of the current block based on values of the first color component samples in an adjacent region of the current block; 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.
47. The method of claim 46.
49. The method comprises: determining a value of the first color component sample by selecting from first color component samples in the adjacent regions.
49. The method of claim 48.
50. Determining a value of the first color component sample by selecting from first color component samples in the adjacent region includes: determining sample positions awaiting selection based on positions and / or color component intensities of first color component samples within the adjacent regions; determining values of the first color component samples from the adjacent regions based on the pending sample locations; Including, 50. The method of claim 49.
51. determining a reference sample value of a first color component of the current block, performing a second filtering on the first color component sample values to obtain filtered adjacent sample values of the first color component of the current block; determining a reference sample value of a first color component of the current block based on the filtered neighboring sample values of the first color component of the current block; Further comprising:
49. The method of claim 48.
52. a number of filtered adjacent sample values of a first color component of the current block is greater than a number of values of the first color component samples; 52. The method of claim 51 .
53. determining a reference sample value of a first color component of the current block, determining a reference sample value of the first color component of the current block based on a reconstructed value of a first reference color component sample in the current block; 52. The method of claim 48 or 51.
54. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a value of the first color component sample and a reconstructed value of the first reference color component sample.
54. The method of claim 53.
55. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a filtered adjacent sample value of the first color component and a reconstructed value of the first reference color component sample.
54. The method of claim 53.
56. determining a reference sample value of a first color component of the current block, performing a third filtering on the reconstructed values of the first reference color component samples in the current block to obtain filtered sample values of the first reference color component samples in the current block; determining a reference sample value of a first color component of the current block based on the filtered sample value of a first reference color component sample in the current block; Further comprising:
52. The method of claim 48 or 51.
57. a number of filtered sample values of the first reference color component sample in the current block is greater than a number of reconstructed values of the first reference color component sample in the current block; 57. The method of claim 56.
58. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a filtered adjacent sample value of the first color component and a filtered sample value of the first reference color component sample; 57. The method of claim 56.
59. a reference sample value of a first color component of the current block is set to an absolute value of a difference between a value of the first color component sample and a filtered sample value of the first reference color component sample.
57. The method of claim 56.
60. determining a weighting coefficient based on the reference sample value of the first color component of the current block, determining a value in a preset mapping that corresponds to a reference sample value of the first color component; setting said weighting factor equal to said value; Including, 47. The method of claim 46.
61. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: Determining the first factor; determining a first product value based on the first factor and a reference sample value of the first color component; determining a value in the predefined mapping that corresponds to the first product value; Including, 61. The method of claim 60.
62. Determining the first factor comprises: The first factor is a preset constant value.
62. The method of claim 61 .
63. Determining the first factor comprises: determining a value of the first factor based on a size parameter of the current block; The size parameters of the current block include at least one parameter of a width of the current block and a height of the current block.
62. The method of claim 61 .
64. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: The predetermined mapping is a Softmax function.
61. The method of claim 60.
65. Determining a value in the preset mapping that corresponds to a reference sample value of the first color component includes: the predefined mapping being a weighting function inversely proportional to a reference sample value of the first color component.
61. The method of claim 60.
66. The method comprises: determining a reference sample value of the second color component of the current block based on values of second color component samples in adjacent regions of the current block; 47. The method of claim 46.
67. The method comprises: performing a fourth filtering on values of second color component samples in a neighboring region of the current block to obtain filtered neighboring sample values of the second color component of the current block; determining a reference sample value of a second color component of the current block according to the filtered neighboring sample values of the second color component of the current block; Further comprising:
67. The method of claim 66.
68. a number of filtered neighboring sample values of the second color component of the current block is greater than a number of values of the second color component samples in a neighboring region of the current block; 68. The method of claim 67.
69. The method comprises: The fourth filtering is an upsampling filtering. The upsampling rate is a positive integer multiple of 2.
68. The method of claim 67.
70. The method comprises: and performing a fourth filtering on values of the second color component samples in the neighboring region of the current block based on color format information to obtain filtered neighboring sample values of the second color component of the current block.
68. The method of claim 67.
71. The performing of the fourth filtering includes: If the color format information indicates 4:2:0 sampling, performing upsampling filtering on values of second color component samples in an adjacent region of the current block; The upsampling rate is a positive integer multiple of 2.
71. The method of claim 70.
72. The method comprises: performing a second filtering on values of the first color component samples in a neighboring region of the current block using a first horizontal upsampling factor and a first vertical upsampling factor to obtain filtered neighboring sample values of the first color component of the current block; performing a fourth filtering on values of the second color component samples in the neighboring region of the current block using a second horizontal upsampling factor and a second vertical upsampling factor to obtain filtered neighboring sample values of the second color component of the current block; Accordingly, the method comprises: determining that the second horizontal upsampling factor is equal to the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor if the color format information indicates 4:4:4 sampling; determining, if the color format information indicates 4:2:2 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor; determining, if the color format information indicates 4:1:1 sampling, that the second horizontal upsampling factor is equal to four times the first horizontal upsampling factor and that the second vertical upsampling factor is equal to the first vertical upsampling factor; determining, if the color format information indicates 4:2:0 sampling, that the second horizontal upsampling factor is equal to twice the first horizontal upsampling factor and that the second vertical upsampling factor is equal to twice the first vertical upsampling factor; Further comprising:
68. The method of claim 67.
73. The method comprises: determining, if the color format information indicates 4:4:4 sampling, that a width of the first predicted block is equal to a width of the current block and that a height of the first predicted block is equal to a height of the current block; determining, if color format information indicates 4:2:2 sampling, that a width of the first predicted block is equal to twice the width of the current block and that a height of the first predicted block is equal to the height of the current block; determining, if color format information indicates 4:1:1 sampling, that a width of the first predicted block is equal to four times a width of the current block and that a height of the first predicted block is equal to a height of the current block; If the color format information indicates 4:2:0 sampling, determining that a width of the first predicted block is equal to twice the width of the current block and a height of the first predicted block is equal to twice the height of the current block; Further comprising:
54. The method of claim 53.
74. The method comprises: performing a third filtering on the reconstructed values of the first reference color component samples in the current block using a third horizontal upsampling factor and a third vertical upsampling factor to obtain filtered sample values of the first reference color component samples in the current block; Accordingly, the method comprises: if color format information indicates 4:4:4 sampling, determining that a width of the first predicted block is equal to a product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to a product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:2:2 sampling, determining that a width of the first predicted block is equal to twice the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to the product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:1:1 sampling, determining that a width of the first predicted block is equal to four times the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to the product of a height of the current block and the third vertical upsampling factor; if color format information indicates 4:2:0 sampling, determining that a width of the first predicted block is equal to twice the product of a width of the current block and the third horizontal upsampling factor, and a height of the first predicted block is equal to twice the product of a height of the current block and the third vertical upsampling factor; Further comprising:
57. The method of claim 56.
75. determining a first prediction block of a second color component of the current block based on the weighting coefficient and a reference sample value of a second color component of the current block, determining a weighting value by multiplying the reference sample value of the second color component by a corresponding weighting coefficient; setting a predicted value of a second color component sample in the first prediction block equal to a sum of N of the weighted values; N indicates the number of reference sample values of the second color component, and N is a positive integer.
47. The method of claim 46.
76. The first filtering is a downsampling filtering.
47. The method of claim 46.
77. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; performing downsampling filtering on the first predicted block using a preset filter to determine a second predicted block of a second color component of the current block; 77. The method of claim 76.
78. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; Determining a horizontal downsampling factor and a vertical downsampling factor; performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block; Including, 77. The method of claim 76.
79. performing downsampling filtering on the first predicted block according to the horizontal downsampling factor and the vertical downsampling factor to obtain a second predicted block of a second color component of the current block; performing downsampling filtering on the first predicted block to obtain the second predicted block if the horizontal downsampling factor is greater than 1 or if the vertical downsampling factor is greater than 1; 79. The method of claim 78.
80. performing downsampling filtering on the first predicted block, performing downsampling filtering on the first predicted block in a horizontal direction; performing downsampling filtering on the first predicted block in a vertical direction; performing downsampling filtering on the first predicted block in a horizontal direction and then performing downsampling filtering on the first predicted block in a vertical direction; performing downsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; At least one of:
80. The method of claim 79.
81. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; performing a weighted sum calculation for each of a predetermined number of prediction values of a second color component of the first prediction block in a horizontal direction and / or a vertical direction according to the horizontal downsampling factor and the vertical downsampling factor to obtain the second prediction block.
79. The method of claim 78.
82. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in a horizontal direction to obtain the second predicted block; 82. The method of claim 81 .
83. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in a vertical direction to obtain the second predicted block; 82. The method of claim 81 .
84. performing a weighted sum calculation for each of a predetermined number of predicted values of a second color component of the first predicted block in the horizontal direction and / or the vertical direction to obtain the second predicted block, performing a weighted sum calculation for each predicted value of the number of horizontal downsampling factors of a second color component of the first predicted block in a horizontal direction, and performing a weighted sum calculation for each predicted value of the number of vertical downsampling factors of a second color component of the first predicted block in a vertical direction to obtain the second predicted block.
82. The method of claim 81 .
85. The method comprises: determining weighting coefficients according to reference sample values of a first color component of some samples in the first prediction block; determining a second prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of some samples in the first prediction block; Further comprising:
47. The method of claim 46.
86. determining a second prediction block of a second color component of the current block based on the weighting coefficients and reference sample values of a second color component of some samples in the first prediction block, performing a weighting calculation on a reference sample value of a second color component of a sample at a position (i, j) in the first prediction block based on the weighting coefficient to obtain a prediction value of a second color component of a sample at a position (x, y) in the current block; i, j, x, and j are all integers of 0 or more.
86. The method of claim 85.
87. The method comprises: if the color format information indicates 4:4:4 sampling, setting x equal to i and y equal to j; if the color format information indicates 4:2:2 sampling, setting x equal to i times 2 and y equal to j; if the color format information indicates 4:1:1 sampling, then setting x equal to i times 4 and y equal to j; if the color format information indicates 4:2:0 sampling, setting x equal to i times 2 and y equal to j times 2; Further comprising:
87. The method of claim 86.
88. The method comprises: Determining a horizontal sampling position factor and a vertical sampling position factor; setting x equal to the product of i and said horizontal sampling position factor and setting y equal to the product of j and said vertical sampling position factor.
87. The method of claim 86.
89. The method comprises: After determining a second predicted block of a second color component of the current block, performing related processing on the second predicted block, and setting the processed second predicted block as the second predicted block; The step of performing related processing on the second predicted block includes: performing a third filtering on the second predicted block; improving the second predicted block using a predetermined compensation value; performing weighted fusion on the second predicted block using a predicted value of a second color component of the current block under at least one prediction mode; At least one of:
47. The method of claim 46.
90. determining residual values of the second color component samples of the current block based on the second predicted block, determining a predicted value of the second color component sample of the current block based on the second predicted block; determining a residual value of the second color component sample of the current block based on an original value of the second color component sample of the current block and a predicted value of the second color component sample of the current block; Including, 47. The method of claim 46.
91. The method comprises: encoding residual values of the second color component samples of the current block and writing the resulting encoded bits to a bitstream.
91. The method of claim 90.
92. 1. An encoding device, comprising: A first determination unit, a first prediction unit, and a first filtering unit, The first determining unit is configured to determine a reference sample value of a first color component of a current block; and determine a weighting coefficient according to the reference sample value of the first color component of the current block; the first prediction unit is configured to determine a first prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of the current block, wherein a number of prediction values of the second color component included in the first prediction block is greater than a number of second color component samples included in the current block; The first filtering unit is configured to perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; the first determining unit is further configured to determine residual values of the second color component samples of the current block based on the second predicted block. An encoding device comprising:
93. 1. An encoding device comprising: A first memory and a first processor, the first memory is configured to store a computer program executable by the first processor; The first processor is configured to execute the method according to any one of claims 46 to 91 when executing the computer program.
1. An encoding device comprising:
94. A decoding device, comprising: A second determination unit, a second prediction unit, and a second filtering unit, The second determining unit is configured to determine a reference sample value of a first color component of a current block, and determine a weighting coefficient according to the reference sample value of the first color component of the current block; the second prediction unit is configured to determine a first prediction block of a second color component of the current block according to the weighting coefficients and reference sample values of a second color component of the current block, wherein a number of prediction values of the second color component included in the first prediction block is greater than a number of second color component samples included in the current block; The second filtering unit is configured to perform a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; the second determining unit is further configured to determine reconstructed values of the second color component samples of the current block based on the second predicted block. A decoding device comprising:
95. 1. A decoding device, comprising: a second memory and a second processor; the second memory is configured to store a computer program executable by the second processor; The second processor is configured, when executing the computer program, to perform the method according to any one of claims 1 to 45. A decoding device comprising:
96. 1. A computer-readable storage medium, comprising: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 45 is realized, or the method according to any one of claims 46 to 91 is realized. A computer-readable storage medium comprising:
Citation Information
Patent Citations
Image encoder, image encoding method and image encoding program, and image decoder, image decoding method and image decoding program
JP2018056685A
Video image component prediction method, apparatus and computer storage medium
JP2022501863A
Cross-component prediction using multiple components
WO2021115235A1