Encoding method, decoding method, encoder, decoder, and storage medium
Patent Information
- Application Number
- PCT/CN2025/089101
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-10-22
Smart Images

Figure CN2025089101_22102026_PF_FP_ABST
Abstract
Description
Encoding / decoding methods, encoders, decoders, and storage media Technical Field
[0001] This application relates to the field of video encoding and decoding technology, and in particular to an encoding and decoding method, encoder, decoder, and storage medium. Background Technology
[0002] As people's demands for video display quality have increased, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information, thus requiring more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.
[0003] Currently, cross-component prediction is supported for different image components, such as luminance and chrominance components. However, common cross-component prediction techniques are not applicable to the prediction of all samples, which reduces the accuracy of prediction and affects encoding and decoding performance. Summary of the Invention
[0004] This application provides an encoding / decoding method, encoder, decoder, and storage medium, which can improve the accuracy of prediction and enhance encoding / decoding performance.
[0005] The technical solution of this application embodiment can be implemented as follows:
[0006] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:
[0007] Determine the prediction parameters for the current block;
[0008] The reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block are determined based on the prediction parameters of the current block.
[0009] The prediction weight of the current block is determined based on the reconstructed value and the predicted value of the first image component.
[0010] Based on the prediction weight of the current block and the first prediction value of the second image component, determine the prediction value of the second image component of the current block.
[0011] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:
[0012] Determine the prediction parameters for the current block;
[0013] The reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block are determined based on the prediction parameters of the current block.
[0014] The prediction weight of the current block is determined based on the reconstructed value and the predicted value of the first image component.
[0015] Based on the prediction weight of the current block and the first prediction value of the second image component, determine the prediction value of the second image component of the current block.
[0016] Thirdly, embodiments of this application provide an encoder, the encoder including...
[0017] The first determining part is configured to determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0018] Fourthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0019] A first memory for storing computer programs that can run on a first processor;
[0020] A first processor is configured to execute the method described in the second aspect when running the computer program.
[0021] Fifthly, embodiments of this application provide a decoder, which includes:
[0022] The second determining part is configured to determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0023] Sixthly, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0024] The second memory is used to store computer programs that can run on the second processor;
[0025] A second processor is configured to execute the method described in the first aspect when running the computer program.
[0026] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by at least one processor, implements the method described in the first aspect or the method described in the second aspect.
[0027] Eighthly, embodiments of this application provide a computer-readable storage medium for storing a bitstream generated by the encoding method described in the second aspect.
[0028] This application provides an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines prediction parameters for the current block; based on the prediction parameters, it determines the reconstructed value of a first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of a second image component of the current block; based on the reconstructed value and the predicted value of the first image component, it determines the prediction weight of the current block; and based on the prediction weight and the first predicted value of the second image component, it determines the predicted value of the second image component of the current block. Therefore, in this application's embodiments, when performing cross-component prediction on the current block, the prediction weight for cross-component prediction can be determined based on the reconstructed value and the predicted value of the first image component, and the predicted value of the second image component can be further derived based on this prediction weight. In other words, this application can introduce a weight-based prediction model into the inter-frame cross-component prediction process, improving prediction accuracy and thus enhancing encoding / decoding performance. Attached Figure Description
[0029] Figure 1 is a schematic diagram of the InterCCCM framework proposed in an embodiment of this application;
[0030] Figure 2 is a schematic diagram of the prediction process of the InterCCCM technology proposed in the embodiments of this application;
[0031] Figure 3 is a schematic diagram of the positional relationship between the luminance prediction sample and the chromaticity prediction sample proposed in the embodiments of this application;
[0032] Figure 4 is a schematic diagram of the positional relationship between the luminance prediction sample and the chromaticity prediction sample proposed in the embodiments of this application.
[0033] Figure 5 is a schematic diagram of the positional relationship between the luminance prediction sample and the chromaticity prediction sample proposed in the embodiments of this application.
[0034] Figure 6 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chromaticity prediction sample proposed in the embodiments of this application;
[0035] Figure 7 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chromaticity prediction sample proposed in the embodiments of this application;
[0036] Figure 8 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chromaticity prediction sample proposed in the embodiments of this application;
[0037] Figure 9 is a schematic diagram of the prediction process of the WCP technology proposed in the embodiments of this application;
[0038] Figure 10 is a schematic diagram of the reference area proposed in the embodiment of this application;
[0039] Figure 11 is a schematic diagram of the weighted colorimetric prediction process proposed in an embodiment of this application;
[0040] Figure 12 is a system block diagram of an encoder proposed in an embodiment of this application;
[0041] Figure 13 is a system block diagram of a decoder proposed in an embodiment of this application;
[0042] Figure 14 is a flowchart illustrating a decoding method proposed in an embodiment of this application;
[0043] Figure 15 is a schematic diagram of the downsampling implementation method proposed in the embodiments of this application;
[0044] Figure 16 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0045] Figure 17 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0046] Figure 18 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0047] Figure 19 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0048] Figure 20 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0049] Figure 21 is a flowchart illustrating an encoding method proposed in an embodiment of this application;
[0050] Figure 22 is a schematic diagram of an InterWCP process according to an embodiment of this application;
[0051] Figure 23 is a schematic diagram illustrating the implementation of cross-component prediction according to an embodiment of this application;
[0052] Figure 24 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0053] Figure 25 is a schematic diagram of the input information for cross-component prediction proposed in an embodiment of this application;
[0054] Figure 26 is a schematic diagram of the second InterWCP process proposed in the embodiment of this application;
[0055] Figure 27 is a schematic diagram of the composition structure of an encoder proposed in an embodiment of this application;
[0056] Figure 28 is a schematic diagram of the specific hardware structure of an encoder proposed in an embodiment of this application;
[0057] Figure 29 is a schematic diagram of the composition structure of a decoder proposed in an embodiment of this application;
[0058] Figure 30 is a schematic diagram of the specific hardware structure of a decoder proposed in an embodiment of this application;
[0059] Figure 31 is a schematic diagram of the composition structure of an encoding / decoding system proposed in an embodiment of this application. Detailed Implementation
[0060] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0062] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0063] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0064] In video images, a first color component, a second color component, and a third color component are generally used to represent a coding block (CB). These three color components are a luma component, a blue chroma component, and a red chroma component, respectively. Specifically, the luma component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. Thus, video images can be represented in YCbCr format or YUV format.
[0065] Video codec standards can employ a block-based hybrid coding framework. Specifically, each image in the video is divided into largest coding units (LCUs) or coding tree units (CTUs) of the same size (e.g., 128x128, 64x64, etc.). Each LCU or CTU can be further subdivided into rectangular coding units (CUs) according to rules. Coding units may also be further divided into prediction units (PUs), transform units (TUs), etc.
[0066] Specifically, the hybrid coding framework includes a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filtering module 15, and a decoded image buffer module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b. The inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Because there is a strong correlation between adjacent pixels in an image of a video, intra-frame prediction is used in video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. Furthermore, because there is a strong similarity between adjacent images in a video, inter-image prediction is used in video coding and decoding technology to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.
[0067] Furthermore, the transformation converts the predicted image patch to the frequency domain, redistributing energy. Combined with quantization, information insensitive to the human eye can be removed, thus eliminating visual redundancy. Entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary bitstream.
[0068] The basic workflow of a video codec is as follows: At the encoding end, after reading a black-and-white or color image, it is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. The original block of the current block is subtracted from the prediction block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. The quantization coefficient matrix is entropy encoded and output to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. On the other hand, the bitstream is parsed to obtain the quantization coefficient matrix. The quantization coefficient matrix is inverse quantized and inverse transformed to obtain a residual block. The prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Based on the image or based on the blocks, loop filtering is performed on the reconstructed image to obtain the decoded image.
[0069] The encoding end requires similar operations to the decoding end to obtain the decoded image. The decoded image can be used as a reference image for inter-frame prediction of subsequent images.
[0070] The block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined at the encoding end need to be written into the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing the bitstream and analyzing the existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.
[0071] During prediction, the current block can be divided into prediction units, and during transformation, it can be divided into transformation units. The division of prediction units and transformation units can be different. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The embodiments of this application are applicable to the basic flow of a video codec under this block-based hybrid coding framework, but are not limited to this framework and flow.
[0072] Furthermore, in this embodiment, the current block (CB) can be the current block, the current prediction unit, or the current transformation unit, etc. Due to the need for parallel processing, an image can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning they have no data dependency. A "frame" is a commonly used term, generally understood as an image. In this embodiment, the term "frame" can also be replaced with an image or a slice, etc.
[0073] In other words, a frame can also be understood as an image, picture, or slice to be encoded. The current frame can also be called the current picture, and the reference frame can be called the reference picture. In another interpretation, if the current picture has only one slice, then the current frame or current picture is also the current slice.
[0074] In embodiments of this application, an Inter Convolutional Cross Component Model (InterCCCM) is proposed for use in both inter-frame prediction and intra-frame prediction modes. If the current block is encoded using inter-frame prediction or intra-frame prediction (such as Intra Block Copy (IBC) mode), and InterCCCM mode is selected for encoding, both the encoder and decoder apply the InterCCCM model to the block to correct the chroma samples from the reconstructed luminance samples. The parameters of the InterCCCM model are derived from the luminance prediction value and the first chroma prediction value. Using the derived model and the reconstructed luminance value, a second chroma prediction value is obtained. The second chroma prediction value is weighted with the first chroma prediction value to generate a third chroma prediction value.
[0075] Figure 1 is a schematic diagram of the InterCCCM framework proposed in this application. As shown in Figure 1, for the luminance component (Y), the luminance prediction value (predY) and the luminance residual value (resY) are added to obtain the luminance reconstruction value to achieve the reconstruction of the Y component. For the first chrominance component (Cb), the filter coefficients between the Y component and the Cb component can be derived based on the luminance prediction value (predY) and the Cb prediction value (predCb). Based on the luminance reconstruction value and the filter coefficients between the Y component and the Cb component, the Cb compensation prediction value can be determined. The two are then weighted and fused to obtain the final Cb chrominance prediction value, which is then added to the Cb chrominance residual value (resCb) to achieve the reconstruction of the Cb component. Similarly, for the second chromaticity component (Cr), the filter coefficients between the Y and Cr components can be derived from the luminance prediction value (predY) and the Cr prediction value (predCr). The Cr compensation prediction value can be determined based on the luminance reconstruction value and the filter coefficients between the Y and Cr components. The two are then weighted and fused to obtain the final Cr chromaticity prediction value. Finally, this value is added to the Cr chromaticity residual value (resCr) to reconstruct the Cr component.
[0076] Here, predY, predCb, and predCr can be understood as the original prediction samples generated by the current coding unit using the corresponding inter-frame prediction mode or intra-frame block copy mode, resY, resCb, and resCr are the residuals, and Y, Cb, and Cr are the reconstructed samples. During the weighted fusion process, the prediction samples generated by the filter use a weighted weight w, and the original chroma prediction samples use a weighted weight 1-w.
[0077] In the weighting module, taking w as 0.75 as an example, the second chromaticity prediction value (predCbVal for Cb component, predCrVal for Cr component) and the first chromaticity prediction value (predSamplesCb for Cb component, predSamplesCr for Cr component) can be weighted at 0.75:0.25 to generate the third chromaticity prediction value (predSamplesCb′ for Cb component, predSamplesCr′ for Cr component). As shown in the following formulas: predSamplesCb′=(3×predCbVal+predSamplesCb+2)>>2 (1) predSamplesCr′=(3×predCrVal+predSamplesCr+2)>>2 (2)
[0078] The inputs to InterCCCM can include the luminance prediction value predSamplesY[x][y] of the current block, the luminance reconstruction value recSamplesY[x][y], and the first chrominance prediction value (predSamplesCb[x1][y1] for the Cb component and predSamplesCr[x1][y1] for the Cr component), where x = 0..nTbW-1, y = 0..nTbH-1, x1 = 0..nTbWC-1, and y1 = 0..nTbHC-1.
[0079] The output of InterCCCM can include the final chromaticity prediction value of the current block (predSamplesCb′[x][y] for Cb components and predSamplesCr′[x][y] for Cr components), where x = 0..nTbWC-1 and y = 0..nTbHC-1.
[0080] Figure 2 is a schematic diagram of the prediction process of the InterCCCM technology proposed in the embodiment of this application. As shown in Figure 2, the specific prediction process of the InterCCCM technology is divided into two steps: S1, solving the model parameters; S2, generating the third chromaticity prediction value of the current block.
[0081] Furthermore, in the process of solving the model parameters, the model used in the InterCCCM technique is an 8-tap filter consisting of 6 spatial brightness samples, a nonlinear term, and a bias term. As shown in the formula: predChromaVal=c0L0′+c1L1′+c2L2′+c3L3′+c4L4′+c5L5′ +c6nonlinear((L0′+L3′+1)>>1)+c7B (3)
[0082] The nonlinear term nonlinear and the bias term B are determined by the following formulas: nonlinear(val)=(val×val+(1<<(bitdepth-1)))>>bitdepth (4) B=1<<(bitdepth-1) (5)
[0083] The model parameters c0 to c7 are obtained by solving the equations, for example, by using the Gaussian elimination method without division.
[0084] InterCCCM technology, to reduce the number of luminance and chromaticity prediction samples involved in model parameter calculation, first determines the downsampling step sizes dsX and dsY in the x and y directions based on the width and height of the chromaticity prediction block, thereby downsampling the chromaticity prediction block. In the above formula, predChromaVal is the downsampled chromaticity prediction value.
[0085] Depending on the image color format, the luminance prediction samples and chrominance prediction samples may have different positional relationships.
[0086] Figure 3 is a schematic diagram of the positional relationship between the luminance prediction sample and the chrominance prediction sample proposed in an embodiment of this application. As shown in Figure 3, if the image color format is 4:4:4 color format, each Y component corresponds to a set of Cb and Cr components. In this case, the luminance prediction value L0 corresponding to the position of the first chrominance prediction value C is obtained, and the values of L1 to L5 are 0.
[0087] Figure 4 is a schematic diagram of the positional relationship between the luminance prediction sample and the chrominance prediction sample proposed in an embodiment of this application. As shown in Figure 4, if the image color format is 4:2:2 color format, each pair of Y components shares a set of Cb and Cr components. If the chrominance sample is located at C0, the luminance sample closest to the chrominance sample is located at L0 and L2. L0 to L2 are obtained. The value of L1 is equal to that of L0, and the values of L3 to L5 are 0. If the chrominance sample is located at C1, L0 and the luminance prediction values L1 and L2 on both sides of L0 are obtained, and the values of L3 to L5 are 0.
[0088] Figure 5 is a schematic diagram of the positional relationship between the luminance prediction sample and the chrominance prediction sample proposed in the embodiments of this application. As shown in Figure 5, if the image color format is 4:2:0 color format, each of the four Y components shares a set of Cb and Cr components. As shown in Figure 6, if the chrominance sample is located at C0, then the luminance sample closest to the chrominance sample is located at L0, L2, L3, and L5. L0 to L5 are obtained. The value of L1 is equal to that of L0, and the value of L4 is equal to that of L3. If the chrominance sample is located at C1, L0 to L5 are obtained.
[0089] In the CCCM model parameter calculation process, luma and chroma offset values are introduced to reduce the dynamic range of the data and the bit depth required for derivation. The luma and chroma prediction values involved in the model parameter calculation are all subtracted from the luma and chroma offset values. In InterCCCM technology, the luma offset (offsetY) and chroma offset (offsetCb for Cb components and offsetCr for Cr components) can be simply represented by the average of the four vertex pixel values of the luma and chroma prediction blocks.
[0090] Therefore, L0′~L5′ in the formula is the difference between L0~L5 (values not zero) and offsetY. The model parameters are obtained by establishing equations for predChromaVal with L0′~L5′, the nonlinear term, and the bias term, using, for example, the division-free Gaussian elimination method in ECM10.0. offsetCb and offsetCr also participate in the model parameter calculation.
[0091] Furthermore, after solving for the model parameters, the InterCCCM technique generates the second chromaticity prediction value edChromaVal for the current block using the following formula: predChromaVal=c0L0′+c1L1′+c2L2′+c3L3′+c4L4′+c5L5′ +c6nonlinear((L0′+L3′+1)>>1)+c7B (3)
[0092] The nonlinear term nonlinear and the bias term B are determined by the following formulas: nonlinear(val)=(val×val+(1<<(bitdepth-1)))>>bitdepth (4) B=1<<(bitdepth-1) (5)
[0093] The model parameters c0 to c7 are the model parameters obtained in the previous step. L0′ to L5′ are the differences between the reconstructed brightness values L0" to L5" (values not equal to 0) and the brightness offset value (offsetY).
[0094] It should be noted that, in the embodiments of this application, when applying the model, the InterCCCM technology does not downsample the chroma prediction block. The luminance reconstruction samples corresponding to all the first chroma prediction values in the chroma prediction block participate in the model application.
[0095] Depending on the image color format, the luminance prediction samples and chrominance prediction samples may have different positional relationships.
[0096] Figure 6 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chrominance prediction sample proposed in an embodiment of this application. As shown in Figure 6, if the image color format is 4:4:4 color format, each Y component corresponds to a set of Cb and Cr components. In this case, the luminance reconstruction value L0" corresponding to the position of the first chrominance prediction value C is obtained, and the values of L1" to L5" are 0.
[0097] Figure 7 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chrominance prediction sample proposed in this application embodiment. As shown in Figure 7, if the image color format is 4:2:2 color format, each pair of Y components shares a set of Cb and Cr components. If the chrominance sample position is at C0, then the luminance sample closest to the chrominance sample position is at L0" and L2". L0" to L2" are obtained. When applied to the calculation formula, the value of L1" is considered equal to L0", and the values of L3" to L5" are 0. If the chrominance sample position is at Cm (m≠0), the luminance reconstruction values L1" and L2" on both sides of L0" are obtained, and the values of L3" to L5" are 0. It can be understood that between adjacent chrominance sampling positions, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point.
[0098] Figure 8 is a schematic diagram of the positional relationship between the luminance reconstruction sample and the chrominance prediction sample proposed in the embodiments of this application. As shown in Figure 8, if the image color format is 4:2:0 color format, each of the four Y components shares a set of Cb and Cr components. If the chrominance sample position is at C0, then the luminance reconstruction sample closest to the chrominance sample position is at L0", L2", L3", and L5". L0"~L5" are obtained. When applied to the calculation formula, the value of L1" is considered equal to L0", and the value of L4" is considered equal to L3". If the chrominance sample position is at Cm (m≠0), L0"~L5" are obtained. It can be understood that between adjacent left and right chrominance sampling positions, the L2" position corresponding to the left sampling point corresponds to the L1" position corresponding to the right sampling point, and the L5" position corresponding to the left sampling point corresponds to the L4" position corresponding to the right sampling point.
[0099] InterCCCM uses the second chromaticity prediction value (predCbVal for Cb components and predCrVal for Cr components) obtained from the above formula and the first chromaticity prediction value (predSamplesCb for Cb components and predSamplesCr for Cr components) to perform a weighted calculation according to the following formulas, thereby generating a third chromaticity prediction value (predSamplesCb′ for Cb components and predSamplesCr′ for Cr components). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (6) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (7)
[0100] Where w is the weighting weight. For example, w is 0.75.
[0101] In the embodiments of this application, a weight-based chroma prediction (WCP) is proposed. When performing chroma prediction on the current coding block, the reconstructed luminance information of the current coding block, the reconstructed luminance information of the adjacent reference region, and the reconstructed chroma information are all encoded reconstructed information. Therefore, a weight-based chroma prediction technique (WCP) utilizing the above-mentioned reconstructed information is proposed. All operations in the technical implementation process use integer operations.
[0102] The input to WCP can include the position of the current chroma prediction block (xTbCmp, yTbCmp), the width nTbW of the current chroma prediction block, and the height nTbH of the current chroma prediction block.
[0103] The output of WCP can include the predicted values of the current chromaticity prediction block, predSamples[x][y], where the origin of the coordinate system is the top-left sample position within the current chromaticity prediction block, x = 0..nTbW-1, y = 0..nTbH-1.
[0104] Figure 9 illustrates the prediction process of the WCP technology proposed in this application. As shown in Figure 9, the specific prediction process of the WCP technology consists of the following steps: S1, determining the core parameters of WCP; S2, acquiring input information; S3, weight-based chromaticity prediction; S4, weight-based post-processing. After these steps, the chromaticity prediction value of the current prediction block can be obtained.
[0105] Furthermore, in the process of determining the core parameters of WCP, the core parameters involved in WCP can be determined, that is, the core parameters of WCP can be obtained or inferred through configuration or through some channel, such as obtaining the core parameters of WCP from the bitstream at the decoding end.
[0106] The core parameters of WCP include, but are not limited to, the WCP control parameter (S), the number of weighted chromaticity prediction inputs inSize, the number of weighted chromaticity prediction outputs (predWcp) (e.g., arranged in predSizeW × predSizeH), the weight model based on a lookup table (LUT), and the maximum index of the weight model LUT, theMaxPos. The number of weighted chromaticity prediction outputs (predWcp) can be set to the same value, such as predSizeW = predSizeH = S / 4, or the number of weighted chromaticity prediction outputs (predWcp) can be related to the current block size, such as predSizeW = nTbW, predSizeH = nTbH. The control parameter S can be used to adjust the nonlinear function in subsequent stages or to adjust the data involved in subsequent stages. The weight model LUT can be predefined or calculated in real time based on different WCP control parameters (S). The maximum index, theMaxPos, of the weighted model LUT can be adjusted or fixed depending on the weighted model LUT.
[0107] The determination of WCP core parameters is influenced by block size, block content, or the number of pixels within a block under certain conditions. For example:
[0108] Chroma prediction blocks can be classified based on their block size, block content, or number of pixels within the block, and the same or different core parameters can be determined for different categories. That is, the WCP control parameter (S), the number of weighted chroma prediction inputs (inSize), or the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) corresponding to different categories can be the same or different. Note that predSizeW and high predSizeH can also be the same or different.
[0109] If the WCP application involves many block sizes, significant differences between block sizes, large differences in block content, or large differences in the number of pixels within a block, the chroma prediction blocks can be classified according to their block size, block content, or number of pixels within the block. The same or different core parameters can be determined based on different categories. That is, the WCP control parameters (S), the number of weighted chroma prediction inputs (inSize), or the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) corresponding to different categories can be the same or different. Note that predSizeW and high predSizeH can also be the same or different.
[0110] To better illustrate the determination of WCP core parameters, let's take two simple categories as examples:
[0111] Classification Example 1: WCP can classify chroma blocks based on their width and height, using wcpSizeId to represent the type of chroma block. For different types of chroma blocks, the WCP control parameter (S), the number of weighted chroma prediction inputs inSize, and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be the same or different. Here, we will illustrate this using one type with three categories as an example:
[0112] Chroma blocks are divided into three categories based on their width and height. The WCP control parameter (S) can be set differently for each category, while the inSize and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same value for each category. nTbW is the width of the current chroma prediction block, and nTbH is the height of the current chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0113] wcpSizeId = 0: chroma blocks with min(nTbW, nTbH) <= 4. Their WCP control parameter (S) is 8, inSize is (2 × nTbH + 2 × nTbW), and the weighted chroma prediction outputs nTbH × nTbW chroma prediction values.
[0114] wcpSizeId = 1: 4 < min(nTbW, nTbH) <= 16. Its WCP control parameter (S) is 12, inSize is (2×nTbH+2×nTbW), and the weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values;
[0115] wcpSizeId = 2: min(nTbW, nTbH) > 16. Its WCP control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and the weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0116] The above quantitative relationships are presented in tabular form, as shown in Table 1:
[0117] Table 1
[0118] We can also illustrate this by taking another example:
[0119] Chroma blocks are divided into three categories based on their width and height. The WCP control parameter (S) can be set differently for each category, while the inSize and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same value for each category. nTbW is the width of the current chroma prediction block, and nTbH is the height of the current chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0120] wcpSizeId = 0: chroma blocks with min(nTbW, nTbH) <= 4. Their WCP control parameter (S) is 8, inSize is (2 × nTbH + 2 × nTbW), and the weighted chroma prediction outputs nTbH × nTbW chroma prediction values.
[0121] wcpSizeId = 1: 4 < min(nTbW, nTbH) <= 16. Its WCP control parameter (S) is 12, inSize is (1.5 × nTbH + 1.5 × nTbW), and the weighted chromaticity prediction outputs nTbH / 2 × nTbW / 2 chromaticity prediction values;
[0122] wcpSizeId = 2: min(nTbW, nTbH) > 16. Its WCP control parameter (S) is 16, inSize is (nTbH + nTbW), and the weighted chromaticity prediction outputs nTbH / 4 × nTbW / 4 chromaticity prediction values.
[0123] The above quantitative relationships are presented in tabular form, as shown in Table 2:
[0124] Table 2
[0125] Classification Example 2: WCP can also classify chroma blocks based on the number of pixels in the chroma prediction block, using wcpSizeId to represent the type of chroma block. For different types of chroma blocks, the WCP control parameter (S), the number of weighted chroma prediction inputs inSize, and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be the same or different. Here, we will illustrate this with an example of a three-class classification:
[0126] Chroma blocks are divided into three categories based on the number of pixels in the chroma prediction block. The WCP control parameter (S) can be set differently for different categories, while the inSize and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same for different categories. nTbW is the width of the current chroma prediction block, nTbH is the height of the current chroma prediction block, and nTbW and nTbH represent the number of pixels in the chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0127] wcpSizeId = 0: a chroma block with (nTbW nTbH) < 128. Its WCP control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and the weighted chroma prediction outputs nTbH×nTbW chroma prediction values;
[0128] wcpSizeId = 1: 128 <= (nTbW nTbH) <= 256 chroma blocks. Its WCP control parameter (S) is 8, inSize is (2×nTbH+2×nTbW), and the weighted chroma prediction outputs nTbH×nTbW chroma prediction values;
[0129] wcpSizeId = 2: (nTbW nTbH) > 256. Its WCP control parameter (S) is 1, inSize is (2×nTbH+2×nTbW), and the weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0130] The above quantitative relationships are presented in tabular form, as shown in Table 3:
[0131] Table 3
[0132] We can also illustrate this by taking another example:
[0133] Chroma blocks are divided into three categories based on the number of pixels in the chroma prediction block. The WCP control parameter (S) can be set differently for different categories, while the inSize and the number of weighted chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same for different categories. nTbW is the width of the current chroma prediction block, nTbH is the height of the current chroma prediction block, and nTbW and nTbH represent the number of pixels in the chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0134] wcpSizeId = 0: a chroma block with (nTbW nTbH) < 64. Its WCP control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and the weighted chroma prediction outputs nTbH×nTbW chroma prediction values;
[0135] wcpSizeId = 1: 64 < (nTbW nTbH) <= 512. Its WCP control parameter (S) is 4, inSize is (1.5 × nTbH + 1.5 × nTbW), and the weighted chromaticity prediction outputs nTbH / 2 × nTbW / 2 chromaticity prediction values;
[0136] wcpSizeId = 2: (nTbW nTbH) > 512. Its WCP control parameter (S) is 1, inSize is (nTbH + nTbW), and the weighted chromaticity prediction outputs nTbH / 4 × nTbW / 4 chromaticity prediction values.
[0137] The above quantitative relationships are presented in tabular form, as shown in Table 4:
[0138] Table 4
[0139] Furthermore, during the process of acquiring input information, when predicting the current block, the upper, upper left, and left regions of the current predicted block are all referred to as reference regions, as shown in Figure 10. The pixels in the reference regions are all reconstructed reference pixels.
[0140] Retrieve reference chromaticity information (refC) and reference luminance information (refY) from the reference regions. The retrieved reference chromaticity information includes, but is not limited to: the reconstructed reference chromaticity value of the reference region above the current chromaticity prediction block, and the reconstructed reference chromaticity value of the reference region to the left. The retrieved reference luminance information includes, but is not limited to, the reference luminance information obtained based on the location of the reference chromaticity information.
[0141] Obtain the reconstructed luminance information recY of the current prediction block. The acquisition method includes, but is not limited to, obtaining the corresponding reconstructed luminance information based on the position of the chromaticity information within the current chromaticity prediction block as the reconstructed luminance information of the current prediction block.
[0142] The input information includes obtaining reference chromaticity information refC of inSize (after preprocessing if preprocessing is required), reference luminance information refY of inSize (after preprocessing if preprocessing is required), and luminance reconstruction information recY of the current prediction block (after preprocessing if preprocessing is required).
[0143] Furthermore, in the weighted chromaticity prediction process, the predicted chromaticity value C within the size specified by the WCP core parameters is... pred [i][j], i = 0…predSizeW-1, j = 0…predSizeH-1, are obtained sequentially. Note that predSizeH and predSizeW are defined WCP core parameters, which can be the same as or different from the height nTbH or width nTbW of the current chroma block to be predicted. Thus, under certain conditions, the following calculation can also be performed only on a portion of the samples to be predicted within the current prediction block.
[0144] As shown in Figure 11, the weighted chromaticity prediction consists of the following steps: S3.1, Preprocessing of reference chromaticity information; S3.2, Constructing a luminance difference vector; S3.3, Calculating the weight vector; S3.4, Calculating the predicted chromaticity value; S3.5, Correcting the predicted value.
[0145] The process involves preprocessing reference chromaticity information, obtaining a weight vector, performing weighted prediction based on the weights to obtain a weighted chromaticity prediction value, and then correcting it. The preprocessing of reference information includes calculating the average value and constructing a reference chromaticity difference vector; the process of obtaining the weight vector includes constructing a luminance difference vector and calculating the weight vector.
[0146] The detailed calculation process is as follows:
[0147] Calculate the average value (avgC) of the reference chromaticity information.
[0148] For k = 0, 1, ..., inSize-1
[0149] Construct the reference chromaticity difference vector diffC
[0150] For i=0…predSizeW-1, j=0…predSizeH-1
[0151] For k = 0, 1, ..., inSize-1
[0152] Construct the brightness difference vector by defining each element diffY[i][j][k].
[0153] Calculate the weights in the weight vector cWeightInt[i][j][k].
[0154] The chromaticity prediction value Cpred[i][j] is calculated using cWeightInt[i][j], diffC, and avgC.
[0155] In the preprocessing of the reference chromaticity information, the average value avgC is calculated for each inSize number of reference chromaticity information refC. The reference chromaticity difference vector diffC is obtained by subtracting the average value avgC from the inSize number of reference chromaticity information refC. Refer to the following formula: diffC[k] = refC[k] - avgC (9)
[0156] In constructing the brightness difference vector, for each sample C to be predicted within the size specified by the WCP core parameters... pred [i][j], subtract the corresponding brightness reconstruction information recY[i][j] from the reference brightness information refY of the number inSize and take the absolute value to obtain the brightness difference vector diffY[i][j]. Refer to the following formula: diffY[i][j][k]=Abs(refY[k]-recY[i][j]) (10)
[0157] Under certain conditions, the brightness difference vector of the sample to be predicted can be subjected to linear or nonlinear numerical processing. For example, the value of the brightness difference vector of the sample to be predicted can be scaled according to the WCP control parameter S in the WCP core parameters.
[0158] In the process of calculating the weight vector, a non-linear weight model LUT is used for each sample C to be predicted. pred The brightness difference vector diffY[i][j] corresponding to [i][j] is processed to obtain the corresponding integer weight vector cWeightInt[i][j].
[0159] For example:
[0160] A non-linear Softmax function can be used as the weight model. The methods for obtaining the weight model LUT include, but are not limited to, the following: theMaxPos = 1 << BitDepth-1 (11)
[0161] The value of theMaxPos includes, but is not limited to, the value calculated according to equation (11), and it can be a parameter determined in the WCP core parameters.
[0162] For n = 0, 1, ..., theMaxPos LUT[n] = Round(e-n ×ModelScale) (12)
[0163] The value of ModelScale includes, but is not limited to, the parameter determined by the WCP core parameters. It represents the amplification factor of the weight coefficient and is a pre-set constant.
[0164] For k=0,1...inSize-1 index=Clip3(0,theMaxPos,diffY[i][j][k]) (13) cWeightInt[i][j][k]=LUT[index] (14)
[0165] Under certain conditions, the weight model can be adjusted according to the WCP control parameter (S) in the core parameters.
[0166] For example:
[0167] When the current predicted block size is flexible, the weight model can be adjusted according to the WCP control parameter (S). Taking the nonlinear Softmax function as an example, different scale parameters can be selected to adjust the function depending on the block classification category to which the current predicted block belongs. The methods for obtaining the weight model LUT at this time include, but are not limited to, the following: theMaxPos=1<<BitDepth-1 (11)
[0168] The value of theMaxPos includes, but is not limited to, the value calculated according to equation (11). It can be a parameter determined in the WCP core parameters and can be assigned different values with different WCP control parameters (S), i.e., theMaxPos[S].
[0169] For n = 0, 1, ..., the MaxPos
[0170] The value of ModelScale includes, but is not limited to, the parameters determined by the WCP core parameters, which represent the amplification factor of the weight coefficients.
[0171] For k=0,1...inSize-1 index=Clip3(0,theMaxPos,f(S,diffY[i][j][k])) (16) cWeightInt[i][j][k]=LUT[S][index] (17)
[0172] Here, f() refers to a function of the WCP control parameter S and the brightness difference diffY[i][j][k], and its output is the index of the LUT.
[0173] Here, f() includes, but is not limited to, the implementation of the following example: f(S,diffY[i][j][k])=diffY[i][j][k] (18)
[0174] in,
[0175] Floor(x) represents the largest integer less than or equal to x.
[0176] Log2(x) represents the logarithm to the base 2. Round(x)=Sign(x)×Floor(Abs(x)+0.5) (22)
[0177] In calculating the chromaticity prediction value, the chromaticity prediction value of each sample to be predicted is calculated based on the integer weight vector cWeightInt[i][j] corresponding to each sample to be predicted, the reference chromaticity difference vector diffC, and the average value of the reference chromaticity information. Specifically, the reference chromaticity difference vector diffC is multiplied one by one with the weight vector element corresponding to each sample to be predicted to obtain subC[i][j]. The multiplication results are accumulated and divided by the sum of the integer weight vector cWeightInt[i][j] corresponding to each sample to be predicted, and then added to the average value of the reference chromaticity information to obtain the chromaticity prediction value C of each sample to be predicted. pred [i][j]. All division operations involved use right shift operations, as detailed below:
[0178] For k = 0, 1, ..., inSize-1, subC[i][j][k] = (cWeightInt[i][j][k] × diffC[k]) (23)
[0179] For i=0…predSizeW-1, j=0…predSizeH-1
[0180] in, v=DivSigTable[normDiff]|(1<<Shift) (26) add=1<<y<<(Shift-1) (29)
[0181] The method of obtaining Shift includes, but is not limited to, the parameters determined by WCP. In the decoding specification text in the appendix, Shift is assigned the value 5.
[0182] The equation (25) for x corresponds to x = Floor(Log2(sum)) in the decoded canonical text.
[0183] The formula (26) for v corresponds to divSigTable[normDiff]|32 when Shift=5 is the value of the decoded canonical text.
[0184] Equation (27) of normDiff corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decoded norm text.
[0185] The equation (28) for y corresponds to x+=(normDiff!=0)? 1:0 in the decoding specification text in the appendix.
[0186] The formula (21) for add corresponds to add = 1 << x << 4 when Shift = 5 in the decoded canonical text.
[0187] DivSigTable is a predefined array related to Shift. DivSigTable corresponds to divSigTable[] = {0,15,14,13,12,12,11,10,10,9,8,8,7,7,6,6,5,5,4,4,4,3,3,3,2,2,2,1,1,1,1,0} in the decoded canonical text.
[0188] Func() is a function related to Shift. Its input is the sum of the weight vectors and x calculated by equation (17), and its output is the index value of DivSigTable[].
[0189] Here is an example of a specific form of Func(), as shown below:
[0190] The corresponding normDiff for decoding the standard text is ((sum<<5)>>x)&31 when Shift=5.
[0191] During the correction of predWcp, the chromaticity prediction values within predWcp should be within a specified range. If they exceed this range, appropriate correction operations should be performed. For example:
[0192] Can be used for C pred The chromaticity prediction values of [i][j] are clamped as follows:
[0193] When C predIf the value of [i][j] is less than 0, set it to 0;
[0194] When C pred When the value of [i][j] is greater than (1 << BitDepth) - 1, it is set to (1 << BitDepth) - 1.
[0195] BitDepth is the bit depth required for the chroma pixel value to ensure that all predicted values in predWcp are between 0 and (1 << BitDepth) - 1.
[0196] That is: C pred [i][j]=Clip3(0,(1<<BitDepth)-1,C pred [i][j]) (31)
[0197] Furthermore, in the weight-based post-processing, the weight-based chroma prediction output predWcp needs to be post-processed under certain conditions to become the final chroma prediction value predSamples; otherwise, the final chroma prediction value predSamples is predWcp.
[0198] However, the InterCCCM technique in related technologies applies the same model parameters to each sample position in the current chromaticity prediction block to obtain the second chromaticity prediction value. The derived model parameters are not necessarily optimal for each chromaticity sample position, thus reducing the prediction accuracy.
[0199] In other words, InterCCCM technology reduces the accuracy of chroma prediction by filtering the luminance reconstruction value, thereby reducing encoding and decoding performance.
[0200] To address the aforementioned issues, embodiments of this application provide an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines prediction parameters for the current block; based on the prediction parameters, it determines the reconstructed value of a first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of a second image component of the current block; based on the reconstructed value and the predicted value of the first image component, it determines the prediction weight of the current block; and based on the prediction weight and the first predicted value of the second image component, it determines the predicted value of the second image component of the current block. Therefore, in embodiments of this application, when performing cross-component prediction on the current block, prediction weights for cross-component prediction can be determined based on the reconstructed value and the predicted value of the first image component, and the predicted value of the second image component can be further derived based on these prediction weights. In other words, this application introduces a weight-based prediction model into the inter-frame cross-component prediction process, improving prediction accuracy and thus enhancing encoding / decoding performance.
[0201] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0202] Referring to Figure 12, it shows an example of a system block diagram of an encoder provided in an embodiment of this application. As shown in Figure 12, the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control and analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by partitioning it through a Coding Tree Unit (CTU). Then, the residual sample information obtained after intra-frame or inter-frame prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the sample domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide time prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 is used to perform the motion estimation based on the motion vectors determined by the motion estimation unit 105. The motion compensation is performed. After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109. In addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the sample domain, and remove the block artifacts by the filter control analysis unit 107 and the filtering unit 108. Then, the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-prediction mode and output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.
[0203] Referring to Figure 13, it shows an example of a system block diagram of a decoder provided in an embodiment of this application. As shown in Figure 13, the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc. The decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding processing shown in Figure 14, the bitstream of the video signal is output. This bitstream is input into the decoder 200, first passing through the decoding unit 201 to obtain the decoded transform coefficients. The transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the sample domain. The intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses... The prediction information is used to generate a predictive block of the video block being decoded; the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.
[0204] In the embodiments of this application, a network architecture for a video encoding / decoding system including decoding and encoding methods is provided. The decoder or encoder in these embodiments can be the aforementioned electronic device. That is, the electronic device in these embodiments has video encoding / decoding capabilities and generally includes a video encoder (i.e., encoder) and a video decoder (i.e., decoder).
[0205] It should also be noted that the embodiments of this application can be applied to encoders, decoders, or even both encoders and decoders.
[0206] It should also be noted that when the embodiments of this application are applied to an encoder, "current block" specifically refers to the encoded block to be predicted; when the embodiments of this application are applied to a decoder, "current block" specifically refers to the decoded block to be predicted.
[0207] In one embodiment of this application, FIG14 is a schematic flowchart of a decoding method proposed in an embodiment of this application. As shown in FIG14, the decoding method of the decoder may include:
[0208] Step 101: Determine the prediction parameters for the current block.
[0209] It should be noted that, in the embodiments of this application, the decoding method is applied to the decoder. Specifically, based on the composition structure of the decoder 200, the decoding method in the embodiments of this application can mainly include a cross-component prediction method, which can improve encoding and decoding performance.
[0210] In embodiments of this application, the current block can be an image block to be decoded in the current image.
[0211] In the embodiments of this application, the prediction parameters of the current block can be determined first. These prediction parameters can be used to perform cross-component prediction processing on the current block.
[0212] In some embodiments, the prediction parameters of the current block include at least one or more of the following: control parameters; prediction input parameters; prediction output parameters; a lookup table-based weight model; and a maximum weight model index.
[0213] In the embodiments of this application, the control parameters include the WCP control parameters (S) of the current block. The value of the control parameters for the current block is not specifically limited in this application.
[0214] In some embodiments, the control parameters may be used to adjust the nonlinear function in subsequent stages and / or to adjust the data involved in subsequent stages, and this application does not impose specific limitations.
[0215] In the embodiments of this application, the predicted input parameters may be determined based on the current block or may be preset, and this application does not impose any specific limitations.
[0216] In some embodiments, the prediction input parameters include the number of prediction inputs inSize, which is the number of reference samples input when performing cross-component prediction for the current block.
[0217] In the embodiments of this application, the predicted output parameters may be determined based on the current block or may be preset, and this application does not impose any specific limitations.
[0218] In some embodiments, the prediction output parameters include the number of prediction outputs. For example, the prediction output parameters can be represented as predSizeW × predSizeH. Here, predSizeW and predSizeH can be the same or different.
[0219] For example, in some examples, the width of the current block is nTbW and the height of the current block is nTbH, then it can be determined that predSizeW = nTbW and predSizeH = nTbH.
[0220] In some embodiments, the predicted output parameters can be determined based on control parameters. For example, the control parameter is S, and predSizeW = predSizeH = S / 4.
[0221] In embodiments of this application, the lookup table-based weight model may include a weight model LUT.
[0222] In some embodiments, the weight model based on the lookup table can be predefined or calculated in real time based on control parameters. This application does not impose any specific limitations.
[0223] In embodiments of this application, the maximum weight model index is used to determine the number of weights in a lookup table-based weight model. Specifically, for a weight model LUT, the maximum weight model index can be the maximum index of the weight model LUT, theMaxPos.
[0224] In some embodiments, the value of the maximum weight model index can be fixed or can be adaptively set for different lookup table-based weight models; this application does not impose any specific limitations.
[0225] In the embodiments of this application, the prediction parameters of the current block may correspond to the size information and / or image information of the current block, that is, for different blocks to be predicted in the current image, the corresponding prediction parameters may be different.
[0226] In some embodiments, the prediction parameters for the current block can be determined based on the size information of the current block.
[0227] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 5 can be referred to:
[0228] Table 5
[0229] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, then the control parameter S can be determined to be 12, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies min(nTbW,nTbH) > 16, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0230] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 6 can be referred to:
[0231] Table 6
[0232] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, then the control parameter S can be determined to be 12, the prediction input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies min(nTbW,nTbH) > 16, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0233] In some embodiments, the prediction parameters for the current block can be determined based on the image information of the current block. This image information may include, but is not limited to, the number of pixels in the current block.
[0234] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW of the current block, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 7 can be referred to:
[0235] Table 7
[0236] Specifically, if the image information of the current block satisfies (nTbW×nTbH)<128, then the control parameter S can be determined to be 10, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies 128<=(nTbW×nTbH)<=256, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbW×nTbH, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies (nTbW×nTbH)>256, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0237] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW of the current block, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 8 can be referred to:
[0238] Table 8
[0239] Specifically, if the image information of the current block satisfies (nTbW×nTbH)<64, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies 64<=(nTbW×nTbH)<=512, then the control parameter S can be determined to be 4, the prediction input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies (nTbW×nTbH)>512, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0240] In some embodiments, when determining the prediction parameters of the current block, the block type of the current block is determined based on the size parameters of the current block; and the control parameters, prediction input parameters, and prediction output parameters are determined based on the block type of the current block.
[0241] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 9 can be referred to:
[0242] Table 9
[0243] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, and the corresponding block type is type 0, then the control parameter S can be determined to be 8, the prediction input parameter inSize to be nTbH × nTbW, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, and the corresponding block type is type 1, then the control parameter S can be determined to be 12. The prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the size information of the current block satisfies min(nTbW,nTbH)>16, and the corresponding block type is type 2, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0244] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 10 can be referred to:
[0245] Table 10
[0246] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, and the corresponding block type is type 0, then the control parameter S can be determined to be 8, the prediction input parameter inSize to be nTbH × nTbW, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, and the corresponding block type is type 1, then the control parameter S can be determined to be 12, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW. The input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the size information of the current block satisfies min(nTbW,nTbH)>16, and the corresponding block type is type 2, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0247] In some embodiments, when determining the prediction parameters of the current block, the block type of the current block is determined based on the image information of the current block; control parameters, prediction input parameters, and prediction output parameters are determined based on the block type of the current block.
[0248] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 11 can be referred to:
[0249] Table 11
[0250] Specifically, if the image information of the current block satisfies (nTbW×nTbH) < 128, and the corresponding block type is type 0, then the control parameter S can be determined to be 10, the prediction input parameter inSize to be nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW; if the image information of the current block satisfies 128 ≤ (nTbW×nTbH) ≤ 256, and the corresponding block type is type 1, then the control parameter S can be determined to be... 8. The prediction input parameter inSize is nTbW×nTbH, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the image information of the current block satisfies (nTbW×nTbH)>256, and the corresponding block type is type 2, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0251] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 12 can be referred to:
[0252] Table 12
[0253] Specifically, if the image information of the current block satisfies (nTbW×nTbH) < 64, and the corresponding block type is type 0, then the control parameter S can be determined to be 16, the prediction input parameter inSize to be nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW; if the image information of the current block satisfies 64 ≤ (nTbW×nTbH) ≤ 512, and the corresponding block type is type 1, then the control parameter S can be determined to be 4, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW. The input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the image information of the current block satisfies (nTbW×nTbH)>512, and the corresponding block type is type 2, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0254] In the embodiments of this application, the prediction parameters of the current block may include, but are not limited to, weighting coefficient method multiples (such as ModelScale), etc., and this application does not impose specific limitations.
[0255] Step 102: Determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block.
[0256] In the embodiments of this application, after determining the prediction parameters of the current block, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block can be further determined based on the prediction parameters of the current block.
[0257] In the embodiments of this application, the chromaticity component of the current block can be determined using the luminance component of the current block, or the luminance component of the current block can be determined using the chromaticity component of the current block. This application does not impose any specific limitations.
[0258] In some embodiments, the first image component can be a luminance component, typically denoted by the symbol Y. The second image component can be a chrominance component, which may include a blue chrominance component (typically denoted by the symbols Cb or U) or a red chrominance component (typically denoted by the symbols Cr or V).
[0259] In some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, then the reconstructed value of the first image component of the current block can be the reconstructed value of the luminance component of the current block; the predicted value of the first image component of the current block can be the predicted value of the luminance component of the current block; and the first predicted value of the second image component of the current block can be the first predicted value of the chrominance component of the current block.
[0260] In some embodiments, the first predicted value of the second image component of the current block can be understood as the initial predicted value of the chroma component of the current block obtained by inter-frame prediction or by intra-frame block copying.
[0261] In embodiments of this application, based on the motion vector of the current block, the reconstructed value of the second image component of the reference block is determined in the reference image of the current image; based on the reconstructed value of the second image component of the reference block, the first predicted value of the second image component of the current block is determined.
[0262] For example, in some embodiments, when obtaining the first predicted value of the second image component of the current block, a reference block of the current block can be determined in a reference image of the current image based on the motion vector of the current block; then, the first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block of the current block.
[0263] In embodiments of this application, based on the block vector of the current block, the reconstructed value of the second image component of the reference block is determined in the current image; based on the reconstructed value of the second image component of the reference block, the first predicted value of the second image component of the current block is determined.
[0264] For example, in some embodiments, when obtaining the first predicted value of the second image component of the current block, it is also possible to select a reference block of the current block in the current image based on the block vector of the current block; and then determine the first predicted value of the second image component of the current block based on the reconstructed value of the second image component of the reference block of the current block.
[0265] In the embodiments of this application, when determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the number of samples is determined based on the prediction input parameters; the reconstructed value of the first image component, the predicted value of the first image component, and the first predicted value of the second image component are determined based on the number of samples.
[0266] In embodiments of this application, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block can be used as input information for cross-component prediction of the current block.
[0267] For example, in some embodiments, assuming the prediction input parameter is inSize, the number of samples to be referenced can be determined to be inSize, that is, inSize samples in the current block are used as input. For example, the reconstructed values of inSize first image components of inSize samples in the current block, the predicted values of inSize first image components of inSize samples in the current block, and the first predicted values of inSize second image components of inSize samples in the current block can be used as input information for cross-component prediction of the current block.
[0268] In some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, and the number of samples determined based on the prediction input parameters is inSize, then the obtained input information may include inSize luminance reconstruction information (luminance reconstruction value) recY of the current block, inSize luminance prediction information (luminance prediction value) predY of the current block, and inSize chrominance prediction information (chrominance prediction value) predC of the current block.
[0269] In embodiments of this application, when determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the initial reconstructed value of the first image component of the current block can be downsampled so that the final reconstructed value of the first image component of the current block satisfies the prediction parameters of the current block; and / or, the initial predicted value of the first image component of the current block can be downsampled so that the final predicted value of the first image component of the current block satisfies the prediction parameters of the current block; and / or, the initial predicted value of the second image component of the current block can be downsampled so that the final predicted value of the second image component of the current block satisfies the prediction parameters of the current block.
[0270] For example, in some embodiments, if the resolution of the luminance component and the chrominance component is inconsistent, for example, if the luminance component and / or chrominance component of the current block do not meet the prediction output parameter inSize of the current block, then it is necessary to downsample the luminance prediction information and luminance reconstruction information of the current block that have not been downsampled to obtain luminance reconstruction information recY and luminance prediction information predY of inSize number for cross-component prediction.
[0271] In some embodiments, as shown in Figure 15, the downsampling methods that can be used are as shown in the figure.
[0272] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, with chrominance sample coordinates of (xC, yC) and corresponding unsampled luminance sample coordinates of (xL, yL), the correspondence between the position coordinates of chrominance samples and luminance samples determined based on different chrominance sampling formats (color sampling formats) is shown in Table 13:
[0273] Table 13
[0274] Wherein, `sps_chroma_format_idc` is the identifier for the chroma sampling format, used to determine the chroma sampling format. Assuming the luminance sample before downsampling is `BefDownLuma` and the luminance sample after downsampling is `AftDownLuma`, the downsampled luminance sample corresponding to the chroma sample position (xC, yC) can be obtained using the following downsampling method:
[0275] An example of downsampling is: AftDownLuma[xC][yC]=((BefDownLuma[xL][yL]×2)+BefDownLuma[xL+1][yL]+BefDownLuma[xL-1][yL]+(BefDownLuma[xL][yL+1]×2)+BefDownLuma[xL+1][yL+1]+BefDownLuma[xL-1][yL+1]+4)>>3
[0276] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+1)>>1
[0277] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL][yL+1]+1)>>1
[0278] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+1)>>1
[0279] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL+1][yL]+BefDownLuma[xL+1][yL+1]+1)>>1
[0280] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+2)>>2.
[0281] The coordinates of the unsampled brightness sample (xL, yL) can be calculated based on Table 13.
[0282] In the embodiments of this application, the input information for cross-component prediction, such as: inSize number of reference chromaticity information refC (predicted value of the second image component), and / or, inSize number of reference luminance information refY (predicted value of the first image component), and / or, luminance reconstruction information recY of the current prediction block (reconstructed value of the first image component), can be refC, and / or, refY, and / or, recY after preprocessing operations.
[0283] In the embodiments of this application, if one or more of refC, refY, and recY do not satisfy inSize, or if the number of refC, refY, and recY is different, it is necessary to perform filtering processing on one or more of refC, refY, and recY, that is, to perform preprocessing, so as to ensure that the input information for cross-component prediction all satisfy the inSize number.
[0284] In other words, for the input information of cross-component prediction of the current block, it is possible to filter only the predicted value of the first image component of the current block, or only the predicted value of the second image component of the current block, or only the reconstructed value of the first image component of the current block, or any two of them, or even all three of them. This application embodiment does not make any limitation.
[0285] For example, in some embodiments, as shown in FIG16, if the number of samples determined based on the prediction input parameters is inSize, then the obtained input information may include inSize luminance reconstruction information (luminance reconstruction value) recY of the current block, inSize luminance prediction information (luminance prediction value) predY of the current block, and inSize chrominance prediction information (chrominance prediction value) predC of the current block.
[0286] Step 103: Determine the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component.
[0287] In the embodiments of this application, after determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the prediction weight of the current block can be further determined based on the reconstructed value of the first image component and the predicted value of the first image component.
[0288] In embodiments of this application, the prediction weight of the current block includes the prediction weight of samples of at least one image component to be predicted in the current block. The prediction weight can be represented as a weight vector.
[0289] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, and the luminance component is used to predict the corresponding chrominance component for the current block, then the prediction weight of the current block may include the prediction weight of at least one chrominance component sample of the current block, wherein each chrominance sample (chrominance component sample) corresponds to a set of weight vectors.
[0290] In the embodiments of this application, when determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component, the first image component difference vector of the first sample is determined based on the reconstructed value and the predicted value of the first image component; the prediction weight of the first sample is determined based on the first image component difference vector of the first sample; and the prediction weight of the current block is determined based on the prediction weight of the first sample.
[0291] In the embodiments of this application, the first sample is any second image component sample of the current block. Taking the second image component as a chroma component as an example, the first sample can be any chroma component sample to be predicted in the current block.
[0292] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample of the current block, the luminance component difference vector of the chrominance component sample can be determined first based on the reconstructed value and the predicted value of the luminance component of the current block. Then, the prediction weight of the chrominance component sample is determined based on the luminance component difference vector of the chrominance component sample; for the chrominance component samples to be predicted in the current block, the corresponding luminance component difference vector and prediction weight are determined sequentially, and finally, the prediction weight of the current block can be determined.
[0293] In the embodiments of this application, when determining the first image component difference vector of the first sample based on the reconstructed value of the first image component and the predicted value of the first image component, the reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed value of the first image component; the first image component difference vector of the first sample is determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component.
[0294] In embodiments of this application, the first image component difference vector of the first sample can be determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the current block.
[0295] For example, in some embodiments, assuming that the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample of the current block, such as the first sample, the luminance component difference vector corresponding to the first sample can be determined based on the reconstructed value of the luminance component corresponding to the first sample and the predicted value of the luminance component of the current block.
[0296] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the brightness reconstruction information (reconstructed value of brightness component) corresponding to the first sample is recY[i][j]. The predicted value of the brightness component of the current block includes inSize brightness prediction information predY of inSize samples of the current block. Then, we can choose to perform difference operation on the brightness reconstruction information corresponding to the first sample and the inSize brightness prediction information of the current block respectively to obtain inSize difference results, and determine the brightness component difference vector diffY[i][j][k] corresponding to the first sample based on the inSize difference results, referring to the following formula: diffY[i][j][k]=Abs(predY[k]-recY[i][j]) (32)
[0297] Where k = 0, 1...inSize-1. It can be seen that the luminance component difference vector corresponding to the first sample has inSize elements.
[0298] In the embodiments of this application, when determining the first image component difference vector of the first sample, the reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed value of the first image component; the predicted value of the first image component of the second sample is determined; and the first image component difference vector of the first sample is determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the second sample.
[0299] In the embodiments of this application, when determining the first image component difference vector of the first sample, the predicted value of the first image component of the current block can also be selected from the first image component samples of the current block based on the first sample, that is, the predicted value of the first image component of the second sample in the current block is selected to determine the subsequent first image component difference vector.
[0300] In other words, in the embodiments of this application, the predicted value of the first image component used to determine the first image component difference vector can be adaptively selected and determined based on the first sample. That is, for different second image component samples to be predicted in the current block (such as the first sample), the predicted value of the first image component selected can be different.
[0301] In embodiments of this application, the second sample can be one or more first image component samples of the current block. That is, in embodiments of this application, the first image component difference vector of the first sample can be determined by selecting the predicted values of a portion of the first image components of the current block based on the relevant information of the first sample.
[0302] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, one or more second samples of the current block can be determined first, and then the first image component difference vector of the first sample can be determined based on the predicted value of the first image component of the second sample.
[0303] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample.
[0304] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample and the position information of the current block. The first image component sample corresponding to the first sample can be understood as the first image component sample corresponding to the position of the first sample.
[0305] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the luminance component sample corresponding to the first sample can be represented as yPos[i][j]. The position information of the current block can be the position of the upper left luminance sample of the current luminance block relative to the upper left luminance sample of the current image. For example, the position information of the current block can be represented as lumaPos=(xCb,yCb). Then, the second sample can be selected based on the position information of the luminance component sample corresponding to the first sample and the position information of the current block. For example, a region can be determined based on yPos[i][j] and lumaPos, and the luminance sample in the region can be determined as the second sample.
[0306] For example, in some embodiments, as shown in Figure 17, the position of the current luminance block is obtained, that is, the position of the upper left corner luminance sample of the current luminance block relative to the upper left corner luminance sample of the current image, lumaPos = (xCb, yCb). The luminance prediction sub-information region at the position yPos[i][j] of the downsampled luminance reconstruction block is a cross-shaped region centered on yPos[i][j] = (xCb+i, yCb+j). The sample positions in its luminance prediction sub-information region are: yPos[i][j] = (xCb+i, yCb+j), Pos[i-1][j] = (xCb-1+i, yCb+j), yPos[i+1][j] = (xCb+1+i, yCb+j), yPos[i][j-1] = (xCb+i, yCb-1+j), yPos[i][j+1] = (xCb+i, yCb+1+j).
[0307] In the embodiments of this application, the second sample can be determined based on the position information, the first preset width, and the first preset height of the first image component sample corresponding to the first sample.
[0308] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample and the position information of the current block, combined with a predetermined first preset width and a first preset height. The first image component sample corresponding to the first sample can be understood as the first image component sample corresponding to the position of the first sample.
[0309] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the luminance component sample corresponding to the first sample can be represented as yPos[i][j]. The position information of the current block can be the position of the upper left luminance sample of the current luminance block relative to the upper left luminance sample of the current image. For example, the position information of the current block can be represented as lumaPos=(xCb,yCb). Then, the second sample can be selected based on the position information of the luminance component sample corresponding to the first sample, the position information of the current block, the first preset width w, and the first preset height h. For example, a region with a size satisfying w×h can be determined based on yPos[i][j] and lumaPos, and the luminance sample in this region can be determined as the second sample.
[0310] For example, in some embodiments, as shown in Figure 18, the position of the current luminance block is obtained, that is, the position of the upper left corner luminance sample of the current luminance block relative to the upper left corner luminance sample of the current image, lumaPos = (xCb, yCb). The luminance prediction sub-information region at the position yPos[i][j] of the downsampled luminance reconstruction block is a 3×3 (w = 3, h = 3) region centered on yPos[i][j] = (xCb+i, yCb+j). The sample positions in its luminance prediction sub-information region are: yPos[i][j] = (xCb+i, yCb+j), yPos[i-1][j] = (xCb-1+i, yCb+j), yPos[i+1][j] = (xCb+1+i, yCb+j), yPos[i-1][j-1] = (xCb-1+i, yCb-1+j), yPos[i ... ]=(xCb+i,yCb-1+j)、yPos[i+1][j-1]=(xCb+1+i,yCb-1+j)、yPos[i-1][j+1]=(xCb-1+ i,yCb+1+j), yPos[i][j+1]=(xCb+i,yCb+1+j), yPos[i+1][j+1]=(xCb+1+i,yCb+1+j).
[0311] Therefore, in the embodiments of this application, the predicted value of the first image component in the input information of the cross-component prediction of the current block may include the predicted values of inSize first image components determined by the prediction input parameters in the prediction parameters, or it may include the predicted values of the first image components of one or more second samples determined by the first samples. This application does not impose any specific limitations.
[0312] In the embodiments of this application, after determining the first image component difference vector of the first sample, a first preset processing can be performed on the first image component difference vector of the first sample; wherein, the first preset processing includes at least one or more of the following: linear processing; nonlinear processing; reduction processing; and magnification processing.
[0313] In other words, in the embodiments of this application, in order to obtain a weight vector with discriminative power in the subsequent calculation of the weight vector, a first preset processing can be performed on the first image component difference vector of the determined first sample.
[0314] For example, in some embodiments, the first image component difference vector of the first sample may be linearly processed, or the first image component difference vector of the first sample may be nonlinearly processed.
[0315] For example, in some embodiments, the first image component difference vector of the first sample can be reduced based on the control parameter S, or the first image component difference vector of the first sample can be enlarged based on the control parameter S.
[0316] In the embodiments of this application, when determining the prediction weight of the first sample based on the first image component difference vector of the first sample, the weight index of the first sample is determined based on the first image component difference vector of the first sample; and the prediction weight of the first sample is determined based on the weight model based on the lookup table and the weight index of the first sample.
[0317] In some embodiments, the lookup table-based weighting model can be a non-linear weighting model, such as using a non-linear Softmax function as the weighting model.
[0318] In the embodiments of this application, the weight model based on the lookup table can determine the corresponding prediction weight, i.e., the weight vector, for the first image component difference vector.
[0319] For example, in an embodiment of this application, assuming the first image component is a luminance component, for the first sample C to be predicted... pred [i][j], based on the first image component difference vector (brightness difference vector) corresponding to the first sample as diffY[i][j], based on the first image component difference vector and the weight model based on the lookup table, the predicted weight of the first sample can be determined, that is, the integer weight vector cWeightInt[i][j] corresponding to the first sample.
[0320] In the embodiments of this application, a weight model (weight model LUT) based on a lookup table can be obtained first.
[0321] For example, in some embodiments, a nonlinear Softmax function can be used as the weight model. The method for obtaining the weight model LUT in this case includes, but is not limited to, the following: theMaxPos = 1 << BitDepth-1 (11)
[0322] The value of the maximum weight model index theMaxPos includes, but is not limited to, the value calculated according to equation (11), and it can be a parameter determined in the WCP core parameters.
[0323] For example, in some embodiments, for n = 0, 1…theMaxPos LUT[n] = Round(e -n ×ModelScale) (12)
[0324] The value of ModelScale includes, but is not limited to, the parameter determined by the WCP core parameters. It represents the amplification factor of the weight coefficient and is a pre-set constant.
[0325] For example, in some embodiments, assuming the first image component is a luminance component, for k = 0, 1...inSize-1, the weight index of the first sample can be determined by the corresponding first image component difference vector (luminance difference vector) as diffY[i][j], and finally determined by the integer weight vector cWeightInt[i][j] corresponding to the first sample by combining the weight model based on the lookup table, referring to the following formula: index = Clip3(0,theMaxPos,diffY[i][j][k]) (13) cWeightInt[i][j][k] = LUT[index] (14)
[0326] For example, in some embodiments, the weight model can be adjusted according to the WCP control parameter (S) in the core parameters. For instance, when the current predicted block size is flexible, the weight model can be adjusted according to the WCP control parameter (S). Taking the nonlinear Softmax function as an example, different scale parameter adjustment functions can be selected according to the different block classification categories to which the current predicted block belongs. The methods for obtaining the weight model LUT at this time include, but are not limited to, the following: theMaxPos=1<<BitDepth-1 (11)
[0327] The value of theMaxPos includes, but is not limited to, the value calculated according to equation (11). It can be a parameter determined in the WCP core parameters and can be assigned different values with different WCP control parameters (S), i.e., theMaxPos[S].
[0328] For n = 0, 1, ..., the MaxPos
[0329] The value of ModelScale includes, but is not limited to, the parameters determined by the WCP core parameters, which represent the amplification factor of the weight coefficients. For k = 0, 1...inSize-1, index = Clip3(0,theMaxPos,f(S,diffY[i][j][k])) (16) cWeightInt[i][j][k] = LUT[S][index] (17)
[0330] Here, f() refers to a function of the WCP control parameter S and the brightness difference diffY[i][j][k], and its output is the index of the LUT.
[0331] Here, f() includes, but is not limited to, the implementation of the following example: f(S,diffY[i][j][k])=diffY[i][j][k] (18)
[0332] in,
[0333] Floor(x) represents the largest integer less than or equal to x.
[0334] Log2(x) represents the logarithm to the base 2. Round(x)=Sign(x)×Floor(Abs(x)+0.5) (22)
[0335] In other words, in the embodiments of this application, assuming that the first image component is the luminance component and the second image component is the chrominance component, for any chrominance component sample of the current block, each chrominance sample to be predicted in the current block is traversed according to the above method to obtain the luminance component difference vector corresponding to each chrominance sample to be predicted. Finally, the prediction weight (weight vector) of each chrominance sample to be predicted in the current block can be determined, and the prediction weight (weight vector) of the current block can be obtained.
[0336] Step 104: Determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0337] In the embodiments of this application, after determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component, the prediction value of the second image component of the current block can be further determined based on the prediction weight of the current block and the first predicted value of the second image component.
[0338] In the embodiments of this application, the predicted value of the second image component of the current block can be understood as the final prediction result of the second image component obtained after completing the cross-component prediction of the current block.
[0339] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the final predicted value of the chrominance component of the current block can be obtained based on the prediction weight of the current block and the first predicted value (initial predicted value) of the chrominance component of the current block.
[0340] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component, the second image component difference vector of the first sample is determined based on the first predicted value of the second image component; and the predicted value of the second image component of the current block is determined based on the second image component difference vector of the first sample and the prediction weight of the current block.
[0341] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample (such as the first sample) of the current block, the chrominance component difference vector of the chrominance component sample can be determined first based on the predicted value of the chrominance component of the current block. Then, based on the chrominance component difference vector and the prediction weight of the chrominance component sample, the predicted value of the chrominance component sample is determined. For the chrominance component sample to be predicted in the current block, the corresponding chrominance component difference vector and chrominance predicted value (predicted value of the chrominance component sample) are determined sequentially, and finally the chrominance predicted value of the current block can be determined.
[0342] In the embodiments of this application, when determining the second image component difference vector of the first sample based on the first predicted value of the second image component, the predicted average value of the second image component of the current block can be determined first based on the first predicted value of the second image component of the current block, and then the second image component difference vector of the first sample can be determined based on the predicted average value of the second image component and the first predicted value of the second image component of the first sample.
[0343] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the chromaticity prediction information (predicted value of chromaticity component) corresponding to the first sample is predC[i][j]. The predicted value of the chromaticity component of the current block includes inSize chromaticity prediction information predC of inSize samples of the current block. Based on the inSize chromaticity prediction information predC, the average value avgC is calculated, which is the predicted average value avgC of the second image component of the current block. Then, the chromaticity prediction information predC of inSize number is subtracted from the average value avgC to obtain the chromaticity difference vector diffC of the first sample, as shown in the following formula: diffC[k] = predC[k] - avgC (34)
[0344] Where k = 0, 1, ..., inSize-1. It can be seen that the chromaticity component difference vector corresponding to the first sample has inSize elements.
[0345] In the embodiments of this application, when determining the predicted value of the second image component of the current block, the predicted value of the second image component of the third sample is determined; based on the predicted value of the second image component of the third sample, the difference vector of the second image component of the first sample is determined; based on the difference vector of the second image component of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
[0346] In the embodiments of this application, when determining the second image component difference vector of the first sample, the predicted value of the second image component of the current block can also be selected from the second image component samples of the current block based on the first sample, that is, the predicted value of the second image component of the third sample in the current block is selected to determine the subsequent second image component difference vector.
[0347] In other words, in the embodiments of this application, the predicted value of the second image component used to determine the difference vector of the second image component can be adaptively selected and determined based on the first sample. That is, for different second image component samples to be predicted in the current block (such as the first sample), the predicted value of the second image component selected can be different.
[0348] In embodiments of this application, the third sample can be one or more second image component samples of the current block. That is, in embodiments of this application, the predicted values of a portion of the second image components of the current block can be selected based on the relevant information of the first sample to determine the second image component difference vector of the first sample.
[0349] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, one or more third samples of the current block can be determined first, and then the second image component difference vector of the first sample can be determined based on the second image component prediction value of the third sample.
[0350] In embodiments of this application, a third sample can be determined based on the location information of the first sample.
[0351] In embodiments of this application, a third sample can be determined based on the location information of the first sample and the location information of the current block.
[0352] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred[i][j], the position information of the first sample can be represented as chPos[i][j], and the position information of the current block can be the position of the top left corner color sample of the current chroma block relative to the top left corner color sample of the current image. For example, the position information of the current block can be represented as chromaPos=(x,y). Then, the third sample can be selected based on the position information of the first sample and the position information of the current block. For example, a region can be determined based on chPos[i][j] and chromaPos, and the chroma samples in that region can be determined as the third sample.
[0353] For example, in some embodiments, as shown in Figure 19, the position of the current chroma block is obtained, that is, the position of the top-left chroma sample of the current chroma block relative to the top-left chroma sample of the current image, chromaPos = (x, y). The region of the chroma prediction sub-information at the position of the current chroma block chPos[i][j] is a cross-shaped region centered at chPos[i][j] = (x+i, y+j). The sample positions in its chroma prediction sub-information region are: chPos[i][j] = (x+i, y+j), chPos[i-1][j] = (x-1+i, y+j), chPos[i+1][j] = (x+1+i, y+j), chPos[i][j-1] = (x+i+1, y-1+j), chPos[i][j+1] = (x+i, y+1+j).
[0354] In the embodiments of this application, a third sample can be determined based on the position information of the first sample, the second preset width, and the second preset height.
[0355] In embodiments of this application, a third sample can be determined based on the position information of the first sample and the position information of the current block, combined with a predetermined second preset width and a second preset height.
[0356] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the first sample can be represented as chPos[i][j], and the position information of the current block can be the position of the top left chroma sample of the current chroma block relative to the top left chroma sample of the current image. For example, the position information of the current block can be represented as chromaPos=(x,y). Then, the third sample can be selected based on the position information of the first sample, the position information of the current block, the second preset width w, and the second preset height h. For example, a region with a size of w×h can be determined based on yPos[i][j] and chromaPos, and the chroma samples in this region can be determined as the third sample.
[0357] For example, in some embodiments, as shown in Figure 20, the position of the current chroma block is obtained, that is, the position of the top-left chroma sample of the current chroma block relative to the top-left chroma sample of the current image, chromaPos = (x, y). The region of the chroma prediction sub-information at the position of the current chroma block chPos[i][j] is a 3×3 (w = 3, h = 3) region centered on chPos[i][j] = (x + i, y + j). The sample positions in its chromaticity prediction sub-information region are: chPos[i][j]=(x+i,y+j), chPos[i-1][j]=(x-1+i,y+j), chPos[i+1][j]=(x+1+i,y+j), chPos[i-1][j-1]=(x-1+i,y-1+j), chPos[i][j-1]=(x+i,y-1+j), chPos[i+1][j-1]=(x+1+i,y-1+j), chPos[i][j+1]=(x+i,y+1+j), chPos[i+1][j+1]=(x+1+i,y+1+j).
[0358] Therefore, in the embodiments of this application, the predicted value of the second image component in the input information of the cross-component prediction of the current block may include the predicted values of inSize second image components determined by the prediction input parameters in the prediction parameters, or it may include the predicted values of the second image components of one or more third samples determined by the first sample. This application does not make any specific limitations.
[0359] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the first parameter of the first sample is determined based on the difference vector of the second image components of the first sample and the prediction weight of the first sample, and the first accumulated parameter of the current block is determined based on the first parameter of the first sample; the second accumulated parameter of the current block is determined based on the prediction weight of the current block; the predicted value of the second image component of the first sample is determined based on the first accumulated parameter and the second accumulated parameter; and the predicted value of the second image component of the current block is determined based on the predicted value of the second image component of the first sample.
[0360] In some embodiments, the first parameter of the first sample can be determined by the second image component difference vector of the first sample and the prediction weight of the first sample. Specifically, for each second image component sample to be predicted in the current block, such as the first sample, the first parameter of the first sample can be determined by multiplying the second image component difference vector of the first sample with the prediction weight of the first sample.
[0361] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the prediction weight corresponding to the first sample is cWeightInt[i][j][k], the chromaticity difference vector of the first sample is diffC[k], then the first parameter subC[i][j][k] of the first sample can be obtained by referring to the following formula: subC[i][j][k]=(cWeightInt[i][j][k]×diffC[k]) (23)
[0362] Where k = 0, 1...inSize-1.
[0363] In some embodiments, the first accumulated parameter of the current block can be obtained by summing the first parameters of all the second image component samples (e.g., the first samples) to be predicted in the current block.
[0364] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the first parameter of the first sample is subC[i][j][k], and the first accumulated parameter of the current block can be expressed as...
[0365] In some embodiments, the prediction weights of the current block determine the second accumulated parameter of the current block by summing the prediction weights of all the second image component samples (e.g., the first samples) to be predicted in the current block.
[0366] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the prediction weight of the first sample is cWeightInt[i][j][k], and the second accumulated parameter of the current block can be expressed as...
[0367] In the embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first accumulation parameter and the second accumulation parameter, the second predicted value of the second image component of the first sample is determined based on the first accumulation parameter and the second accumulation parameter; the predicted value of the second image component of the first sample is determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
[0368] In some embodiments, the second predicted value of the second image component of the first sample can be understood as the prediction result of the second image component obtained by cross-component prediction of the first sample. Accordingly, based on the first predicted value and / or the second predicted value of the second image component of the first sample, the predicted value of the second image component of the first sample can be obtained. That is, by combining the initial predicted value of the second image component of the first sample and / or the predicted value of the second image component of the first sample obtained by cross-component prediction, the final predicted value of the second image component of the first sample can be obtained.
[0369] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the first accumulated parameter of the current block is The second accumulated parameter of the current block is For i = 0…predSizeW-1, j = 0…predSizeH-1, the second predicted value C of the chromaticity component of the first sample. pred [i][j] can be obtained using the following formula:
[0370] in, v=DivSigTable[normDiff]|(1<<Shift) (26) add=1<<y<<(Shift-1) (29)
[0371] The method of obtaining Shift includes, but is not limited to, the parameters determined by WCP. In the decoding specification text in the appendix, Shift is assigned the value 5.
[0372] The equation (25) for x corresponds to x = Floor(Log2(sum)) in the decoded canonical text.
[0373] The formula (26) for v corresponds to divSigTable[normDiff]|32 when Shift=5 is the value of the decoded canonical text.
[0374] Equation (27) of normDiff corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decoded norm text.
[0375] The equation (28) for y corresponds to x+=(normDiff!=0)? 1:0 in the decoding specification text in the appendix.
[0376] The formula (21) for add corresponds to add = 1 << x << 4 when Shift = 5 in the decoded canonical text.
[0377] DivSigTable is a predefined array related to Shift. DivSigTable corresponds to divSigTable[] = {0,15,14,13,12,12,11,10,10,9,8,8,7,7,6,6,5,5,4,4,4,3,3,3,2,2,2,1,1,1,1,0} in the decoded canonical text.
[0378] Func() is a function related to Shift. Its input is the sum of the weight vectors and x calculated by equation (17), and its output is the index value of DivSigTable[].
[0379] Here is an example of a specific form of Func(), as shown below:
[0380] The corresponding normDiff for decoding the standard text is ((sum<<5)>>x)&31 when Shift=5.
[0381] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component, the predicted average value of the second image component of the first sample and the difference vector of the second image component of the first sample can also be determined based on the first predicted value of the second image component; the predicted value of the second image component of the current block can be determined based on the predicted average value of the second image component of the first sample, the difference vector of the second image component of the first sample and the prediction weight of the current block.
[0382] For example, in some embodiments, a first parameter of the first sample can be determined based on the difference vector of the second image components of the first sample and the prediction weight of the first sample, and a first accumulated parameter of the current block can be determined based on the first parameter of the first sample; a second accumulated parameter of the current block can be determined based on the prediction weight of the current block; based on the first accumulated parameter and the second accumulated parameter; a second predicted value of the second image component of the first sample can be determined based on the first accumulated parameter, the second accumulated parameter and the predicted average value of the second image components of the first sample; and a predicted value of the second image component of the first sample can be determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
[0383] In other words, in the embodiments of this application, in the process of determining the predicted value of the second image component of the current block, the average predicted value of the second image component of the first sample can also be introduced to improve the calculation accuracy.
[0384] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the first accumulated parameter of the current block is The second accumulated parameter of the current block is The average chromaticity component of the first sample is avgC, and the second predicted value of the chromaticity component of the first sample is C. pred [i][j] can be obtained using the following formula:
[0385] In embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, the predicted value of the second image component of the first sample is determined based on the first weight of the first predicted value of the second image component of the first sample, the second weight of the second predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample, and the second predicted value of the second image component of the first sample.
[0386] In some embodiments, when determining the predicted value of the final second image component of the first sample, it is possible to choose to refer only to the first predicted value of the second image component of the first sample, or to choose to refer only to the second predicted value of the second image component of the first sample.
[0387] In embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, the second predicted value of the second image component of the first sample is determined as the predicted value of the second image component of the first sample.
[0388] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the second predicted value of the chrominance component can be directly used as the final chrominance predicted value.
[0389] In the embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, a second preset processing is performed on the second predicted value of the second image component of the first sample to determine the predicted value of the second image component of the first sample; wherein, the second preset processing includes at least one or more of the following: correction processing based on a first upper limit threshold; correction processing based on a first lower limit threshold; rounding processing; and rounding to the nearest integer.
[0390] In embodiments of this application, the first upper limit threshold may be greater than or equal to the first lower limit threshold.
[0391] In other words, in the embodiments of this application, a second preset processing can be performed on the second predicted value of the second image component of the current block to determine the predicted value of the second image component of the first sample; wherein, the second preset processing includes at least one or more of the following: correction processing based on a first upper limit threshold; correction processing based on a first lower limit threshold; rounding processing; and rounding to the nearest integer.
[0392] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the second predicted value of the chrominance component can be simply corrected (a second preset processing) to obtain the final chrominance predicted value. For example, the second predicted value of the chrominance component can be rounded to obtain the final chrominance predicted value, or the second predicted value of the chrominance component can be clamped using a first upper limit threshold, or the second predicted value of the chrominance component can be clamped using a first lower limit threshold, etc.
[0393] In some embodiments, when determining the final predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample and the second predicted value of the second image component of the first sample can be weighted and fused to obtain the final predicted value of the second image component.
[0394] In the embodiments of this application, the specific values of the first weight and the second weight are not specifically limited, and the sum of the first weight and the second weight can be 1.
[0395] In the embodiments of this application, the ratio between the first weight and the second weight is determined to be a first value.
[0396] In some embodiments, the ratio between the first weight and the second weight corresponding to the first predicted value of the second image component of the first sample and the second predicted value of the second image component of the first sample can be preset to a fixed value, such as a first value.
[0397] For example, in some embodiments, the specific value of the first numerical value is not limited in this application. For example, the first numerical value can be 3, or the first numerical value can be 0, or the first numerical value can be 2, or the first numerical value can be 1 / 3.
[0398] In the embodiments of this application, a first image component residual value corresponding to a first sample is determined; a first weight and a second weight are determined based on the first image component residual value corresponding to the first sample.
[0399] In some embodiments, the first weight and the second weight can also be adaptively determined based on the residual value of the first image component corresponding to the first sample. That is, for different second image component samples to be predicted in the current block, the first weight and the second weight used can be different.
[0400] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the weighting weight is determined based on the residual value of the luminance sample corresponding to the chrominance sample location. For instance, the smaller the residual value, the more accurate the chrominance sample prediction at the corresponding location is considered, and the larger the weighting weight (first weight) of the chrominance prediction value (the first predicted chrominance value) is; conversely, the larger the residual value, the less accurate the chrominance sample prediction at the corresponding location is considered, and the smaller the weighting weight (first weight) of the chrominance prediction value (the first predicted chrominance value) is.
[0401] In the embodiments of this application, the bitstream is decoded to determine the first syntax element identification information; and the first weight and the second weight are determined based on the first syntax element identification information.
[0402] In some embodiments, the first weight and the second weight can also be adaptively determined based on the parsed first syntax element identification information. That is, for different second image component samples to be predicted in the current block, the first weight and the second weight determined based on the parsed first syntax element identification information can be different.
[0403] For example, in some embodiments, the encoder transmits first syntax element identification information to indicate the weighted weight allocation between the first predicted value and the second predicted value. For instance, when the value of the first syntax element identification information is 0, it indicates that both the first weight and the second weight are 0.5; when the value of the first syntax element identification information is 1, it indicates that the first weight is 0.75 and the second weight is 0.25; when the value of the first syntax element identification information is 2, it indicates that the first weight is 0.25 and the second weight is 0.75.
[0404] In the embodiments of this application, after determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, a third preset processing can be performed on the predicted value of the second image component of the first sample, wherein the third preset processing includes at least one or more of the following: correction processing based on a second upper limit threshold; correction processing based on a second lower limit threshold.
[0405] In embodiments of this application, the second upper limit threshold may be greater than or equal to the second lower limit threshold.
[0406] In other words, in the embodiments of this application, the predicted value of the second image component of the first sample can be clamped by the second upper limit threshold and / or the second lower limit threshold, so that the predicted value of the second image component of the first sample is within the limited range formed by the second upper limit threshold and / or the second lower limit threshold.
[0407] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the chrominance prediction value of the first sample should be within a defined range; if it exceeds this range, a corresponding correction operation should be performed. For example, a clamping operation can be performed on the chrominance prediction value of the first sample, using C... pred [i][j] represents the third chromaticity prediction value, when C pred When the value of [i][j] is less than 0, it is set to 0; when C pred When the value of [i][j] is greater than (1 << BitDepth) - 1, it is set to (1 << BitDepth) - 1. Here, BitDepth is the bit depth required for the chroma pixel value, ensuring that the third predicted value is between 0 and (1 << BitDepth) - 1, i.e.: C pred [i][j]=Clip3(0,(1<<BitDepth)-1,C pred [i][j]) (31)
[0408] In the embodiments of this application, after obtaining the predicted value of the second image component of the current block based on weight derivation, post-processing operations can be performed on the output predicted value of the second image component to further improve the accuracy of the prediction. These post-processing operations may include, but are not limited to, filtering.
[0409] In the embodiments of this application, taking the first image component as the luminance component and the second image component as the chrominance component as an example, the prediction output parameter is determined to be predSizeW×predSizeH based on the prediction parameters. If predSizeW×predSizeH is less than or equal to the size nTbW×nTbH of the current block (i.e., the original chrominance block), then post-processing can be performed.
[0410] In some embodiments, for post-processing operations on the chromaticity prediction value of the current block, the output size (predSizeW×predSizeH) of the current block is determined. If the output size of the current block is equal to the size of the current block, the current block is directly filtered and enhanced, and the result after filtering and enhancement is used as the final prediction result.
[0411] In some embodiments, for post-processing the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the current block size, the current block is first upsampled to obtain an upsampled prediction block, which is restored to the same size as the current block. Then, the upsampled prediction block is filtered and enhanced, and the result of the enhanced filtering is used as the final prediction result.
[0412] In some embodiments, for post-processing the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the size of the current block, the upsampled and filtered prediction block is first enhanced to obtain an enhanced prediction block. Then, the enhanced prediction block is upsampled and filtered again to obtain a second prediction block, which is restored to the same size as the current block, thus obtaining the final prediction result.
[0413] Therefore, in the embodiments of this application, when performing post-processing operations on the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the size of the current block, the execution order of the current block can be determined first. The execution order of the current block can include a first execution order and a second execution order. The first execution order is: first, upsample filtering is performed on the current block, and then filtering enhancement is performed on the upsampled prediction block; the second execution order is: first, filtering enhancement is performed on the current block, and then upsample filtering is performed on the enhanced prediction block.
[0414] In the embodiments of this application, the post-processing operation on the predicted values of the output second image component fully considers the case where predSizeW×predSizeH is less than or equal to nTbW×nTbH. When predSizeW×predSizeH is less than nTbW×nTbH, upsampling filtering is required. In addition, filtering enhancement can be performed on the chroma prediction blocks output by WCP that have undergone upsampling filtering and those that do not require upsampling filtering (when predSizeW×predSizeH is equal to nTbW×nTbH). The bilateral filtering method used has edge-preserving noise reduction characteristics and can further improve the accuracy of chroma prediction.
[0415] Therefore, the decoding method proposed in this application can adjust the prediction process of Inter CCCM. Specifically, weighted chromaticity prediction is introduced into the Inter CCCM prediction. The weight vector (prediction weight) for each chromaticity prediction sample position is determined by the luminance difference vector, and since the luminance difference vector is different for each chromaticity prediction sample position, this overcomes the limitation of single and fixed model coefficients in Inter CCCM, improving prediction flexibility and thus enhancing prediction accuracy.
[0416] This application provides a decoding method that can also be used in other prediction modes based on block vectors (BV), such as chroma blocks encoded in IntraTMP mode. The difference lies in the source of the BV corresponding to the chroma block. In Inter and IBC scenarios, single-tree partitioning is common, with strict correspondence between luminance and chroma block regions, and their MV / BV information is completely corresponding. In IntraTMP mode, dual-tree partitioning may be used, and chroma block and luminance block regions often do not correspond strictly. The BV of the chroma block may originate from a sub-region of the corresponding luminance region, or from luminance and chroma blocks in adjacent regions.
[0417] This application provides a decoding method in which the decoder determines the prediction parameters of the current block; based on the prediction parameters of the current block, it determines the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block; based on the reconstructed value and the predicted value of the first image component, it determines the prediction weight of the current block; and based on the prediction weight of the current block and the first predicted value of the second image component, it determines the predicted value of the second image component of the current block. Therefore, in the embodiments of this application, when performing cross-component prediction on the current block, the prediction weight for cross-component prediction can be determined based on the reconstructed value and the predicted value of the first image component, and the predicted value of the second image component can be further derived based on the prediction weight. In other words, this application can introduce a weight-based prediction model into the inter-frame cross-component prediction process, improving the prediction accuracy and thus enhancing encoding and decoding performance.
[0418] In one embodiment of this application, FIG21 is a schematic flowchart of an encoding method proposed in an embodiment of this application. As shown in FIG22, the encoding method of the encoder may include:
[0419] Step 201: Determine the prediction parameters for the current block.
[0420] It should be noted that, in the embodiments of this application, the encoding method is applied to an encoder. Specifically, based on the composition structure of the encoder 100, the encoding method in the embodiments of this application can mainly include a cross-component prediction method, which can improve encoding and decoding performance.
[0421] In embodiments of this application, the current block can be an image block to be encoded in the current image.
[0422] In the embodiments of this application, the prediction parameters of the current block can be determined first. These prediction parameters can be used to perform cross-component prediction processing on the current block.
[0423] In some embodiments, the prediction parameters of the current block include at least one or more of the following: control parameters; prediction input parameters; prediction output parameters; a lookup table-based weight model; and a maximum weight model index.
[0424] In the embodiments of this application, the control parameters include the WCP control parameters (S) of the current block. The value of the control parameters for the current block is not specifically limited in this application.
[0425] In some embodiments, the control parameters may be used to adjust the nonlinear function in subsequent stages and / or to adjust the data involved in subsequent stages, and this application does not impose specific limitations.
[0426] In the embodiments of this application, the predicted input parameters may be determined based on the current block or may be preset, and this application does not impose any specific limitations.
[0427] In some embodiments, the prediction input parameters include the number of prediction inputs inSize, which is the number of reference samples input when performing cross-component prediction for the current block.
[0428] In the embodiments of this application, the predicted output parameters may be determined based on the current block or may be preset, and this application does not impose any specific limitations.
[0429] In some embodiments, the prediction output parameters include the number of prediction outputs. For example, the prediction output parameters can be represented as predSizeW × predSizeH. Here, predSizeW and predSizeH can be the same or different.
[0430] For example, in some examples, the width of the current block is nTbW and the height of the current block is nTbH, then it can be determined that predSizeW = nTbW and predSizeH = nTbH.
[0431] In some embodiments, the predicted output parameters can be determined based on control parameters. For example, the control parameter is S, and predSizeW = predSizeH = S / 4.
[0432] In embodiments of this application, the lookup table-based weight model may include a weight model LUT.
[0433] In some embodiments, the weight model based on the lookup table can be predefined or calculated in real time based on control parameters. This application does not impose any specific limitations.
[0434] In embodiments of this application, the maximum weight model index is used to determine the number of weights in a lookup table-based weight model. Specifically, for a weight model LUT, the maximum weight model index can be the maximum index of the weight model LUT, theMaxPos.
[0435] In some embodiments, the value of the maximum weight model index can be fixed or can be adaptively set for different lookup table-based weight models; this application does not impose any specific limitations.
[0436] In the embodiments of this application, the prediction parameters of the current block may correspond to the size information and / or image information of the current block, that is, for different blocks to be predicted in the current image, the corresponding prediction parameters may be different.
[0437] In some embodiments, the prediction parameters for the current block can be determined based on the size information of the current block.
[0438] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 5 can be referred to.
[0439] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, then the control parameter S can be determined to be 12, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies min(nTbW,nTbH) > 16, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0440] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, and the prediction parameters of the current block include the control parameter S, the prediction input parameter inSize, and the prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 6 can be referred to.
[0441] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, then the control parameter S can be determined to be 12, the prediction input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the current block size information satisfies min(nTbW,nTbH) > 16, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0442] In some embodiments, the prediction parameters for the current block can be determined based on the image information of the current block. This image information may include, but is not limited to, the number of pixels in the current block.
[0443] For example, in some embodiments, the image information of the current block includes the number of pixels of the current block nTbH×nTbW, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 7 can be referred to.
[0444] Specifically, if the image information of the current block satisfies (nTbW×nTbH)<128, then the control parameter S can be determined to be 10, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies 128<=(nTbW×nTbH)<=256, then the control parameter S can be determined to be 8, the prediction input parameter inSize is nTbW×nTbH, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies (nTbW×nTbH)>256, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0445] For example, in some embodiments, the image information of the current block includes the number of pixels of the current block nTbH×nTbW, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 8 can be referred to.
[0446] Specifically, if the image information of the current block satisfies (nTbW×nTbH)<64, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies 64<=(nTbW×nTbH)<=512, then the control parameter S can be determined to be 4, the prediction input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW; if the image information of the current block satisfies (nTbW×nTbH)>512, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0447] In some embodiments, when determining the prediction parameters of the current block, the block type of the current block is determined based on the size parameters of the current block; and the control parameters, prediction input parameters, and prediction output parameters are determined based on the block type of the current block.
[0448] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 9 can be referred to.
[0449] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, and the corresponding block type is type 0, then the control parameter S can be determined to be 8, the prediction input parameter inSize to be nTbH × nTbW, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, and the corresponding block type is type 1, then the control parameter S can be determined to be 12. The prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the size information of the current block satisfies min(nTbW,nTbH)>16, and the corresponding block type is type 2, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0450] For example, in some embodiments, the size information of the current block includes the width nTbW and the height nTbH of the current block, the block type of the current block includes 0, 1, and 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 10 can be referred to.
[0451] Specifically, if the current block size information satisfies min(nTbW,nTbH) ≤ 4, and the corresponding block type is type 0, then the control parameter S can be determined to be 8, the prediction input parameter inSize to be nTbH × nTbW, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW; if the current block size information satisfies 4 < min(nTbW,nTbH) ≤ 16, and the corresponding block type is type 1, then the control parameter S can be determined to be 12, and the prediction output parameter predSizeW × predSizeH to be nTbH × nTbW. The input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the size information of the current block satisfies min(nTbW,nTbH)>16, and the corresponding block type is type 2, then the control parameter S can be determined to be 16, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0452] In some embodiments, when determining the prediction parameters of the current block, the block type of the current block is determined based on the image information of the current block; control parameters, prediction input parameters, and prediction output parameters are determined based on the block type of the current block.
[0453] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW of the current block, the block type of the current block includes 0, 1, 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 11 can be referred to.
[0454] Specifically, if the image information of the current block satisfies (nTbW×nTbH) < 128, and the corresponding block type is type 0, then the control parameter S can be determined to be 10, the prediction input parameter inSize to be nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW; if the image information of the current block satisfies 128 ≤ (nTbW×nTbH) ≤ 256, and the corresponding block type is type 1, then the control parameter S can be determined to be... 8. The prediction input parameter inSize is nTbW×nTbH, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the image information of the current block satisfies (nTbW×nTbH)>256, and the corresponding block type is type 2, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0455] For example, in some embodiments, the image information of the current block includes the number of pixels nTbH×nTbW of the current block, the block type of the current block includes 0, 1, 2, and the prediction parameters of the current block include control parameter S, prediction input parameter inSize, and prediction output parameter predSizeW×predSizeH. When determining the prediction parameters of the current block based on the size information of the current block, Table 12 can be referred to.
[0456] Specifically, if the image information of the current block satisfies (nTbW×nTbH) < 64, and the corresponding block type is type 0, then the control parameter S can be determined to be 16, the prediction input parameter inSize to be nTbH×nTbW, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW; if the image information of the current block satisfies 64 ≤ (nTbW×nTbH) ≤ 512, and the corresponding block type is type 1, then the control parameter S can be determined to be 4, and the prediction output parameter predSizeW×predSizeH to be nTbH×nTbW. The input parameter inSize is nTbH / 2×nTbW / 2, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW. If the image information of the current block satisfies (nTbW×nTbH)>512, and the corresponding block type is type 2, then the control parameter S can be determined to be 1, the prediction input parameter inSize is nTbH / 4×nTbW / 4, and the prediction output parameter predSizeW×predSizeH is nTbH×nTbW.
[0457] In the embodiments of this application, the prediction parameters of the current block may include, but are not limited to, weighting coefficient method multiples (such as ModelScale), etc., and this application does not impose specific limitations.
[0458] Step 202: Determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block.
[0459] In the embodiments of this application, after determining the prediction parameters of the current block, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block can be further determined based on the prediction parameters of the current block.
[0460] In the embodiments of this application, the chromaticity component of the current block can be determined using the luminance component of the current block, or the luminance component of the current block can be determined using the chromaticity component of the current block. This application does not impose any specific limitations.
[0461] In some embodiments, the first image component can be a luminance component, typically denoted by the symbol Y. The second image component can be a chrominance component, which may include a blue chrominance component (typically denoted by the symbols Cb or U) or a red chrominance component (typically denoted by the symbols Cr or V).
[0462] In some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, then the reconstructed value of the first image component of the current block can be the reconstructed value of the luminance component of the current block; the predicted value of the first image component of the current block can be the predicted value of the luminance component of the current block; and the first predicted value of the second image component of the current block can be the first predicted value of the chrominance component of the current block.
[0463] In some embodiments, the first predicted value of the second image component of the current block can be understood as the initial predicted value of the chroma component of the current block obtained by inter-frame prediction or by intra-frame block copying.
[0464] In embodiments of this application, based on the motion vector of the current block, the reconstructed value of the second image component of the reference block is determined in the reference image of the current image; based on the reconstructed value of the second image component of the reference block, the first predicted value of the second image component of the current block is determined.
[0465] For example, in some embodiments, when obtaining the first predicted value of the second image component of the current block, a reference block of the current block can be determined in a reference image of the current image based on the motion vector of the current block; then, the first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block of the current block.
[0466] In embodiments of this application, based on the block vector of the current block, the reconstructed value of the second image component of the reference block is determined in the current image; based on the reconstructed value of the second image component of the reference block, the first predicted value of the second image component of the current block is determined.
[0467] For example, in some embodiments, when obtaining the first predicted value of the second image component of the current block, it is also possible to select a reference block of the current block in the current image based on the block vector of the current block; and then determine the first predicted value of the second image component of the current block based on the reconstructed value of the second image component of the reference block of the current block.
[0468] In the embodiments of this application, when determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the number of samples is determined based on the prediction input parameters; the reconstructed value of the first image component, the predicted value of the first image component, and the first predicted value of the second image component are determined based on the number of samples.
[0469] In embodiments of this application, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block can be used as input information for cross-component prediction of the current block.
[0470] For example, in some embodiments, assuming the prediction input parameter is inSize, the number of samples to be referenced can be determined to be inSize, that is, inSize samples in the current block are used as input. For example, the reconstructed values of inSize first image components of inSize samples in the current block, the predicted values of inSize first image components of inSize samples in the current block, and the first predicted values of inSize second image components of inSize samples in the current block can be used as input information for cross-component prediction of the current block.
[0471] In some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, and the number of samples determined based on the prediction input parameters is inSize, then the obtained input information may include inSize luminance reconstruction information (luminance reconstruction value) recY of the current block, inSize luminance prediction information (luminance prediction value) predY of the current block, and inSize chrominance prediction information (chrominance prediction value) predC of the current block.
[0472] In embodiments of this application, when determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the initial reconstructed value of the first image component of the current block can be downsampled so that the final reconstructed value of the first image component of the current block satisfies the prediction parameters of the current block; and / or, the initial predicted value of the first image component of the current block can be downsampled so that the final predicted value of the first image component of the current block satisfies the prediction parameters of the current block; and / or, the initial predicted value of the second image component of the current block can be downsampled so that the final predicted value of the second image component of the current block satisfies the prediction parameters of the current block.
[0473] For example, in some embodiments, if the resolution of the luminance component and the chrominance component is inconsistent, for example, if the luminance component and / or chrominance component of the current block do not meet the prediction output parameter inSize of the current block, then it is necessary to downsample the luminance prediction information and luminance reconstruction information of the current block that have not been downsampled to obtain luminance reconstruction information recY and luminance prediction information predY of inSize number for cross-component prediction.
[0474] In some embodiments, as shown in Figure 15, the downsampling methods that can be used are as shown in the figure.
[0475] For example, in some embodiments, it is assumed that the first image component is the luminance component and the second image component is the chrominance component. The chrominance sample coordinates are (xC, yC) and the corresponding unsampled luminance sample coordinates are (xL, yL). The correspondence between the position coordinates of the chrominance sample and the luminance sample determined based on different chrominance sampling formats (color sampling formats) is shown in Table 13.
[0476] Wherein, `sps_chroma_format_idc` is the identifier for the chroma sampling format, used to determine the chroma sampling format. Assuming the luminance sample before downsampling is `BefDownLuma` and the luminance sample after downsampling is `AftDownLuma`, the downsampled luminance sample corresponding to the chroma sample position (xC, yC) can be obtained using the following downsampling method:
[0477] An example of downsampling is: AftDownLuma[xC][yC]=((BefDownLuma[xL][yL]×2)+BefDownLuma[xL+1][yL]+BefDownLuma[xL-1][yL]+(BefDownLuma[xL][yL+1]×2)+BefDownLuma[xL+1][yL+1]+BefDownLuma[xL-1][yL+1]+4)>>3
[0478] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+1)>>1
[0479] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL][yL+1]+1)>>1
[0480] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+1)>>1
[0481] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL+1][yL]+BefDownLuma[xL+1][yL+1]+1)>>1
[0482] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+2)>>2.
[0483] The coordinates of the unsampled brightness sample (xL, yL) can be calculated based on Table 13.
[0484] In the embodiments of this application, the input information for cross-component prediction, such as: inSize number of reference chromaticity information refC (predicted value of the second image component), and / or, inSize number of reference luminance information refY (predicted value of the first image component), and / or, luminance reconstruction information recY of the current prediction block (reconstructed value of the first image component), can be refC, and / or, refY, and / or, recY after preprocessing operations.
[0485] In the embodiments of this application, if one or more of refC, refY, and recY do not satisfy inSize, or if the number of refC, refY, and recY is different, it is necessary to perform filtering processing on one or more of refC, refY, and recY, that is, to perform preprocessing, so as to ensure that the input information for cross-component prediction all satisfy the inSize number.
[0486] In other words, for the input information of cross-component prediction of the current block, it is possible to filter only the predicted value of the first image component of the current block, or only the predicted value of the second image component of the current block, or only the reconstructed value of the first image component of the current block, or any two of them, or even all three of them. This application embodiment does not make any limitation.
[0487] For example, in some embodiments, as shown in FIG16, if the number of samples determined based on the prediction input parameters is inSize, then the obtained input information may include inSize luminance reconstruction information (luminance reconstruction value) recY of the current block, inSize luminance prediction information (luminance prediction value) predY of the current block, and inSize chrominance prediction information (chrominance prediction value) predC of the current block.
[0488] Step 203: Determine the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component.
[0489] In the embodiments of this application, after determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block, the prediction weight of the current block can be further determined based on the reconstructed value of the first image component and the predicted value of the first image component.
[0490] In embodiments of this application, the prediction weight of the current block includes the prediction weight of samples of at least one image component to be predicted in the current block. The prediction weight can be represented as a weight vector.
[0491] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, and the luminance component is used to predict the corresponding chrominance component for the current block, then the prediction weight of the current block may include the prediction weight of at least one chrominance component sample of the current block, wherein each chrominance sample (chrominance component sample) corresponds to a set of weight vectors.
[0492] In the embodiments of this application, when determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component, the first image component difference vector of the first sample is determined based on the reconstructed value and the predicted value of the first image component; the prediction weight of the first sample is determined based on the first image component difference vector of the first sample; and the prediction weight of the current block is determined based on the prediction weight of the first sample.
[0493] In the embodiments of this application, the first sample is any second image component sample of the current block. Taking the second image component as a chroma component as an example, the first sample can be any chroma component sample to be predicted in the current block.
[0494] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample of the current block, the luminance component difference vector of the chrominance component sample can be determined first based on the reconstructed value and the predicted value of the luminance component of the current block. Then, the prediction weight of the chrominance component sample is determined based on the luminance component difference vector of the chrominance component sample; for the chrominance component samples to be predicted in the current block, the corresponding luminance component difference vector and prediction weight are determined sequentially, and finally, the prediction weight of the current block can be determined.
[0495] In the embodiments of this application, when determining the first image component difference vector of the first sample based on the reconstructed value of the first image component and the predicted value of the first image component, the reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed value of the first image component; the first image component difference vector of the first sample is determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component.
[0496] In embodiments of this application, the first image component difference vector of the first sample can be determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the current block.
[0497] For example, in some embodiments, assuming that the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample of the current block, such as the first sample, the luminance component difference vector corresponding to the first sample can be determined based on the reconstructed value of the luminance component corresponding to the first sample and the predicted value of the luminance component of the current block.
[0498] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the brightness reconstruction information (reconstructed value of brightness component) corresponding to the first sample is recY[i][j]. The predicted value of the brightness component of the current block includes inSize brightness prediction information predY of inSize samples of the current block. Then, we can choose to perform difference operation on the brightness reconstruction information corresponding to the first sample and the inSize brightness prediction information of the current block respectively to obtain inSize difference results, and determine the brightness component difference vector diffY[i][j][k] corresponding to the first sample based on the inSize difference results, referring to the following formula: diffY[i][j][k]=Abs(predY[k]-recY[i][j]) (32)
[0499] Where k = 0, 1...inSize-1. It can be seen that the luminance component difference vector corresponding to the first sample has inSize elements.
[0500] In the embodiments of this application, when determining the first image component difference vector of the first sample, the reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed value of the first image component; the predicted value of the first image component of the second sample is determined; and the first image component difference vector of the first sample is determined based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the second sample.
[0501] In the embodiments of this application, when determining the first image component difference vector of the first sample, the predicted value of the first image component of the current block can also be selected from the first image component samples of the current block based on the first sample, that is, the predicted value of the first image component of the second sample in the current block is selected to determine the subsequent first image component difference vector.
[0502] In other words, in the embodiments of this application, the predicted value of the first image component used to determine the first image component difference vector can be adaptively selected and determined based on the first sample. That is, for different second image component samples to be predicted in the current block (such as the first sample), the predicted value of the first image component selected can be different.
[0503] In embodiments of this application, the second sample can be one or more first image component samples of the current block. That is, in embodiments of this application, the first image component difference vector of the first sample can be determined by selecting the predicted values of a portion of the first image components of the current block based on the relevant information of the first sample.
[0504] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, one or more second samples of the current block can be determined first, and then the first image component difference vector of the first sample can be determined based on the predicted value of the first image component of the second sample.
[0505] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample.
[0506] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample and the position information of the current block. The first image component sample corresponding to the first sample can be understood as the first image component sample corresponding to the position of the first sample.
[0507] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the luminance component sample corresponding to the first sample can be represented as yPos[i][j]. The position information of the current block can be the position of the upper left luminance sample of the current luminance block relative to the upper left luminance sample of the current image. For example, the position information of the current block can be represented as lumaPos=(xCb,yCb). Then, the second sample can be selected based on the position information of the luminance component sample corresponding to the first sample and the position information of the current block. For example, a region can be determined based on yPos[i][j] and lumaPos, and the luminance sample in the region can be determined as the second sample.
[0508] For example, in some embodiments, as shown in Figure 17, the position of the current luminance block is obtained, that is, the position of the upper left corner luminance sample of the current luminance block relative to the upper left corner luminance sample of the current image, lumaPos = (xCb, yCb). The luminance prediction sub-information region at the position yPos[i][j] of the downsampled luminance reconstruction block is a cross-shaped region centered on yPos[i][j] = (xCb+i, yCb+j). The sample positions in its luminance prediction sub-information region are: yPos[i][j] = (xCb+i, yCb+j), Pos[i-1][j] = (xCb-1+i, yCb+j), yPos[i+1][j] = (xCb+1+i, yCb+j), yPos[i][j-1] = (xCb+i, yCb-1+j), yPos[i][j+1] = (xCb+i, yCb+1+j).
[0509] In the embodiments of this application, the second sample can be determined based on the position information, the first preset width, and the first preset height of the first image component sample corresponding to the first sample.
[0510] In embodiments of this application, a second sample can be determined based on the position information of the first image component sample corresponding to the first sample and the position information of the current block, combined with a predetermined first preset width and a first preset height. The first image component sample corresponding to the first sample can be understood as the first image component sample corresponding to the position of the first sample.
[0511] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the luminance component sample corresponding to the first sample can be represented as yPos[i][j]. The position information of the current block can be the position of the upper left luminance sample of the current luminance block relative to the upper left luminance sample of the current image. For example, the position information of the current block can be represented as lumaPos=(xCb,yCb). Then, the second sample can be selected based on the position information of the luminance component sample corresponding to the first sample, the position information of the current block, the first preset width w, and the first preset height h. For example, a region with a size satisfying w×h can be determined based on yPos[i][j] and lumaPos, and the luminance sample in this region can be determined as the second sample.
[0512] For example, in some embodiments, as shown in Figure 18, the position of the current luminance block is obtained, that is, the position of the upper left corner luminance sample of the current luminance block relative to the upper left corner luminance sample of the current image, lumaPos = (xCb, yCb). The luminance prediction sub-information region at the position yPos[i][j] of the downsampled luminance reconstruction block is a 3×3 (w = 3, h = 3) region centered on yPos[i][j] = (xCb+i, yCb+j). The sample positions in its luminance prediction sub-information region are: yPos[i][j] = (xCb+i, yCb+j), yPos[i-1][j] = (xCb-1+i, yCb+j), yPos[i+1][j] = (xCb+1+i, yCb+j), yPos[i-1][j-1] = (xCb-1+i, yCb-1+j), yPos[i ... ]=(xCb+i,yCb-1+j)、yPos[i+1][j-1]=(xCb+1+i,yCb-1+j)、yPos[i-1][j+1]=(xCb-1+ i,yCb+1+j), yPos[i][j+1]=(xCb+i,yCb+1+j), yPos[i+1][j+1]=(xCb+1+i,yCb+1+j).
[0513] Therefore, in the embodiments of this application, the predicted value of the first image component in the input information of the cross-component prediction of the current block may include the predicted values of inSize first image components determined by the prediction input parameters in the prediction parameters, or it may include the predicted values of the first image components of one or more second samples determined by the first samples. This application does not impose any specific limitations.
[0514] In the embodiments of this application, after determining the first image component difference vector of the first sample, a first preset processing can be performed on the first image component difference vector of the first sample; wherein, the first preset processing includes at least one or more of the following: linear processing; nonlinear processing; reduction processing; and magnification processing.
[0515] In other words, in the embodiments of this application, in order to obtain a weight vector with discriminative power in the subsequent calculation of the weight vector, a first preset processing can be performed on the first image component difference vector of the determined first sample.
[0516] For example, in some embodiments, the first image component difference vector of the first sample may be linearly processed, or the first image component difference vector of the first sample may be nonlinearly processed.
[0517] For example, in some embodiments, the first image component difference vector of the first sample can be reduced based on the control parameter S, or the first image component difference vector of the first sample can be enlarged based on the control parameter S.
[0518] In the embodiments of this application, when determining the prediction weight of the first sample based on the first image component difference vector of the first sample, the weight index of the first sample is determined based on the first image component difference vector of the first sample; and the prediction weight of the first sample is determined based on the weight model based on the lookup table and the weight index of the first sample.
[0519] In some embodiments, the lookup table-based weighting model can be a non-linear weighting model, such as using a non-linear Softmax function as the weighting model.
[0520] In the embodiments of this application, the weight model based on the lookup table can determine the corresponding prediction weight, i.e., the weight vector, for the first image component difference vector.
[0521] For example, in an embodiment of this application, assuming the first image component is a luminance component, for the first sample C to be predicted... pred [i][j], based on the first image component difference vector (brightness difference vector) corresponding to the first sample as diffY[i][j], based on the first image component difference vector and the weight model based on the lookup table, the predicted weight of the first sample can be determined, that is, the integer weight vector cWeightInt[i][j] corresponding to the first sample.
[0522] In the embodiments of this application, a weight model (weight model LUT) based on a lookup table can be obtained first.
[0523] For example, in some embodiments, a nonlinear Softmax function can be used as the weight model. The method for obtaining the weight model LUT in this case includes, but is not limited to, the following: theMaxPos = 1 << BitDepth-1 (11)
[0524] The value of the maximum weight model index theMaxPos includes, but is not limited to, the value calculated according to equation (11), and it can be a parameter determined in the WCP core parameters.
[0525] For example, in some embodiments, for n = 0, 1…theMaxPos LUT[n] = Round(e -n ×ModelScale) (12)
[0526] The value of ModelScale includes, but is not limited to, the parameter determined by the WCP core parameters. It represents the amplification factor of the weight coefficient and is a pre-set constant.
[0527] For example, in some embodiments, assuming the first image component is a luminance component, for k = 0, 1...inSize-1, the weight index of the first sample can be determined by the corresponding first image component difference vector (luminance difference vector) as diffY[i][j], and finally determined by the integer weight vector cWeightInt[i][j] corresponding to the first sample by combining the weight model based on the lookup table, referring to the following formula: index = Clip3(0,theMaxPos,diffY[i][j][k]) (13) cWeightInt[i][j][k] = LUT[index] (14)
[0528] For example, in some embodiments, the weight model can be adjusted according to the WCP control parameter (S) in the core parameters. For instance, when the current predicted block size is flexible, the weight model can be adjusted according to the WCP control parameter (S). Taking the nonlinear Softmax function as an example, different scale parameter adjustment functions can be selected according to the different block classification categories to which the current predicted block belongs. The methods for obtaining the weight model LUT at this time include, but are not limited to, the following: theMaxPos=1<<BitDept<<-1 (11)
[0529] The value of theMaxPos includes, but is not limited to, the value calculated according to equation (11). It can be a parameter determined in the WCP core parameters and can be assigned different values with different WCP control parameters (S), i.e., theMaxPos[S].
[0530] For n = 0, 1, ..., the MaxPos
[0531] The value of ModelScale includes, but is not limited to, the parameters determined by the WCP core parameters, which represent the amplification factor of the weight coefficients. For k = 0, 1...inSize-1, index = Clip3(0,theMaxPos,f(S,diffY[i][j][k])) (16) cWeightInt[i][j][k] = LUT[S][index] (17)
[0532] Here, f() refers to a function of the WCP control parameter S and the brightness difference diffY[i][j][k], and its output is the index of the LUT.
[0533] Here, f() includes, but is not limited to, the implementation of the following example: f(S,diffY[i][j][k])=diffY[i][j][k] (18)
[0534] in,
[0535] Floor(x) represents the largest integer less than or equal to x.
[0536] Log2(x) represents the logarithm to the base 2. Round(x)=Sign(x)×Floor(Abs(x)+0.5) (22)
[0537] In other words, in the embodiments of this application, assuming that the first image component is the luminance component and the second image component is the chrominance component, for any chrominance component sample of the current block, each chrominance sample to be predicted in the current block is traversed according to the above method to obtain the luminance component difference vector corresponding to each chrominance sample to be predicted. Finally, the prediction weight (weight vector) of each chrominance sample to be predicted in the current block can be determined, and the prediction weight (weight vector) of the current block can be obtained.
[0538] Step 204: Based on the prediction weight of the current block and the first prediction value of the second image component, determine the prediction value of the second image component of the current block.
[0539] In the embodiments of this application, after determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component, the prediction value of the second image component of the current block can be further determined based on the prediction weight of the current block and the first predicted value of the second image component.
[0540] In the embodiments of this application, the predicted value of the second image component of the current block can be understood as the final prediction result of the second image component obtained after completing the cross-component prediction of the current block.
[0541] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the final predicted value of the chrominance component of the current block can be obtained based on the prediction weight of the current block and the first predicted value (initial predicted value) of the chrominance component of the current block.
[0542] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component, the second image component difference vector of the first sample is determined based on the first predicted value of the second image component; and the predicted value of the second image component of the current block is determined based on the second image component difference vector of the first sample and the prediction weight of the current block.
[0543] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, for any chrominance component sample (such as the first sample) of the current block, the chrominance component difference vector of the chrominance component sample can be determined first based on the predicted value of the chrominance component of the current block. Then, based on the chrominance component difference vector and the prediction weight of the chrominance component sample, the predicted value of the chrominance component sample is determined. For the chrominance component sample to be predicted in the current block, the corresponding chrominance component difference vector and chrominance predicted value (predicted value of the chrominance component sample) are determined sequentially, and finally the chrominance predicted value of the current block can be determined.
[0544] In the embodiments of this application, when determining the second image component difference vector of the first sample based on the first predicted value of the second image component, the predicted average value of the second image component of the current block can be determined first based on the first predicted value of the second image component of the current block, and then the second image component difference vector of the first sample can be determined based on the predicted average value of the second image component and the first predicted value of the second image component of the first sample.
[0545] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the chromaticity prediction information (predicted value of chromaticity component) corresponding to the first sample is predC[i][j]. The predicted value of the chromaticity component of the current block includes inSize chromaticity prediction information predC of inSize samples of the current block. Based on the inSize chromaticity prediction information predC, the average value avgC is calculated, which is the predicted average value avgC of the second image component of the current block. Then, the chromaticity prediction information predC of inSize number is subtracted from the average value avgC to obtain the chromaticity difference vector diffC of the first sample, as shown in the following formula: diffC[k] = predC[k] - avgC (34)
[0546] Where k = 0, 1, ..., inSize-1. It can be seen that the chromaticity component difference vector corresponding to the first sample has inSize elements.
[0547] In the embodiments of this application, when determining the predicted value of the second image component of the current block, the predicted value of the second image component of the third sample is determined; based on the predicted value of the second image component of the third sample, the difference vector of the second image component of the first sample is determined; based on the difference vector of the second image component of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
[0548] In the embodiments of this application, when determining the second image component difference vector of the first sample, the predicted value of the second image component of the current block can also be selected from the second image component samples of the current block based on the first sample, that is, the predicted value of the second image component of the third sample in the current block is selected to determine the subsequent second image component difference vector.
[0549] In other words, in the embodiments of this application, the predicted value of the second image component used to determine the difference vector of the second image component can be adaptively selected and determined based on the first sample. That is, for different second image component samples to be predicted in the current block (such as the first sample), the predicted value of the second image component selected can be different.
[0550] In embodiments of this application, the third sample can be one or more second image component samples of the current block. That is, in embodiments of this application, the predicted values of a portion of the second image components of the current block can be selected based on the relevant information of the first sample to determine the second image component difference vector of the first sample.
[0551] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, one or more third samples of the current block can be determined first, and then the second image component difference vector of the first sample can be determined based on the second image component prediction value of the third sample.
[0552] In embodiments of this application, a third sample can be determined based on the location information of the first sample.
[0553] In embodiments of this application, a third sample can be determined based on the location information of the first sample and the location information of the current block.
[0554] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred[i][j], the position information of the first sample can be represented as chPos[i][j], and the position information of the current block can be the position of the top left corner color sample of the current chroma block relative to the top left corner color sample of the current image. For example, the position information of the current block can be represented as chromaPos=(x,y). Then, the third sample can be selected based on the position information of the first sample and the position information of the current block. For example, a region can be determined based on chPos[i][j] and chromaPos, and the chroma samples in that region can be determined as the third sample.
[0555] For example, in some embodiments, as shown in Figure 19, the position of the current chroma block is obtained, that is, the position of the top-left chroma sample of the current chroma block relative to the top-left chroma sample of the current image, chromaPos = (x, y). The region of the chroma prediction sub-information at the position of the current chroma block chPos[i][j] is a cross-shaped region centered at chPos[i][j] = (x+i, y+j). The sample positions in its chroma prediction sub-information region are: chPos[i][j] = (x+i, y+j), chPos[i-1][j] = (x-1+i, y+j), chPos[i+1][j] = (x+1+i, y+j), chPos[i][j-1] = (x+i+1, y-1+j), chPos[i][j+1] = (x+i, y+1+j).
[0556] In the embodiments of this application, a third sample can be determined based on the position information of the first sample, the second preset width, and the second preset height.
[0557] In embodiments of this application, a third sample can be determined based on the position information of the first sample and the position information of the current block, combined with a predetermined second preset width and a second preset height.
[0558] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the position information of the first sample can be represented as chPos[i][j], and the position information of the current block can be the position of the top left chroma sample of the current chroma block relative to the top left chroma sample of the current image. For example, the position information of the current block can be represented as chromaPos=(x,y). Then, the third sample can be selected based on the position information of the first sample, the position information of the current block, the second preset width w, and the second preset height h. For example, a region with a size of w×h can be determined based on yPos[i][j] and chromaPos, and the chroma samples in this region can be determined as the third sample.
[0559] For example, in some embodiments, as shown in Figure 20, the position of the current chroma block is obtained, that is, the position of the top-left chroma sample of the current chroma block relative to the top-left chroma sample of the current image, chromaPos = (x, y). The region of the chroma prediction sub-information at the position of the current chroma block chPos[i][j] is a 3×3 (w = 3, h = 3) region centered on chPos[i][j] = (x + i, y + j). The sample positions in its chromaticity prediction sub-information region are: chPos[i][j]=(x+i,y+j), chPos[i-1][j]=(x-1+i,y+j), chPos[i+1][j]=(x+1+i,y+j), chPos[i-1][j-1]=(x-1+i,y-1+j), chPos[i][j-1]=(x+i,y-1+j), chPos[i+1][j-1]=(x+1+i,y-1+j), chPos[i][j+1]=(x+i,y+1+j), chPos[i+1][j+1]=(x+1+i,y+1+j).
[0560] Therefore, in the embodiments of this application, the predicted value of the second image component in the input information of the cross-component prediction of the current block may include the predicted values of inSize second image components determined by the prediction input parameters in the prediction parameters, or it may include the predicted values of the second image components of one or more third samples determined by the first sample. This application does not make any specific limitations.
[0561] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the first parameter of the first sample is determined based on the difference vector of the second image components of the first sample and the prediction weight of the first sample, and the first accumulated parameter of the current block is determined based on the first parameter of the first sample; the second accumulated parameter of the current block is determined based on the prediction weight of the current block; the predicted value of the second image component of the first sample is determined based on the first accumulated parameter and the second accumulated parameter; and the predicted value of the second image component of the current block is determined based on the predicted value of the second image component of the first sample.
[0562] In some embodiments, the first parameter of the first sample can be determined by the second image component difference vector of the first sample and the prediction weight of the first sample. Specifically, for each second image component sample to be predicted in the current block, such as the first sample, the first parameter of the first sample can be determined by multiplying the second image component difference vector of the first sample with the prediction weight of the first sample.
[0563] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the prediction weight corresponding to the first sample is cWeightInt[i][j][k], the chromaticity difference vector of the first sample is diffC[k], then the first parameter subC[i][j][k] of the first sample can be obtained by referring to the following formula: subC[i][j][k]=(cWeightInt[i][j][k]×diffC[k]) (23)
[0564] Where k = 0, 1...inSize-1.
[0565] In some embodiments, the first accumulated parameter of the current block can be obtained by summing the first parameters of all the second image component samples (e.g., the first samples) to be predicted in the current block.
[0566] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the first parameter of the first sample is subC[i][j][k], and the first accumulated parameter of the current block can be expressed as...
[0567] In some embodiments, the prediction weights of the current block determine the second accumulated parameter of the current block by summing the prediction weights of all the second image component samples (e.g., the first samples) to be predicted in the current block.
[0568] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the prediction weight of the first sample is cWeightInt[i][j][k], and the second accumulated parameter of the current block can be expressed as...
[0569] In the embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first accumulation parameter and the second accumulation parameter, the second predicted value of the second image component of the first sample is determined based on the first accumulation parameter and the second accumulation parameter; the predicted value of the second image component of the first sample is determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
[0570] In some embodiments, the second predicted value of the second image component of the first sample can be understood as the prediction result of the second image component obtained by cross-component prediction of the first sample. Accordingly, based on the first predicted value and / or the second predicted value of the second image component of the first sample, the predicted value of the second image component of the first sample can be obtained. That is, by combining the initial predicted value of the second image component of the first sample and / or the predicted value of the second image component of the first sample obtained by cross-component prediction, the final predicted value of the second image component of the first sample can be obtained.
[0571] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred [i][j], the first accumulated parameter of the current block is The second accumulated parameter of the current block is The second predicted value C of the chromaticity component of the first sample pred [i][j] can be obtained using the following formula:
[0572] in, v=DivSigTable[normDiff]|(1<<Shift) (26) add=1<<y<<(Shift-1) (29)
[0573] The method of obtaining Shift includes, but is not limited to, the parameters determined by WCP. In the decoding specification text in the appendix, Shift is assigned the value 5.
[0574] The equation (25) for x corresponds to x = Floor(Log2(sum)) in the decoded canonical text.
[0575] The formula (26) for v corresponds to divSigTable[normDiff]|32 when Shift=5 is the value of the decoded canonical text.
[0576] Equation (27) of normDiff corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decoded norm text.
[0577] The equation (28) for y corresponds to x+=(normDiff!=0)? 1:0 in the decoding specification text in the appendix.
[0578] The formula (21) for add corresponds to add = 1 << x << 4 when Shift = 5 in the decoded canonical text.
[0579] DivSigTable is a predefined array related to Shift. DivSigTable corresponds to divSigTable[] = {0,15,14,13,12,12,11,10,10,9,8,8,7,7,6,6,5,5,4,4,4,3,3,3,2,2,2,1,1,1,1,0} in the decoded canonical text.
[0580] Func() is a function related to Shift. Its input is the sum of the weight vectors and x calculated by equation (17), and its output is the index value of DivSigTable[].
[0581] Here is an example of a specific form of Func(), as shown below:
[0582] The corresponding normDiff for decoding the standard text is ((sum<<5)>>x)&31 when Shift=5.
[0583] In the embodiments of this application, when determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component, the predicted average value of the second image component of the first sample and the difference vector of the second image component of the first sample can also be determined based on the first predicted value of the second image component; the predicted value of the second image component of the current block can be determined based on the predicted average value of the second image component of the first sample, the difference vector of the second image component of the first sample and the prediction weight of the current block.
[0584] For example, in some embodiments, a first parameter of the first sample can be determined based on the difference vector of the second image components of the first sample and the prediction weight of the first sample, and a first accumulated parameter of the current block can be determined based on the first parameter of the first sample; a second accumulated parameter of the current block can be determined based on the prediction weight of the current block; based on the first accumulated parameter and the second accumulated parameter; a second predicted value of the second image component of the first sample can be determined based on the first accumulated parameter, the second accumulated parameter and the predicted average value of the second image components of the first sample; and a predicted value of the second image component of the first sample can be determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
[0585] In other words, in the embodiments of this application, in the process of determining the predicted value of the second image component of the current block, the average predicted value of the second image component of the first sample can also be introduced to improve the calculation accuracy.
[0586] For example, in some embodiments, it is assumed that the first image component is a luminance component, the second image component is a chrominance component, and the first sample is the chrominance sample C to be predicted. pred[i][j], the first accumulated parameter of the current block is The second accumulated parameter of the current block is The average chromaticity component of the first sample is avgC, and the second predicted value of the chromaticity component of the first sample is C. pred [i][j] can be obtained using the following formula:
[0587] In embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, the predicted value of the second image component of the first sample is determined based on the first weight of the first predicted value of the second image component of the first sample, the second weight of the second predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample, and the second predicted value of the second image component of the first sample.
[0588] In some embodiments, when determining the predicted value of the final second image component of the first sample, it is possible to choose to refer only to the first predicted value of the second image component of the first sample, or to choose to refer only to the second predicted value of the second image component of the first sample.
[0589] In embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, the second predicted value of the second image component of the first sample is determined as the predicted value of the second image component of the first sample.
[0590] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the second predicted value of the chrominance component can be directly used as the final chrominance predicted value.
[0591] In the embodiments of this application, when determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, a second preset processing is performed on the second predicted value of the second image component of the first sample to determine the predicted value of the second image component of the first sample; wherein, the second preset processing includes at least one or more of the following: correction processing based on a first upper limit threshold; correction processing based on a first lower limit threshold; rounding processing; and rounding to the nearest integer.
[0592] In embodiments of this application, the first upper limit threshold may be greater than or equal to the first lower limit threshold.
[0593] In other words, in the embodiments of this application, a second preset processing can be performed on the second predicted value of the second image component of the current block to determine the predicted value of the second image component of the first sample; wherein, the second preset processing includes at least one or more of the following: correction processing based on a first upper limit threshold; correction processing based on a first lower limit threshold; rounding processing; and rounding to the nearest integer.
[0594] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the second predicted value of the chrominance component can be simply corrected (a second preset processing) to obtain the final chrominance predicted value. For example, the second predicted value of the chrominance component can be rounded to obtain the final chrominance predicted value, or the second predicted value of the chrominance component can be clamped using a first upper limit threshold, or the second predicted value of the chrominance component can be clamped using a first lower limit threshold, etc.
[0595] In some embodiments, when determining the final predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample and the second predicted value of the second image component of the first sample can be weighted and fused to obtain the final predicted value of the second image component.
[0596] In the embodiments of this application, the specific values of the first weight and the second weight are not specifically limited, and the sum of the first weight and the second weight can be 1.
[0597] In the embodiments of this application, the ratio between the first weight and the second weight is determined to be a first value.
[0598] In some embodiments, the ratio between the first weight and the second weight corresponding to the first predicted value of the second image component of the first sample and the second predicted value of the second image component of the first sample can be preset to a fixed value, such as a first value.
[0599] For example, in some embodiments, the specific value of the first numerical value is not limited in this application. For example, the first numerical value can be 3, or the first numerical value can be 0, or the first numerical value can be 2, or the first numerical value can be 1 / 3.
[0600] In the embodiments of this application, a first image component residual value corresponding to a first sample is determined; a first weight and a second weight are determined based on the first image component residual value corresponding to the first sample.
[0601] In some embodiments, the first weight and the second weight can also be adaptively determined based on the residual value of the first image component corresponding to the first sample. That is, for different second image component samples to be predicted in the current block, the first weight and the second weight used can be different.
[0602] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the weighting weight is determined based on the residual value of the luminance sample corresponding to the chrominance sample location. For instance, the smaller the residual value, the more accurate the chrominance sample prediction at the corresponding location is considered, and the larger the weighting weight (first weight) of the chrominance prediction value (the first predicted chrominance value) is; conversely, the larger the residual value, the less accurate the chrominance sample prediction at the corresponding location is considered, and the smaller the weighting weight (first weight) of the chrominance prediction value (the first predicted chrominance value) is.
[0603] In the embodiments of this application, a first syntax element identification information is determined; a first weight and a second weight are determined based on the first syntax element identification information.
[0604] In some embodiments, the first weight and the second weight can also be adaptively determined based on the parsed first syntax element identification information. That is, for different second image component samples to be predicted in the current block, the first weight and the second weight determined based on the parsed first syntax element identification information can be different.
[0605] For example, in some embodiments, the encoder transmits first syntax element identification information to indicate the weighted weight allocation between the first predicted value and the second predicted value. For instance, when the value of the first syntax element identification information is 0, it indicates that both the first weight and the second weight are 0.5; when the value of the first syntax element identification information is 1, it indicates that the first weight is 0.75 and the second weight is 0.25; when the value of the first syntax element identification information is 2, it indicates that the first weight is 0.25 and the second weight is 0.75.
[0606] In the embodiments of this application, after determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample, a third preset processing can be performed on the predicted value of the second image component of the first sample, wherein the third preset processing includes at least one or more of the following: correction processing based on a second upper limit threshold; correction processing based on a second lower limit threshold.
[0607] In embodiments of this application, the second upper limit threshold may be greater than or equal to the second lower limit threshold.
[0608] In embodiments of this application, the predicted value of the second image component of the first sample can be clamped by a second upper threshold and / or a second lower threshold, so that the predicted value of the second image component of the first sample is within the range defined by the second upper threshold and / or the second lower threshold.
[0609] In other words, in the embodiments of this application, the predicted value of the second image component of the current block can be clamped by the second upper limit threshold and / or the second lower limit threshold, so that the predicted value of the second image component of the current block is within the limited range formed by the second upper limit threshold and / or the second lower limit threshold.
[0610] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the chrominance prediction value of the first sample should be within a defined range; if it exceeds this range, a corresponding correction operation should be performed. For example, a clamping operation can be performed on the chrominance prediction value of the first sample, using C... pred [i][j] represents the third chromaticity prediction value, when C pred When the value of [i][j] is less than 0, it is set to 0; when C pred When the value of [i][j] is greater than (1 << BitDepth) - 1, it is set to (1 << BitDepth) - 1. Here, BitDepth is the bit depth required for the chroma pixel value, ensuring that the third predicted value is between 0 and (1 << BitDepth) - 1, i.e.: C pred [i][j]=Clip3(0,(1<<BitDepth)-1,C pred [i][j]) (31)
[0611] In the embodiments of this application, after obtaining the predicted value of the second image component of the current block based on weight derivation, post-processing operations can be performed on the output predicted value of the second image component to further improve the accuracy of the prediction. These post-processing operations may include, but are not limited to, filtering.
[0612] In the embodiments of this application, taking the first image component as the luminance component and the second image component as the chrominance component as an example, the prediction output parameter is determined to be predSizeW×predSizeH based on the prediction parameters. If predSizeW×predSizeH is less than or equal to the size nTbW×nTbH of the current block (i.e., the original chrominance block), then post-processing can be performed.
[0613] In some embodiments, for post-processing operations on the chromaticity prediction value of the current block, the output size (predSizeW×predSizeH) of the current block is determined. If the output size of the current block is equal to the size of the current block, the current block is directly filtered and enhanced, and the result after filtering and enhancement is used as the final prediction result.
[0614] In some embodiments, for post-processing the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the current block size, the current block is first upsampled to obtain an upsampled prediction block, which is restored to the same size as the current block. Then, the upsampled prediction block is filtered and enhanced, and the result of the enhanced filtering is used as the final prediction result.
[0615] In some embodiments, for post-processing the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the size of the current block, the upsampled and filtered prediction block is first enhanced to obtain an enhanced prediction block. Then, the enhanced prediction block is upsampled and filtered again to obtain a second prediction block, which is restored to the same size as the current block, thus obtaining the final prediction result.
[0616] Therefore, in the embodiments of this application, when performing post-processing operations on the chromaticity prediction value of the current block, the output size (predSizeW × predSizeH) of the current block is determined. If the output size of the current block is smaller than the size of the current block, the execution order of the current block can be determined first. The execution order of the current block can include a first execution order and a second execution order. The first execution order is: first, upsample filtering is performed on the current block, and then filtering enhancement is performed on the upsampled prediction block; the second execution order is: first, filtering enhancement is performed on the current block, and then upsample filtering is performed on the enhanced prediction block.
[0617] In the embodiments of this application, the post-processing operation on the predicted values of the output second image component fully considers the case where predSizeW×predSizeH is less than or equal to nTbW×nTbH. When predSizeW×predSizeH is less than nTbW×nTbH, upsampling filtering is required. In addition, filtering enhancement can be performed on the chroma prediction blocks output by WCP that have undergone upsampling filtering and those that do not require upsampling filtering (when predSizeW×predSizeH is equal to nTbW×nTbH). The bilateral filtering method used has edge-preserving noise reduction characteristics and can further improve the accuracy of chroma prediction.
[0618] Therefore, the encoding method proposed in this application can adjust the prediction process of Inter CCCM. Specifically, weighted chromaticity prediction is introduced into the Inter CCCM prediction. The weight vector (prediction weight) of each chromaticity prediction sample position is determined by the luminance difference vector, and since the luminance difference vector is different for each chromaticity prediction sample position, this overcomes the deficiency of single and fixed model coefficients in Inter CCCM, improving prediction flexibility and thus improving prediction accuracy.
[0619] This application provides an encoding method that can also be used in other prediction modes based on block vectors (BV), such as chroma blocks encoded in IntraTMP mode. The difference lies in the source of the BV corresponding to the chroma block. In Inter and IBC scenarios, single-tree partitioning is common, with strict correspondence between luminance and chroma block regions, and their MV / BV information is completely corresponding. In IntraTMP mode, dual-tree partitioning may be used, and chroma blocks and luminance block regions often do not correspond strictly. The BV of the chroma block may originate from a sub-region of the corresponding luminance region, or from luminance and chroma blocks in adjacent regions.
[0620] This application provides an encoding method in which the encoder determines prediction parameters for the current block; based on the prediction parameters, it determines the reconstructed value of a first image component, the predicted value of the first image component, and the first predicted value of a second image component; based on the reconstructed value and the predicted value of the first image component, it determines the prediction weight of the current block; and based on the prediction weight and the first predicted value of the second image component, it determines the predicted value of the second image component. Therefore, in this application's embodiments, when performing cross-component prediction on the current block, the prediction weight for cross-component prediction can be determined based on the reconstructed value and the predicted value of the first image component, and the predicted value of the second image component can be further derived based on this prediction weight. In other words, this application can introduce a weight-based prediction model into the inter-frame cross-component prediction process, improving prediction accuracy and thus enhancing encoding / decoding performance.
[0621] Based on the above embodiments, this application provides an encoding and decoding method. In the process of applying the same model parameters to each sample position in the current chromaticity prediction block to obtain the chromaticity prediction value in InterCCCM technology, since the derived model parameters are not necessarily optimal for each chromaticity sample position, the prediction accuracy will be reduced. Therefore, a weight-based cross-component prediction scheme is proposed.
[0622] In the embodiments of this application, taking inter-frame chroma prediction as an example, weighted chroma prediction is introduced into inter-frame prediction. The weight vector of each chroma prediction sample position is determined by the luminance difference vector, and the luminance difference vector is different for each chroma prediction sample position. Therefore, it is more flexible compared to the single model of InterCCCM.
[0623] The encoding and decoding method proposed in this application can be understood as an inter-weighted chroma prediction (InterWCP) method used in both inter-prediction and intra-prediction modes. If the current block is encoded using inter-prediction or intra-prediction (such as IBC mode), and InterWCP mode is selected for encoding, both the encoder and decoder apply a weighted chroma prediction model to the block to correct the chroma samples and obtain a second chroma prediction value (the prediction value obtained by weighted chroma prediction). The second chroma prediction value is then weighted with the first chroma prediction value (the original chroma prediction value obtained based on inter-prediction or intra-prediction) to generate a third chroma prediction value.
[0624] It is understood that the encoding and decoding method proposed in this application can also be used in other BV-based prediction modes, such as chroma blocks encoded in IntraTMP mode. The difference lies in the source of the BV corresponding to the chroma block. In the Inter and IBC cases, single-tree partitioning is mostly used, and the luminance and chroma block regions correspond strictly, with their MV / BV information being completely corresponding. In IntraTMP mode, dual-tree partitioning may be used, and the chroma block and luminance block regions often do not correspond strictly. The BV of the chroma block may originate from a sub-region of the corresponding luminance region, or from luminance and chroma blocks in adjacent regions.
[0625] The following example, taking the first image component as the luminance component and the second image component as the chrominance component, i.e., cross-component prediction of chrominance information based on luminance information, illustrates the encoding and decoding method proposed in this application.
[0626] The inputs to InterWCP are: the luminance prediction value predSamplesY[x][y] of the current block, the luminance reconstruction value recSamplesY[x][y], and the first chrominance prediction value (predSamplesCb[x1][y1] for the Cb component and predSamplesCr[x1][y1] for the Cr component), where x = 0..nTbWY-1, y = 0..nTbHY-1, x1 = 0..nTbW-1, and y1 = 0..nTbH-1.
[0627] The output of InterWCP is the third chromaticity prediction of the current block (predSamplesCb′[x][y] for Cb components and predSamplesCr′[x][y] for Cr components), where x = 0..nTbW-1 and y = 0..nTbH-1.
[0628] As shown in Figure 22, the specific prediction process of InterWCP technology includes the following steps:
[0629] Step 301: Determine the core parameters of InterWCP.
[0630] Step 302: Obtain input information.
[0631] Step 303: Weight-based chromaticity prediction.
[0632] Step 304: Generate the third chromaticity prediction value for the current block.
[0633] In the embodiments of this application, the InterWCP core parameters are the prediction parameters of the current block. When determining the InterWCP core parameters, the InterWCP core parameters include, but are not limited to, the InterWCP control parameters (S), the number of weighted inter-frame chroma prediction inputs inSize, the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged in the form of predSizeW × predSizeH), the weighted model LUT, and the maximum index of the weighted model LUT theMaxPos. The number of weighted inter-frame chroma prediction outputs (predWcp) can be set to the same value (e.g., predSizeW = predSizeH = S / 4) or related to the current block size (e.g., predSizeW = nTbW, predSizeH = nTbH). The control parameter S can be used to adjust the nonlinear function in subsequent stages or to adjust the data involved in subsequent stages. The weighted model LUT can be predefined or calculated in real time based on different InterWCP control parameters (S). The maximum index, theMaxPos, of the weighted model LUT can be adjusted or fixed depending on the weighted model LUT.
[0634] The determination of InterWCP core parameters is influenced by block size, block content, or the number of pixels within a block under certain conditions. For example:
[0635] Chroma prediction blocks can be classified based on their block size, block content, or number of pixels within the block, and different core parameters can be determined for different categories. That is, the InterWCP control parameters (S), the number of weighted inter-frame chroma prediction inputs (inSize), or the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) corresponding to different categories can be the same or different. Note that predSizeW and high predSizeH can also be the same or different.
[0636] If the InterWCP application involves many block sizes, significant differences between block sizes, large differences in block content, or significant differences in the number of pixels within a block, the chroma prediction blocks can be classified according to their block size, block content, or number of pixels within the block. The same or different core parameters can be determined based on different categories. That is, the InterWCP control parameters (S), the number of weighted inter-frame chroma prediction inputs (inSize), or the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) corresponding to different categories can be the same or different. Note that predSizeW and high predSizeH can also be the same or different.
[0637] To better illustrate the determination of InterWCP core parameters, let's take two simple categories as examples:
[0638] Classification Example 1: InterWCP can classify chroma blocks based on their width and height, using wcpSizeId to represent the type of chroma block. For different types of chroma blocks, the InterWCP control parameters (S), the number of weighted inter-frame chroma prediction inputs inSize, and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be the same or different. Here, we will illustrate this using one of three categories as an example:
[0639] Chroma blocks are divided into three categories based on their width and height. The InterWCP control parameter (S) can be set differently for each category, while the inSize and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same value for each category. nTbW is the width of the current chroma prediction block, and nTbH is the height of the current chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0640] wcpSizeId = 0: chroma blocks with min(nTbW, nTbH) <= 4. Its InterWCP control parameter (S) is 8, inSize is (nTbH × nTbW), and weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0641] wcpSizeId = 1: 4 < min(nTbW, nTbH) <= 16. Its InterWCP control parameter (S) is 12, inSize is (nTbH × nTbW), and the weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0642] wcpSizeId = 2: min(nTbW, nTbH) > 16. Its InterWCP control parameter (S) is 16, inSize is (nTbH × nTbW), and the weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0643] The above quantitative relationships are presented in tabular form, as shown in Table 14:
[0644] Table 14
[0645] We can also illustrate this by taking another example:
[0646] Chroma blocks are divided into three categories based on their width and height. The InterWCP control parameter (S) can be set differently for each category, while the inSize and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same value for each category. nTbW is the width of the current chroma prediction block, and nTbH is the height of the current chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0647] wcpSizeId = 0: chroma blocks with min(nTbW, nTbH) <= 4. Its InterWCP control parameter (S) is 8, inSize is (nTbH × nTbW), and weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0648] wcpSizeId = 1: 4 < min(nTbW, nTbH) <= 16. Its InterWCP control parameter (S) is 12, inSize is (nTbH / 2 × nTbW / 2), and the weighted inter-frame chroma prediction outputs nTbH / 2 × nTbW / 2 chroma prediction values;
[0649] wcpSizeId = 2: min(nTbW, nTbH) > 16. Its InterWCP control parameter (S) is 16, inSize is (nTbH / 4 × nTbW / 4), and the weighted inter-frame chroma prediction outputs nTbH / 4 × nTbW / 4 chroma prediction values;
[0650] The above quantitative relationships are presented in tabular form, as shown in Table 15:
[0651] Table 15
[0652] Classification Example 2: InterWCP can also classify chroma blocks based on the number of pixels in the chroma prediction block, using wcpSizeId to represent the type of chroma block. For different types of chroma blocks, the InterWCP control parameters (S), the number of weighted inter-frame chroma prediction inputs inSize, and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW×predSizeH) can be the same or different.
[0653] Here, we will use one of the three categories as an example for explanation:
[0654] Chroma blocks are divided into three categories based on the number of pixels in the chroma prediction block. The InterWCP control parameter (S) can be set differently for different categories, while the inSize and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same for different categories. nTbW is the width of the current chroma prediction block, nTbH is the height of the current chroma prediction block, and nTbW and nTbH represent the number of pixels in the chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0655] wcpSizeId = 0: chroma blocks with (nTbW nTbH) < 128. Their InterWCP control parameter (S) is 10, inSize is (nTbH × nTbW), and weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values.
[0656] wcpSizeId = 1: 128 <= (nTbW nTbH) <= 256 chroma blocks. Its InterWCP control parameter (S) is 8, inSize is (nTbH × nTbW), and the weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0657] wcpSizeId = 2: (nTbW nTbH) > 256. Its InterWCP control parameter (S) is 1, inSize is (nTbH × nTbW), and the weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values;
[0658] The above quantitative relationships are presented in tabular form, as shown in Table 16:
[0659] Table 16
[0660] We can also illustrate this by taking another example:
[0661] Chroma blocks are divided into three categories based on the number of pixels in the chroma prediction block. The InterWCP control parameter (S) can be set differently for different categories, while the inSize and the number of weighted inter-frame chroma prediction outputs (predWcp) (arranged as predSizeW × predSizeH) can be set to the same for different categories. nTbW is the width of the current chroma prediction block, nTbH is the height of the current chroma prediction block, and nTbW and nTbH represent the number of pixels in the chroma prediction block. The definition of the chroma block type wcpSizeId is as follows:
[0662] wcpSizeId = 0: chroma blocks with (nTbW nTbH) < 64. Their InterWCP control parameter (S) is 16, inSize is (nTbH × nTbW), and weighted inter-frame chroma prediction outputs nTbH × nTbW chroma prediction values.
[0663] wcpSizeId = 1: 64 <= (nTbW nTbH) <= 512. Its InterWCP control parameter (S) is 4, inSize is (nTbH / 2 × nTbW / 2), and the weighted inter-frame chroma prediction outputs nTbH / 2 × nTbW / 2 chroma prediction values;
[0664] wcpSizeId = 2: (nTbW nTbH) > 512. Its InterWCP control parameter (S) is 1, inSize is (nTbH / 4 × nTbW / 4), and the weighted inter-frame chroma prediction outputs nTbH / 4 × nTbW / 4 chroma prediction values;
[0665] The above quantitative relationships are presented in tabular form, as shown in Table 17:
[0666] Table 17
[0667] When acquiring input information, the acquired input information includes acquiring the current block luminance reconstruction information recY (number inSize), the current block luminance prediction information predY (number inSize), and the current block chrominance prediction information predC (number inSize).
[0668] As shown in Figure 23, this example illustrates the concept of inSize being equal to the current chromaticity prediction block size (inSize = nTbH × nTbW):
[0669] When the resolutions of the luminance and chrominance components are inconsistent, it is necessary to downsample the current block luminance prediction information and luminance reconstruction information that have not been downsampled to obtain luminance reconstruction information recY and luminance prediction information predY with an inSize number of values for InterWCP prediction.
[0670] As shown in Figure 15, the following downsampling methods are included, but are not limited to:
[0671] For example, in some embodiments, it is assumed that the first image component is the luminance component and the second image component is the chrominance component. The chrominance sample coordinates are (xC, yC) and the corresponding unsampled luminance sample coordinates are (xL, yL). The correspondence between the position coordinates of the chrominance sample and the luminance sample determined based on different chrominance sampling formats (color sampling formats) is shown in Table 13.
[0672] Wherein, `sps_chroma_format_idc` is the identifier for the chroma sampling format, used to determine the chroma sampling format. Assuming the luminance sample before downsampling is `BefDownLuma` and the luminance sample after downsampling is `AftDownLuma`, the downsampled luminance sample corresponding to the chroma sample position (xC, yC) can be obtained using the following downsampling method:
[0673] An example of downsampling is: AftDownLuma[xC][yC]=((BefDownLuma[xL][yL]×2)+BefDownLuma[xL+1][yL]+BefDownLuma[xL-1][yL]+(BefDownLuma[xL][yL+1]×2)+BefDownLuma[xL+1][yL+1]+BefDownLuma[xL-1][yL+1]+4)>>3
[0674] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+1)>>1
[0675] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL][yL+1]+1)>>1
[0676] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+1)>>1
[0677] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL+1][yL]+BefDownLuma[xL+1][yL+1]+1)>>1
[0678] Another example of downsampling is: AftDownLuma[xC][yC]=(BefDownLuma[xL][yL]+BefDownLuma[xL+1][yL]+BefDownLuma[xL][yL+1]+BefDownLuma[xL+1][yL+1]+2)>>2.
[0679] The coordinates of the unsampled brightness sample (xL, yL) can be calculated based on Table 13.
[0680] In the embodiments of this application, when acquiring input information, the chromaticity prediction information predC is the current chromaticity prediction block, and its region size is the same as the current chromaticity block size; the luminance prediction information predY is the downsampled current luminance prediction block, and its region size is the same as the current chromaticity block size. For each sample position to be corrected in the current chromaticity block, the sets predY and predC are the same.
[0681] Of course, different subsets of chromaticity prediction information, predCsub (e.g., using the chromaticity prediction value of the third sample as input information), and subsets of luminance prediction information, predYsub (e.g., using the luminance prediction value of the second sample as input information), can also be established for each sample position in the current chromaticity block and the downsampled luminance reconstruction block.
[0682] For example, as shown in Figure 24, the position of the current chroma block is obtained, that is, the position of the top-left chroma sample of the current chroma block relative to the top-left chroma sample of the current image, chromaPos = (x, y). The region of the chroma prediction sub-information at the position chPos[i][j] of the current chroma block is a cross-shaped region centered at chPos[i][j] = (x+i, y+j). The sample positions in its chroma prediction sub-information region are:
[0683] 1) chPos[i][j]=(x+i,y+j)
[0684] 2) chPos[i-1][j]=(x-1+i,y+j)
[0685] 3) chPos[i+1][j]=(x+1+i,y+j)
[0686] 4)chPos[i][j-1]=(x+i+,y-1+j)
[0687] 5) chPos[i][j+1]=(x+i,y+1+j)
[0688] The position of the current luminance block is obtained, that is, the position of the top-left luminance sample of the current luminance block relative to the top-left luminance sample of the current image, lumaPos = (xCb, yCb). The luminance prediction sub-information region at the position yPos[i][j] of the downsampled luminance reconstruction block is a cross-shaped region centered at yPos[i][j] = (xCb+i, yCb+j). The sample positions in its luminance prediction sub-information region are:
[0689] 1) yPos[i][j]=(xCb+i,yCb+j)
[0690] 2)yPos[i-1][j]=(xCb-1+i,yCb+j)
[0691] 3)yPos[i+1][j]=(xCb+1+i,yCb+j)
[0692] 4)yPos[i][j-1]=(xCb+i,yCb-1+j)
[0693] 5)yPos[i][j+1]=(xCb+i,yCb+1+j)
[0694] For example, as shown in Figure 25, the chroma prediction information sub-region at the current chroma block chPos[i][j] position is a w×h region centered at chPos[i][j]=(x+i,y+j), one example being a 3×3 region (w=3,h=3). The sample positions within this chroma prediction information sub-region are:
[0695] 1) chPos[i][j]=(x+i,y+j)
[0696] 2) chPos[i-1][j]=(x-1+i,y+j)
[0697] 3) chPos[i+1][j]=(x+1+i,y+j)
[0698] 4)chPos[i-1][j-1]=(x-1+i,y-1+j)
[0699] 5) chPos[i][j-1]=(x+i,y-1+j)
[0700] 6)chPos[i+1][j-1]=(x+1+i,y-1+j)
[0701] 7)chPos[i-1][j+1]=(x-1+i,y+1+j)
[0702] 8) chPos[i][j+1]=(x+i,y+1+j)
[0703] 9)chPos[i+1][j+1]=(x+1+i,y+1+j)
[0704] The brightness prediction information sub-region at the downsampled brightness reconstruction block yPos[i][j] is a w×h region centered at yPos[i][j]=(xCb+i,yCb+j), an example of which is a 3×3 region (w=3,h=3). The sample locations within this brightness prediction information sub-region are:
[0705] 1) yPos[i][j]=(xCb+i,yCb+j)
[0706] 2)yPos[i-1][j]=(xCb-1+i,yCb+j)
[0707] 3)yPos[i+1][j]=(xCb+1+i,yCb+j)
[0708] 4)yPos[i-1][j-1]=(xCb-1+i,yCb-1+j)
[0709] 5)yPos[i][j-1]=(xCb+i,yCb-1+j)
[0710] 6)yPos[i+1][j-1]=(xCb+1+i,yCb-1+j)
[0711] 7)yPos[i-1][j+1]=(xCb-1+i,yCb+1+j)
[0712] 8)yPos[i][j+1]=(xCb+i,yCb+1+j)
[0713] 9)yPos[i+1][j+1]=(xCb+1+i,yCb+1+j)
[0714] In the embodiments of this application, during weighted chromaticity prediction, the predicted chromaticity value C is within the size specified by the InterWCP core parameters. pred [i][j], i = 0…predSizeW-1, j = 0…predSizeH-1, are obtained sequentially. Note that predSizeH and predSizeW are defined InterWCP core parameters, which may be the same as or different from the height nTbH or width nTbW of the current chroma block to be predicted. Thus, under certain conditions, the following calculations can also be performed only on a portion of the samples to be predicted within the current prediction block.
[0715] As shown in Figure 26, weighted chromaticity prediction may include the following steps:
[0716] Step 3031: Preprocessing of chromaticity prediction information.
[0717] Step 3032: Obtain the weight vector.
[0718] Step 3033: Perform weighted prediction based on the weights to obtain the weighted second chromaticity prediction value.
[0719] The process involves preprocessing chromaticity prediction information, obtaining a weight vector, and performing weighted prediction based on the weights to obtain a weighted second chromaticity prediction value. The preprocessing of chromaticity prediction information includes calculating the average value and constructing a chromaticity difference vector; the process of obtaining the weight vector includes constructing a luminance difference vector and calculating the weight vector.
[0720] The detailed calculation process is as follows:
[0721] Calculate the average value avgC of the chromaticity prediction information.
[0722] For k = 0, 1, ..., inSize-1
[0723] Construct the chromaticity difference vector diffC
[0724] For i=0…predSizeW-1, j=0…predSizeH-1
[0725] For k = 0, 1, ..., inSize-1
[0726] Construct the brightness difference vector by defining each element diffY[i][j][k].
[0727] Calculate the weights in the weight vector cWeightInt[i][j][k].
[0728] The chromaticity prediction value C is calculated using cWeightInt[i][j], diffC, and avgC. pred [i][j]
[0729] Calculate the average value avgC for the chromaticity prediction information predC for the inSize quantity. Subtract the average value avgC from the chromaticity prediction information predC for the inSize quantity to obtain the reference chromaticity difference vector diffC, as shown in the following formula: diffC[k] = predC[k] - avgC (34)
[0730] Where k = 0, 1...inSize-1.
[0731] In the embodiments of this application, when constructing the luminance difference vector, for each sample C to be predicted within the size specified by the WCP core parameters... pred [i][j], subtract the corresponding brightness reconstruction information recY[i][j] from the brightness prediction information predY of the inSize quantity and take the absolute value to obtain the brightness difference vector diffY[i][j], referring to the following formula: diffY[i][j][k]=Abs(predY[k]-recY[i][j]) (32)
[0732] Under certain conditions, the brightness difference vector of the sample to be predicted can be subjected to linear or nonlinear numerical processing. For example, the value of the brightness difference vector of the sample to be predicted can be scaled according to the InterWCP control parameter S in the InterWCP core parameters.
[0733] In the embodiments of this application, when calculating the weight vector,
[0734] A LUT with a non-linear weighting model is used for each sample C to be predicted. pred The brightness difference vector diffY[i][j] corresponding to [i][j] is processed to obtain the corresponding integer weight vector cWeightInt[i][j].
[0735] For example, a non-linear Softmax function can be used as the weight model. The methods for obtaining the weight model LUT include, but are not limited to, the following: theMaxPos = 1 << BitDepth-1 (11)
[0736] The value of the maximum weight model index theMaxPos includes, but is not limited to, the value calculated according to equation (11), and it can be a parameter determined in the WCP core parameters.
[0737] For example, in some embodiments, for n = 0, 1…theMaxPos LUT[n] = Round(e -n ×ModelScale) (12)
[0738] The value of ModelScale includes, but is not limited to, the parameter determined by the WCP core parameters. It represents the amplification factor of the weight coefficient and is a pre-set constant.
[0739] For example, in some embodiments, assuming the first image component is a luminance component, for k = 0, 1...inSize-1, the weight index of the first sample can be determined by the corresponding first image component difference vector (luminance difference vector) as diffY[i][j], and finally determined by the integer weight vector cWeightInt[i][j] corresponding to the first sample by combining the weight model based on the lookup table, referring to the following formula: index = Clip3(0,theMaxPos,diffY[i][j][k]) (13) cWeightInt[i][j][k] = LUT[index] (14)
[0740] For example, in some embodiments, the weight model can be adjusted according to the WCP control parameter (S) in the core parameters. For instance, when the current predicted block size is flexible, the weight model can be adjusted according to the WCP control parameter (S). Taking the nonlinear Softmax function as an example, different scale parameter adjustment functions can be selected according to the different block classification categories to which the current predicted block belongs. The methods for obtaining the weight model LUT at this time include, but are not limited to, the following: theMaxPos=1<<BitDepth-1 (11)
[0741] The value of theMaxPos includes, but is not limited to, the value calculated according to equation (11). It can be a parameter determined in the WCP core parameters and can be assigned different values with different WCP control parameters (S), i.e., theMaxPos[S].
[0742] For n = 0, 1, ..., the MaxPos
[0743] The value of ModelScale includes, but is not limited to, the parameters determined by the WCP core parameters, which represent the amplification factor of the weight coefficients. For k = 0, 1...inSize-1, index = Clip3(0,theMaxPos,f(S,diffY[i][j][k])) (16) cWeightInt[i][j][k] = LUT[S][index] (17)
[0744] Here, f() refers to a function of the WCP control parameter S and the brightness difference diffY[i][j][k], and its output is the index of the LUT.
[0745] Here, f() includes, but is not limited to, the implementation of the following example: f(S,diffY[i][j][k])=diffY[i][j][k] (18)
[0746] in,
[0747] Floor(x) represents the largest integer less than or equal to x.
[0748] Log2(x) represents the logarithm to the base 2.
[0749] Round(x)=Sign(x)×Floor(Abs(x)+0.5) (22)
[0750] In the embodiments of this application, when calculating the second chromaticity prediction value, the second chromaticity prediction value of the sample to be predicted is calculated based on the integer weight vector cWeightInt[i][j], the chromaticity difference vector diffC, and the average value of the chromaticity prediction information corresponding to each sample to be predicted. Specifically, the chromaticity difference vector diffC is multiplied one by one with the weight vector element corresponding to each sample to be predicted to obtain subC[i][j]. The multiplication results are accumulated and divided by the sum of the integer weight vector cWeightInt[i][j] corresponding to each sample to be predicted, and then added to the average value of the chromaticity prediction information to obtain the second chromaticity prediction value C of each sample to be predicted. pred [i][j]. All division operations involved use right shift operations, as detailed below: subC[i][j][k]=(cWeightInt[i][j][k]×diffC[k]) (23)
[0751] Where k = 0, 1...inSize-1.
[0752] For i=0...predSizeW-1, j=0...predSizeH-1,
[0753] in, v=DivSigTable[normDiff]|(1<<Shift) (26) add=1<<y<<(Shift-1) (29)
[0754] The method of obtaining Shift includes, but is not limited to, the parameters determined by WCP. In the decoding specification text in the appendix, Shift is assigned the value 5.
[0755] The equation (25) for x corresponds to x = Floor(Log2(sum)) in the decoded canonical text.
[0756] The formula (26) for v corresponds to divSigTable[normDiff]|32 when Shift=5 is the value of the decoded canonical text.
[0757] Equation (27) of normDiff corresponds to normDiff = ((sum << 5) >> x) & 31 when Shift = 5 in the decoded norm text.
[0758] The equation (28) for y corresponds to x+=(normDiff!=0)? 1:0 in the decoding specification text in the appendix.
[0759] The formula (21) for add corresponds to add = 1 << x << 4 when Shift = 5 in the decoded canonical text.
[0760] DivSigTable is a predefined array related to Shift. DivSigTable corresponds to divSigTable[] = {0,15,14,13,12,12,11,10,10,9,8,8,7,7,6,6,5,5,4,4,4,3,3,3,2,2,2,1,1,1,1,0} in the decoded canonical text.
[0761] Func() is a function related to Shift. Its input is the sum of the weight vectors and x calculated by equation (17), and its output is the index value of DivSigTable[].
[0762] Here is an example of a specific form of Func(), as shown below:
[0763] The corresponding normDiff for decoding the standard text is ((sum<<5)>>x)&31 when Shift=5.
[0764] In the embodiments of this application, during the generation of the third chromaticity prediction value of the current block, the second chromaticity prediction value (predCbVal for Cb components, predCrVal for Cr components) and the first chromaticity prediction value (predSamplesCb for Cb components, predSamplesCr for Cr components) are weighted according to equations (23) and (24) to generate the third chromaticity prediction value (predSamplesCb′ for Cb components, predSamplesCr′ for Cr components). The weighting operation is performed according to the following formulas to generate the third chromaticity prediction value (predSamplesCb′ for Cb components, predSamplesCr′ for Cr components). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (6) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (7)
[0765] Where w is the weighting weight. For example, w is 0.75.
[0766] Furthermore, the predicted value of the third chromaticity should be within a specified range; if it exceeds this range, appropriate corrections should be made. For example:
[0767] Clamping operations can be performed on the third chromaticity prediction value using C. pred [i][j] represents the third chromaticity prediction value, which can be applied to C. pred The chromaticity prediction values of [i][j] are clamped as follows:
[0768] When C pred If the value of [i][j] is less than 0, set it to 0;
[0769] When C pred When the value of [i][j] is greater than (1 << BitDepth) - 1, it is set to (1 << BitDepth) - 1.
[0770] BitDepth is the bit depth required for the chroma pixel value to ensure that all predicted values in predWcp are between 0 and (1 << BitDepth) - 1.
[0771] That is: C pred[i][j]=Clip3(0,(1<<BitDepth)-1,C pred [i][j]) (31)
[0772] In the embodiments of this application, the second chromaticity prediction value can also be directly used as the final chromaticity prediction value, or the second chromaticity prediction value can be simply modified (such as rounding, clamping, etc.) and then used as the final chromaticity prediction value.
[0773] For example, in some embodiments, after determining the second chromaticity prediction value of the current block (predCbVal for Cb components and predCrVal for Cr components) based on the prediction weights, the fusion process with the first chromaticity prediction value (predSamplesCb for Cb components and predSamplesCr for Cr components) can be skipped, and the second chromaticity prediction value can be directly determined as the final chromaticity prediction result, that is, the second chromaticity prediction value can be determined as the third chromaticity prediction value of the current block (predSamplesCb′ for Cb components and predSamplesCr′ for Cr components).
[0774] In the embodiments of this application, when weighting the second chromaticity prediction value and the first chromaticity prediction value, the weighting weight is determined based on the residual value of the luminance sample corresponding to the chromaticity sample position. The smaller the residual, the more accurate the chromaticity sample prediction at the corresponding position is considered, and the greater the weighting weight of the first chromaticity prediction value.
[0775] In the embodiments of this application, the encoding end transmits signaling indicating the weighting allocation of the second chroma prediction value and the first chroma prediction value. For example, when transmitting idx (first syntax element identification information), when idx = 0, the first chroma prediction value and the second chroma prediction value are weighted at 0.5:0.5; when idx = 1, the first chroma prediction value and the second chroma prediction value are weighted at 0.75:0.25; and when idx = 2, the first chroma prediction value and the second chroma prediction value are weighted at 0.25:0.75.
[0776] For example, in some embodiments, after determining the second chromaticity prediction value of the current block based on the prediction weight (predCbVal for Cb component and predCrVal for Cr component), during the weighted fusion with the first chromaticity prediction value (predSamplesCb for Cb component and predSamplesCr for Cr component), the weight w of the second chromaticity prediction value in formulas (6) and (7) can be 1. At this time, the weight 1-w of the first chromaticity prediction value is 0, which can be understood as directly determining the second chromaticity prediction value as the third chromaticity prediction value of the current block (predSamplesCb′ for Cb component and predSamplesCr′ for Cr component).
[0777] This application provides an encoding / decoding method. When performing cross-component prediction on the current block, prediction weights for cross-component prediction can be determined based on the reconstructed value and predicted value of the first image component, and the predicted value of the second image component can be further derived based on these prediction weights. In other words, this application can introduce a weight-based prediction model into the inter-frame cross-component prediction process, improving prediction accuracy and thus enhancing encoding / decoding performance.
[0778] Based on the above embodiments, in another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG27 is a schematic diagram of the composition structure of an encoder proposed in an embodiment of this application. As shown in FIG27, the encoder 100 may include a first determining part 1101, wherein:
[0779] The first determining part 1101 is configured to determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0780] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.
[0781] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0782] Therefore, this application provides a computer-readable storage medium applied to an encoder 100, the computer-readable storage medium storing a computer program that, when executed by a first processor, implements the method described in any of the foregoing embodiments.
[0783] Based on the composition of the encoder 100 described above and the computer-readable storage medium, Figure 28 is a schematic diagram of the specific hardware structure of an encoder proposed in an embodiment of this application. As shown in Figure 28, the encoder 100 may include: a first communication interface 1201, a first memory 1202, and a first processor 1203; the various components are coupled together through a first bus system 1204. It can be understood that the first bus system 1204 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 1204 in the figure.
[0784] The first communication interface 1201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0785] The first memory 1202 is used to store computer programs that can run on the first processor 1203;
[0786] The first processor 1203 is configured to, when running the computer program, perform the following: determining prediction parameters of the current block; determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determining the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0787] It is understood that the first memory 1202 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1202 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0788] The first processor 1203 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1203 or by instructions in software form. The first processor 1203 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1202. The first processor 1203 reads the information in the first memory 1202 and completes the steps of the above method in conjunction with its hardware.
[0789] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal 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 for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0790] Alternatively, as another embodiment, the first processor 1203 is further configured to execute the method described in any of the foregoing embodiments when running the computer program.
[0791] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG29 is a schematic diagram of the composition structure of a decoder proposed in an embodiment of this application. As shown in FIG29, the decoder 200 may include a second determining part 2101, wherein:
[0792] The second determining part 2101 is configured to determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0793] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0794] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applied to the decoder 200. This computer-readable storage medium stores a computer program, which, when executed by a second processor, implements the method described in any of the foregoing embodiments.
[0795] Based on the composition of the decoder 200 and the computer-readable storage medium described above, Figure 30 is a schematic diagram of the specific hardware structure of a decoder proposed in an embodiment of this application. As shown in Figure 30, the decoder 200 may include: a second communication interface 2201, a second memory 2202, and a second processor 2203; the various components are coupled together through a second bus system 2204. It is understood that the second bus system 2204 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 2204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 2204 in the figure.
[0796] The second communication interface 2201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0797] The second memory 2202 is used to store computer programs that can run on the second processor 2203;
[0798] The second processor 2203 is configured to, when running the computer program, perform the following: determining prediction parameters for the current block; determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters for the current block; determining the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
[0799] Alternatively, as another embodiment, the second processor 2203 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.
[0800] It is understood that the second memory 2202 has similar hardware functions to the first memory 1202, and the second processor 2203 has similar hardware functions to the first processor 1203; details will not be elaborated here.
[0801] In another embodiment of this application, FIG31 is a schematic diagram of the composition structure of an encoding and decoding system proposed in an embodiment of this application. As shown in FIG31, the encoding and decoding system 300 may include an encoder 100 and a decoder 200.
[0802] In the embodiments of this application, the encoder 100 may be any one of the encoders described in the foregoing embodiments, and the decoder 200 may be any one of the decoders described in the foregoing embodiments.
[0803] Furthermore, this embodiment provides a computer-readable storage medium for storing a bitstream generated by any of the encoding methods in the foregoing embodiments.
[0804] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0805] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0806] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0807] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0808] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0809] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability
[0810] This application provides an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines prediction parameters for the current block; based on the prediction parameters, it determines the reconstructed value of a first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of a second image component of the current block; based on the reconstructed value and the predicted value of the first image component, it determines the prediction weight of the current block; and based on the prediction weight and the first predicted value of the second image component, it determines the predicted value of the second image component of the current block. Therefore, in this application's embodiments, when performing cross-component prediction on the current block, the prediction weight for cross-component prediction can be determined based on the reconstructed value and the predicted value of the first image component, and the predicted value of the second image component can be further derived based on this prediction weight. In other words, this application can introduce a weight-based prediction model into the inter-frame cross-component prediction process, improving prediction accuracy and thus enhancing encoding / decoding performance.
Claims
1. A decoding method applied to a decoder, the method comprising: Determine the prediction parameters for the current block; Based on the prediction parameters of the current block, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block are determined. The prediction weight of the current block is determined based on the reconstructed value of the first image component and the predicted value of the first image component. Based on the prediction weight of the current block and the first prediction value of the second image component, the prediction value of the second image component of the current block is determined.
2. The method according to claim 1, wherein, The prediction parameters include at least one or more of the following: Control parameters; Predict the input parameters; Predict the output parameters; Weighted model based on lookup table; Maximum weight model index.
3. The method of claim 2, wherein, Determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block includes: The number of samples is determined based on the predicted input parameters; The reconstructed value of the first image component, the predicted value of the first image component, and the first predicted value of the second image component are determined based on the number of samples.
4. The method of claim 3, wherein, Determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component includes: Based on the reconstructed value of the first image component and the predicted value of the first image component, a first image component difference vector of the first sample is determined; wherein, the first sample is any second image component sample of the current block; The prediction weights of the first sample are determined based on the first image component difference vector of the first sample. The prediction weight of the current block is determined based on the prediction weight of the first sample.
5. The method of claim 4, wherein, Determining the first image component difference vector of the first sample based on the reconstructed value and the predicted value of the first image component includes: The reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed values of the first image component; Based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component, the difference vector of the first image component of the first sample is determined.
6. The method of claim 4, wherein, Determining the first image component difference vector of the first sample based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component includes: The reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed values of the first image component; Determine the predicted value of the first image component of the second sample; wherein the second sample is one or more first image component samples of the current block; Based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the second sample, the first image component difference vector of the first sample is determined.
7. The method of claim 6, wherein, The method further includes: The second sample is determined based on the position information of the first image component sample corresponding to the first sample.
8. The method of claim 6, wherein, The method further includes: The second sample is determined based on the position information, first preset width, and first preset height of the first image component sample corresponding to the first sample.
9. The method of any one of claims 5 to 8, wherein, The method further includes: The first image component difference vector of the first sample is subjected to a first preset processing; wherein... The first preset process includes at least one or more of the following: Linear processing; Nonlinear processing; Shrinkage processing; Magnification.
10. The method of any one of claims 4 to 9, wherein, Determining the prediction weights of the first sample based on the first image component difference vector of the first sample includes: The weight index of the first sample is determined based on the first image component difference vector of the first sample. Based on the lookup table-based weight model and the weight index of the first sample, the predicted weight of the first sample is determined.
11. The method of any one of claims 4 to 10, wherein, Determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component includes: Based on the first predicted value of the second image component, determine the second image component difference vector of the first sample; Based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
12. The method of any one of claims 4 to 10, wherein, The method further includes: Determine the predicted value of the second image component of the third sample; wherein the third sample is one or more second image component samples of the current block; Based on the predicted value of the second image component of the third sample, the difference vector of the second image component of the first sample is determined; Based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
13. The method of claim 12, wherein, The method further includes: The third sample is determined based on the location information of the first sample.
14. The method of claim 12, wherein, The method further includes: The third sample is determined based on the position information of the first sample, the second preset width, and the second preset height.
15. The method of any one of claims 11 to 14, wherein, Determining the predicted value of the second image component of the current block based on the difference vector of the second image component of the first sample and the prediction weight of the current block includes: Based on the second image component difference vector of the first sample and the prediction weight of the first sample, the first parameter of the first sample is determined, and the first accumulation parameter of the current block is determined based on the first parameter of the first sample. The second accumulation parameter of the current block is determined based on the prediction weight of the current block; Based on the first accumulated parameter and the second accumulated parameter, the predicted value of the second image component of the first sample is determined; Based on the predicted value of the second image component of the first sample, the predicted value of the second image component of the current block is determined.
16. The method of claim 15, wherein, Determining the predicted value of the second image component of the first sample based on the first accumulation parameter and the second accumulation parameter includes: Based on the first accumulated parameter and the second accumulated parameter, determine the second predicted value of the second image component of the first sample; The predicted value of the second image component of the first sample is determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
17. The method of claim 16, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The predicted value of the second image component of the first sample is determined based on the first weight of the first predicted value of the second image component of the first sample, the second weight of the second predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample, and the second predicted value of the second image component of the first sample.
18. The method of claim 17, wherein, The method further includes: The ratio between the first weight and the second weight is determined to be a first value.
19. The method of claim 17, wherein, The method further includes: Determine the residual value of the first image component corresponding to the first sample; The first weight and the second weight are determined based on the residual value of the first image component corresponding to the first sample.
20. The method of claim 17, wherein, The method further includes: Decode the bitstream to determine the first syntax element identifier information; The first weight and the second weight are determined based on the first syntax element identification information.
21. The method of claim 16, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The second predicted value of the second image component of the first sample is determined as the predicted value of the second image component of the first sample.
22. The method of claim 16, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The second predicted value of the second image component of the first sample is subjected to a second preset processing to determine the predicted value of the second image component of the first sample; wherein, The second preset processing includes at least one or more of the following: Correction processing based on the first upper limit threshold; Correction processing based on the first lower threshold; Rounding down; Rounding.
23. The method of any one of claims 4 to 22, wherein, The method further includes: The predicted values of the second image components of the first sample are subjected to a third preset processing, wherein, The third preset process includes at least one or more of the following: Correction processing based on the second upper limit threshold; Correction processing based on the second lower threshold.
24. The method of any one of claims 2 to 23, wherein, The determination of the prediction parameters for the current block includes: The block type of the current block is determined based on the size information of the current block; The control parameters, the prediction input parameters, and the prediction output parameters are determined based on the block type of the current block.
25. The method of any one of claims 2 to 23, wherein, The determination of the prediction parameters for the current block includes: The block type of the current block is determined based on the image information of the current block; The control parameters, the prediction input parameters, and the prediction output parameters are determined based on the block type of the current block.
26. The method of any one of claims 1 to 25, wherein, The method further includes: Based on the motion vector of the current block, the reconstructed value of the second image component of the reference block is determined in the reference image of the current image; The first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block.
27. The method of any one of claims 1 to 25, wherein, The method further includes: Based on the block vector of the current block, the reconstructed value of the second image component of the reference block is determined in the current image; The first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block.
28. An encoding method applied to an encoder, the method comprising: Determine the prediction parameters for the current block; Based on the prediction parameters of the current block, the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block are determined. The prediction weight of the current block is determined based on the reconstructed value of the first image component and the predicted value of the first image component. Based on the prediction weight of the current block and the first prediction value of the second image component, the prediction value of the second image component of the current block is determined.
29. The method according to claim 28, wherein, The prediction parameters include at least one or more of the following: Control parameters; Predict the input parameters; Predict the output parameters; Weighted model based on lookup table; Maximum weight model index.
30. The method of claim 29, wherein, Determining the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block includes: The number of samples is determined based on the predicted input parameters; The reconstructed value of the first image component, the predicted value of the first image component, and the first predicted value of the second image component are determined based on the number of samples.
31. The method of claim 30, wherein, Determining the prediction weight of the current block based on the reconstructed value and the predicted value of the first image component includes: Based on the reconstructed value of the first image component and the predicted value of the first image component, a first image component difference vector of the first sample is determined; wherein, the first sample is any second image component sample of the current block; The prediction weights of the first sample are determined based on the first image component difference vector of the first sample. The prediction weight of the current block is determined based on the prediction weight of the first sample.
32. The method of claim 31, wherein, Determining the first image component difference vector of the first sample based on the reconstructed value and the predicted value of the first image component includes: The reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed values of the first image component; Based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component, the difference vector of the first image component of the first sample is determined.
33. The method of claim 31, wherein, Determining the first image component difference vector of the first sample based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component includes: The reconstructed value of the first image component corresponding to the first sample is determined from the reconstructed values of the first image component; Determine the predicted value of the first image component of the second sample; wherein the second sample is one or more first image component samples of the current block; Based on the reconstructed value of the first image component corresponding to the first sample and the predicted value of the first image component of the second sample, the first image component difference vector of the first sample is determined.
34. The method of claim 33, wherein, The method further includes: The second sample is determined based on the position information of the first image component sample corresponding to the first sample.
35. The method of claim 33, wherein, The method further includes: The second sample is determined based on the position information, first preset width, and first preset height of the first image component sample corresponding to the first sample.
36. The method of any one of claims 32 to 35, wherein, The method further includes: The first image component difference vector of the first sample is subjected to a first preset processing; wherein... The first preset process includes at least one or more of the following: Linear processing; Nonlinear processing; Shrinkage processing; Magnification.
37. The method of any one of claims 31 to 36, wherein, Determining the prediction weights of the first sample based on the first image component difference vector of the first sample includes: The weight index of the first sample is determined based on the first image component difference vector of the first sample. Based on the lookup table-based weight model and the weight index of the first sample, the predicted weight of the first sample is determined.
38. The method of any one of claims 31 to 37, wherein, Determining the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component includes: Based on the first predicted value of the second image component, determine the second image component difference vector of the first sample; Based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
39. The method of any one of claims 31 to 37, wherein, The method further includes: Determine the predicted value of the second image component of the third sample; wherein the third sample is one or more second image component samples of the current block; Based on the predicted value of the second image component of the third sample, the difference vector of the second image component of the first sample is determined; Based on the difference vector of the second image components of the first sample and the prediction weight of the current block, the predicted value of the second image component of the current block is determined.
40. The method of claim 39, wherein, The method further includes: The third sample is determined based on the location information of the first sample.
41. The method of claim 39, wherein, The method further includes: The third sample is determined based on the position information of the first sample, the second preset width, and the second preset height.
42. The method of any one of claims 38-41, wherein, Determining the predicted value of the second image component of the current block based on the difference vector of the second image component of the first sample and the prediction weight of the current block includes: Based on the second image component difference vector of the first sample and the prediction weight of the first sample, the first parameter of the first sample is determined, and the first accumulation parameter of the current block is determined based on the first parameter of the first sample. The second accumulation parameter of the current block is determined based on the prediction weight of the current block; Based on the first accumulated parameter and the second accumulated parameter, the predicted value of the second image component of the first sample is determined; Based on the predicted value of the second image component of the first sample, the predicted value of the second image component of the current block is determined.
43. The method of claim 42, wherein, Determining the predicted value of the second image component of the first sample based on the first accumulation parameter and the second accumulation parameter includes: Based on the first accumulated parameter and the second accumulated parameter, determine the second predicted value of the second image component of the first sample; The predicted value of the second image component of the first sample is determined based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample.
44. The method of claim 43, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The predicted value of the second image component of the first sample is determined based on the first weight of the first predicted value of the second image component of the first sample, the second weight of the second predicted value of the second image component of the first sample, the first predicted value of the second image component of the first sample, and the second predicted value of the second image component of the first sample.
45. The method of claim 44, wherein, The method further includes: The ratio between the first weight and the second weight is determined to be a first value.
46. The method of claim 44, wherein, The method further includes: Determine the residual value of the first image component corresponding to the first sample; The first weight and the second weight are determined based on the residual value of the first image component corresponding to the first sample.
47. The method of claim 44, wherein, The method further includes: Determine the identifier information of the first syntax element; The first weight and the second weight are determined based on the first syntax element identification information.
48. The method of claim 43, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The second predicted value of the second image component of the first sample is determined as the predicted value of the second image component of the first sample.
49. The method of claim 43, wherein, Determining the predicted value of the second image component of the first sample based on the first predicted value of the second image component of the first sample and / or the second predicted value of the second image component of the first sample includes: The second predicted value of the second image component of the first sample is subjected to a second preset processing to determine the predicted value of the second image component of the first sample; wherein, The second preset processing includes at least one or more of the following: Correction processing based on the first upper limit threshold; Correction processing based on the first lower threshold; Rounding down; Rounding.
50. The method of any one of claims 31 to 49, wherein, The method further includes: The predicted values of the second image components of the first sample are subjected to a third preset processing, wherein, The third preset process includes at least one or more of the following: Correction processing based on the second upper limit threshold; Correction processing based on the second lower threshold.
51. The method of any of claims 28 to 20, wherein, The determination of the prediction parameters for the current block includes: The block type of the current block is determined based on the size information of the current block; The control parameters, the prediction input parameters, and the prediction output parameters are determined based on the block type of the current block.
52. The method of any one of claims 28-20, wherein, The determination of the prediction parameters for the current block includes: The block type of the current block is determined based on the image information of the current block; The control parameters, the prediction input parameters, and the prediction output parameters are determined based on the block type of the current block.
53. The method of any one of claims 28 to 52, wherein, The method further includes: Based on the motion vector of the current block, the reconstructed value of the second image component of the reference block is determined in the reference image of the current image; The first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block.
54. The method of any one of claims 28 to 52, wherein, The method further includes: Based on the block vector of the current block, the reconstructed value of the second image component of the reference block is determined in the current image; The first predicted value of the second image component of the current block is determined based on the reconstructed value of the second image component of the reference block.
55. An encoder, wherein, The encoder includes: The first determining part is configured to: determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
56. An encoder, wherein, The encoder includes: a first memory and a first processor; wherein, A first memory for storing computer programs that can run on a first processor; A first processor is configured to, while running the computer program, perform the method as described in any one of claims 28 to 54.
57. A decoder, wherein, The decoder includes: The second determining part is configured to: determine the prediction parameters of the current block; determine the reconstructed value of the first image component of the current block, the predicted value of the first image component of the current block, and the first predicted value of the second image component of the current block based on the prediction parameters of the current block; determine the prediction weight of the current block based on the reconstructed value of the first image component and the predicted value of the first image component; and determine the predicted value of the second image component of the current block based on the prediction weight of the current block and the first predicted value of the second image component.
58. A decoder, wherein, The decoder includes: a second memory and a second processor; wherein... The second memory is used to store computer programs that can run on the second processor; A second processor is configured to perform the method as described in any one of claims 1 to 27 when running the computer program.
59. A computer-readable storage medium storing a computer program that, when executed, implements the decoding method as described in any one of claims 1 to 27, or the encoding method as described in any one of claims 28 to 54.
60. A computer-readable storage medium for storing a bitstream generated by the encoding method of any one of claims 28 to 54.