Coding method and apparatus, encoding device, decoding device, and storage medium
The method addresses the poor prediction accuracy in H.266/VVC by determining reference sample values and weighting coefficients for color component prediction, resulting in improved saturation prediction accuracy and coding performance.
Patent Information
- Application Number
- JP2024559965
- 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 faces challenges with 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 and encoding method that determines the reference sample value of the first color component, calculates weighting coefficients, and uses these coefficients to predict the second color component, followed by filtering to improve prediction accuracy and reduce bitrate.
This approach enhances the accuracy of saturation prediction, saves bitrate, and improves coding performance by fully utilizing the correlation between luminance information and adjacent regions.
Smart Images

Figure 2025512019000001_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 factor according to the reference sample value of the first color component of the current block; determining a first predicted block of a second color component of the current block according to the weighting factor and the reference sample value of a second color component of the current block; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; the second predicted block includes predicted values of all second color component samples in the current block; determining a reconstructed value of a second color component sample of the current block according to the second predicted block.
[0007] In a second aspect, an embodiment of the present application provides an encoding 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; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; the second predicted block includes predicted values of all second color component samples in the current block; determining a 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, comprising a first determining 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 factor 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 predicted block of a second color component of the current block based on the weighting factor and the reference sample value of a second color component of the current block. The first filtering unit is configured to perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block. The second predicted block includes predicted values of all the second color component samples in 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.
[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, which includes a second determining 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 factor 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 predicted block of a second color component of the current block based on the weighting factor and the reference sample value of the second color component of the current block. The second filtering unit is configured to perform a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block. The second predicted block includes predicted values of all the second color component samples in the current block. The second determining unit is further configured to determine a reconstructed value of the second color component sample of the current block based on the second predicted 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; a first predicted block of a second color component of the current block is determined by performing a first filtering on the first predicted block; the second predicted block includes predicted values of all second color component samples in the current block. In this way, at the encoding side, a residual value of a second color component sample of a current block can be determined according to the second predicted block, and at the decoding side, a reconstructed value of a second color component sample of a current block can be determined according to the second predicted block. In this way, by calculating the weighting coefficients using the reference samples adjacent to the current block and the color component information of the current block, the correlation in luminance information between the current block and the adjacent regions is fully utilized, and the correlation is used for chroma prediction of the current block, thereby improving the accuracy of chroma prediction. In addition, in order to reduce the complexity of the calculation of the weighting coefficients by utilizing the characteristic that the human eye has low sensitivity to chroma, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. Furthermore, in consideration of the instability of the predicted value of the first predicted block, filtering enhancement can be performed thereon, thereby further improving the accuracy of chroma prediction and the subjective and objective quality, 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 showing filter positions according to an embodiment of the present application. [Figure 8] FIG. 8 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 9] FIG. 9 is a schematic diagram illustrating the framework of a WCP according to an embodiment of the present application. [Figure 10] FIG. 10 is a flow chart 2 illustrating a decoding method according to an embodiment of the present application. [Figure 11] FIG. 11 is a flow chart 3 illustrating a decoding method according to an embodiment of the present application. [Figure 12] FIG. 12 is a flow chart 4 illustrating a decoding method according to an embodiment of the present application. [Figure 13] FIG. 13 is a schematic diagram 1 illustrating a process of upsampling interpolation according to an embodiment of the present application. [Figure 14] FIG. 14 is a schematic diagram 2 illustrating the process of upsampling interpolation according to an embodiment of the present application. [Figure 15]FIG. 15 is a schematic diagram illustrating weight values in upsampling interpolation according to an embodiment of the present application. [Figure 16] FIG. 16 is a schematic diagram 3 illustrating the process of upsampling interpolation according to an embodiment of the present application. [Figure 17] FIG. 17 is a schematic diagram 1 illustrating another upsampling interpolation process according to an embodiment of the present application. [Figure 18] FIG. 18 is a schematic diagram illustrating weight values in another upsampling interpolation according to an embodiment of the present application. [Figure 19] FIG. 19 is a schematic diagram 2 illustrating another upsampling interpolation process according to an embodiment of the present application. [Figure 20] FIG. 20 is a flow chart 1 illustrating an encoding method according to an embodiment of the present application. [Figure 21] FIG. 21 is a flow chart 2 illustrating an encoding method according to an embodiment of the present application. [Figure 22] FIG. 22 is a schematic diagram showing the structure of an encoding device according to an embodiment of the present application. [Figure 23] FIG. 23 is a schematic diagram illustrating a specific hardware structure of an encoding device according to an embodiment of the present application. [Figure 24] FIG. 24 is a schematic diagram showing the structure of a decoding device according to an embodiment of the present application. [Diagram 25] FIG. 25 is a schematic diagram illustrating a specific hardware structure of a decoding device according to an embodiment of the present application. [Figure 26] FIG. 26 is a schematic diagram showing the structure of a coding system according to an embodiment of the present application. 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] JPEG2025512019000002.jpg38152
[0021] JPEG2025512019000003.jpg37152
[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] JPEG2025512019000004.jpg63152
[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] JPEG2025512019000005.jpg133152
[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. 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 predicted block includes predicted values of all second color component samples in the current block. Determine a residual value of a 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; performing a first filtering on the first predicted block to determine a second predicted block of the second color component of the current block; the second predicted block includes predicted values of all second color component samples in the current block; determining a reconstructed value of a second color component sample of the current block according to the second predicted block.
[0041] In this way, by calculating the weighting coefficients using the reference samples adjacent to the current block and the color component information of the current block, the correlation in luminance information between the current block and the adjacent regions is fully utilized, and the correlation is used for chroma prediction of the current block, thereby improving the accuracy of chroma prediction. In addition, in order to utilize the characteristic that the human eye has low sensitivity to chroma and to reduce the complexity of the calculation of the weighting coefficients, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. Furthermore, in consideration of the instability of the predicted value of the first predicted block, filtering enhancement can be performed thereon, thereby further improving the accuracy of chroma prediction and the subjective and objective quality, saving the bit rate, improving the coding efficiency, and further improving the 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 post-processing method based on weight-based chroma prediction (WCP).
[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, as shown in detail in FIG. 6A, the neighboring regions can further include a top left region. 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 be referred to as the reference region of the current block, and the samples in the reference region are 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 smaller than the number of values of the first color component sample.
[0066] In an embodiment of the present application, the second filtering may be downsampling filtering. The first color component is a luminance component. In this case, the downsampling filtering is performed on the reference luminance information, so that the spatial resolution of the filtered reference luminance information and the spatial resolution of the reference chroma information are the same. For example, if the size of the current block is 2M×2N and the number of reference luminance information is 2M+2N, it can be converted to M+N after downsampling 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 smaller than the number of reconstructed values of the first reference color component sample in the current block.
[0071] In an embodiment of the present application, the third filtering may be downsampling filtering. The first reference color component is a luminance component. In this case, downsampling filtering may be performed on the reconstructed luminance information in the current block. For example, if the number of reconstructed luminance information in the current block is 2M×2N, it may be converted to M×N after downsampling 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, it is possible to select to perform filtering before weighted prediction according to known reference information of the current block, such as reference luminance information in the neighboring area of the current block, reconstructed luminance information in the current block, etc. Specifically, downsampling filtering can be performed on the reference luminance information in the neighboring area of the current block, downsampling filtering can be performed on the reconstructed luminance information in the current block, downsampling filtering can be performed on both the reference luminance information and the reconstructed luminance information, or downsampling filtering can be not performed on both the reference luminance information and the reconstructed luminance information. Then, the luminance difference information can be determined according to different combinations, and the luminance difference information can be 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] JPEG2025512019000006.jpg77152
number
[0082] JPEG2025512019000009.jpg37152
[0083] JPEG2025512019000010.jpg63152
number
[0084] JPEG2025512019000012.jpg32152
number
[0085] JPEG2025512019000014.jpg20152
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] JPEG2025512019000016.jpg25152
[0088] In a particular embodiment, determining the first factor may include the first factor being a preset constant value.
[0089] JPEG2025512019000017.jpg63152
[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 a width of the current block and a 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] JPEG2025512019000020.jpg51152
[0102] JPEG2025512019000021.jpg43153
[0103] JPEG2025512019000022.jpg26153
[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] JPEG2025512019000024.jpg20153
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] JPEG2025512019000028.jpg13153
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] JPEG2025512019000031.jpg56152
[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] JPEG2025512019000032.jpg42152
[0116] JPEG2025512019000033.jpg29152
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] JPEG2025512019000037.jpg25152
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] JPEG2025512019000041.jpg45152
[0125] JPEG2025512019000042.jpg43152
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] JPEG2025512019000046.jpg50152
[0130] JPEG2025512019000047.jpg48152
[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] It should be noted that in the embodiment of the present application, the first predicted block includes predicted values of at least some of the second color component samples 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 an embodiment of the present application, by performing upsampling filtering on the reference chroma information, the spatial resolution of the filtered reference chroma information and the spatial resolution of the reference luminance information can be made the same. For example, when the number of reference luminance information is 2M+2N and the number of reference chroma information is M+N, the number of reference chroma information can be converted to 2M+2N after upsampling filtering is performed on the reference chroma information.
[0139] In addition, in the embodiment of the present application, whether the second filtering is performed on the values of the first color component samples in the neighboring region or the third filtering is performed on the reconstructed values of the first reference color component samples in the current block, these two filterings may be downsampling filtering. The second filtering may be performed using a first filter, and the third filtering may be performed using a second filter. The first filter and the second filter may be downsampling filters. Since the data to be processed are different, the downsampling rates of these filters may be different. Therefore, the first filter and the second filter may be the same or different. Furthermore, a fourth filtering is performed on the values of the second color component samples in the neighboring region. The fourth filtering may be performed using a third filter. If the fourth filtering is upsampling filtering, the third filter may be an upsampling filter. Furthermore, the first filter, the second filter, and the third filter may be neural network filters. No limitation is imposed thereon.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] 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).
[0144] 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.
[0145] That is, when the number of reference sample values of the second color component is N, first, a weighted 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
[0146] 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.
[0147] However, in the embodiment of the present application, assuming that the width of the first prediction block is predSizeW, the height of the first prediction block is predSizeH, the width of the current block is nTbW, and the height of the current block is nTbH, predSizeH is less than or equal to nTbH, or predSizeW is less than or equal to nTbW, that is, the first prediction block includes prediction values of at least some second color component samples in the current block.
[0148] S504: Perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0149] S505: Determine a reconstructed value of a second color component sample of the current block based on the second predicted block.
[0150] It should be noted that in the embodiments of the present application, when the first predicted block includes predicted values of some second color component samples in the current block, it is necessary to perform upsampling filtering on the first predicted block to obtain the final second predicted block. Thus, in some embodiments, performing first filtering on the first predicted block to determine the second predicted block of the second color component of the current block includes performing upsampling filtering on the first predicted block to determine the second predicted block of the second color component of the current block.
[0151] In addition, in an embodiment of the present application, if the number of predicted values of the second color component included in the second predicted block is the same as the number of second color component samples included in the current block, but the second predicted block does not include predicted values of the second color component samples of the current block, it is necessary to perform filtering enhancement on the predicted values to obtain the final second predicted block. Thus, in some embodiments, performing first filtering on the first predicted block to determine the second predicted block of the second color component of the current block includes performing filtering enhancement on the first predicted block to determine the second predicted block of the second color component of the current block.
[0152] In addition, in an embodiment of the present application, when the first prediction block includes predicted values of all second color component samples in the current block, there is no need to perform any processing on the first prediction block, and the first prediction block can be directly used as the final second prediction block.
[0153] As can be understood, in the embodiment of the present application, the first filtering may be upsampling filtering, filtering enhancement, etc. No limitation is made here. However, for the second prediction block on which the first filtering is performed, the second prediction block includes prediction values of all second color component samples in the current block.
[0154] Wherein, if the first filtering is upsampling filtering, the fourth filter can perform upsampling filtering on the first predicted block. The fourth filter can be an upsampling filter. The fourth filter can be the same as or different from the above-mentioned third filter. The fourth filter here can also be a neural network filter. The embodiment of the present application does not make any restrictions thereon.
[0155] 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 upsampling filtering, an input of the upsampling filtering is a first upsampling input block, and an output of the upsampling filtering is a first upsampling output block.
[0156] Further, in some embodiments, the upsampling filtering may include: determining an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor, a vertical upsampling factor, and performing upsampling filtering on a first upsampling input block based on the upsampling factor to obtain a first upsampling output block.
[0157] In one possible embodiment, performing upsampling filtering on the first upsampling input block based on the upsampling factor to obtain a first upsampling output block may include: when the horizontal upsampling factor is greater than 1, or when the vertical upsampling factor is greater than 1, performing upsampling filtering on the first upsampling input block to obtain a first upsampling output block.
[0158] In an embodiment of the present application, performing upsampling filtering on the first upsampling input block includes: performing upsampling filtering horizontally on a first upsampled input block; performing vertical upsampling filtering on a first upsampled input block; performing upsampling filtering in the horizontal direction and then in the vertical direction on a first upsampling input block; performing upsampling filtering in the vertical direction and then in the horizontal direction on a first upsampling input block; may include at least one of:
[0159] Here, a horizontal upsampling factor can be calculated according to the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated according to the height of the first upsampling input block and the height of the first upsampling output block. Then, upsampling filtering is performed on the first upsampling input block according to the horizontal upsampling factor and the vertical upsampling factor. Specifically, when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, the first upsampling input block needs to be upsampling only in the horizontal direction. When the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, the first upsampling input block needs to be upsampling only in the vertical direction. When the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, the first upsampling input block needs to be upsampling in both the horizontal and vertical directions. Upsampling can be performed horizontally and then vertically, or can be performed vertically and then horizontally, and the upsampling filtering operation here can be replaced by a convolution operation in a neural network structure. The embodiments of this application do not impose any limitations.
[0160] In another possible embodiment, the second predicted block is determined by performing upsampling filtering on the first predicted block, in which case the method may further include: the first predicted block is a first upsampling input block, and the first upsampling output block is a second predicted block of a second color component of the current block.
[0161] In another possible embodiment, the first prediction block is first subjected to enhancement filtering and then subjected to upsampling filtering to determine the second prediction block. In this case, the method may further include the following: Performing enhancement filtering on the first prediction block to determine a first enhanced prediction block; The first enhanced prediction block is a first upsampling input block; and The first upsampling output block is a second prediction block of a second color component of the current block.
[0162] In yet another possible embodiment, the first prediction block is first subjected to upsampling filtering and then subjected to enhanced filtering to determine a second prediction block. In this case, the method may further include the following contents: The first prediction block is a first upsampling input block; The first upsampling output block is a first upsampling filtered prediction block; and The first upsampling filtered prediction block is subjected to enhanced filtering to determine a second prediction block of a second color component of the current block.
[0163] In another possible embodiment, the first prediction block is first subjected to enhanced filtering, then subjected to upsampling filtering, and then subjected to enhanced filtering to determine a second prediction block. In this case, the method may further include 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 upsampling input block; The first upsampling output block is a second upsampling filtered prediction block; Perform a second filtering enhancement on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0164] If the first filtering is upsampling filtering, the first predicted block may be upsampling filtered by a horizontal upsampling factor and a vertical upsampling factor. Specifically, in some embodiments, performing upsampling filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include the following: determining a horizontal upsampling factor and a vertical upsampling factor; performing upsampling filtering on the first predicted block according to the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of a second color component of the current block.
[0165] In a specific embodiment, performing upsampling filtering on the first predicted block according to a horizontal upsampling factor and a vertical upsampling factor to obtain a second predicted block of a second color component of the current block may include: when the horizontal upsampling factor is greater than 1, or when the vertical upsampling factor is greater than 1, performing upsampling filtering on the first predicted block to obtain a second predicted block.
[0166] In an embodiment of the present application, performing upsampling filtering on the first prediction block includes: performing upsampling filtering on the first predicted block in a horizontal direction; performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a horizontal direction and then performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first predicted block in a vertical direction and then in a horizontal direction; Includes at least one of the following:
[0167] Here, first, a horizontal upsampling factor can be calculated according to the width of the first predicted block and the width of the current block, and a vertical upsampling factor can be calculated according to the height of the first predicted block and the height of the current block. Then, upsampling filtering is performed on the first predicted block according to the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, the first predicted block needs to be upsampling only in the horizontal direction. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, the first predicted block needs to be upsampling only in the vertical direction. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, the first predicted block needs to be upsampling in both the horizontal and vertical directions. Upsampling can be performed in the horizontal direction and then in the vertical direction, or upsampling can be performed in the vertical direction and then in the horizontal direction, and the upsampling 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.
[0168] In some embodiments, the upsampling filtering is realized by at least one of linear interpolation and convolution operation based on a preset neural network. That is, the upsampling filtering can be realized by different filters, for example, a two-dimensional filter, a one-dimensional filter, etc. In the case of a one-dimensional filter, there are two filtering orders: "first vertical, then horizontal" and "first horizontal, then vertical". The above two filtering orders may be fixed filtering orders, or may be flexible filtering orders determined according to certain parameters (for example, an order directly indicated by identification information, an implicit order associated with elements such as a prediction mode or a block size, etc.). The embodiments of the present application do not impose any restrictions thereon.
[0169] In yet another possible embodiment, when the first filtering is filtering enhancement, the filtering enhancement can be realized by bilateral filtering. Specifically, 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 following contents: determining a first weight value of the first predicted block under a bilateral filtering mode; performing bilateral filtering on the first predicted block according to the first weight value to obtain a second predicted block.
[0170] It should be noted that bilateral filtering is a nonlinear filtering method used for edge preservation and noise removal. The filtering method considers both spatial proximity information and color similarity information, and can remove noise and smooth the image while preserving the edges of the image. Bilateral filtering uses a combination of two Gaussian filters. One is for calculating the weight value of spatial proximity, that is, the principle of the commonly used Gaussian filter, and the other is for calculating the weight value of pixel value similarity. Bilateral filtering is realized by two Gaussian filters. During bilateral filtering, the optimized weight value is convolved with the image to achieve the effect of edge preservation and noise removal. Referring to FIG. 7, FIG. 7 is a schematic diagram showing the filter position according to an embodiment of the present application. The current center position of the filter is (i, j), and the neighboring points of the center point are (k, l), and their weight values are painted in gray. In this way, the weight values of the two Gaussian filters are obtained as follows:
number
number
number
[0171] Furthermore, the optimized weights w(i,j,k,l) are convolved with the image to obtain the filtered prediction
number
[0172] Also, in the embodiment of the present application, in addition to bilateral filtering, the filtering enhancement may be median filtering, Gaussian filtering, normalized filtering, etc. That is, the filtering enhancement may include, but is not limited to, at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.
[0173] In addition, in some embodiments, the method may further include: before performing upsampling filtering on the first predicted block, performing filtering enhancement on the first predicted block; the first predicted block obtained after the enhancement is the first predicted block.
[0174] In addition, in some embodiments, the method may further include: after performing upsampling filtering on the first predicted block, performing filtering enhancement on the first predicted block obtained after upsampling filtering to obtain a second predicted block of a second color component of the current block.
[0175] That is, in the embodiment of the present application, the first filtering can be upsampling filtering, can be filtering enhancement, or can include both upsampling filtering and filtering enhancement. When including both, the first prediction block can be first upsampling filtering and then filtering enhancement, or the first prediction block can be first filtering enhancement and then upsampling filtering. The embodiment of the present application does not make any restrictions thereon.
[0176] In this way, the predSamples(i,j) obtained in equation (20) is not necessarily the final predicted value, but may be a filtering-augmented predicted value before upsampling (in which case predSamples(i,j) is not the final predicted value), may be a filtering-augmented predicted value after upsampling, or may be a filtering-augmented predicted value that does not require upsampling.
[0177] Further, for the filtering enhancement, in some embodiments, the method further includes: determining a compensation value of a second color component sample of the first predicted block according to a reference sample value in a neighboring region of the current block; and improving a prediction value of the second color component sample of the first predicted block according to the compensation value to determine a second predicted block.
[0178] In addition, to further improve the prediction accuracy of the WCP mode, position-related refinement can be performed on the first predicted block, for example, by using a reference sample with a nearby spatial position to calculate a saturation compensation value for each second color component sample to be predicted, and using the saturation compensation value to refine the second color component samples in the second predicted block, and determining the final predicted values (predSamples) of the second color component samples according to the refined predicted values, and then obtaining the final second predicted block.
[0179] Further, for the filtering enhancement, in some embodiments, the method further includes: predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; and performing a weighted fusion between the at least one initial predicted value and the predicted value of the second color component sample in the first prediction block to determine a second prediction block.
[0180] In addition, in order to further improve the prediction accuracy of the WCP mode, the chroma prediction value calculated under the other prediction mode and the chroma prediction value calculated under the WCP mode may be weighted and merged, and the final chroma prediction value may be determined based on the fusion result. Exemplarily, as shown in FIG. 8, 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 prediction 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.
[0181] 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.
[0182] 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.
[0183] 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.
[0184] 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.
[0185] For understanding, in the embodiment of the present application, during prediction according to WCP mode, the process of post-processing after WCP prediction is described in detail in the following four aspects. First, the luminance information of the reference sample and the current block is fully utilized to realize the calculation of the chroma weighting coefficient of the reference sample. Second, the core parameters of the WCP mode are fully considered to utilize the characteristics of the low sensitivity of the human eye to chroma, and to reduce the complexity of the chroma weighting calculation. That is, when predSizeW×predSizeH is equal to or smaller than nTbW×nTbH, upsampling is performed on the chroma prediction block. Third, the reference chroma information is fully utilized when upsampling, and the characteristics on different directions are considered. During linear interpolation, different weight values are assigned to different points to be interpolated between existing neighboring points, so that the spatial correlation between the points to be interpolated and existing points is fully considered, and the accuracy of upsampling filtering is improved. Fourth, taking into consideration the possibility that the chroma prediction block output by WCP prediction may produce an unstable and inaccurate prediction value, and the possibility that the upsampling filtering of the embodiment of the present application may produce an inaccurate prediction value, the accuracy and subjective and objective quality of the chroma prediction block are further improved by performing filtering enhancement using bilateral filtering that can realize edge preservation and noise removal on the chroma prediction block in such cases. Note that the four aspects described here are not sequentially related and may be used individually or in combination.
[0186] JPEG2025512019000054.jpg55152
[0187] This embodiment provides a decoding method. A reference sample value of a first color component of a current block is determined. A weighting factor is determined based on 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 based on the weighting factor and the reference sample value of the second color component of 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. The second predicted block includes predicted values of all second color component samples in the current block. A reconstructed value of a second color component sample of the current block is determined based on the second predicted block. In this way, by using the reference samples adjacent to the current block and the color component information of the current block to calculate the weighting factor, the correlation in luminance information between the current block and the adjacent area can be fully utilized, and the correlation can be used for chroma prediction of the current block to improve the accuracy of chroma prediction. In addition, in order to utilize the characteristic that the human eye has low sensitivity to chroma and to reduce the complexity of the calculation of the weighting factor, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. Furthermore, taking into account the instability of the predicted value of the first predicted block, filtering enhancement can also be performed on it, thereby further improving the accuracy of saturation prediction and the subjective and objective quality, saving bit rate, improving coding efficiency, and further improving coding performance.
[0188] In another embodiment of the present application, the chroma prediction is performed on the 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 the chroma prediction block obtained by WCP is post-processed to further improve the accuracy of chroma prediction. Here, the detailed steps of the chroma prediction process according to the WCP mode are as follows:
[0189] WCP mode input: current block position (xTbCmp, yTbCmp), current block width nTbW, and current block height nTbH.
[0190] 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.
[0191] The prediction process in WCP mode may include steps such as determining core parameters, obtaining target information, WCP, and post-processing. After going through these steps, the chroma prediction value of the current block can be obtained.
[0192] In one specific embodiment, refer to Figure 10, which is a flow chart 2 showing a decoding method according to an embodiment of the present application. As shown in Figure 10, the method may include the following contents:
[0193] S1001: Determine core parameters for WCP mode.
[0194] In addition, with respect to S1001, with regard to 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 on the decoding side.
[0195] 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.
[0196] 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.
[0197] In the following, two simple classifications are taken as examples to more clearly explain the determination of core parameters.
[0198] Classification Example 1: In the WCP mode, the current block can be classified according to the width and height of the current block, and the block category is represented by wcpSizeId. The control parameter(s), the number of WCP inputs inSize, and the number of WCP outputs (arranged in predSizeW×predSizeH) corresponding to different categories of blocks may be the same or different. Here, an example of classification into three categories will be described.
[0199] 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 to be different, 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.
[0200] wcpSizeId = 0: Represents the current block where min(nTbW, nTbH) <= 4. The control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.
[0201] wcpSizeId = 1: Represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter(s) is 12, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.
[0202] wcpSizeId = 2: Represents the current block where min(nTbW, nTbH) > 16. The control parameter(s) is 16, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.
[0203] The numerical relationships among the above core parameters are represented in a table, for example, as shown in Table 6.
[0204] [Table 6]
[0205] Another example that can be described is classified into three categories.
[0206] 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 to be different, and the inSize and the number of WCP outputs (arranged in predSizeW×predSizeH) corresponding to different categories can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and the block category wcpSizeId is defined as follows.
[0207] wcpSizeId = 0: represents the current block where min(nTbW, nTbH) <= 4. The control parameter(s) is 8, inSize is (2×nTbH + 2×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH×nTbW.
[0208] wcpSizeId = 1: represents the current block where 4 < min(nTbW, nTbH) <= 16. The control parameter(s) is 12, inSize is (1.5×nTbH + 1.5×nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH / 2×nTbW / 2.
[0209] wcpSizeId = 2: represents the current block where min(nTbW, nTbH) > 16. The control parameter(s) of WCP is 16, inSize is (nTbH + nTbW), and the number of chroma prediction values is the number of WCP outputs nTbH / 4×nTbW / 4.
[0210] The numerical relationships between the above core parameters are tabulated, for example as shown in Table 7.
[0211] [Table 7]
[0212] Classification Example 2: In WCP mode, the current block can also be classified according to its width and height, 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×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:
[0214] wcpSizeId=0: represents the current block where (nTbWnTbH)<128. The control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0215] 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.
[0216] 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.
[0217] The numerical relationships between the above core parameters may be tabulated, for example as shown in Table 8.
[0218] [Table 8]
[0219] This can also be illustrated with other examples that fall 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 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:
[0221] wcpSizeId=0: represents the current block where (nTbWnTbH)<64. The control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and the number of chroma prediction values is the number of WCP outputs, nTbH×nTbW.
[0222] 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.
[0223] 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.
[0224] The numerical relationships between the above core parameters may be tabulated, for example as shown in Table 9.
[0225] [Table 9]
[0226] S1002: Determine target information of the current block based on the core parameters.
[0227] In addition, for S1002, 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.
[0228] Here, reference chroma information refC and reference luma information refY are obtained from adjacent regions. The obtained reference chroma information includes, but is not limited to, a reference reconstructed chroma value selected from an upper region of the current block and / or a reference reconstructed chroma value selected from a left region of the current block. The obtained reference luma information includes, but is not limited to, a corresponding reference luma information obtained based on the position of the reference chroma information.
[0229] Obtain reconstructed luminance information recY of the current prediction block, the obtaining manner of which includes but is not limited to: according to the position of chroma information in the current block, obtain corresponding reconstructed luminance information to be the reconstructed luminance information of the current block.
[0230] In addition, in the embodiment of the present application, refC, refY, or recY can be pre-processed under certain conditions and then used as target information for WCP input.
[0231] Illustratively, to reduce the computational complexity of the WCP prediction, sampling or downsampling filtering can be performed on refC, refY, or recY.
[0232] Illustratively, for current blocks having different sizes, different filtering can be performed on refC, refY, or recY.
[0233] For example, if the spatial resolution of the chroma and luma components of a video does not match, upsampling or downsampling filtering can be performed on refC, refY, or recY to facilitate subsequent chroma prediction calculation.
[0234] For example, when the spatial resolution of the chroma and luma components of a video is the same, multiple row / column reference samples can be used, and upsampling or downsampling filtering can be performed on refC, refY, or recY to facilitate the subsequent chroma prediction calculation.
[0235] For example, when the number of acquired refC or refY is different from the number of inSize in the core parameters, extraction, upsampling filtering or downsampling filtering can be performed on refC or refY.
[0236] That is, obtaining the target information may include the following contents: Obtain reference chroma information refC, the number of which is inSize (if preprocessing is required, refC is obtained after preprocessing); Obtain reference luma information refY, the number of which is inSize (if preprocessing is required, refY is obtained after preprocessing); Obtain reconstructed luma information recY in the current block (if preprocessing is required, recY is obtained after preprocessing).
[0237] S1003: Perform WCP based on the target information to obtain a first predicted block of the current block.
[0238] JPEG2025512019000059.jpg51152
[0239] JPEG2025512019000060.jpg61152
[0240] In a specific embodiment, after obtaining the target information, as shown in FIG. 11, the method may include:
[0241] S1101: For each sample to be predicted, construct a luma difference vector using reference chroma information, reference luma information included in the target information, and reconstructed luma information of the current block.
[0242] JPEG2025512019000061.jpg30152
number
[0243] 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.
[0244] S1102: For each sample to be predicted, a weight vector is calculated using a nonlinear function based on the luminance difference vector.
[0245] JPEG2025512019000064.jpg57152
[0246] JPEG2025512019000065.jpg32152
number
[0247] 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
[0248] 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.
[0249] In this way, after completing the calculations based on Equation (22) or (23), fixed-point arithmetic can be performed on cWeightFloat as follows:
number
[0250] S1103: For each sample waiting to be predicted, 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.
[0251] JPEG2025512019000070.jpg50152
[0252] 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.
[0253] Exemplarily, the calculation formula is as follows: For k=0, 1, ..., inSize-1,
number
number
number
number
[0254] In another possible embodiment, a weighting calculation is performed based on fixed-point weighting coefficients and reference chroma information to obtain an initial prediction value of a sample waiting to be predicted, and fixed-point compensation is performed on the initial prediction value to obtain a target prediction value of the sample waiting to be predicted.
[0255] Exemplarily, the calculation formula is as follows. For k = 0, 1, ..., inSize - 1,
Equation
Equation
[0256] S1104: For each sample waiting to be predicted, improve the calculated chroma prediction value to determine the first prediction block of the current block.
[0257] JPEG2025512019000079.jpg57152
[0258] BitDepth is the bit depth required for the chroma sample value to ensure that all chroma prediction values within the prediction block are between 0 and (1 << BitDepth) - 1. That is,
Equation
Equation
number
[0259] S1004: Perform post-processing on the chroma prediction value of the first prediction block to determine a second prediction block of the current block.
[0260] In addition, in step S1004, the reconstructed luminance information is used to obtain a saturation prediction value through weight derivation, and the obtained saturation prediction value is subsequently post-processed to further improve the accuracy of the saturation prediction.
[0261] Because the human eye is not very sensitive to partial removal of chroma information, in the embodiment of the present application, chroma prediction can be performed on only some samples in the current block, in which case the size of the first predicted block obtained is equal to or smaller than the size of the current block (i.e., the original chroma block), nTbW×nTbH. The technical solution of the embodiment of the present application mainly determines whether to perform upsampling filtering on chroma and whether to perform enhanced filtering on chroma predicted values according to the output size of the first predicted block obtained after WCP prediction.
[0262] In a specific embodiment, for performing post-processing on the chroma prediction value of the first prediction block, as shown in FIG. 12, the method may include the following contents:
[0263] S1201: Determine the output size of the first prediction block.
[0264] S1202: If the output size of the first prediction block is equal to the size of the current block, directly perform filtering enhancement on the first prediction block to obtain a second prediction block.
[0265] S1203: If the output size of the first predicted block is smaller than the size of the current block, determine the execution order of the first predicted block.
[0266] S1204: First, perform upsampling filtering on the first predicted block to obtain an upsampled predicted block, and restore its size to the same size as the current block.
[0267] S1205: Next, perform filtering enhancement on the upsampled prediction block to obtain a second prediction block.
[0268] S1206: First, perform filtering enhancement on the prediction block after upsampling filtering to obtain an enhanced prediction block.
[0269] S1207: Next, perform upsampling filtering on the augmented prediction block to obtain a second prediction block, and restore its size to the same size as the current block.
[0270] It should be noted that the execution order of the first prediction block may include a first execution order and a second execution order. The first execution order is to first perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the upsampled prediction block. The second execution order is to first perform filtering enhancement on the first prediction block, and then perform upsampling filtering on the enhanced prediction block.
[0271] Here, it is assumed that the execution order of the first prediction block is the first execution order, that is, first, upsampling filtering is performed on the first prediction block, and then enhanced filtering is performed on the upsampled prediction block.
[0272] In actual coding, chroma sub-sampling utilizes the characteristic that the human eye is less sensitive to chroma signals than to luminance signals to remove part of the information expressing color in an image without being noticed by humans. This means that a relatively low spatial sampling rate can be given to the chroma signal. In addition, the chroma components in the same block are relatively flat and have similar content characteristics. In video content with these two characteristics, if prediction is performed on a sample-by-sample basis for all samples in the same block in an image, high complexity will be generated in the calculation of weight vectors and weighting of chroma prediction values, and the prediction efficiency will be greatly reduced. Based on the above two characteristics of the video and the high complexity of calculating the chroma prediction values of all samples, it may be considered to predict only some samples in the current block, that is, in the core parameters of the WCP mode, if predSizeW is smaller than the width nTbW of the current block or predSizeH is smaller than the height nTbH of the current block, upsampling filtering needs to be performed on predWcp to obtain the final chroma prediction value predSamples.
[0273] In the embodiment of the present application, first, a horizontal upsampling factor upHor is calculated according to the width predSizeW of the output first predicted block and the width nTbW of the current block. Similarly, a vertical upsampling factor upVer is calculated according to 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
[0274] Immediately afterwards, fill the first prediction block predWcp into the current second prediction block predSamples as follows:
number
[0275] Specifically, first, the upper reference reconstructed chroma sample refC_T is filled into the upper row predSamples[x][-1] of the second prediction block, and the left reference reconstructed chroma sample refC_L is filled into the left column predSamples[-1][y] of the second prediction block, where x = 0, ..., nTbW-1 and y = 0, ..., nTbH-1.
[0276] In this case, according to Equation 36, predWcp is filled in the corresponding position ((x+1)×upHor-1, (y+1)×upVer-1) in the second prediction block predSamples. This can be understood as follows. The second prediction block is evenly divided into predSizeW×predSizeH sub-blocks, and the filled position is the lower right corner of each sub-block. As shown in detail in FIG. 13, taking a 32×32 block as an example, the samples shaded in the grid are the reference reconstructed chroma samples refC_T on the upper side, the samples shaded in diagonal lines are the reference reconstructed chroma samples refC_L on the left side, and the samples shaded in black are the positions where the chroma prediction samples predWcp are filled.
[0277] When the horizontal upsampling factor upHor is greater than 1, the horizontal upsampling filtering is performed first, and the upsampling process is given by the following equation:
number
number
[0278] This process is shown in detail in Figure 14. Take a 32x32 block as an example, during horizontal upsampling, the samples in the left reference chroma sample refC_L corresponding to the horizontal positions filled with predWcp are also used as reference samples for upsampling, and are shown as black-colored samples. In this case, all the black-colored samples are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two black-colored samples in the horizontal direction are colored gray.
[0279] The upsampling is performed by linear interpolation. That is, the value of each interpolated sample (colored gray) between two reference chroma samples for upsampling (colored black) is the weighted average value of the two reference chroma samples for upsampling. According to Equation (37) and Equation (38), 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. That is, when interpolating horizontally, the weight is related only to the horizontal upsampling factor upHor. FIG. 15 shows an example of the weight. In this example, upHor=4. For the first interpolated sample in FIG. 15, 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 15, 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 15, 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.
[0280] When the vertical upsampling factor upVer is greater than 1, vertical upsampling filtering is required, and the process is similar to that of horizontal upsampling. The specific process is shown in the following equation:
number
number
[0281] This process is shown in detail in Figure 16. Taking a 32x32 block as an example, after completing the horizontal upsampling filtering shown in Figure 14, the upper reference chroma sample refC_T and all existing samples in the second prediction block are all reference samples for vertical upsampling, which are shown as black. In this case, all the samples marked with black are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two black samples in the vertical direction are marked with gray.
[0282] Upsampling is performed by linear interpolation. According to Equation 39 and Equation 40, the weight of the upper reference sample for upsampling is (upVer-dY) / upVer, and the weight of the lower reference sample is dY / upVer, where dY=1, ..., upVer-1, and dY is the distance between the current interpolated sample and the upper reference sample. That is, when performing vertical interpolation, the weight is related only to the vertical upsampling factor upVer.
[0283] In this way, the predSamples obtained after the above process are the predicted values of the final chroma prediction block in the current WCP technology.
[0284] In addition, in order to solve the inaccuracy of the non-linear weight mapping model of the WCP technique and the instability caused by predicting each sample independently, in the embodiment of the present application, the prediction block to be output may be considered to be subjected to filtering enhancement. The prediction block to be subjected to filtering enhancement may include a first prediction block before upsampling filtering, may include a second prediction block after upsampling filtering, or may include a first prediction block that does not require upsampling filtering (when upHor=upVer=1).
[0285] Here, the filtering enhancement method used in the embodiment of the present application is bilateral filtering, which is a nonlinear filtering method used for edge preservation and noise removal, which takes into account both spatial proximity information and color similarity information, and can remove noise and smooth the image while preserving the edges of the image.
[0286] Specifically, bilateral filtering uses a combination of two Gaussian filters. One is for calculating the weight value of spatial proximity, that is, the principle of commonly used Gaussian filters, and the other is for calculating the weight value of pixel value similarity. Bilateral filtering is realized by two Gaussian filters. During bilateral filtering, the optimized weight value is convolved with the image to achieve the effect of edge preservation and noise removal. The weight values of the two Gaussian filters are obtained as shown in the above-mentioned Equation 17 to Equation 19. The optimized weight value w(i,j,k,l) is convolved with the image to obtain the filtered prediction value shown in the above-mentioned Equation 20. Note that predSamples(i,j) is the filtered prediction value. However, predSamples(i,j) here is not necessarily the final predicted value, but may be a filtered predicted value before upsampling (in which case predSamples(i,j) is not the final predicted value), a filtered predicted value after upsampling, or a filtered predicted value that does not require upsampling.
[0287] As can be understood, in the embodiment of the present application, in addition to bilateral filtering being the filtering method, a median filter can be used to replace each pixel of an image with the median value of pixels in a neighborhood (a square area centered on the current pixel), a Gaussian filter can be used, or a normalized box filter can be used. No limitations are imposed here. Exemplarily, for a normalized filter, the output pixel value is the average value of pixel values in a kernel window (all pixels have equal weighting coefficients), and the kernel is shown below:
number
[0288] Furthermore, in order to improve the prediction performance of WCP, in addition to using conventional filtering algorithms, a neural network can also be used to perform filtering augmentation on the prediction output predWcp of WCP.
[0289] To be further understood, in an embodiment of the present application, a conventional improvement method of post-processing enhancement for the output first predicted block may include: (1) To further improve the accuracy of the WCP prediction, position-related refinements can be made to predWcp, for example, by calculating a saturation compensation value for each sample to be predicted using a reference sample with a nearby spatial location, refining predWcp using the saturation compensation value, and taking the refined prediction as the final saturation prediction value predSamples. (2) In addition, a weighted fusion is performed on the saturation prediction value calculated by one or more other saturation prediction techniques and the saturation prediction value predWcp calculated by WCP, and the fusion result is the final saturation prediction value predSamples. The weighted fusion method can be seen in detail in FIG. 8.
[0290] It can be further understood that in the embodiment of the present application, in addition to using the "first horizontal, then vertical" upsampling method, the upsampling filtering can also use the "first vertical, then horizontal" upsampling method. For example, as shown in FIG. 17, taking a 32×32 block as an example, the grid-shaded samples are the upper reference reconstruction chroma samples refC_T, and the shaded samples are the left reference reconstruction chroma samples refC_L.
[0291] If the vertical upsampling factor upVer is greater than 1, then vertical upsampling is performed first. The upsampling process is given by the following equation:
number
number
[0292] This process is shown in detail in Figure 17. Take a 32x32 block as an example, during vertical upsampling, the samples in the upper reference chroma sample refC_T corresponding to the vertical positions filled with predWcp are also used as reference samples for upsampling, and are shown as black-colored samples. In this case, all the black-colored samples are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two black-colored samples in the vertical direction are colored gray.
[0293] Upsampling is performed by linear interpolation. According to Equation 42 and Equation 43, the weight of the upper reference sample for upsampling is (upVer-dY) / upVer, and the weight of the lower reference sample is dY / upVer, where dY=1, ..., upVer-1, and dY is the distance between the current interpolated sample and the upper reference sample. That is, when performing vertical interpolation, the weight is related only to the vertical upsampling factor upVer. FIG. 18 shows an example of the weight. In this example, upHor=4. For the first interpolated sample in FIG. 18, the weight of the upper reference chroma sample for upsampling is 5 / 8, and the weight of the lower reference chroma sample for upsampling is 3 / 8. For the second interpolated sample in FIG. 18, the weight of the upper reference chroma sample for upsampling is 4 / 8, and the weight of the lower reference chroma sample for upsampling is 4 / 8. For the third interpolated sample in FIG. 18, the weight of the upper reference chroma sample for upsampling is 3 / 8, and the weight of the lower reference chroma sample for upsampling is 5 / 8.
[0294] When the horizontal upsampling factor upHor is greater than 1, horizontal upsampling is required, and the process is similar to that of vertical upsampling. The specific process is shown in the following formula:
number
number
[0295] This process is shown in detail in Figure 19. Taking a 32x32 block as an example, after completing the vertical upsampling shown in Figure 17, the left reference chroma sample refC_L and all existing samples in the second prediction block are all reference samples for horizontal upsampling, and are shown as black. In this case, all the samples marked with black are reference samples for upsampling, and the predicted samples obtained by linear interpolation between every two black samples in the horizontal direction are marked with gray.
[0296] Upsampling is performed by linear interpolation, i.e., the value of each interpolated sample (shaded in gray) between two reference chroma samples for upsampling (shaded in black) is the weighted average value of the two reference chroma samples for upsampling. According to Equation (44) and Equation (45), 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. That is, when interpolating horizontally, the weight is only related to the horizontal upsampling factor upHor.
[0297] In this way, the predSamples obtained after the above process are the predicted values of the final chroma prediction block in the current WCP technology.
[0298] As can be further understood, in the embodiment of the present application, the chroma prediction value after "first horizontal, then vertical" upsampling and the chroma prediction value after "first vertical, then horizontal" upsampling can be averaged to obtain the final chroma prediction value. Or, when performing upsampling by linear interpolation, the value of each interpolated sample (filled in gray) between two reference chroma samples for upsampling (filled in black) can be the average value of the two reference chroma samples for upsampling, that is, both weights are 1 / 2. Or, in addition to the above conventional upsampling method, a convolution operation in a neural network structure can be used instead of the upsampling operation. There is no limitation thereon.
[0299] JPEG2025512019000095.jpg184153
[0300] In another embodiment of the present application, refer to Fig. 20, which is a flow chart 1 illustrating an encoding method according to an embodiment of the present application. As shown in Fig. 20, the method may include the following contents:
[0301] S2001: The reference sample value of the first color component of the current block is determined.
[0302] 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 post-processing method of weight-based chroma prediction (WCP).
[0303] 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.
[0304] Also, in embodiments 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, which are 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.
[0305] In some embodiments, determining the reference sample value of the first color component of the current block may include determining the reference sample value of the first color component of the current block based on values of first color component samples in adjacent regions of the current block.
[0306] 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.
[0307] 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.
[0308] 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.
[0309] 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.
[0310] 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.
[0311] In some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a second filtering on the 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.
[0312] In an embodiment of the present application, the number of filtered neighboring sample values of the first color component of the current block is smaller than the number of values of the first color component sample.
[0313] In an embodiment of the present application, the second filtering may be downsampling filtering. The first color component is a luminance component. In this case, the downsampling filtering is performed on the reference luminance information so that the spatial resolution of the filtered reference luminance information and the spatial resolution of the reference chroma information are the same.
[0314] In some embodiments, determining the reference sample value of the first color component of the current block may further include determining the reference sample value of the first color component of the current block based on a reconstructed value of the first reference color component sample in the current block.
[0315] 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.
[0316] Furthermore, in some embodiments, determining the reference sample value of the first color component of the current block may further include: performing a third filtering on the reconstructed value of the first reference color component sample in the current block to obtain 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.
[0317] 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 smaller than the number of reconstructed values of the first reference color component sample in the current block.
[0318] In an embodiment of the present application, the third filtering may be downsampling filtering, and the first reference color component is a luminance component. In this case, the downsampling filtering may be performed on the reconstructed luminance information in the current block.
[0319] 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.
[0320] 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.
[0321] 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.
[0322] 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.
[0323] That is, it is possible to select to perform filtering before weighted prediction according to known reference information of the current block, such as reference luminance information in the neighboring area of the current block, reconstructed luminance information in the current block, etc. Specifically, downsampling filtering can be performed on the reference luminance information in the neighboring area of the current block, downsampling filtering can be performed on the reconstructed luminance information in the current block, downsampling filtering can be performed on both the reference luminance information and the reconstructed luminance information, or downsampling filtering can be not performed on both the reference luminance information and the reconstructed luminance information. Then, the luminance difference information can be determined according to different combinations, and the luminance difference information can be used as the reference sample value of the first color component of the current block.
[0324] S2002: Determine a weighting coefficient based on the reference sample value of the first color component of the current block.
[0325] 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;
[0326] 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.
[0327] JPEG2025512019000096.jpg45152
[0328] 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.
[0329] In a particular embodiment, determining the first factor may include the first factor being a preset constant value.
[0330] 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.
[0331] 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.
[0332] Here, the size parameter of the current block may include at least one parameter of a width of the current block and a height of the current block.
[0333] 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.
[0334] 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.
[0335] 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.
[0336] 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.
[0337] 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.
[0338] 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.
[0339] JPEG2025512019000097.jpg50152
[0340] JPEG2025512019000098.jpg26152
[0341] 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.
[0342] 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.
[0343] 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, such as that shown in the above Equation 6 or Equation 7. 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].
[0344] 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, such as that shown in Equation 8 or Equation 9 above.
[0345] 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 preset mapping may be in the form of a preset lookup table. For example, by adopting the form of an array element lookup table, a part of the calculation operation is simplified. The embodiment of the present application is not particularly limited.
[0346] JPEG2025512019000099.jpg48152
[0347] S2003: 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.
[0348] It should be noted that in the embodiment of the present application, the first predicted block includes predicted values of at least some of the second color component samples in the current block.
[0349] 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.
[0350] 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.
[0351] 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.
[0352] 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.
[0353] 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.
[0354] That is, the first color component is a luminance component, and the second color component is a chroma component. In an embodiment of the present application, by performing upsampling filtering on the reference chroma information, the spatial resolution of the filtered reference chroma information and the spatial resolution of the reference luminance information can be made the same. For example, when the number of reference luminance information is 2M+2N and the number of reference chroma information is M+N, the number of reference chroma information can be converted to 2M+2N after upsampling filtering is performed on the reference chroma information.
[0355] In addition, in the embodiment of the present application, whether the second filtering is performed on the values of the first color component samples in the neighboring region or the third filtering is performed on the reconstructed values of the first reference color component samples in the current block, these two filterings may be downsampling filtering. The second filtering may be performed using a first filter, and the third filtering may be performed using a second filter. The first filter and the second filter may be downsampling filters. Since the data to be processed are different, the downsampling rates of these filters may be different. Therefore, the first filter and the second filter may be the same or different. Furthermore, a fourth filtering is performed on the values of the second color component samples in the neighboring region. The fourth filtering may be performed using a third filter. If the fourth filtering is upsampling filtering, the third filter may be an upsampling filter. Furthermore, the first filter, the second filter, and the third filter may be neural network filters. No limitation is imposed thereon.
[0356] 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.
[0357] 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.
[0358] 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.
[0359] In this way, 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, average interpolation, median interpolation, copy interpolation, etc. Or, the upsampling filtering method 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. The embodiments of the present application do not impose any limitations.
[0360] Further, after determining the reference sample value of the second color component of the current block, in some embodiments, for S2003, 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.
[0361] 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.
[0362] However, in the embodiment of the present application, assuming that the width of the first prediction block is predSizeW, the height of the first prediction block is predSizeH, the width of the current block is nTbW, and the height of the current block is nTbH, predSizeH is less than or equal to nTbH, or predSizeW is less than or equal to nTbW, that is, the first prediction block includes prediction values of at least some second color component samples in the current block.
[0363] S2004: Perform first filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0364] S2005: Determine the residual value of the second color component sample of the current block based on the second predicted block.
[0365] It should be noted that in the embodiments of the present application, when the first predicted block includes predicted values of some second color component samples in the current block, it is necessary to perform upsampling filtering on the first predicted block to obtain the final second predicted block. Thus, in some embodiments, performing first filtering on the first predicted block to determine the second predicted block of the second color component of the current block includes performing upsampling filtering on the first predicted block to determine the second predicted block of the second color component of the current block.
[0366] In addition, in an embodiment of the present application, if the number of predicted values of the second color component included in the second predicted block is the same as the number of second color component samples included in the current block, but the second predicted block does not include predicted values of the second color component samples of the current block, it is necessary to perform filtering enhancement on the predicted values to obtain the final second predicted block. Thus, in some embodiments, performing first filtering on the first predicted block to determine the second predicted block of the second color component of the current block includes performing filtering enhancement on the first predicted block to determine the second predicted block of the second color component of the current block.
[0367] In addition, in an embodiment of the present application, when the first prediction block includes predicted values of all second color component samples in the current block, there is no need to perform any processing on the first prediction block, and the first prediction block can be directly used as the final second prediction block.
[0368] As can be understood, in the embodiment of the present application, the first filtering may be upsampling filtering, filtering enhancement, etc. No limitation is made here. However, for the second prediction block on which the first filtering is performed, the second prediction block includes prediction values of all second color component samples in the current block.
[0369] Wherein, if the first filtering is upsampling filtering, the fourth filter can perform upsampling filtering on the first predicted block. The fourth filter can be an upsampling filter. The fourth filter can be the same as or different from the above-mentioned third filter. The fourth filter here can also be a neural network filter. The embodiment of the present application does not make any restrictions thereon.
[0370] 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 upsampling filtering, an input of the upsampling filtering is a first upsampling input block, and an output of the upsampling filtering is a first upsampling output block.
[0371] Further, in some embodiments, the upsampling filtering may include: determining an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor, a vertical upsampling factor, and performing upsampling filtering on a first upsampling input block based on the upsampling factor to obtain a first upsampling output block.
[0372] In one possible embodiment, performing upsampling filtering on the first upsampling input block based on the upsampling factor to obtain a first upsampling output block may include: when the horizontal upsampling factor is greater than 1, or when the vertical upsampling factor is greater than 1, performing upsampling filtering on the first upsampling input block to obtain a first upsampling output block.
[0373] In an embodiment of the present application, performing upsampling filtering on the first upsampling input block includes: performing upsampling filtering horizontally on a first upsampled input block; performing vertical upsampling filtering on a first upsampled input block; performing upsampling filtering in the horizontal direction and then in the vertical direction on a first upsampling input block; performing upsampling filtering in the vertical direction and then in the horizontal direction on a first upsampling input block; may include at least one of:
[0374] Here, a horizontal upsampling factor can be calculated according to the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated according to the height of the first upsampling input block and the height of the first upsampling output block. Then, upsampling filtering is performed on the first upsampling input block according to the horizontal upsampling factor and the vertical upsampling factor. Specifically, when the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, the first upsampling input block needs to be upsampling only in the horizontal direction. When the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, the first upsampling input block needs to be upsampling only in the vertical direction. When the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, the first upsampling input block needs to be upsampling in both the horizontal and vertical directions. Upsampling can be performed horizontally and then vertically, or can be performed vertically and then horizontally, and the upsampling filtering operation here can be replaced by a convolution operation in a neural network structure. The embodiments of this application do not impose any limitations.
[0375] In another possible embodiment, the second predicted block is determined by performing upsampling filtering on the first predicted block, in which case the method may further include: the first predicted block is a first upsampling input block, and the first upsampling output block is a second predicted block of a second color component of the current block.
[0376] In another possible embodiment, the first prediction block is first subjected to enhanced filtering and then subjected to upsampling filtering to determine the second prediction block. In this case, the method may further include the following: Perform filtering enhancement on the first prediction block to determine the first enhanced prediction block; The first enhanced prediction block is a first upsampling input block; and The first upsampling output block is a second prediction block of a second color component of the current block.
[0377] In yet another possible embodiment, the first prediction block is first subjected to upsampling filtering and then subjected to enhanced filtering to determine a second prediction block, in which the method may further include: the first prediction block is a first upsampling input block; the first upsampling output block is a first upsampling filtered prediction block; and the first upsampling filtered prediction block is subjected to enhanced filtering to determine a second prediction block of a second color component of the current block.
[0378] In another possible embodiment, the first prediction block is first subjected to enhanced filtering, then subjected to upsampling filtering, and then subjected to enhanced filtering to determine a second prediction block. In this case, the method may further include 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 upsampling input block; The first upsampling output block is a second upsampling filtered prediction block; Perform a second filtering enhancement on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0379] If the first filtering is upsampling filtering, the first predicted block may be upsampling filtered by a horizontal upsampling factor and a vertical upsampling factor. Specifically, performing upsampling filtering on the first predicted block to determine a second predicted block of a second color component of the current block may include the following: determining a horizontal upsampling factor and a vertical upsampling factor; performing upsampling filtering on the first predicted block according to the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of a second color component of the current block.
[0380] In a specific embodiment, performing upsampling filtering on the first predicted block according to a horizontal upsampling factor and a vertical upsampling factor to obtain a second predicted block of a second color component of the current block may include: when the horizontal upsampling factor is greater than 1, or when the vertical upsampling factor is greater than 1, performing upsampling filtering on the first predicted block to obtain a second predicted block.
[0381] In an embodiment of the present application, performing upsampling filtering on the first prediction block includes: performing upsampling filtering on the first predicted block in a horizontal direction; performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a horizontal direction and then performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a vertical direction and then in a horizontal direction; Includes at least one of the following:
[0382] Here, first, a horizontal upsampling factor can be calculated according to the width of the first predicted block and the width of the current block, and a vertical upsampling factor can be calculated according to the height of the first predicted block and the height of the current block. Then, upsampling filtering is performed on the first predicted block according to the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, the first predicted block needs to be upsampling only in the horizontal direction. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, the first predicted block needs to be upsampling only in the vertical direction. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, the first predicted block needs to be upsampling in both the horizontal and vertical directions. Upsampling can be performed in the horizontal direction and then in the vertical direction, or upsampling can be performed in the vertical direction and then in the horizontal direction, and the upsampling 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.
[0383] In some embodiments, the upsampling filtering is realized by at least one of linear interpolation and convolution operation based on a preset neural network. That is, the upsampling filtering can be realized by different filters, for example, a two-dimensional filter, a one-dimensional filter, etc. In the case of a one-dimensional filter, there are two filtering orders: "first vertical, then horizontal" and "first horizontal, then vertical". The above two filtering orders may be fixed filtering orders, or may be flexible filtering orders determined according to certain parameters (for example, an order directly indicated by identification information, an implicit order associated with elements such as a prediction mode or a block size, etc.). The embodiments of the present application do not impose any restrictions thereon.
[0384] In yet another possible embodiment, when the first filtering is filtering enhancement, the filtering enhancement can be realized by bilateral filtering. Specifically, 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 following contents: determining a first weight value of the first predicted block under a bilateral filtering mode; performing bilateral filtering on the first predicted block according to the first weight value to obtain a second predicted block.
[0385] Also, in the embodiment of the present application, in addition to bilateral filtering, the filtering enhancement may be median filtering, Gaussian filtering, normalized filtering, etc. That is, the filtering enhancement may include at least one of bilateral filtering, median filtering, Gaussian filtering, and normalized filtering, but is not limited thereto.
[0386] In addition, in some embodiments, the method may further include: before performing upsampling filtering on the first predicted block, performing filtering enhancement on the first predicted block; the first predicted block obtained after the enhancement is the first predicted block.
[0387] In addition, in some embodiments, the method may further include: after performing upsampling filtering on the first predicted block, performing filtering enhancement on the first predicted block obtained after upsampling filtering to obtain a second predicted block of a second color component of the current block.
[0388] That is, in the embodiment of the present application, the first filtering can be upsampling filtering, can be filtering enhancement, or can include both upsampling filtering and filtering enhancement. When including both, the first prediction block can be first upsampling filtering and then filtering enhancement, or the first prediction block can be first filtering enhancement and then upsampling filtering. The embodiment of the present application does not make any restrictions thereon.
[0389] In this way, the predSamples(i,j) obtained in the above equation (20) is not necessarily the final predicted value, but may be a filtering-augmented predicted value before upsampling (in which case predSamples(i,j) is not the final predicted value), may be a filtering-augmented predicted value after upsampling, or may be a filtering-augmented predicted value that does not require upsampling.
[0390] Further, for the filtering enhancement, in some embodiments, the method further includes: determining a compensation value of a second color component sample of the first predicted block according to a reference sample value in a neighboring region of the current block; and improving a prediction value of the second color component sample of the first predicted block according to the compensation value to determine a second predicted block.
[0391] In addition, to further improve the prediction accuracy of the WCP mode, a position-related refinement can be performed on the first predicted block, for example, by using a reference sample with a nearby spatial position to calculate a saturation compensation value for each second color component sample to be predicted, and then using the saturation compensation value to refine the second color component samples in the second predicted block, and determining the final predicted values (predSamples) of the second color component samples according to the refined predicted values, and then obtaining the final second predicted block.
[0392] Further, for the filtering enhancement, in some embodiments, the method further includes: predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; and performing a weighted fusion between the at least one initial predicted value and the predicted value of the second color component sample in the first prediction block to determine a second prediction block.
[0393] In addition, in order to further improve the prediction accuracy of the WCP mode, the chroma prediction value calculated under other prediction modes and the chroma prediction value calculated under the WCP mode can be weighted and fused, and the final chroma prediction block can be determined based on the fusion result. Or, in order to improve the prediction performance of the WCP, the chroma prediction value calculated in the WCP can be improved using a neural network model. In the embodiment of the present application, no limitation is imposed thereon.
[0394] In some embodiments, after the second predicted block is determined, as shown in FIG. 21, after S2004, the following steps may be further included.
[0395] S2101: Determine a predicted value of a second color component sample of a current block based on a second predicted block.
[0396] S2102: 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.
[0397] S2103: Encode the residual values of the second color component samples of the current block, and write the resulting encoded bits into the bitstream.
[0398] 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.
[0399] 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.
[0400] For understanding, in the embodiment of the present application, during prediction according to WCP mode, the process of post-processing after WCP prediction is described in detail in the following four aspects. First, the luminance information of the reference sample and the current block is fully utilized to realize the calculation of the chroma weighting coefficient of the reference sample. Second, the core parameters of the WCP mode are fully considered to utilize the characteristics of the low sensitivity of the human eye to chroma, and to reduce the complexity of the chroma weighting calculation. That is, when predSizeW×predSizeH is equal to or smaller than nTbW×nTbH, upsampling is performed on the chroma prediction block. Third, the reference chroma information is fully utilized when upsampling, and the characteristics on different directions are considered. During linear interpolation, different weight values are assigned to different points to be interpolated between existing neighboring points, so that the spatial correlation between the points to be interpolated and existing points is fully considered, and the accuracy of upsampling filtering is improved. Fourth, taking into consideration the possibility that the chroma prediction block output by WCP prediction may produce an unstable and inaccurate prediction value, and the possibility that the upsampling filtering of the embodiment of the present application may produce an inaccurate prediction value, the accuracy and subjective and objective quality of the chroma prediction block are further improved by performing filtering enhancement using bilateral filtering that can realize edge preservation and noise removal on the chroma prediction block in such cases. Note that the four aspects described here are not sequentially related and may be used individually or in combination.
[0401] The embodiment of the present application further provides an encoding method. A reference sample value of a first color component of a current block is determined. A weighting factor is determined based on 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 based on the weighting factor and the reference sample value of the second color component of 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. The second predicted block includes predicted values of all second color component samples in the current block. A reconstructed value of a second color component sample of the current block is determined based on the second predicted block. In this way, by using the reference samples adjacent to the current block and the color component information of the current block to calculate the weighting factor, the correlation in luminance information between the current block and the adjacent area can be fully utilized, and the correlation can be used for chroma prediction of the current block to improve the accuracy of chroma prediction. In addition, in order to utilize the characteristic that the human eye has low sensitivity to chroma and to reduce the complexity of the calculation of the weighting factor, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. Furthermore, taking into account the instability of the predicted value of the first predicted block, filtering enhancement can also be performed on it, thereby further improving the accuracy and subjective and objective quality of chroma prediction, saving bitrate, and further improving coding performance.
[0402] 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.
[0403] 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 based on the residual value and the predicted value of the second color component sample of the current block. In this way, in order to utilize the characteristic that the human eye has low sensitivity to saturation and reduce the complexity of the calculation of the weighting coefficient, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. In addition, in consideration of the instability of the predicted value of the first predicted block, filtering enhancement can also be performed thereon, thereby further improving the accuracy of saturation prediction and the subjective and objective quality, saving the bit rate, and further improving the coding performance.
[0404] In a further embodiment of the present application, based on the same inventive idea as the previous embodiment, refer to Fig. 22, 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. 22, the encoding device 300 may 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. The first filtering unit 3003 is configured to perform first filtering on the first prediction block to determine a second prediction block of a second color component of the current block, where the second prediction block includes predicted values of all second color component samples in 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.
[0405] In some embodiments, the first prediction block includes predictions of at least some of the second color component samples in the current block.
[0406] 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.
[0407] 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.
[0408] 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.
[0409] 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.
[0410] In some embodiments, the number of filtered neighboring sample values of the first color component of the current block is smaller than the number of values of the first color component sample.
[0411] 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.
[0412] 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.
[0413] 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.
[0414] 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 a first color 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; 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.
[0415] In some embodiments, the number of filtered sample values of the first reference color component sample in the current block is smaller than the number of reconstructed values of the first reference color component sample in the current block.
[0416] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute 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.
[0417] 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.
[0418] 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.
[0419] In some embodiments, the first determination unit 3001 is further configured to determine a first factor, determine a first product value based on the first factor and a reference sample value of the first color component, and determine a value corresponding to the first product value in a preset mapping.
[0420] In some embodiments, the first factor is a preset constant value.
[0421] In some embodiments, the first determining unit 3001 is further configured to determine the value of the first factor based on a size parameter of the current block, where the size parameter of the current block includes at least one parameter of a width of the current block, a height of the current block, and a product of the width and height of the current block.
[0422] In some embodiments, the pre-defined mapping is a Softmax function.
[0423] 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.
[0424] 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.
[0425] 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.
[0426] 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.
[0427] In some embodiments, the fourth filtering is an upsampling filtering, the upsampling rate being a positive integer multiple of two.
[0428] 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.
[0429] 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.
[0430] 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.
[0431] In some embodiments, the first filtering comprises upsampling filtering, an input of the upsampling filtering is a first upsampling input block and an output of the upsampling filtering is a first upsampling output block.
[0432] In some embodiments, the first determining unit 3001 is further configured to determine an upsampling factor, where the upsampling factor includes at least one of a horizontal upsampling factor, a vertical upsampling factor. The first filtering unit 3003 is further configured to perform upsampling filtering on the first upsampling input block based on the upsampling factor to obtain a first upsampling output block.
[0433] In some embodiments, the first filtering unit 3003 further comprises: It is configured to perform upsampling filtering on the first upsampled input block to obtain a first upsampled output block if the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1.
[0434] In some embodiments, the first filtering unit 3003 configured to perform upsampling filtering on the first upsampling input block further comprises: performing upsampling filtering horizontally on a first upsampled input block; performing vertical upsampling filtering on a first upsampled input block; performing upsampling filtering in the horizontal direction and then in the vertical direction on a first upsampling input block; performing upsampling filtering in the vertical direction and then in the horizontal direction on a first upsampling input block; is configured to perform at least one of
[0435] In some embodiments, the first filtering unit 3003 further comprises: The first predicted block is the first upsampled input block; The first upsampled output block is configured to be a second predicted block of a second color component of the current block.
[0436] In some embodiments, the first filtering unit 3003 further comprises: performing filtering enhancement on the first predicted block to obtain a first enhanced predicted block; The first enhanced prediction block is a first upsampled input block; The first upsampled output block is configured to be a second predicted block of a second color component of the current block.
[0437] In some embodiments, the first filtering unit 3003 further comprises: The first enhanced prediction block is a first upsampled input block; The first upsampling output block is a first upsampling filtered prediction block; The filtering step is configured to perform a filtering enhancement on the first upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0438] In some embodiments, the first filtering unit 3003 further comprises: Perform a first filtering enhancement on the first predicted block to determine a second enhanced predicted block; the second enhanced prediction block is the first upsampled input block; The first upsampling output block is a second upsampling filtered prediction block; A second filtering enhancement is configured to perform on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0439] In some embodiments, the first filtering unit 3003 is further configured to perform upsampling filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0440] In some embodiments, the first filtering unit 3003 is further configured to determine a horizontal upsampling factor and a vertical upsampling factor, and perform upsampling filtering on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of a second color component of the current block.
[0441] In some embodiments, the first filtering unit 3003 further comprises: If the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1, upsampling filtering is performed on the first prediction block to obtain a second prediction block.
[0442] In some embodiments, the first filtering unit 3003 configured to perform upsampling filtering on the first prediction block further comprises: performing upsampling filtering on the first predicted block in a horizontal direction; performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a horizontal direction and then performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a vertical direction and then in a horizontal direction; is configured to perform at least one of
[0443] In some embodiments, the first filtering unit 3003 further comprises: The filtering section is configured to perform filtering enhancement on the first predicted block before performing upsampling filtering on the first predicted block, and to set the first predicted block obtained after enhancement as the first predicted block.
[0444] In some embodiments, the first filtering unit 3003 is further configured to perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the first prediction block obtained after the upsampling filtering to obtain a second prediction block of a second color component of the current block.
[0445] In some embodiments, the upsampling filtering is achieved by at least one of the following methods: linear interpolation, convolution operation based on a pre-configured neural network.
[0446] In some embodiments, the filtering enhancement comprises at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.
[0447] In some embodiments, the first filtering unit 3003 is further configured to perform enhanced filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0448] In some embodiments, the first filtering unit 3003 further comprises: Determine a first weight value of a first predicted block under a bilateral filtering mode; The bilateral filtering unit is configured to perform bilateral filtering on the first predicted block based on the first weighting value to obtain a second predicted block.
[0449] In some embodiments, the first prediction unit 3002 further comprises: Determine a compensation value of a second color component sample of the first prediction block according to a reference sample value in an adjacent region of the current block; The prediction unit is configured to improve a prediction value of a second color component sample of the first prediction block based on the compensation value to determine a second prediction block.
[0450] In some embodiments, the first prediction unit 3002 further comprises: predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; The method is configured to perform a weighted fusion of at least one initial prediction value and the prediction value of the second color component sample in the first prediction block to determine a second prediction block.
[0451] 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.
[0452] In some embodiments, referring to Fig. 22, 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.
[0453] 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.
[0454] 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.
[0455] 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.
[0456] Based on the above-mentioned configuration of the encoding apparatus 300 and the computer-readable storage medium, refer to FIG. 23, 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. 23, the encoding device 310 may include a first communication interface 3101, a first memory 3102 and a first processor 3103. Each component is coupled together via a first bus system 3104. 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. 23. 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 factor is determined according to the reference sample value of the first color component of the current block. A first prediction block of the 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. 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, where the second predicted block includes predicted values of all the second color component samples in the current block. Determine a residual value of a second color component sample of the current block according to the second predicted block.
[0457] 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.
[0458] 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.
[0459] 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.
[0460] 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.
[0461] This embodiment provides an encoding device, which may further include the encoding device 300 according to any one of the previous embodiments. In order to utilize the characteristic that the human eye has low sensitivity to saturation and reduce the complexity of the calculation of the weighting coefficient, the encoding device performs upsampling filtering on the first predicted block when the size of the first predicted block is smaller than the size of the current block. In addition, considering the instability of the predicted value of the first predicted block, it can also perform filtering enhancement thereon, thereby further improving the accuracy of saturation prediction and the subjective and objective quality, saving the bit rate, and further improving the coding performance.
[0462] Based on the same inventive idea as the above embodiment, refer to Fig. 24, 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. 24, 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 according to the weighting coefficient and the reference sample value of the second color component of the current block. The second filtering unit 3203 is configured to perform first filtering on the first prediction block to determine a second prediction block of a second color component of the current block, where the second prediction block includes predicted values of all second color component samples in the current block.
[0463] In some embodiments, the first prediction block includes predictions of at least some of the second color component samples in the current block.
[0464] 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.
[0465] 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.
[0466] 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.
[0467] 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.
[0468] In some embodiments, the number of filtered neighboring sample values of the first color component of the current block is smaller than the number of values of the first color component sample.
[0469] 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.
[0470] 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.
[0471] 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.
[0472] 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.
[0473] In some embodiments, the number of filtered sample values of the first reference color component sample in the current block is smaller than the number of reconstructed values of the first reference color component sample in the current block.
[0474] In some embodiments, the reference sample value of the first color component of the current block is set to the absolute 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.
[0475] 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.
[0476] 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.
[0477] 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.
[0478] In some embodiments, the first factor is a preset constant value.
[0479] In some embodiments, the second determining unit 3201 is further configured to determine the value of the first factor based on a size parameter of the current block, where the size parameter of the current block includes at least one parameter of a width of the current block, a height of the current block, and a product of the width and height of the current block.
[0480] In some embodiments, the pre-defined mapping is a Softmax function.
[0481] 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.
[0482] 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.
[0483] 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.
[0484] 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.
[0485] In some embodiments, the fourth filtering is an upsampling filtering, the upsampling rate being a positive integer multiple of two.
[0486] 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.
[0487] 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.
[0488] 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.
[0489] In some embodiments, the first filtering comprises upsampling filtering, an input of the upsampling filtering is a first upsampling input block and an output of the upsampling filtering is a first upsampling output block.
[0490] In some embodiments, the second determining unit 3201 is further configured to determine an upsampling factor, where the upsampling factor includes at least one of a horizontal upsampling factor, a vertical upsampling factor. The second filtering unit 3203 is further configured to perform upsampling filtering on the first upsampling input block based on the upsampling factor to obtain a first upsampling output block.
[0491] In some embodiments, the second filtering unit 3203 further comprises: It is configured to perform upsampling filtering on the first upsampled input block to obtain a first upsampled output block if the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1.
[0492] In some embodiments, the second filtering unit 3203 configured to perform upsampling filtering on the first upsampling input block further comprises: performing upsampling filtering horizontally on a first upsampled input block; performing vertical upsampling filtering on a first upsampled input block; performing upsampling filtering in the horizontal direction and then in the vertical direction on a first upsampling input block; performing upsampling filtering in the vertical direction and then in the horizontal direction on a first upsampling input block; is configured to perform at least one of
[0493] In some embodiments, the second filtering unit 3203 further comprises: The first predicted block is the first upsampled input block; The first upsampled output block is configured to be a second predicted block of a second color component of the current block.
[0494] In some embodiments, the second filtering unit 3203 further comprises: performing filtering enhancement on the first predicted block to obtain a first enhanced predicted block; The first enhanced prediction block is a first upsampled input block; The first upsampled output block is configured to be a second predicted block of a second color component of the current block.
[0495] In some embodiments, the second filtering unit 3203 further comprises: The first enhanced prediction block is a first upsampled input block; The first upsampling output block is a first upsampling filtered prediction block; The filtering step is configured to perform a filtering enhancement on the first upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0496] In some embodiments, the second filtering unit 3203 further comprises: Perform a first filtering enhancement on the first predicted block to determine a second enhanced predicted block; the second enhanced prediction block is the first upsampled input block; The first upsampling output block is a second upsampling filtered prediction block; A second filtering enhancement is performed on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block.
[0497] In some embodiments, the second filtering unit 3203 is further configured to perform upsampling filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0498] In some embodiments, the second filtering unit 3203 is further configured to determine a horizontal upsampling factor and a vertical upsampling factor, and perform upsampling filtering on the first predicted block based on the horizontal upsampling factor and the vertical upsampling factor to obtain a second predicted block of a second color component of the current block.
[0499] In some embodiments, the second filtering unit 3203 further comprises: If the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1, upsampling filtering is performed on the first prediction block to obtain a second prediction block.
[0500] In some embodiments, the second filtering unit 3203 configured to perform upsampling filtering on the first prediction block further comprises: performing upsampling filtering on the first predicted block in a horizontal direction; performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a horizontal direction and then performing upsampling filtering on the first prediction block in a vertical direction; performing upsampling filtering on the first prediction block in a vertical direction and then in a horizontal direction; is configured to perform at least one of
[0501] In some embodiments, the second filtering unit 3203 further comprises: The filtering section is configured to perform filtering enhancement on the first predicted block before performing upsampling filtering on the first predicted block, and to set the first predicted block obtained after enhancement as the first predicted block.
[0502] In some embodiments, the second filtering unit 3203 is further configured to perform upsampling filtering on the first prediction block, and then perform filtering enhancement on the first prediction block obtained after the upsampling filtering to obtain a second prediction block of a second color component of the current block.
[0503] In some embodiments, the upsampling filtering is achieved by at least one of the following methods: linear interpolation, convolution operation based on a pre-configured neural network.
[0504] In some embodiments, the filtering enhancement comprises at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.
[0505] In some embodiments, the second filtering unit 3203 is further configured to perform enhanced filtering on the first predicted block to determine a second predicted block of a second color component of the current block.
[0506] In some embodiments, the second filtering unit 3203 further comprises: Determine a first weight value of a first predicted block under a bilateral filtering mode; The bilateral filtering unit is configured to perform bilateral filtering on the first predicted block based on the first weighting value to obtain a second predicted block.
[0507] In some embodiments, the second prediction unit 3202 further comprises: Determine a compensation value of a second color component sample of the first prediction block according to a reference sample value in an adjacent region of the current block; The prediction unit is configured to improve a prediction value of a second color component sample of the first prediction block based on the compensation value to determine a second prediction block.
[0508] In some embodiments, the second prediction unit 3202 further comprises: predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; The method is configured to perform a weighted fusion of at least one initial prediction value and the prediction value of the second color component sample in the first prediction block to determine a second prediction block.
[0509] 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.
[0510] In some embodiments, referring to Fig. 24, 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.
[0511] 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.
[0512] When the integrated unit is implemented as a software function module, instead of 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 decoding device 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.
[0513] Based on the above-mentioned configuration of the decoding apparatus 320 and the computer-readable storage medium, refer to FIG. 25, 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. 25, 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, in FIG. 25, various buses are marked as the second bus system 3304. 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. 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. 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, where the second predicted block includes predicted values of all the second color component samples in the current block. A reconstructed value of a second color component sample of the current block is determined based on the second predicted block.
[0514] 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.
[0515] 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.
[0516] This embodiment provides a decoding device, which may further include the decoding device 320 described in the above embodiment. In order to utilize the characteristics of human eyes being less sensitive to saturation and reduce the complexity of calculating weighting coefficients, the decoding device performs upsampling filtering on the first predicted block when the size of the first predicted block is smaller than the size of the current block. In addition, considering the instability of the predicted value of the first predicted block, it can also perform filtering enhancement thereon, thereby further improving the accuracy of saturation prediction and the subjective and objective quality, saving the bit rate, and further improving the coding performance.
[0517] In a further embodiment of the present application, refer to FIG. 26, which is a schematic diagram showing the structure of a coding system according to an embodiment of the present application. As shown in FIG. 26, 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.
[0518] In the embodiment of the present application, in the codec system 340, whether the encoder 3401 or the decoder 3402 utilizes the characteristic that the human eye has low sensitivity to saturation, and in order to reduce the complexity of the calculation of the weighting coefficient, upsampling filtering can be performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. In addition, considering the instability of the predicted value of the first predicted block, filtering enhancement can also be performed on it, so as to further improve the accuracy of saturation prediction and the subjective and objective quality, save the bit rate, and further improve the coding performance.
[0519] 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.
[0520] 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 purposes only.
[0521] 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.
[0522] 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.
[0523] 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.
[0524] 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. [Industrial Applicability]
[0525] 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 a second color component of the current block; a first predicted block of a second color component of the current block is determined by performing a first filtering on the first predicted block; the second predicted block includes predicted values of all second color component samples in the current block. In this way, at the encoding side, a residual value of a second color component sample of a current block can be determined according to the second predicted block, and the residual value is written into a bitstream; at the decoding side, a reconstructed value of a second color component sample of a current block can be determined according to the second predicted block and the residual value obtained by decoding. In this way, by calculating the weighting coefficients using the reference samples adjacent to the current block and the color component information of the current block, the correlation in luminance information between the current block and the adjacent regions is fully utilized, and the correlation is used for chroma prediction of the current block, thereby improving the accuracy of chroma prediction. In addition, in order to utilize the characteristic that the human eye has low sensitivity to chroma and to reduce the complexity of the calculation of the weighting coefficients, upsampling filtering is performed on the first predicted block when the size of the first predicted block is smaller than the size of the current block. Furthermore, in consideration of the instability of the predicted value of the first predicted block, filtering enhancement can be performed thereon, thereby further improving the accuracy of chroma prediction and the subjective and objective quality, saving the bit rate, improving the coding efficiency, and further improving the 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 coefficient and a reference sample value of a second color component of the current block; performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block, the second predicted block including predicted values of all second color component samples in 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 first prediction block includes predictions of at least some of the second color component samples 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. the number of filtered adjacent sample values of the first color component of the current block is less than the 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 smaller 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. 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 .
28. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; the first filtering includes upsampling filtering, an input of the upsampling filtering is a first upsampling input block, and an output of the upsampling filtering is a first upsampling output block.
2. The method of claim 1 .
29. The upsampling filtering is determining an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor, a vertical upsampling factor; performing upsampling filtering on the first upsampled input block based on the upsampling factor to obtain the first upsampled output block; Including, 29. The method of claim 28.
30. performing upsampling filtering on the first upsampled input block based on the upsampling factor to obtain the first upsampled output block, performing upsampling filtering on the first upsampling input block to obtain the first upsampling output block if the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1; 30. The method of claim 29.
31. Performing upsampling filtering on the first upsampling input block includes: performing upsampling filtering on the first upsampled input block in a horizontal direction; performing vertical upsampling filtering on the first upsampled input block; performing upsampling filtering on the first upsampling input block in a horizontal direction and then in a vertical direction; performing upsampling filtering on the first upsampling input block in a vertical direction and then in a horizontal direction; At least one of:
31. The method of claim 30.
32. The method comprises: said first predicted block being said first upsampled input block; the first upsampled output block being a second predicted block of a second color component of the current block; Further comprising:
29. The method of claim 28.
33. The method comprises: performing a filtering enhancement on the first predicted block to obtain a first enhanced predicted block; said first enhanced prediction block being said first upsampled input block; the first upsampled output block being a second predicted block of a second color component of the current block; Further comprising:
29. The method of claim 28.
34. The method comprises: said first predicted block being said first upsampled input block; the first upsampling output block being a first upsampling filtered prediction block; performing enhanced filtering on the first upsampling filtered prediction block to determine a second prediction block of a second color component of the current block; Further comprising:
29. The method of claim 28.
35. The method comprises: performing a first filtering enhancement on the first predicted block to determine a second enhanced predicted block; said second enhanced prediction block being said first upsampled input block; said first upsampling output block being a second upsampling filtered prediction block; performing a second filtering enhancement on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block; Further comprising:
29. The method of claim 28.
36. The upsampling filtering is realized by at least one of the following methods: linear interpolation, convolution operation based on a preset neural network; 36. The method according to any one of claims 28 to 35.
37. The filtering enhancement includes at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.
36. The method according to any one of claims 33 to 35.
38. 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 first weight value of the first predicted block under a bilateral filtering mode; performing bilateral filtering on the first predicted block based on the first weighting value to obtain the second predicted block; Including, 2. The method of claim 1 .
39. 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 compensation value of a second color component sample of the first prediction block according to a reference sample value in an adjacent region of the current block; determining the second predicted block by improving a predicted value of a second color component sample of the first predicted block based on the compensation value; Including, 2. The method of claim 1 .
40. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; performing a weighted fusion of the at least one initial prediction value and a prediction value of the second color component sample in the first prediction block to determine the second prediction block; Including, 2. The method of claim 1 .
41. 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 .
42. 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 coefficient and a reference sample value of a second color component of the current block; performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block, the second predicted block including predicted values of all second color component samples in 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:
43. the first prediction block includes predictions of at least some of the second color component samples in the current block; 43. The method of claim 42.
44. 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.
43. The method of claim 42.
45. The method comprises: determining a value of the first color component sample by selecting from first color component samples in the adjacent regions.
45. The method of claim 44.
46. 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, 46. The method of claim 45.
47. 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:
45. The method of claim 44.
48. the number of filtered adjacent sample values of the first color component of the current block is less than the number of values of the first color component samples; 48. The method of claim 47.
49. 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; 48. The method of claim 44 or 47.
50. 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.
50. The method of claim 49.
51. 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.
50. The method of claim 49.
52. 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:
48. The method of claim 44 or 47.
53. a number of filtered sample values of the first reference color component sample in the current block is smaller than a number of reconstructed values of the first reference color component sample in the current block; 53. The method of claim 52.
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 filtered adjacent sample value of the first color component and a filtered sample value of the first reference color component sample; 53. The method of claim 52.
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 value of the first color component sample and a filtered sample value of the first reference color component sample.
53. The method of claim 52.
56. 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, 43. The method of claim 42.
57. 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, 57. The method of claim 56.
58. Determining the first factor comprises: The first factor is a preset constant value.
58. The method of claim 57.
59. 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.
58. The method of claim 57.
60. 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.
57. The method of claim 56.
61. 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.
57. The method of claim 56.
62. 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; 43. The method of claim 42.
63. 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:
63. The method of claim 62.
64. 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; 64. The method of claim 63.
65. The method comprises: The fourth filtering is an upsampling filtering. The upsampling rate is a positive integer multiple of 2.
64. The method of claim 63.
66. 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.
64. The method of claim 63.
67. 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.
67. The method of claim 66.
68. 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.
43. The method of claim 42.
69. performing a first filtering on the first predicted block to determine a second predicted block of a second color component of the current block; the first filtering includes upsampling filtering, an input of the upsampling filtering is a first upsampling input block, and an output of the upsampling filtering is a first upsampling output block.
43. The method of claim 42.
70. The upsampling filtering is determining an upsampling factor, the upsampling factor including at least one of a horizontal upsampling factor, a vertical upsampling factor; performing upsampling filtering on the first upsampled input block based on the upsampling factor to obtain the first upsampled output block; Including, 70. The method of claim 69.
71. performing upsampling filtering on the first upsampled input block based on the upsampling factor to obtain the first upsampled output block, performing upsampling filtering on the first upsampling input block to obtain the first upsampling output block if the horizontal upsampling factor is greater than 1 or if the vertical upsampling factor is greater than 1; 71. The method of claim 70.
72. Performing upsampling filtering on the first upsampling input block includes: performing upsampling filtering on the first upsampled input block in a horizontal direction; performing vertical upsampling filtering on the first upsampled input block; performing upsampling filtering on the first upsampling input block in a horizontal direction and then in a vertical direction; performing upsampling filtering on the first upsampling input block in a vertical direction and then in a horizontal direction; At least one of:
72. The method of claim 71 .
73. The method comprises: said first predicted block being said first upsampled input block; the first upsampled output block being a second predicted block of a second color component of the current block; Further comprising:
70. The method of claim 69.
74. The method comprises: performing a filtering enhancement on the first predicted block to obtain a first enhanced predicted block; said first enhanced prediction block being said first upsampled input block; the first upsampled output block being a second predicted block of a second color component of the current block; Further comprising:
70. The method of claim 69.
75. The method comprises: said first enhanced prediction block being said first upsampled input block; the first upsampling output block being a first upsampling filtered prediction block; performing enhanced filtering on the first upsampling filtered prediction block to determine a second prediction block of a second color component of the current block; Further comprising:
75. The method of claim 74.
76. The method comprises: performing a first filtering enhancement on the first predicted block to determine a second enhanced predicted block; said second enhanced prediction block being said first upsampled input block; said first upsampling output block being a second upsampling filtered prediction block; performing a second filtering enhancement on the second upsampling filtered prediction block to determine a second prediction block of a second color component of the current block; Further comprising:
70. The method of claim 69.
77. The upsampling filtering is realized by at least one of the following methods: linear interpolation, convolution operation based on a preset neural network; 77. The method according to any one of claims 69 to 76.
78. The filtering enhancement includes at least one of bilateral filtering, median filtering, Gaussian filtering, normalized filtering, and neural network filtering.
77. The method according to any one of claims 74 to 76.
79. 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 first weight value of the first predicted block under a bilateral filtering mode; performing bilateral filtering on the first predicted block based on the first weighting value to obtain the second predicted block; Including, 43. The method of claim 42.
80. 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 compensation value of a second color component sample of the first prediction block according to a reference sample value in an adjacent region of the current block; determining the second predicted block by improving a predicted value of a second color component sample of the first predicted block based on the compensation value; Including, 43. The method of claim 42.
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; predicting a second color component sample of the first prediction block based on at least one prediction mode to determine at least one initial predicted value of the second color component sample of the first prediction block; performing a weighted fusion of the at least one initial prediction value and a prediction value of the second color component sample in the first prediction block to determine the second prediction block; Including, 43. The method of claim 42.
82. 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, 43. The method of claim 42.
83. 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.
83. The method of claim 82.
84. 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; the first 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 predicted block including predicted values of all second color component samples in 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:
85. 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 42 to 83 when executing the computer program.
1. An encoding device comprising:
86. 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; 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 predicted block including predicted values of all second color component samples in 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:
87. 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 41. A decoding device comprising:
88. 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 41 is realized, or the method according to any one of claims 42 to 83 is realized. A computer-readable storage medium comprising:
Citation Information
Patent Citations
Image decoding method, image encoding method, and recording medium
JP2020533822A
Video image component prediction method, apparatus and computer storage medium
JP2022501863A
Prediction image generation device, moving image decoding device, moving image encoding device, and prediction image generation method
WO2020129990A1
Cross-component prediction using multiple components
WO2021115235A1