Encoding and decoding method and apparatus therefor, encoding device, decoding device, and storage medium
The proposed method addresses the accuracy and efficiency issues in H.266/VVC by filtering and weighting color component predictions, improving chromaticity prediction and reducing bitrate in video encoding and decoding.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-04-28
AI Technical Summary
The Joint Video Exploration Team's H.266/Versatile Video Coding (VVC) exhibits large deviations in predicted color component values, leading to reduced prediction accuracy and decreased coding performance in video decoding.
An encoding and decoding method that determines reference information for a current block, filters a portion of this information, calculates a weighting coefficient based on color component values, and uses this to predict the block, enhancing spatial correlation continuity and removing weakly correlated information.
Improves chromaticity prediction accuracy, reduces bitrate, and enhances encoding and decoding performance by considering color format information and applying filtering processes.
Smart Images

Figure 2026071343000001_ABST
Abstract
Description
[Technical Field]
[0001] The embodiments of this application relate to the video encoding and decoding technology, and more particularly to encoding and decoding methods and apparatus therefor, encoding equipment, decoding equipment, and storage media. [Background technology]
[0002] As people's demands for video display quality increase, new forms of video applications, such as high-resolution and ultra-high-resolution video, are emerging. The Joint Video Exploration Team (JVET) of the International Organization for Standardization (ISO / IEC) and the ITU-T has developed the next-generation video coding standard H.266 / Versatile Video Coding (VVC).
[0003] H.266 / VVC includes color component prediction techniques. However, there is a large deviation between the predicted values of coded blocks calculated by H.266 / VVC's color component prediction techniques and the original values, which leads to a decrease in prediction accuracy, resulting in a decline in the quality of decoded video and reduced coding performance. [Overview of the Initiative] [Problems that the invention aims to solve]
[0004] The embodiments of this application provide an encoding and decoding method and apparatus, encoding device, decoding device, and storage medium that can improve the accuracy of chromaticity prediction, save bitrate, and also improve encoding and decoding performance. [Means for solving the problem]
[0005] The technical solution of the embodiment of the present application can be realized as follows.
[0006] According to the first aspect, the embodiments of the present application provide a decoding method, the method is Currently, the block's reference information is determined, Currently, a filtering process is performed on some of the reference information of the current block to determine the target information of the current block. The weighting coefficient is determined based on the reference sample value of the first color component in the target information, Based on the weighting coefficient and the reference sample value of the second color component in the target information, the predicted block for the second color component of the current block is determined, This includes determining the reconstructed values of the second color component sample points of the current block based on the predicted block.
[0007] According to a second aspect, an embodiment of the present application provides an encoding method, the method is Currently, the block's reference information is determined, Currently, a filtering process is performed on some of the reference information of the current block to determine the target information of the current block. The weighting coefficient is determined based on the reference sample value of the first color component in the target information, Based on the weighting coefficient and the reference sample value of the second color component in the target information, the predicted block for the second color component of the current block is determined, This includes determining the predicted difference value of the second color component sample point of the current block based on the predicted block.
[0008] According to a third aspect, an embodiment of the present application provides an encoding device comprising a first decision unit, a first filtering unit, and a first prediction unit, wherein, The first decision unit is configured to determine the reference information of the current block. The first filtering unit is configured to perform filtering on some of the information within the reference information of the current block and to determine the target information of the current block. The first decision unit is further configured to determine a weighting coefficient based on the reference sample value of the first color component in the target information. The first prediction unit is configured to determine the predicted block for the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component in the target information. The first decision unit is further configured to determine the predicted difference value of the second color component sample point of the current block based on the prediction block.
[0009] According to a fourth aspect, an embodiment of the present application provides an encoding device comprising a first memory and a first processor, wherein, The first memory is configured to store computer programs that can be executed by the first processor. The first processor is configured to perform the method of the second embodiment by executing a computer program.
[0010] According to a fifth aspect, an embodiment of the present application provides a decoding device comprising a second determination unit, a second filtering unit, and a second prediction unit, wherein, The second decision unit is configured to determine the reference information for the current block. The second filtering unit is configured to perform filtering on a portion of the reference information of the current block and to determine the target information of the current block. The second decision unit is further configured to determine a weighting coefficient based on the reference sample value of the first color component in the target information. The second prediction unit is configured to determine the predicted block for the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component in the target information. The second decision unit is further configured to determine the reconstructed values of the second color component sample points of the current block based on the predicted block.
[0011] According to the sixth aspect, an embodiment of the present application provides a decoding device comprising a second memory and a second processor, wherein, The second memory is configured to store computer programs that can be executed by the second processor. The second processor is configured to perform the method described in the first embodiment by executing a computer program.
[0012] According to the seventh aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for performing the method described in the first aspect or the method described in the second aspect. [Effects of the Invention]
[0013] Embodiments of the present application provide an encoding / decoding method and apparatus, an encoding device, a decoding device, and a storage medium. On either the encoding or decoding side, the current block reference information is determined, a filtering process is performed on a portion of the current block reference information, the current block target information is determined, a weighting coefficient is determined based on the reference sample value of the first color component in the target information, and the predicted block of the second color component of the current block is determined based on the weighting coefficient and the reference sample value of the second color component in the target information. In this way, the encoding side can determine the predicted difference value of the sample point of the second color component of the current block based on the predicted block, and thereby the decoding side can determine the reconstructed value of the sample point of the second color component of the current block based on the predicted block. In this manner, the characteristics of the color format information are sufficiently considered with respect to the color component information in the adjacent region of the current block and the color component information within the current block, thereby improving the accuracy of this reference information. Furthermore, by applying filtering processes such as upsampling and downsampling to this reference information, the continuity of its spatial correlation can be strengthened to some extent, or some information with relatively weak spatial correlation can be removed. By using the target information obtained after filtering, chromaticity prediction can be performed more appropriately, thereby improving the accuracy of chromaticity prediction, saving bitrate, and improving encoding and decoding performance. [Brief explanation of the drawing]
[0014] [Figure 1]This is a schematic diagram of the distribution of effective adjacent regions. [Figure 2] This is a schematic diagram showing the distribution of selection regions in different prediction modes. [Figure 3] This is an example flowchart of a method for deriving model parameters. [Figure 4A] This is a schematic block diagram of the encoder configuration according to an embodiment of the present invention. [Figure 4B] This is a schematic block diagram of the decoder configuration according to the embodiment of the present invention. [Figure 5] This is flowchart 1 illustrating the decoding method according to the embodiment of the present application. [Figure 6] This is a schematic diagram 1 of the reference region of the current block according to the embodiment of the present application. [Figure 7A] This is a schematic diagram of the downsampling position of the reference luminance information according to the embodiment of the present invention. [Figure 7B] This is a schematic diagram of the upsampling position of the reference chromaticity information according to the embodiment of the present application. [Figure 8] This is a schematic diagram of the rearrangement position of the reference luminance information according to the embodiment of the present application. [Figure 9] This is a schematic diagram of weighted predictions for the WCP mode and other prediction modes according to the embodiment of the present invention. [Figure 10] This is a schematic diagram of the weight-based chromaticity prediction framework according to the embodiment of the present invention. [Figure 11] This is flowchart 2 illustrating an exemplary decoding method according to the embodiment of the present invention. [Figure 12] Figure 1 shows a schematic diagram of the upsampling interpolation process according to the embodiment of the present invention. [Figure 13] Figure 2 shows a schematic diagram of the upsampling interpolation process according to the embodiment of the present invention. [Figure 14] This is a schematic diagram of the weight values for upsampling interpolation according to the embodiment of the present application. [Figure 15] Figure 3 shows a schematic diagram of the upsampling interpolation process according to the embodiment of the present invention. [Figure 16]This is flowchart 3 illustrating an exemplary decoding method according to the embodiment of the present application. [Figure 17] This is a schematic diagram 2 of the reference region of the current block according to the embodiment of the present application. [Figure 18] This is flowchart 1 illustrating an example of the encoding method according to the embodiment of the present invention. [Figure 19] This is flowchart 2 illustrating an example of the encoding method according to the embodiment of the present invention. [Figure 20] This is an illustrative structural diagram of the configuration of an encoding device according to an embodiment of the present invention. [Figure 21] This is a schematic diagram of the specific hardware structure of the encoding device according to the embodiment of the present invention. [Figure 22] This is an illustrative structural diagram of the configuration of a decoding device according to an embodiment of the present application. [Figure 23] This is a schematic diagram of the specific hardware structure of the decoding device according to the embodiment of the present invention. [Figure 24] This is an illustrative structural diagram of the configuration of an encoding / decoding system according to an embodiment of the present invention. [Modes for carrying out the invention]
[0015] To better understand the features and technical content of the embodiments of this application, the embodiments will be described in detail below with reference to the drawings. The accompanying drawings are for reference only and are not intended to limit the embodiments of the present invention.
[0016] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art. The terms used herein are for illustrative purposes only and are not intended to limit the application.
[0017] In the following description, the term “several embodiments” refers to a subset of all possible embodiments, and as can be understood, “several embodiments” may be the same subset or different subsets of all possible embodiments, and these can be combined with one another without conflict. The terms “first / second / third” as used in the embodiments of this application are merely for distinguishing similar subjects and do not represent a particular order of subjects, and as can be understood, “first / second / third” may, in some cases, be interchangeable with a particular order or precedence, so that the embodiments of this application described herein may be carried out in an order other than the order illustrated or described.
[0018] In video images, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component, where these three color components are one luminance component, one blue chromaticity component, and one red chromaticity component, respectively. Exemplaryly, the luminance component is usually represented by the code "Y", the blue chromaticity component by the code "Cb" or "U", and the red chromaticity component by the code "Cr" or "V". Thus, a video image may be represented in YCbCr format or YUV format. In addition, a video image may be represented in RGB format, YCgCo format, etc., and the embodiments of this application are not limited to these.
[0019] It can be understood that in current video image or video encoding / decoding processes, cross-component prediction techniques mainly include cross-component linear model (CCLM) prediction modes and multi-directional linear model (MDLM) prediction modes. Whether the model parameters are derived based on the CCLM prediction mode or the MDLM prediction mode, the corresponding prediction models can achieve predictions between color components, such as predictions from the first color component to the second color component, from the second color component to the first color component, from the first color component to the third color component, from the third color component to the first color component, from the second color component to the third color component, or from the third color component to the second color component.
[0020] Taking the prediction from the first color component to the second color component as an example, assuming the first color component is the luminance component and the second color component is the chromaticity component, in order to reduce redundancy between the luminance and chromaticity components, H.266 / Versatile Video Coding (VVC) uses the CCLM prediction mode, that is, it constructs the predicted chromaticity value based on the luminance reconstruction value of the same coding block, for example, Pred_C (i,j)=α·Rec L (i,j)+β
[0021] Here, (i,j) represents the position coordinates of the target pixel within the coding block, where i represents the horizontal direction and j represents the vertical direction. Pred_C(i,j) represents the predicted chromaticity value corresponding to the target pixel at position coordinates (i,j) within the coding block, and Rec_L(i,j) represents the reconstructed luminance value corresponding to the target pixel at (downsampled) position coordinates (i,j) within the same coding block. Furthermore, α and β represent model parameters, which can be derived from the reference pixel.
[0022] With respect to an encoded block, its adjacency region can be divided into five parts: the left adjacency region, the upper adjacency region, the lower left adjacency region, the upper left adjacency region, and the upper right adjacency region. H.266 / VVC includes three types of cross-component linear model prediction modes: the left and upper adjacency intra-CCLM prediction mode (which can be represented as INTRA_LT_CCLM), the left and lower left adjacency region (which can be represented as INTRA_L_CCLM), and the upper and upper right adjacency region (which can be represented as INTRA_T_CCLM). In these three prediction modes, a set number (e.g., four) of reference pixels can be selected for use in deriving the model parameters α and β. The main difference between these three prediction modes is that the selected regions corresponding to the reference pixels used in deriving the model parameters α and β are different.
[0023] Specifically, assuming that the size of the coding block corresponding to the chromaticity component is W × H, and that the upper selection region corresponding to the reference pixel is W' and the left selection region corresponding to the reference pixel is H', In INTRA_LT_CCLM mode, the reference pixel can be selected from the upper adjacent region and the left adjacent region, that is, set W'=W and H'=H. In INTRA_L_CCLM mode, the reference pixel can be selected from the left adjacent region and the lower left adjacent region, that is, H′=W+H and W′=0. In INTRA_T_CCLM mode, the reference pixel can be selected from the upper adjacent region and the upper right adjacent region, that is, W′=W+H and H′=0.
[0024] It is important to note that in VTM, only pixel points within the maximum W range are stored in the upper right adjacent region, and only pixel points within the maximum H range are stored in the lower left adjacent region. While the selection area range for INTRA_L_CCLM mode and INTRA_T_CCLM mode is defined as W+H, in actual applications, the selection area for INTRA_L_CCLM mode is limited to H+H, and the selection area for INTRA_T_CCLM mode is limited to W+W. Therefore, In INTRA_L_CCLM mode, the reference pixel can be selected from the left adjacent region and the lower left adjacent region, and H′ = min{W+H,H+H}. In INTRA_T_CCLM mode, the reference pixel can be selected from the upper adjacent region and the upper right adjacent region, and W' = min{W+H,W+W}.
[0025] Figure 1 shows a schematic diagram of the distribution of valid adjacent regions. In Figure 1, the left adjacent region, the lower left adjacent region, the upper adjacent region, and the upper right adjacent region are all valid. Furthermore, the gray-filled blocks are the predicted pixels whose position coordinates within the coded block are (i,j).
[0026] Based on Figure 1, the selection regions for the three prediction modes are as shown in Figure 2. In Figure 2, (a) shows the selection region for the INTRA_LT_CCLM mode, which includes the left adjacent region and the upper adjacent region; (b) shows the selection region for the INTRA_L_CCLM mode, which includes the left adjacent region and the lower left adjacent region; and (c) shows the selection region for the INTRA_T_CCLM mode, which includes the upper adjacent region and the upper right adjacent region. After determining the selection regions for the three prediction modes in this way, pixels to be used to derive model parameters can be selected from the selection regions. These selected pixels are called reference pixels, and there are usually four reference pixels. In the case of a W×H coded block with a fixed size, the position of its reference pixels is generally fixed.
[0027] After obtaining a predetermined number of reference pixels, chromaticity prediction is now performed according to an exemplary flowchart of the model parameter derivation scheme shown in Figure 3. According to the process shown in Figure 3, assuming the predetermined number is 4, the process may include the following steps.
[0028] In step S301, a reference pixel is obtained from the selected area.
[0029] In step S302, the number of valid reference pixels is determined.
[0030] In step S303, if the number of valid reference pixels is 0, the model parameter α is set to 0 and β is set to its default value.
[0031] In step S304, the chromaticity prediction value is populated with the default value.
[0032] In step S305, if the number of valid reference pixels is 4, the comparison obtains two reference pixels with large luminance component values and two reference pixels with small luminance component values.
[0033] In step S306, the mean point corresponding to the larger value and the mean point corresponding to the smaller value are calculated.
[0034] In step S307, the model parameters α and β are derived based on the two mean points.
[0035] In step S308, chromaticity prediction is performed using the prediction model constructed by α and β.
[0036] In VVC, the number of valid reference pixels being 0 is determined based on the validity of adjacent regions.
[0037] Further explanation is needed regarding the principle of "determining a straight line with two points" used to construct the predictive model, where these two points are also called fitting points. In current technical solutions, after acquiring four reference pixels, comparison is performed to obtain two reference pixels with large luminance component values and two reference pixels with small luminance component values, and then the mean point is determined based on the two reference pixels with large values. max We find the mean (which can be represented as) and, based on the two reference pixels with smaller values, we find another mean point (mean max (which can be expressed as) and find the two mean points max and mean min We can obtain meanmax and mean min Using these as two fitting points, we can derive the model parameters (which can be represented by α and β), and finally, we construct a predictive model based on α and β, and then perform a predictive process for the chromaticity component based on this predictive model.
[0038] However, in related technologies, the chromaticity component of each coding block is a simple linear model Pred C (i,j) = α·Rec LPrediction is made using (i,j)+β, and pixels at any position in each coded block are also predicted using the same model parameters α and β. This method has the following drawbacks: Firstly, while coded blocks with different content characteristics all achieve chromaticity prediction by mapping from luminance to chromaticity using a simple linear model, the luminance-to-chromaticity mapping function within all coded blocks cannot necessarily be accurately fitted by this simple linear model, resulting in insufficient prediction accuracy for some coded blocks. Secondly, because pixel points at different positions within a coded block all use the same model parameters α and β in the prediction process, there is a large difference in prediction accuracy at different positions within the coded block. Thirdly, the CCLM technique's prediction process does not adequately consider the high correlation between the reconstructed luminance information of the current block and the reference information of the adjacent region, so accurate prediction is not possible for some coded blocks using this technique, affecting the gain effect of the technique. In short, current CCLM technology suffers from large deviations between the predicted and original values of some coded blocks, resulting in reduced prediction accuracy, lower quality, and consequently, decreased coding and decoding efficiency.
[0039] In view of this, an embodiment of the present application provides an encoding method which determines the reference information of the current block, filters a portion of the reference information of the current block, determines the target information of the current block, determines a weighting coefficient based on the reference sample value of the first color component in the target information, determines the predicted block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component in the target information, and determines the predicted difference value of the sample point of the second color component of the current block based on the predicted block.
[0040] Embodiments of the present invention further provide a decoding method which involves determining reference information for the current block, filtering some of the reference information for the current block, determining target information for the current block, determining a weighting coefficient based on the reference sample value of the first color component in the target information, determining a predicted block for the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component in the target information, and determining a reconstructed value for the sample point of the second color component of the current block based on the predicted block.
[0041] In this way, the characteristics of the color format information are fully considered for the color component information in the adjacent region of the current block and the color component information within the current block, thereby improving the accuracy of this reference information. Furthermore, by applying filtering processes such as upsampling and downsampling to this reference information, the continuity of spatial correlation can be strengthened to some extent, or some information with relatively weak spatial correlation can be removed. By utilizing the target information obtained through the filtering process, chromaticity prediction can be performed more appropriately, thereby improving the accuracy of chromaticity prediction and enhancing encoding and decoding performance while saving bitrate.
[0042] The embodiments of this application will be described in detail below with reference to the drawings.
[0043] Referring to Figure 4A, a schematic block diagram of the encoder configuration according to an embodiment of the present invention is shown. As shown in Figure 4A, the encoder (specifically, the "video encoder") 100 includes a transform and quantization unit 101, an intra-estimation unit 102, an intra-prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoding image buffer unit 110, where 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). A single video coding block can be obtained from the input original video signal by dividing it into a coding tree unit (CTU). Then, the video coding block is transformed via a transformation and quantization unit 101 with respect to residual pixel information obtained by intra-prediction or inter-prediction. This involves transforming the residual information from the pixel region to the transformation region and quantizing the resulting transformation coefficients, thereby further reducing the bitrate.The intra-estimation unit 102 and the intra-prediction unit 103 are configured to perform intra-prediction on the video coding block, specifically, the intra-estimation unit 102 and the intra-prediction unit 103 are configured to determine the intra-prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are configured to perform inter-prediction coding of the received video coding block for 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 that generates motion vectors, which are used to estimate the motion of the video coding block; and the motion compensation unit 104 performs motion compensation based on the motion vectors determined by the motion estimation unit 105; and after the intra-prediction mode is determined, the intra-prediction unit 103 is further configured to provide selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also transmits the computationally determined motion vector data to the encoding unit 109. Furthermore, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coded block, the residual block is reconstructed in the pixel region, the reconstructed residual block is deblocked of blocking artifacts by the filter control analysis unit 107 and the filtering unit 108, and the reconstructed residual block is added to one prediction block in the frame of the decoding image buffer unit 110 to generate a reconstructed video coded block. The coding unit 109 is configured to encode various coding parameters and quantized transformation coefficients, and in a CABAC-based coding algorithm, the context content can be based on adjacent coded blocks, encode information indicating a determined intra-prediction mode, and can be used to output a bitstream of the video signal, and the decoding image buffer unit 110 is configured to store the reconstructed video coded block used for prediction reference.As the encoding of the video image progresses, newly reconstructed video encoding blocks are continuously generated, and all of these reconstructed video encoding blocks are stored in the decoded image buffer unit 110.
[0044] Referring to Figure 4B, a schematic block diagram of the decoder configuration according to an embodiment of the present invention is shown. As shown in Figure 4B, the decoder (specifically, the "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, where 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 performing the encoding process shown in Figure 4A on the input video signal, the bitstream of the video signal is output and input to the decoder 200. First, the decoding unit 201 processes the decoded conversion coefficients, which are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel region. The intra-prediction unit 203 is configured to generate prediction data for the current video decoding block based on the determined intra-prediction mode and data from previous decoding blocks from the current frame or picture. The motion compensation unit 204 is configured to determine prediction information for the video decoding block by analyzing motion vectors and other relevant syntactic elements, and to use this prediction information to generate a prediction block for the video decoding block being decoded. The decoded video block is formed by adding the residual block from the inverse transform and inverse quantization unit 202 with the corresponding prediction block generated by the intra-prediction unit 203 or the motion compensation unit 204. The decoded video signal can be filtered by the filtering unit 205 to remove blocking artifacts and improve video quality. The decoded video block is stored in the decoding image buffer unit 206, which stores a reference image to be used for subsequent intra-prediction or motion compensation and outputs a video signal to obtain the restored original video signal.
[0045] The method of the embodiment of this application is mainly applied to the intra-prediction unit 103 shown in Figure 4A and the intra-prediction unit 203 shown in Figure 4B. In other words, the embodiment of this application may be applied to an encoder, or to a decoder, or even to both an encoder and a decoder simultaneously, but the embodiment of this application is not limited to these.
[0046] To further explain, when applied to the intra-prediction unit 103, "current block" specifically refers to the currently intra-predicted coding block, and when applied to the intra-prediction unit 203, "current block" refers to the currently intra-predicted decoding block.
[0047] In one embodiment of the present application, referring to Figure 5, an illustrative flowchart 1 of the decoding method according to the embodiment of the present application is shown. As shown in Figure 5, the method may include the following steps.
[0048] In step S501, the reference information for the current block is determined.
[0049] Furthermore, the decoding method of the embodiment of this application can be applied to a decoding device or a decoding equipment (also called a "decoder") that integrates such a decoding device. More specifically, the decoding method of the embodiment of this application may refer to an intra-prediction method, and more specifically, a weight-based chroma prediction (WCP) preprocessing operation method.
[0050] In embodiments of the present invention, a video image can be divided into a plurality of decoding blocks, each decoding block may include a first color component, a second color component, and a third color component, where the current block refers to the decoding block currently intra-predicted within the video image. Furthermore, if the current block makes a prediction for the first color component and it is assumed that the first color component is the luminance component, that is, if it is assumed that the component to be predicted is the luminance component, then the current block is also called a luminance prediction block. Alternatively, if a prediction for the second color component is made for the current block and it is assumed that the second color component is the chromaticity component, that is, if it is assumed that the component to be predicted is the chromaticity component, then the current block is also called a chromaticity prediction block.
[0051] Furthermore, in embodiments of the present application, the reference information for the current block may include the values of the first color component sample points in the adjacent region of the current block and the values of the second color component sample points in the adjacent region of the current block, and these sample points can be determined based on the decoded pixels in the adjacent region of the current block. In some embodiments, the adjacent region of the current block may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0052] Here, the entire upper adjacent region and the upper right adjacent region can be considered as the upper region, the entire left adjacent region and the entire lower left adjacent region can be considered as the left region, and in addition, the adjacent region may further include the upper left region (see Figure 6). Here, when predicting the second color component for the current block, the upper region, left region, and upper left region of the current block as adjacent regions can be called the reference region of the current block, and all pixels within the reference region are decoded reference pixels.
[0053] Furthermore, the reference information of the current block may also include the reconstructed values of the first reference color component sample points within the current block. Therefore, in some embodiments, determining the reference information of the current block is This may include determining the reference information for the current block based on the values of the first color component sample points in the adjacent region of the current block, the values of the second color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block.
[0054] In the embodiments of this application, the reference pixel of the current block may refer to a reference pixel point adjacent to the current block, and is also called the first color component sample point or second color component sample point in the adjacent region of the current block, and is represented as Neighboring Sample or Reference Sample. Here, adjacent means spatially adjacent, but is not limited to this. For example, adjacent means adjacent in the time domain, adjacent in the space and time domains, and furthermore, the reference pixel of the current block may be a reference pixel obtained by performing a specific process on a spatially adjacent reference pixel point, a reference pixel point adjacent in the time domain, or a reference pixel point adjacent in the space and time domains, and the embodiments of this application are not limited to these.
[0055] Furthermore, in the embodiments of this application, the first color component is the luminance component, and the second color component is the chromaticity component. Then, the value of the first color component sample point in the adjacent region of the current block is shown as reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sample point in the adjacent region of the current block is shown as reference chromaticity information corresponding to the reference pixel of the current block.
[0056] In some embodiments, determining the reference pixel of the current block may involve performing a sorting process on pixels in adjacent regions of the current block to determine the reference pixel.
[0057] Specifically, in the embodiments of the present application, a first set of reference pixels can be constructed based on pixels in the adjacent region of the current block, and a selection process can be performed on the first set of reference pixels to determine the reference pixels. Here, the number of reference pixels can be M, where M is a positive integer. In other words, M reference pixels can be selected from pixels in the adjacent region. Here, the value of M may generally be 4, but is not particularly limited.
[0058] Furthermore, it should be explained that the pixels in the adjacent regions of the current block may contain some unimportant pixels (e.g., pixels with low correlation) or some anomalous pixels. To ensure prediction accuracy, these pixels must be removed to obtain valid reference pixels.
[0059] In one particular embodiment, a selection process is performed on pixels in adjacent regions to determine a reference pixel. The position of the selected pixel is determined based on the position of the pixel and / or the color component intensity in the adjacent region, This may include determining a reference pixel from a pixel in an adjacent region based on the position of the selected pixel.
[0060] In the embodiments of this application, the color component intensity can be represented by color component information such as reference luminance information and reference chromaticity information, where the larger the value of the color component information, the higher the color component intensity. Thus, the selection of pixels in adjacent regions may be based on the position of the pixels or on the color component intensity, thereby determining the reference pixels of the current block based on the selected pixels, and further determining the value of the first color component sample point in the adjacent region of the current block and the value of the second color component sample point in the adjacent region of the current block.
[0061] In step S502, filtering is performed on some of the reference information of the current block to determine the target information of the current block.
[0062] In the embodiments of this application, there are cases where the number of values of the first color component sample points in the adjacent region of the current block differs from the number of values of the second color component sample points. In this case, it may be necessary to filter the values of the first color component sample points or the values of the second color component sample points in order to make the numbers equal. Also, since the number of reconstructed values of the first reference color component sample points in the current block differs from the preset size, in this case, it may be necessary to filter the reconstructed values of the first reference color component sample points in the current block and convert the number of reconstructed values of the first reference color component sample points obtained from the current block to the preset size before inputting. In other words, with respect to the reference information of the current block, filtering may be performed only on the values of the first color component sample points in the adjacent region of the current block, or only on the values of the second color component sample points in the adjacent region of the current block, or only on the reconstructed values of the first reference color component sample points in the current block, or on any two of these, or even on all three, and the embodiments of this application are not limited thereto. The following sections will explain each of these situations.
[0063] In one possible embodiment, filtering is performed on a portion of the reference information of the current block to determine the target information of the current block. Currently, a first filtering process is performed on the values of the first color component sample points in the adjacent region of the current block to obtain the filtered sample values of the first color component in the adjacent region of the current block. This may include determining the target information of the current block based on filtered sample values of the first color component in the adjacent region of the current block.
[0064] In the embodiments of the present invention, the quantity of filtered sample values (Samples) of the first color component in the adjacent region of the current block is equal to L, where L represents the quantity of sample values (Samples) of the second color component in the adjacent region of the current block, and L is a positive integer.
[0065] In one particular embodiment, the first filtering process may be a downsampling filtering process. Exemplarily, since the number of reference luminance information points in the current block is usually greater than the number of reference chromaticity information points, a downsampling filtering process can be performed on the reference luminance information of the current block to make the number of reference luminance information points equal to the number of reference chromaticity information points.
[0066] Furthermore, since the number of reference luminance information and reference chromaticity information for the current block is affected by the color format information, in some embodiments the method may further include performing a first filtering process on the values of the first color component sample points in the adjacent region of the current block based on the color format information to obtain filtered sample values of the first color component in the adjacent region of the current block.
[0067] In one particular embodiment, the first filtering process is: When the color format information indicates 4:4:4 sampling, downsampling filtering is not performed on the values of the first color component sample points in the adjacent regions of the current block. When the color format information indicates 4:2:2 sampling, downsampling filtering is performed on the values of the first color component sample points in the adjacent regions of the current block. If the color format information indicates 4:2:0 sampling, this may further include performing downsampling filtering on the values of the first color component sample points in adjacent regions of the current block.
[0068] In the embodiments of this application, when the color format information indicates 4:2:0 sampling, the downsampling rate is the reciprocal of a positive integer multiple of 2.
[0069] Furthermore, in the embodiments of this application, the color format information may include 4:4:4 sampling, 4:2:2 sampling, 4:2:0 sampling, etc. Here, when the color format information indicates 4:4:4 sampling (which can also be represented by YUV444), that is, when the ratio of luminance to chromaticity samples is 4:4:4, the number of reference luminance information obtained from adjacent regions is the same as the number of reference chromaticity information, and no operation is required. When the color format information indicates 4:2:2 sampling (which can also be represented by YUV422), that is, when the ratio of luminance to chromaticity samples is 4:2:2, or when the color format information indicates 4:2:0 sampling (which can also be represented by YUV420), that is, when the ratio of luminance to chromaticity samples is 4:1:1, the number of reference luminance information obtained from adjacent regions is different from the number of reference chromaticity information. In this case, downsampling filtering is required on the reference luminance information obtained from adjacent regions to match the number of reference chromaticity information.
[0070] Thus, the downsampling filtering performed on the reference luminance information obtained from the adjacent region may involve employing a multi-tap filter (e.g., a 4-tap filter, a 5-tap filter, a 6-tap filter, etc.) to perform downsampling, or it may involve obtaining a specific pixel from among multiple reference luminance pixels at the corresponding positions of the reference chromaticity pixels, or it may involve other downsampling methods, and the embodiments of this application are not limited thereto.
[0071] For example, as shown in Figure 7A, if the color format information indicates 4:2:0 sampling, taking an adjacent region of 8x4 luminance pixels as an example, this region needs to be downsampled to a region of 4x2 pixels. Here, (a) represents the reference luminance information refY, and within the thick frame are four luminance pixels corresponding to the same chromaticity pixels, and (k,l) is the corresponding pixel position in the upper left corner; (b) represents the downsampled reference luminance information refY', and within the thick frame are a specific downsampled luminance pixel, and the same chromaticity pixels corresponding to the four luminance pixels within the thick frame in (a) and the specific downsampled luminance pixel are pairs of luminance pixels and chromaticity pixels at the same position; and (i,j) is the position of the downsampled luminance pixel in the downsampled reference luminance information, where i=0,...,3 and j=0,1.
[0072] Furthermore, if the number of downsampled and filtered reference luminance information is L and is the same as the number of reference chromaticity information, then L must be matched to a preset number. Therefore, in some embodiments, the method is This involves comparing L with a pre-set number, Based on the comparison result between L and a pre-set number, a second filtering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. This may further include determining the target information of the current block based on the filtered adjacent sample values of the first color component of the current block and the filtered adjacent sample values of the second color component of the current block.
[0073] In one particular embodiment, based on the comparison result of L with a predetermined number, a second filtering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If L is greater than a preset number, a first subfiltering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. If L is less than a preset number, this may include performing a second subfiltering process on the filtered sample value of the first color component in the adjacent region of the current block and the value of the second color component sample point in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0074] In the embodiments of this application, the pre-set number can be represented by inSize. Here, inSize represents the number of inputs when making predictions based on the weighting coefficient, and the value of inSize is related to the current block type. For example, assuming that the current block width is nTbW and the current block height is nTbH, the value of inSize may be 2 × nTbH + 2 × nTbW, 1.5 × nTbH + 1.5 × nTbW, or even nTbH + nTbW, and is not particularly limited here.
[0075] Furthermore, in the embodiments of this application, if L is equal to a preset number, no operation is required; if L is greater than a preset number, a first subfiltering process (i.e., size reduction) must be performed on the reference luminance information and reference chromaticity information; and if L is less than a preset number, a second subfiltering process (i.e., size expansion) must be performed on the reference luminance information and reference chromaticity information.
[0076] In another possible embodiment, filtering is performed on some of the reference information of the current block to determine the target information of the current block. Currently, a third filtering process is performed on the values of the second color component sample points in the adjacent region of the current block to obtain the filtered sample values of the second color component in the adjacent region of the current block. This may include determining the target information of the current block based on filtered sample values of the second color component in the adjacent region of the current block.
[0077] In the embodiments of the present invention, the number of filtered sample values of the second color component in the adjacent region of the current block is equal to K, where K represents the number of values of the first color component sample points in the adjacent region of the current block, and K is a positive integer.
[0078] In one particular embodiment, the third filtering process is an upsampling filtering process. Exemplarily, since the number of reference luminance information points in the current block is usually greater than the number of reference chromaticity information points, an upsampling filtering process can be applied to the reference chromaticity information of the current block in order to make the number of reference luminance information points equal to the number of reference chromaticity information points.
[0079] Since the number of reference luminance information and reference chromaticity information for a current block is affected by the color format information, in some embodiments, the method may further include performing a third filtering process on the values of the second color component sample points in the adjacent region of the current block based on the color format information to obtain filtered sample values of the second color component in the adjacent region of the current block.
[0080] In one particular embodiment, the third filtering process is: When the color format information indicates 4:4:4 sampling, upsampling filtering is not performed on the values of the second color component sample points in the adjacent region of the current block. When the color format information indicates 4:2:2 sampling, upsampling filtering is performed on the values of the second color component sample points in the adjacent region of the current block. If the color format information indicates 4:2:0 sampling, this may further include performing upsampling filtering on the values of the second color component sample points in adjacent regions of the current block.
[0081] In the embodiment of this application, when the color format information indicates 4:2:0 sampling, the upsampling rate is a positive integer multiple of 2. In this way, if the number of reference luminance information points obtained from adjacent regions differs from the number of reference chromaticity information points, upsampling filtering can be performed on the reference chromaticity information points obtained from adjacent regions to match the number of reference luminance information points.
[0082] Thus, the upsampling filtering performed on the reference chromaticity information obtained from adjacent regions may involve upsampling using methods such as linear interpolation or nonlinear interpolation, or it may involve duplicating specific reference chromaticity pixels, or it may involve other upsampling methods, and the embodiments of this application are not limited thereto.
[0083] For example, as shown in Figure 7B, if the color format information indicates 4:2:0 sampling, then, taking an adjacent region of 4x2 chromaticity pixels as an example, this region needs to be upsampled to an 8x4 pixel region. In Figure 7B, (a) represents the reference chromaticity information refC, and (b) represents the upsampled reference chromaticity information refC'. Here, the thick frame in (a) contains chromaticity pixels corresponding to the four upsampled chromaticity pixels in the thick frame in (b), with k=0,...,3 and l=0,1. The four chromaticity pixels in the thick frame in (b) are the upsampled chromaticity pixels corresponding to the thick frame in (a), and (i,j) is the pixel position of the upper left corner.
[0084] Furthermore, if the number of upsampled and filtered reference chromaticity information is K and the same as the number of reference luminance information, then K must be matched to a preset number. Therefore, in some embodiments, the method is This involves comparing K to a pre-set number, Based on the comparison result between K and a pre-set number, a fourth filtering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. This may further include determining the target information of the current block based on the filtered adjacent sample values of the first color component of the current block and the filtered adjacent sample values of the second color component of the current block.
[0085] In one particular embodiment, based on the comparison result between K and a preset number, a fourth filtering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If K is greater than a preset number, a first subfiltering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If K is less than a preset number, this may include performing a second subfiltering operation on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0086] In the embodiments of this application, the pre-set number can be represented by inSize. Specifically, if K is equal to inSize, no operation is required; if K is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference luminance information and reference chromaticity information; and if K is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference luminance information and reference chromaticity information.
[0087] Furthermore, it can be understood that, in the embodiments of this application, if color format information is not considered, the number of reference luminance information obtained from adjacent regions and the number of reference chromaticity information can be made the same by directly matching them with inSize.
[0088] In one possible embodiment, filtering is performed on a portion of the reference information of the current block to determine the target information of the current block. Currently, the number of values of the first color component sample points in the adjacent region of the block is determined as the first quantity, Based on the comparison result between the first quantity and a pre-set number, a fifth filtering process is performed on the values of the first color component sample points in the adjacent region of the current block, and the filtered adjacent sample values of the first color component of the current block are determined. This may include determining the target information of the current block based on the filtered neighboring sample values of the first color component of the current block.
[0089] In one particular embodiment, a fifth filtering process is performed on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block. If the first quantity is greater than a preset number, a first subfiltering process is performed on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block. If the first quantity is smaller than a preset number, the process may include performing a second subfiltering operation on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block.
[0090] In the embodiment of this application, the number of reference luminance information points obtained from an adjacent region can be matched with a pre-set number. Here, the number of reference luminance information points obtained from an adjacent region (i.e., the first quantity) can be represented by refYnum, and the pre-set number can be represented by inSize. Specifically, if refYnum is equal to inSize, no operation is required; if refYnum is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference luminance information; and if refYnum is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference luminance information.
[0091] In another possible embodiment, filtering is performed on some of the reference information of the current block to determine the target information of the current block. Currently, the number of values of the second color component sample points in the adjacent region of the block is determined as the second quantity, Based on the comparison result between the second quantity and the pre-set number, a sixth filtering process is performed on the values of the second color component sample points in the adjacent region of the current block, and the filtered adjacent sample values of the second color component of the current block are determined. This may further include determining the target information of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0092] In one particular embodiment, a sixth filtering process is performed on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block. If the second quantity is greater than a preset number, a first subfiltering process is performed on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block. If the second quantity is smaller than a preset number, the process may include performing a second subfiltering operation on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block.
[0093] Furthermore, in the embodiments of this application, the number of reference chromaticity information obtained from adjacent regions can be matched with a pre-set number. Here, the number of reference chromaticity information obtained from adjacent regions (i.e., the second quantity) can be represented by refCnum, and the pre-set number can be represented by inSize. Specifically, if refCnum is equal to inSize, no operation is required; if refCnum is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference chromaticity information; and if refCnum is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference chromaticity information.
[0094] Here, the first subfiltering process may be a downsampling filtering process. In addition, in some embodiments, the first subfiltering process is Subfiltering processing is performed using a fixed-interval position selection method, and This may further include at least one of the following: employing a continuous position selection method to perform subfiltering.
[0095] For example, let refYnum be the number of reference luminance information points obtained from an adjacent region. When performing size reduction using a fixed-interval position selection method, that is, by arranging refYnum reference luminance pixels into a one-dimensional vector based on a certain positional relationship, and then selecting points at fixed intervals based on the relationship between inSize and refYnum, the size of the reference luminance information can be reduced. As shown in Figure 8, the reference luminance information refY obtained from a 1x1 "L" shaped reference region can be rearranged into a one-dimensional vector refY' based on the positional relationship from bottom left to top left, and then from top left to top right. Here, the method of arranging into the one-dimensional vector and the starting position of the fixed-interval selection can be freely set and are not particularly limited here. In this way, assuming that the fixed interval used for size reduction is subDist, by starting from the first pixel position of the one-dimensional vector and selecting one pixel for every (subDist-1) pixel positions, inSize reference luminance information points can ultimately be obtained.
[0096] Furthermore, taking the reference luminance information as an example, when performing size reduction using a continuous position selection method, that is, refYnum reference luminance pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then inSize pixels are continuously selected from a predetermined position on the one-dimensional vector, thereby obtaining inSize pieces of reference luminance information. Here, the predetermined position may be the position of the first pixel, or the position of the posth pixel, and is not particularly limited here.
[0097] Furthermore, the second subfiltering process may be an upsampling filtering process. In addition, in some embodiments, the second subfiltering process may further include performing subfiltering using a fixed-interval position interpolation method.
[0098] When using a fixed-interval position interpolation method to enlarge the size, that is, refCnum reference chromaticity pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then points are selected at fixed intervals based on the relationship between inSize and refCnum, thereby enlarging the size of the reference chromaticity information. Here, the method of arranging in the one-dimensional vector and the starting position of the fixed-interval interpolation can be freely set and are not particularly limited here. In this way, after arranging the reference luminance information in the same way as in the size reduction, a one-dimensional vector is obtained, and then, based on the fixed interval used for size enlargement, starting from the first pixel position of the one-dimensional vector, inSize reference luminance information is finally obtained by interpolation.
[0099] Furthermore, it should be noted that after performing a first filtering process on the values of the first color component sample points in the adjacent region of the current block, the target information for the current block is determined based on the filtered adjacent sample values of the first color component of the current block. This target information may include the filtered adjacent sample values of the first color component of the current block, the values of the second color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block. Similarly, after performing a second filtering process on the values of the second color component sample points in the adjacent region of the current block, the target information for the current block is determined based on the filtered adjacent sample values of the second color component of the current block. This target information may include the filtered adjacent sample values of the second color component of the current block, the values of the first color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block. Alternatively, a first filtering process is performed on the value of the first color component sample point in the adjacent region of the current block, and a second filtering process is performed on the value of the second color component sample point in the adjacent region of the current block. In this case, the target information may include the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the reconstructed value of the first reference color component sample point within the current block.
[0100] Furthermore, when predicting the chromaticity component for the current block, the reference information for the current block may further include the reconstructed luminance information for the current block. Thus, in some embodiments, determining the reference information for the current block may further include determining the reference information for the current block based on the reconstructed values of a first reference color component sample point within the current block.
[0101] In the embodiments of this application, the first reference color component may be a luminance component, in which case the reconstructed value of the first reference color component sample point in the current block is the reconstructed luminance information of the current block.
[0102] Furthermore, in the embodiment of this application, since the number of reconstructed luminance information units for the current block differs from the pre-set size, it is necessary to perform a filtering process on the reconstructed luminance information units of the current block in order to convert the number of reconstructed luminance information units obtained from the current block to the pre-set size and input it. Here, the pre-set size is predSizeW × predSizeH, where predSizeW represents the width of the predicted block and predSizeH represents the height of the predicted block.
[0103] In some embodiments, filtering is performed on a portion of the reference information of the current block to determine the target information of the current block. Currently, a seventh filtering process is performed on the reconstructed value of the first reference color component sample point within the block, and the filtered sample value of the first reference color component sample point within the block is determined. This may include determining the target information of the current block based on the filtered sample values of the first reference color component sample points within the current block.
[0104] In one particular embodiment, a seventh filtering process is performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block. Currently, the first width and first height are determined based on the reconstruction value of the first reference color component sample point within the block. If the first width is greater than the width of the prediction block, or if the first height is greater than the height of the prediction block, a third subfiltering process is performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block. If the first width is less than the width of the prediction block, or if the first height is less than the height of the prediction block, a fourth subfiltering process may be performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block.
[0105] In the embodiment of this application, assuming that the number of reconstructed luminance information is recSizeW × recSizeH, recSizeW represents the first width and recSizeH represents the first height. Specifically, if recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required. If recSizeW is greater than predSizeW or recSizeH is greater than predSizeH, a first subfiltering process (i.e., size reduction) must be performed on the reconstructed luminance information. If recSizeW is less than predSizeW or recSizeH is less than predSizeH, a second subfiltering process (i.e., size expansion) must be performed on the reconstructed luminance information.
[0106] Furthermore, in the embodiments of this application, the third subfiltering process may be a downsampling filtering process. In addition, in some embodiments, the third subfiltering process is Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering. Currently, downsampling filtering is performed vertically on the reconstructed value of the first reference color component sample point within the block. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering, followed by vertical downsampling filtering, and This may further include at least one of the following: performing vertical downsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal downsampling filtering.
[0107] Here, first, a horizontal downsampling factor is calculated based on recSizeW and predSizeW, and a vertical downsampling factor is calculated based on recSizeH and predSizeH. Then, downsampling filtering can be performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical downsampling factor. Specifically, if the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling should be performed only in the horizontal direction on the reconstructed luminance information. If the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling should be performed only in the vertical direction on the reconstructed luminance information. If the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling should be performed on the reconstructed luminance information in both the horizontal and vertical directions. Here, horizontal downsampling may be performed first, followed by vertical downsampling, or vertical downsampling may be performed first, followed by horizontal downsampling. Furthermore, a convolutional operation in a neural network structure may be used instead of the downsampling operation here, and the embodiments of this application are not limited thereto.
[0108] Furthermore, in the embodiments of this application, the fourth subfiltering process is an upsampling filtering process. In addition, in some embodiments, the fourth subfiltering process is Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to vertical upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering, followed by vertical upsampling filtering, and This may further include at least one of the following: performing vertical upsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal upsampling filtering.
[0109] Here, first, the horizontal upsampling factor is calculated based on recSizeW and predSizeW, and the vertical upsampling factor is calculated based on recSizeH and predSizeH. Then, upsampling filtering is performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, it is sufficient to perform upsampling only in the horizontal direction on the reconstructed luminance information. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, it is sufficient to perform upsampling only in the vertical direction on the reconstructed luminance information. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, it is necessary to perform upsampling in both the horizontal and vertical directions on the reconstructed luminance information. Here, it is possible to perform horizontal upsampling first and then vertical upsampling, or vertical upsampling first and then horizontal upsampling. Furthermore, it is possible to perform a weighted average of the upsampling results of "horizontal first, then vertical" and "vertical first, then horizontal" to determine the final upsampling result, or to employ a convolutional operation in a neural network structure instead of the upsampling operation here, and the embodiments of this application are not limited to these.
[0110] In other words, in the embodiments of the present application, the reference information of the current block may include the value of the first color component sample point in the adjacent region of the current block, the value of the second color component sample point in the adjacent region of the current block, and the reconstructed value of the first reference color component sample point within the current block, and the target information may include the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point within the current block. Here, if there is no need to perform filtering on the value of the first color component sample point in the adjacent region of the current block, the filtered adjacent sample value of the first color component of the current block is equal to the value of the first color component sample point in the adjacent region of the current block. Similarly, if filtering is not required for the values of the second color component sample points in the adjacent region of the current block, the filtered adjacent sample value of the second color component in the current block is equal to the value of the second color component sample point in the adjacent region of the current block. Similarly, if filtering is not required for the reconstructed values of the first reference color component sample points in the current block, the filtered sample value of the first reference color component sample points in the current block is equal to the reconstructed value of the first reference color component sample points in the current block.
[0111] In this way, the obtained target information may include filtered adjacent sample values of the first color component of the current block, filtered adjacent sample values of the second color component of the current block, and filtered sample values of the first reference color component sample points within the current block, that is, it may include inSize reference chromaticity information, inSize reference luminance information, and reconstructed luminance information that fits a preset size.
[0112] In step S503, the weighting coefficient is determined based on the reference sample value of the first color component in the target information.
[0113] Furthermore, after determining the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point in the current block, in some embodiments, the method may further include setting the reference sample value of the first color component in the target information to the absolute difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block.
[0114] In some embodiments, the method may further include setting the reference sample value of the second color component in the target information to the filtered adjacent sample value of the second color component in the current block.
[0115] Furthermore, considering the filtering process applied to the reference information, filtering can be applied only to the reference luminance information, only to the reconstructed luminance information, only to the reference luminance information and the reconstructed luminance information, or even to all of the reference chromaticity information, reference luminance information, and reconstructed luminance information; no particular limitations are made here. Therefore, the calculation of the luminance difference may be the absolute value of the difference between the reference luminance information and the reconstructed luminance information, the absolute value of the difference between the filtered reference luminance information and the reconstructed luminance information, the absolute value of the difference between the filtered reference luminance information and the reconstructed luminance information, or even the absolute value of the difference between the filtered reference luminance information and the reconstructed luminance information. Therefore, in the embodiments of the present application, with respect to the reference sample value of the first color component in the target information, the method may further include, but is not particularly limited here, setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in the adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block; setting the reference sample value of the first color component in the target information to the absolute value of the difference between the filtered adjacent sample value of the first color component in the current block and the reconstructed value of the first reference color component sample point in the current block; or setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the first reference color component sample point in the current block.
[0116] In some embodiments, determining the weighting coefficient based on the reference sample value of the first color component in the target information is: Based on pre-configured mapping relationships, the value corresponding to the reference sample value of the first color component is determined, This may include setting the weighting coefficient to be equal to the value in question.
[0117] In the embodiments of the present application, the reference sample value of the first color component can be the absolute value of the difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point within the current block. Here, the first reference color component is the first color component, and the first color component is a color component different from the predicted second color component in the embodiments of the present application.
[0118] Exemplarily, assuming that the first color component is a chrominance component and the second color component is a luminance component, the embodiments of the present application mainly relate to the prediction of the chrominance component of the pixel to be predicted within the current block. First, at least one pixel to be predicted in the current block is selected, and the luminance difference (represented by |ΔC k |) between their reconstructed chrominance and the reference chrominance in the adjacent region is calculated respectively. The chrominance differences in the adjacent regions of the pixels to be predicted at different positions are different. The reference pixel position with the smallest chrominance difference changes as the pixel to be predicted within the current block changes. Usually, the magnitude of the chrominance difference represents the degree of similarity between chrominances. When |ΔC k | is relatively small, it indicates that the similarity of the chrominance values is relatively strong, and a large weight can be given to the corresponding weighting coefficient (represented by w k ). Conversely, when |ΔC k | is relatively large, it indicates that the similarity of the chrominance values is relatively weak, and a small weight can be given to w k . That is, the relationship between w k and |ΔC k | is approximately inversely proportional. Thus, as shown below, a pre-set mapping relationship can be established based on |ΔC k |.
[0119] w k =f(|ΔC k |) (1) Here, taking Equation (1) as an example, |ΔC k | represents the reference sample value of the first color component, f(|ΔC k |) represents the value corresponding to the reference sample value of the first color component in the pre-set mapping relationship, and w k represents the weighting coefficient. That is, wk f(|ΔC) k Set to equal to |).
[0120] Furthermore, in the embodiments of this application, if the number of reference sample values for the second color component is N, then the number of weighting coefficients is also N, where the sum of the N weighting coefficients is equal to 1, and each weighting coefficient is a value between 0 and 1, i.e., 0 ≤ w k The value is ≤ 1. However, it should be noted that "the sum of N weighting coefficients is equal to 1" is merely a theoretical concept, and in the actual fixed-point implementation process, the absolute value of the weighting coefficients may be greater than 1.
[0121] In terms of probability theory and related fields, the normalized exponential function (also called the Softmax function) is a generalization of the logical function. This function can "compress" an N-dimensional vector z containing any real numbers into another N-dimensional vector σ(z) such that each element is within the range of (0,1) and the sum of all elements is 1. It is often used as a nonlinear activation function in multi-class classification neural networks. The Softmax function is shown below.
[0122]
number
[0123]
number
[0124]
number
[0125] In the embodiments of this application, the first factor is a constant value less than zero. Taking the Softmax function as an example, in equation (4), γ represents the first factor, and |ΔC k | represents the first reference color component parameter, γ|ΔC k | represents the first power product, w k This represents the weighting coefficient, where k = 1, 2, ..., N.
[0126] In one particular embodiment, determining the first factor may include the first factor being a predetermined constant value.
[0127] In this case, for γ, a weighting coefficient distribution suitable for predicting the chromaticity of natural images can be obtained by adjusting the distribution of weighting coefficients of adjacent chromaticities based on the characteristic that chromaticity is relatively flat. To determine a parameter γ suitable for predicting the chromaticity of natural images, the appropriateness of γ is evaluated based on the difference between the predicted chromaticity and the original chromaticity for different γ values by traversing a given set of γ values. For example, γ is -2 εWe can take the following values, where ε∈{1,0,-1,-2,-3}, and experimental results show that the optimal value of γ within this set of γ is -0.25. Therefore, in one particular embodiment, γ can be set to -0.25, but the embodiments of the present application are not limited to this.
[0128] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the size parameter of the block.
[0129] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a mapping lookup table of pre-configured current block size parameters and first factor values.
[0130] Here, the current block size parameter may include at least one of the following: the current block width, the current block height, and the product of the current block width and height.
[0131] In the embodiments of this application, the value of the first factor can be fixed using a classification method. For example, the current block can be divided into three categories based on its size parameter, and the value of the first factor corresponding to each category can be determined. In this case, in the embodiments of this application, a mapping lookup table between the current block's size parameter and the value of the first factor can be stored in advance, and the value of the first factor can be determined based on this lookup table. Exemplarily, Table 1 shows the correspondence between the first factor and the current block's size parameter according to the embodiments of this application. Note that Table 1 is merely an illustrative lookup table and is not limited thereto.
[0132] [Table 1]
[0133] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the number of reference pixels in the current block.
[0134] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a mapping lookup table of a predetermined number of reference pixels in the current block and the value of the first factor.
[0135] In the embodiment of this application, the number of reference pixels can be divided into three categories, and the value of the first factor is still fixed by the classification method. For example, the number of reference pixels in the current block can be divided into three categories, and the value of the first factor corresponding to each category can be determined. In this case, the embodiment of this application can also store in advance a mapping lookup table between the number of reference pixels in the current block and the value of the first factor, and the value of the first factor can be determined based on this lookup table. Exemplarily, Table 2 shows the correspondence between the first factor and the number of reference pixels in the current block according to the embodiment of this application. Note that Table 2 is merely an illustrative lookup table and is not limited thereto.
[0136] [Table 2]
[0137] Furthermore, regarding the first product value, determining the first product value based on the reference sample values of the first factor and the first color component is possible. The first product value is set to be equal to the product of the first factor and the reference sample value of the first color component, or The first product is set to a number obtained by performing a bit-right shift with respect to the reference sample value of the first color component, wherein the number of bits in the bit-right shift is equal to the first factor, or This may include setting the first product value to a number obtained by adding and bit-shifting the reference sample value of the first color component based on the first factor.
[0138] For example, assuming the first factor is equal to 0.25, and the reference sample value of the first color component is denoted by Ref, the first product is 0.25 × Ref, which can be expressed as Ref / 4, i.e., Ref >> 2. Furthermore, in the fixed-point calculation process, floating-point numbers may also be converted to addition and bit shift operations. In other words, the method for calculating the first product is not particularly limited.
[0139] Furthermore, it can be understood that in the embodiments of this application, the first color component may be the luminance component and the second color component may be the chromaticity component, in which case at least one target pixel for prediction in the current block is selected and the luminance difference (denoted by |ΔYk|) between their reconstructed luminance and the reference luminance in the adjacent region is calculated, respectively. Here, if |ΔYk| is relatively small, it indicates that the similarity of the luminance values is relatively strong, and the corresponding weighting coefficient (w k This allows us to give a large weight to (represented by ), and conversely, when |ΔYk| is relatively large, it indicates that the similarity of luminance values is relatively weak, and w k A small weight can be assigned to it; that is, when calculating the weighting coefficient, the reference sample value of the first color component can be set to |ΔYk|, and the weighting coefficient can be calculated in this way.
[0140] It should be noted that, currently, when predicting the chromaticity component of a target pixel in a block, the chromaticity component value of the target pixel cannot be directly determined, therefore, the chromaticity difference |ΔC| between the reference pixel and the target pixel is not considered. k | cannot be obtained directly. However, within the local region of the current block, there is a strong correlation between the components, so in this case, the brightness difference |ΔY between the reference pixel and the target pixel can be obtained. k |Based on|ΔC k We can derive |, that is, |ΔY k |ΔC based on the product of | and the second factor k We can obtain |, and in this way, the first product is the first factor and |ΔC k It is equal to the product of |.
[0141] In other words, in the embodiments of the present application, the reference sample value of the first color component may be |ΔCk|, i.e., the absolute value of the chromaticity difference, or |ΔYk|, i.e., the absolute value of the luminance difference, or |αΔYk|, i.e., the product of the absolute value of the luminance difference and a predetermined multiplier. The predetermined multiplier here is the second factor described in the embodiments of the present application.
[0142] Furthermore, with respect to the second factor, in one particular embodiment, the method may further include determining the second factor by performing a least-squares calculation based on the first color component value and the second color component value of the reference pixel.
[0143] In other words, assuming that there are N reference pixels, that the first color component value of each reference pixel represents the reference luminance information of the current block, and that the second color component value of each reference pixel represents the reference chromaticity information of the current block, then the second factor can be obtained by performing a least squares calculation on the chromaticity and luminance component values of the N reference pixels. An example of least squares regression calculation is shown below.
[0144]
number
[0145] Furthermore, regarding the pre-defined mapping relationships, in some embodiments, the pre-defined mapping relationships may be pre-defined function relationships. In some embodiments, the pre-defined mapping relationship may be a Softmax function. Here, the Softmax function is a normalized exponential function, but in the embodiments of this application, normalization may not be used, and its value is not limited to the range [0,1].
[0146] For example, |ΔY k Taking | as an example of the reference sample value for the first color component, the weighting coefficient w corresponds to the kth reference pixel. k This can be calculated by formula (4), or it can be replaced as follows:
[0147]
number
number
[0148] Exemplary, the value of S relates to the size parameter of the current block, where the size parameter of the current block includes the width and height of the current block. In one possible embodiment, if the minimum values of the width and height are 4 or less, the value of S is equal to 8; if the minimum values of the width and height are greater than 4 and 16 or less, the value of S is equal to 12; and if the minimum values of the width and height are greater than 16, the value of S is equal to 16. In another possible embodiment, if the minimum values of the width and height are 4 or less, the value of S is equal to 7; if the minimum values of the width and height are greater than 4 and 16 or less, the value of S is equal to 11; and if the minimum values of the width and height are greater than 16, the value of S is equal to 15. Alternatively, the value of S relates to the number of reference pixels (R) of the current block. In one possible embodiment, if R is less than 16, the value of S is equal to 8; if R is 16 or greater and less than 32, the value of S is equal to 12; and if R is 16 or greater, the value of S is equal to 16, and the embodiments of this application are not limited thereto.
[0149] Furthermore, in addition to the Softmax function, in some other embodiments, the pre-defined mapping relationship may be a weighted function that is inversely proportional to the reference sample value of the first color component.
[0150] For example, if we still use |ΔYk| as the reference sample value for the first color component, the Softmax function in equation (4) can be replaced as follows.
[0151]
number
[0152] Thus, if the pre-defined mapping relationship is a pre-defined functional relationship, it may be as shown in equation (4), as shown in equation (6) or (7), as shown in equation (8) or (9), or even other functional models of weighting coefficients constructed to adapt to the tendency that the closer the reference luminance value of the reference pixel is to the luminance reconstruction value of the predicted target pixel in the current block, the greater the importance of the reference chromaticity value of the reference pixel for the predicted target pixel in the current block, and the embodiments of the present application are not limited thereto.
[0153] Furthermore, in some embodiments, the pre-configured mapping relationship may take the form of a pre-configured look-up table. In other words, in embodiments of the present invention, the operation can be further simplified, and some calculation operations can be reduced by employing, for example, an array element look-up table method. Here, in the case of a pre-configured mapping relationship, the value of the array element can be determined based on a pre-configured reference sample value of the first color component, the first factor, and the mapping look-up table of the array element. Then, based on the pre-configured mapping relationship, a value corresponding to the value of the array element can be determined, and the weighting coefficient can be set to be equal to that value.
[0154] Specifically, the f-model for calculating the weighting coefficient can be implemented using simplified operations such as lookup tables. Here, the brightness difference |ΔY of the target pixel (i,j) is... k | is |ΔY kijIt can also be represented by |, and in this way, the weighting coefficient w is determined by the f model. kij =f(|ΔY kij |) is calculated. Here, the numerator of the f model is the independent variable |ΔY kij It can be stored as an array index with the number of categories of | and S, and subsequently, all operations similar to numerator calculations related to the f model can be obtained by the lookup table, thus avoiding numerator and denominator calculations.
[0155] In the embodiments of this application, memory can be divided into complete memory or partial memory.
[0156] In one particular embodiment, perfect memory is defined as |ΔY kij This refers to memorizing the range of values for | and the numerator of the number of categories for S, and in the case of perfect memory, (|ΔY kij It is necessary to set up an array space of size (the product of the range of values and the number of categories in S). Here, the size of the required memory array is |ΔY kij This represents the size of the range of values, and in this case, the performance does not change.
[0157] For example, taking a 10-bit pixel and equation (7) as an example, the variable |ΔY kij The range of | is an integer from 0 to 1023, the number of categories in S is 3, and |ΔY kij The number of categories for | and S is used as the index of the two-dimensional array storMole to completely store the molecule.
[0158]
number
[0159]
number
[0160] [Table 3]
[0161] Furthermore, for perfect memory, a corresponding array offset amount is set according to the classification of S, and then (|ΔY kij The molecule can be completely stored by using the value obtained by adding an offset to | as the index of the one-dimensional array ostorMole, specifically as shown below.
[0162]
number
[0163]
number
[0164] [Table 4]
[0165] In another specific embodiment, partial storage refers to selecting and storing a portion of all numerator values in the calculation of the weighting coefficient, |ΔY kij |You can select and store numerator values for some value ranges and / or some categories of S, f-model values outside the selection range will default to 0, and the size of the required storage array is (selected |ΔY kij It is the product of the range of values and the number of selected categories for S.
[0166] For example, taking a 10-bit pixel and equation (7) as an example, |ΔY kij Assuming that the range of | is an integer from 0 to 99 and that we select a numerator value for which the number of categories in S is 3 and store it in partial memory, |ΔY kijThe range of | is an integer between 0 and 99, and since the number of categories in S is 3, |ΔY kij The number of categories for | and S is used as the index of the two-dimensional array partsorMole to store the molecule.
[0167]
number
[0168]
number
[0169] [Table 5]
[0170] In other words, the memory range of partial memory is measurable according to the actual needs, and the exemplified integer |ΔY| is within 100. kij The embodiments of this application are not limited to the categories of | or the three S categories, but also to partial memory, where a one-dimensional memory space for memory can be set by setting an offset amount corresponding to a selected subset of S categories. Furthermore, in the cases of Tables 3 to 5, expanded integer values can also be stored for fixed-point calculations, in which case a corresponding reduction operation must be performed after the subsequent prediction value is determined.
[0171] In this way, the reference sample value of the first color component (e.g., |ΔY kij Based on |), the weighting coefficients can be determined, specifically w1, w2, ..., w NIt may include N weighting coefficients, where N represents the number of reference sample values for the second color component. Theoretically, the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value between 0 and 1. However, it should be noted that "the sum of N weighting coefficients is equal to 1" is merely a theoretical concept, and in the actual fixed-point implementation process, the absolute value of the weighting coefficients may be greater than 1.
[0172] In step S504, the predicted block for the second color component of the current block is determined based on the weighting coefficient and the reference sample value of the second color component in the target information.
[0173] In step S505, the reconstruction value of the second color component sample point of the current block is determined based on the predicted block.
[0174] Furthermore, after determining the weighting coefficients, the weighting coefficients can be used to perform weight calculations on the reference sample values of the second color component, thereby obtaining the predicted values of the second color component sample points within the prediction block.
[0175] In some embodiments, the predicted block of the second color component of the current block is determined based on a weighting coefficient and a reference sample value of the second color component in the target information. Determine the reference sample value of the second color component and the weighted value of the corresponding weighting coefficient, This may include setting the predicted value of the second color component sample point within the prediction block to the sum of N weighted values, where N represents the number of reference sample values for the second color component, and N is a positive integer.
[0176] In other words, if there are N reference sample values for the second color component, first, the reference sample value for each second color component and the weighted value of the corresponding weighting coefficient (i.e., w k C k The following is determined, and then the sum of these N weighted values is used as the predicted value for the second color component sample point within the prediction block. Specifically, the calculation formula is as follows:
[0177]
number
[0178] Furthermore, in the embodiments of this application, the first color component is the luminance component, and the second color component is the chromaticity component. Since the resolution of the luminance component may differ from the resolution of the chromaticity component, filtering the reference information includes either performing downsampling filtering on the luminance component to match the resolution of the chromaticity component, or performing upsampling filtering on the chromaticity component to match the resolution of the luminance component.
[0179] In embodiments of the present application, the prediction block includes predicted values for at least some of the second color component sample points in the current block. If the prediction block includes only predicted values for some of the second color component sample points in the current block, or does not include predicted values for the second color component sample points (i.e., it is necessary to perform enhanced filtering on the predicted values to obtain the final predicted values), further filtering can be performed on the prediction block. In this case, the prediction block is designated as the first prediction block, and upsampling filtering can be performed on the first prediction block to determine the second prediction block for the second color component of the current block. This second prediction block becomes the final prediction block for the second color component of the current block and includes predicted values for all of the second color component sample points in the current block. Specifically, in some embodiments, performing upsampling filtering on the first prediction block to determine the second prediction block for the second color component of the current block may include the input to the upsampling filtering process being the first upsampling input block and the output to the upsampling filtering process being the first upsampling output block.
[0180] Furthermore, in some embodiments, the upsampling filtering process is performed. The upsampling factor is determined, and the upsampling factor includes at least one of a horizontal upsampling factor and a vertical upsampling factor. This may include performing an upsampling filtering process on a first upsampling input block based on an upsampling factor to obtain a first upsampling output block.
[0181] In one possible embodiment, performing an upsampling filtering process on a first upsampling input block based on an upsampling factor to obtain a first upsampling output block may include performing an upsampling filtering process on a first upsampling input block to obtain a first upsampling output block when the horizontal upsampling factor is greater than 1 or when the vertical upsampling factor is greater than 1.
[0182] In the embodiments of the present application, performing an upsampling filtering process on the first upsampling input block is: Perform horizontal upsampling filtering on the first upsampling input block. Perform vertical upsampling filtering on the first upsampling input block. After performing horizontal upsampling filtering on the first upsampling input block, perform vertical upsampling filtering, and This includes at least one of the following: performing vertical upsampling filtering on a first upsampling input block, followed by performing horizontal upsampling filtering.
[0183] Here, first, a horizontal upsampling factor can be calculated based on the width of the first upsampling input block and the width of the first upsampling output block, and a vertical upsampling factor can be calculated based on the height of the first upsampling input block and the height of the first upsampling output block. Then, upsampling filtering can be performed on the first upsampling input block based on the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, then upsampling should be performed only horizontally on the first upsampling input block. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, then upsampling should be performed only vertically on the first upsampling input block. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, then upsampling should be performed both horizontally and vertically on the first upsampling input block. Here, horizontal upsampling may be performed first, followed by vertical upsampling, or vertical upsampling may be performed first, followed by horizontal upsampling. Furthermore, a convolutional operation in a neural network structure may be used instead of the upsampling filtering operation described here, and the embodiments of this application are not limited to these.
[0184] In another possible embodiment, upsampling filtering is performed on the first prediction block to determine the second prediction block. In this case, the method may further include making the first prediction block the first upsampling input block and the first upsampling output block the second prediction block for the second color component of the current block.
[0185] In another possible embodiment, for the first prediction block, first perform enhancement filtering, then perform upsampling filtering, and determine the second prediction block. In this case, the method may further include performing a filtering enhancement process on the first prediction block to determine a first enhanced prediction block, using the first enhanced prediction block as a first upsampling input block, and using the first upsampling output block as the second prediction block of the second color component of the current block.
[0186] In another possible embodiment, for the first prediction block, first perform upsampling filtering, then perform enhancement filtering, and determine the second prediction block. In this case, the method may further include using the first prediction block as a first upsampling input block, using the first upsampling output block as a first upsampling filtering prediction block, performing a filtering enhancement process on the first upsampling filtering prediction block, and determining the second prediction block of the second color component of the current block.
[0187] In another possible embodiment, for the first prediction block, first perform enhancement filtering, then perform upsampling filtering, and then perform enhancement filtering again to determine the second prediction block. In this case, the method may further include performing a first filtering enhancement process on the first prediction block to determine a second enhanced prediction block, using the second enhanced prediction block as a first upsampling input block, using the first upsampling output block as a second upsampling filtering prediction block, performing a second filtering enhancement process on the second upsampling filtering prediction block, and determining the second prediction block of the second color component of the current block.
[0188] Furthermore, the predicted value of the second color component sample points within the prediction block usually needs to be restricted within a preset range. Therefore, in some embodiments, the method may further include performing a correction operation on the predicted value of the second color component sample points within the prediction block to determine the prediction block of the second color component of the current block.
[0189] In addition, in the embodiments of the present application, the preset range may be a range from 0 to (1 << BitDepth) - 1, where BitDepth is the bit depth required for the chrominance component. When the predicted value exceeds the value of the preset range, it is necessary to perform a corresponding correction operation on the predicted value. Exemplarily,
Number
[0190]
Number
Number
Number
Number
[0191] In this way, by performing a correction process on the predicted value, the predicted values of all the second color component sample points within the prediction block can be within the range from 0 to (1 << BitDepth) - 1.
[0192] Furthermore, after determining the prediction block, under certain conditions, the prediction block requires further post-processing to be used as the final prediction block. Therefore, in some embodiments, the method is This may further include performing related processing on the prediction block and making the processed prediction block the prediction block for the second color component of the current block.
[0193] In one possible embodiment, performing an associated process on a prediction block may include performing an enhanced filtering process on the prediction block, making the processed prediction block the prediction block for the second color component of the current block.
[0194] In WCP mode, to reduce instability caused by performing predictions independently and in parallel on a pixel-by-pixel basis, for example, a smoothing filter can be applied to the prediction blocks, and the processed prediction blocks can be used as the final prediction blocks.
[0195] In another possible embodiment, performing related processing on a prediction block may include determining a compensation value for the second color component of the prediction block based on a reference sample value in an adjacent region of the current block, and then, based on the compensation value, performing a modification on the prediction value of the second color component sample point in the prediction block to determine the prediction block for the second color component of the current block.
[0196] Furthermore, to further improve prediction accuracy in WCP mode, a positional correction process can be performed on the prediction block. For example, a chromaticity compensation value can be calculated for each predicted second-color component sample point using a reference pixel with a nearby spatial position. This chromaticity compensation value can then be used to correct the second-color component sample points within the prediction block. Based on the corrected prediction values, the final predicted values (predSamples) for the second-color component sample points can be determined, and the final prediction block can be obtained.
[0197] In another possible embodiment, performing related processing on a prediction block may include performing prediction processing on second color component sample points within the prediction block according to at least one prediction mode to determine at least one initial predicted value for the second color component sample points within the prediction block, and performing a weighted fusion process based on at least one initial predicted value and the predicted value for the second color component sample points within the prediction block to determine the prediction block for the second color component of the current block.
[0198] Furthermore, to further improve the prediction accuracy in WCP mode, weighted fusion can be performed on the chromaticity prediction values calculated in other prediction modes and the chromaticity prediction values calculated in WCP mode, and the final chromaticity prediction block can be determined based on the fusion result. Exemplarily, as shown in Figure 9, other prediction modes may include Planar mode, DC mode, Vertical mode, Horizontal mode, and CCLM mode, and each prediction mode is connected to a switch, which is used to control whether the chromaticity prediction values in that prediction mode participate in the weighted fusion process. Assuming that the weight value for Planar mode is W_Planar, the weight value for DC mode is W_DC, the weight value for Vertical mode is W_Ver, the weight value for Horizontal mode is W_Hor, the weight value for CCLM mode is W_CCLM, and the weight value for WCP mode is W_Wcp, then for the chromaticity prediction values in Planar mode, DC mode, Vertical mode, Horizontal mode, and CCLM mode, if only the switch connected to CCLM mode is closed, then weighted fusion can be performed on the chromaticity prediction values in CCLM mode and WCP mode based on W_CCLM and W_Wcp. Based on the values of W_CCLM and W_Wcp, it can be determined whether to perform a weighted fusion with equal weighting or a weighted fusion with unequal weighting, and the weighted result becomes the final chromaticity prediction value of the second color component sample point, thereby obtaining the final prediction block.
[0199] In some embodiments, after determining the prediction block, based on the prediction block, determining a reconstruction value of the second color component sample point of the current block may include: determining a prediction difference value of the second color component sample point of the current block; determining a predicted value of the second color component sample point of the current block based on the prediction block; and determining a reconstruction value of the second color component sample point of the current block based on the prediction difference value and the predicted value of the second color component sample point of the current block.
[0200] Note that in the embodiments of the present application, determining the prediction difference value (residual) of the second color component sample point of the current block may be to determine the prediction difference value of the second color component sample point of the current block by analyzing the bitstream.
[0201] Furthermore, it should be further explained that in the embodiments of the present application, the prediction block may include predicted values of at least some of the second color component sample points within the current block. Here, when the prediction block includes the predicted values of all the second color component sample points within the current block, the predicted value of the second color component sample point of the current block can be set equal to the value of the prediction block. When the prediction block includes the predicted values of some of the second color component sample points within the current block, upsampling filtering is performed on the value of the prediction block, and the predicted value of the second color component sample point of the current block can be set equal to the output value after the upsampling filtering.
[0202] That is, in the embodiments of the present application, based on the prediction block, determining the predicted value of the second color component sample point of the current block may be to set the predicted value of the second color component sample point of the current block equal to the value of the prediction block, or to filter the value of the prediction block and then set the predicted value of the second color component sample point of the current block equal to the output value of the filtering.
[0203] Thus, taking the chromaticity component as an example, by analyzing the bitstream, the predicted chromaticity difference value of the current block can be determined, then the predicted chromaticity value of the current block can be determined based on the predicted block, and finally, the predicted chromaticity value and the predicted chromaticity difference value can be added together to obtain the reconstructed chromaticity value of the current block.
[0204] It can be understood that the embodiment of the present application optimizes the input information acquisition process in the WCP mode prediction process, and mainly includes the following three aspects: First, it improves the accuracy of the reference luminance information and reference chromaticity information by fully considering the characteristics of the input color format information. Second, it performs filtering processing such as upsampling, downsampling, size expansion or reduction on the reference luminance information, reference chromaticity information, and the reconstructed luminance information of the current block by fully utilizing spatial correlation. Third, it improves the accuracy of the WCP prediction technology by employing different filtering processing methods on the reference luminance information, reference chromaticity information, and the reconstructed luminance information of the current block, while fully considering the relevant information of the prediction block.
[0205] In short, the embodiment of the present invention further provides a weight-based chromaticity prediction framework, and as shown in Figure 10, for each sample point recY[i][j] of the reconstructed luminance information in the downsampled current block (i.e., the downsampled luminance block), first, a luminance difference vector diffY[i][j] is obtained based on the absolute value of the difference between recY[i][j] and the adjacent luminance vector refY[k], then a normalized weight vector cWeight[i][j] is derived based on a nonlinear mapping model associated with diffY[i][j], and then, using the weight vector, vector multiplication is performed between the weight vector and the adjacent chromaticity vector of the current block to obtain the predicted chromaticity value
number
[0206] The embodiments of this application further provide a decoding method in which reference information of the current block is determined, a filtering process is performed on some of the reference information of the current block, target information of the current block is determined, a weighting coefficient is determined based on the reference sample value of the first color component in the target information, the predicted block of the second color component of the current block is determined based on the weighting coefficient and the reference sample value of the second color component in the target information, and the reconstruction value of the sample point of the second color component of the current block is determined based on the predicted block. In this way, the characteristics of the color format information are sufficiently considered for the color component information in the adjacent region of the current block and the color component information within the current block, so that the accuracy of this reference information can be improved. Furthermore, by performing filtering processes such as upsampling and downsampling on this reference information, the continuity of spatial correlation can be strengthened to some extent, or some information with relatively weak spatial correlation can be removed. By using the target information obtained after filtering, chromaticity prediction can be performed more appropriately, thereby improving the accuracy of chromaticity prediction and improving encoding and decoding performance while saving bitrate.
[0207] In another embodiment of the present application, taking as an example the performance of chromaticity prediction for the current block based on the decoding method described in the above embodiment, in the embodiment of the present application, the reconstructed luminance information of the current block, and the reference luminance information and reference chromaticity information of the adjacent region are all decoded reference information. Therefore, the embodiment of the present application proposes a weight-based chromaticity prediction technique that utilizes the above information, and in the process of determining the target information of the current block based on this information, the information of the adjacent region of the current block, the information of the current block, and the current color format information can be analyzed and processed. Here, the information of the adjacent region mainly refers to the position of the sample point in the adjacent region, the reference luminance information, and the reference chromaticity information; the information of the current block mainly refers to the reconstructed luminance information within the current block; and the current color format information mainly refers to the InputChromaFormat parameter in the configuration file (*.cfg format) in the decoding process, i.e., the ratio of luminance to chromaticity samples of the input video.
[0208] In terms of what can be understood, the embodiments of this application primarily propose the following: (1) Based on the current color format information, select whether or not to downsample the reference luminance information of adjacent regions, or whether or not to upsample the reference chromaticity information of adjacent regions. (2) Match the reference luminance information, reference chromaticity information of adjacent regions, and reconstructed luminance information within the current block to a preset size of the core parameter through different size scaling operations.
[0209] Here, the detailed steps of the chromaticity prediction process in WCP mode are as follows:
[0210] WCP mode input: current block position (xTbCmp, yTbCmp), current block width nTbW, and current block height nTbH.
[0211] The output in WCP mode is the predicted value of the current block, predSamples[x][y], where x=0,...,nTbW-1 and y=0,...,nTbH-1, with the upper left corner of the current block as the coordinate origin.
[0212] Here, the prediction process in WCP mode may include steps such as determining core parameters, acquiring target information, weight-based chromaticity prediction, and post-processing, with a pre-processing step added to the target information acquisition process. These steps allow us to obtain the chromaticity prediction value for the current block.
[0213] Referring to Figure 11, an illustrative flowchart 2 of the decoding method according to an embodiment of the present application is shown in one particular embodiment. As shown in Figure 11, the method may include the following steps:
[0214] In step S1101, the core parameters for WCP mode are determined.
[0215] Regarding step S1101, determining the core parameters related to WCP mode can be done by obtaining or inferring the core parameters of WCP mode through settings or some other method, for example, by obtaining the core parameters from the bitstream on the decoding side.
[0216] Here, the core parameters of WCP mode include, but are not limited to, a control parameter (S), the number of weight-based chromaticity prediction inputs (inSize), and the number of weight-based chromaticity prediction outputs (arranged in predSizeW × predSizeH). Here, the prediction block output by weight-based chromaticity prediction can be represented by predWcp, where the number of weight-based chromaticity prediction outputs can be set to the same value (e.g., predSizeW = predSizeH = T / 4) or can be set to be related to the size parameter of the current block (e.g., predSizeW = nTbW, predSizeH = nTbH). Here, the control parameter (S) is used to adjust a nonlinear function in a subsequent stage or to adjust data related to a subsequent stage.
[0217] The determination of core parameters is influenced by the size of the block, the contents of the block, or the number of pixels within the block under certain conditions. For example, When there are many types of block sizes applied in WCP mode, or when the block sizes differ significantly, or when the block contents differ significantly, or when the number of pixels within a block differs significantly, the current block can be classified based on its block size, block contents, or number of pixels within a block, and the same or different core parameters can be determined based on the different categories. In other words, the control parameter (S) corresponding to different categories, or the number of weight-based chromaticity prediction inputs inSize, or the number of weight-based chromaticity prediction outputs (arranged in predSizeW × predSizeH), may be the same or different. Note that predSizeW and predSizeH may also be the same or different.
[0218] Below, we will explain two simple classifications as examples to better illustrate the determination of core parameters.
[0219] In Example 1 of classification, in the WCP mode, the current block can be classified based on the width and height of the current block, and the type of the block is represented by wcpSizeId. For different types of blocks, the control parameter(s), the number of chrominance prediction inputs inSize based on weights, and the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) based on weights may be the same or different. Here, an example of dividing into three categories will be described.
[0220] Based on the width and height of the current block, the current block is divided into three categories, and the control parameter(s) of different categories are set to be different, the inSize of different categories is set to be the same, and the number of chrominance prediction outputs arranged in (predSizeW × predSizeH) based on weights of different categories can be set to be the same. nTbW represents the width of the current block, nTbH represents the height of the current block, and the block category wcpSizeId is defined as follows.
[0221] wcpSizeId = 0 indicates the current block where min(nTbW, nTbH) ≤ 4. Here, the control parameter(s) is 8, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.
[0222] wcpSizeId = 1 indicates the current block where 4 < min(nTbW, nTbH) ≤ 16. Here, the control parameter(s) is 12, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.
[0223] wcpSizeId = 2 indicates the current block where min(nTbW, nTbH) > 16. Here, the control parameter(s) is 16, inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.
[0224] Table 6 is a table showing the numerical relationships of the above core parameters in tabular form.
[0225] [Table 6]
[0226] Another example of dividing into three categories will be described.
[0227] Based on the current block's width and height, the current block is divided into three categories, and the control parameter(s) for different categories are set differently, the inSize for different categories is set the same, and the number of chrominance prediction outputs based on the weights of different categories (arranged in predSizeW × predSizeH) can be set the same. nTbW is the width of the current block, nTbH is the height of the current block, and the block category wcpSizeId is defined as follows.
[0228] wcpSizeId = 0 indicates the current block where min(nTbW, nTbH) ≤ 4. Here, the control parameter(s) is 8, the inSize is (2 × nTbH + 2 × nTbW), and nTbH × nTbW chrominance prediction values are output by chrominance prediction based on weights.
[0229] wcpSizeId = 1 indicates the current block where 4 < min(nTbW, nTbH) ≤ 16. Here, the control parameter(s) is 12, the inSize is (1.5 × nTbH + 1.5 × nTbW), and nTbH / 2 × nTbW / 2 chrominance prediction values are output by chrominance prediction based on weights.
[0230] wcpSizeId = 2 indicates the current block where min(nTbW, nTbH) > 16. Here, the control parameter(s) is 16, the inSize is (nTbH + nTbW), and nTbH / 4 × nTbW / 4 chrominance prediction values are output by chrominance prediction based on weights.
[0231] Table 7 is a table showing the numerical relationships of the core parameters mentioned above.
[0232] [Table 7]
[0233] In classification example 2, even in WCP mode, the current block can be classified based on its width and height, and the block category is represented by wcpSizeId. For blocks of different categories, the control parameter (S), the number of weight-based chromaticity prediction inputs inSize, and the number of weight-based chromaticity prediction outputs (arranged as predSizeW × predSizeH) may be the same or different. Here, we will explain using the example of dividing into three categories.
[0234] The current block is divided into three categories based on its width and height, with different control parameters (S) set to be different for each category, the inSize set to be the same for each category, and the number of chromaticity prediction outputs (arranged as predSizeW × predSizeH) based on the weights of each category can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW × nTbH represents the number of pixels in the current block. The block category wcpSizeId is defined as follows:
[0235] wcpSizeId=0 indicates the current block where (nTbW×nTbH)<128. Here, the control parameter (S) is 10, inSize is (2×nTbH+2×nTbW), and weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0236] wcpSizeId=1 indicates the current block is 128≦(nTbW×nTbH)≦256. Here, the control parameter (S) is 8, inSize is (2×nTbH+2×nTbW), and weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0237] The fact that wcpSizeId=2 indicates the current block where (nTbW×nTbH)>256. Here, the control parameter (S) is 1, inSize is (2×nTbH+2×nTbW), and weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0238] Table 8 is a table showing the numerical relationships of the core parameters mentioned above.
[0239] [Table 8]
[0240] Let me explain with another example that divides things into three categories.
[0241] The current block is divided into three categories based on its width and height, with different control parameters (S) set to be different for each category, the inSize set to be the same for each category, and the number of chromaticity prediction outputs (arranged as predSizeW × predSizeH) based on the weights of each category can be set to be the same. nTbW is the width of the current block, nTbH is the height of the current block, and nTbW × nTbH represents the number of pixels in the current block. The block category wcpSizeId is defined as follows:
[0242] wcpSizeId=0 indicates the current block where (nTbW×nTbH)<64. Here, the control parameter (S) is 16, inSize is (2×nTbH+2×nTbW), and weighted chromaticity prediction outputs nTbH×nTbW chromaticity prediction values.
[0243] wcpSizeId=1 indicates the current block is 64≦(nTbW×nTbH)≦512. Here, the control parameter (S) is 4, inSize is (1.5×nTbH+1.5×nTbW), and weighted chromaticity prediction outputs nTbH / 2×nTbW / 2 chromaticity prediction values.
[0244] The fact that wcpSizeId=2 indicates the current block where (nTbW×nTbH)>512. Here, the control parameter (S) is 1, inSize is (nTbH+nTbW), and weighted chromaticity prediction outputs nTbH / 4×nTbW / 4 chromaticity prediction values.
[0245] Table 9 is a table showing the numerical relationships of the core parameters mentioned above.
[0246] [Table 9]
[0247] In step S1102, the target information after the preprocessing operation is determined based on the core parameters.
[0248] Regarding step S1102, the target information may include reference chromaticity information (refC), reference luminance information (refY), and reconstructed luminance information (recY). Here, when predicting the current block for acquiring the target information (i.e., input information), the upper region, upper left region, and left region of the current block are considered adjacent regions of the current block (also called "reference regions"), and as shown in Figure 6 above, all pixels in the adjacent regions are decoded reference pixels.
[0249] Furthermore, the reference chromaticity information refC and reference luminance information refY are obtained from adjacent regions. Obtaining the reference chromaticity information includes, but is not limited to, selecting the reference chromaticity reconstruction value for the upper region of the current block and / or the reference chromaticity reconstruction value for the left region. Obtaining the reference luminance information includes, but is not limited to, obtaining the corresponding reference luminance information based on the location of the reference chromaticity information.
[0250] The method for obtaining the reconstructed luminance information recY of the current block includes, but is not limited to, obtaining the corresponding reconstructed luminance information as the reconstructed luminance information of the current block based on the position of the chromaticity information within the current block.
[0251] As can be understood, if the number of reference chromaticity information refC and reference luminance information refY obtained from adjacent regions differs partially or completely from the inSize specified in the step of determining the core parameters, or if the number of reconstructed luminance information recY obtained from the current block differs from the pre-set size (predSizeW × predSizeH) specified in the step of determining the core parameters, then related processing must be performed on the three obtained pieces of information. Since this step is performed before the prediction process, this step is called the pre-processing operation.
[0252] Herein, the embodiments of this application mainly address cases where the inSize specified in the step of determining the core parameters differs from the number of reference chromaticity information refC and reference luminance information refY obtained from adjacent regions, or where the number of reconstructed luminance information recY obtained from the current block differs from the pre-set size (predSizeW × predSizeH) specified in the step of determining the core parameters. These two cases will be described in detail below.
[0253] Case 1: If the inSize specified in the step of determining the core parameters differs from the number of reference chromaticity information refC and reference luminance information refY obtained from the adjacent region, the number of pixels of the reference chromaticity information refC and reference luminance information refY obtained from the adjacent region must be converted to the inSize specified in the step of determining the core parameters and input. The number of reference chromaticity information and reference luminance information is determined by the current color format information. Then, the specific process of the preprocessing operation in Case 1 is as follows:
[0254] (1) Considering the current color format information, typically the quantity of reference luminance information and the quantity of reference chromaticity information obtained from adjacent regions are unified and then matched to inSize in the core parameters. This processing is as follows:
[0255] a. Unify the quantity of reference luminance information and reference chromaticity information obtained from adjacent regions into refNum.
[0256] ●If the current color format information indicates 4:4:4 sampling (i.e., YUV444) and the ratio of luminance samples to chromaticity samples is 4:4:4, then the number of reference luminance information refY obtained from adjacent regions is the same as the number of reference chromaticity information refC, and no operation is required.
[0257] ● If the current color format information indicates 4:2:2 sampling (i.e., YUV422) and the ratio of luminance samples to chromaticity samples is 4:2:2, or if the current color format information indicates 4:2:0 sampling (i.e., YUV420) and the ratio of luminance samples to chromaticity samples is 4:1:1, then the reference luminance information refY obtained from the adjacent region must be downsampled to match the number of reference chromaticity information refC, or the reference chromaticity information refC obtained from the adjacent region must be upsampled to match the number of reference luminance information refY.
[0258] ●Current color format information includes, but is not limited to, the aforementioned color format information. The principle of processing is that if the ratio of luminance and chromaticity samples differs, it is necessary to either downsample the reference luminance information or upsample the reference chromaticity information.
[0259] b. Match the number of reference pieces, refNum, to inSize in the core parameters.
[0260] ●If inSize is equal to refNum, no action is required.
[0261] ●If inSize is smaller than refNum, the reference luminance information and reference chromaticity information need to be scaled down.
[0262] ●If inSize is larger than refNum, the reference luminance information and reference chromaticity information need to be scaled up.
[0263] The downsampling process mentioned in the processing process for the first case is specifically as follows: For refNum reference chromaticity information refC obtained from adjacent regions, downsampling of the reference luminance information refY can be performed using a multitap filter, by obtaining a specific pixel from multiple reference luminance pixels at corresponding positions of the reference chromaticity pixels, or by employing other downsampling methods, and the embodiments of this application are not limited to these.
[0264] For example, as shown in Figure 7A, if the color format information indicates 4:2:0 sampling, then, taking an adjacent region of 8x4 luminance pixels as an example, this region needs to be downsampled to a region of 4x2 pixels. In Figure 7A, (a) represents the reference luminance information refY, and (b) represents the reference luminance information refY' after downsampling. Here, the thick frame in (a) contains four luminance pixels corresponding to the same chromaticity pixels, and (k,l) is the corresponding pixel position in the upper left corner. The thick frame in (b) contains a specific downsampled luminance pixel, and the same chromaticity pixels corresponding to the four luminance pixels in the thick frame in (a) and the specific downsampled luminance pixel are pairs of luminance pixels and chromaticity pixels at the same position, and (i,j) is the position of the downsampled luminance pixel in the downsampled reference luminance information refY', where i=0,...,3 and j=0,1.
[0265] ●When downsampling using a 4-tap filter, for example, if the filter coefficients are [1,1,1,1], the calculation process for the pixel points of refY' is as follows:
[0266]
number
[0267]
number
[0268]
number
[0269] The upsampling process mentioned in the processing process for the first case is specifically as follows: For refNum reference luminance information refY obtained from adjacent regions, upsampling of the reference chromaticity information refC can be performed by employing methods such as linear interpolation or nonlinear interpolation, duplicating specific reference chromaticity pixels, or other upsampling methods, and the embodiments of this application are not limited thereto.
[0270] For example, as shown in Figure 7B, if the color format information indicates 4:2:0 sampling, then, taking an adjacent region of 4x2 chromaticity pixels as an example, this region needs to be upsampled to an 8x4 pixel region. In Figure 7B, (a) represents the reference chromaticity information refC, and (b) represents the upsampled reference chromaticity information refC'. Here, the thick-bordered area in (a) contains chromaticity pixels corresponding to the four upsampled chromaticity pixels in the thick-bordered area in (b), with k=0,...,3 and l=0,1. The four chromaticity pixels in the thick-bordered area in (b) are the upsampled chromaticity pixels corresponding to the thick-bordered area in (a), and (i,j) is the pixel position of the upper left corner.
[0271] ●When performing upsampling using horizontal linear interpolation, it is necessary to perform linear interpolation on the pixel points of refC' using adjacent points in the horizontal direction, for example as follows:
[0272] for k=0,…,3 and l=0,1 refC'[i][j]=(w0×refC[k][l]+w1×refC[k+1][l]+offset)≫shift (21) refC'[i+1][j]=(w2×refC[k][l]+w3×refC[k+1][l]+offset)≫shift(22) refC'[i][j+1]=(w4×refC[k][l]+w5×refC[k+1][l]+offset)≫shift(23) refC'[i+1][j+1]=(w6×refC[k][l]+w7×refC[k+1][l]+offset)≫shift (twenty four) Here, offset = 1 ≪ (shift - 1). {w0, w1, w2, w3, w4, w5, w6, w7} and shift can be chosen differently depending on the block size or block content, and below are some examples of commonly used coefficient combinations.
[0273]
number
[0274] for k=0,…,3 and l=0,1 refC'[i][j]=(w0×refC[k][l]+w1×refC[k][l+1]+offset)≫shift (25) refC'[i+1][j]=(w2×refC[k][l]+w3×refC[k][l+1]+offset)≫shift(26) refC'[i][j+1]=(w4×refC[k][l]+w5×refC[k][l+1]+offset)≫shift(27) refC'[i+1][j+1]=(w6×refC[k][l]+w7×refC[k][l+1]+offset)≫shift (28) Here, offset = 1 ≪ (shift - 1). {w0, w1, w2, w3, w4, w5, w6, w7} and shift can be chosen differently depending on the block size or block content, and below are some examples of commonly used coefficient combinations.
[0275]
number
[0276] for k=0,…,3 and l=0,1 refC'[i][j]=refC[k][l] (29) refC'[i+1][j]=refC[k][l] (30) refC'[i][j+1]=refC[k][l] (31) refC'[i+1][j+1]=refC[k][l] (32) (2) If the current color format information is not taken into consideration, it is sufficient to match the core parameter inSize, and the processing steps are as follows:
[0277] a. Match the number of reference luminance information points (refYnum) obtained from adjacent reference regions to the core parameter inSize.
[0278] ●If inSize is equal to refYnum, no operation is required.
[0279] ●If inSize is smaller than refYnum, the reference brightness information needs to be scaled down.
[0280] ●If inSize is larger than refYnum, the reference brightness information needs to be scaled up.
[0281] b. Match the number of reference chromaticity information points, refCnum, obtained from the reference region to the WCP core parameter inSize.
[0282] ●If inSize is equal to refYnum, no operation is required.
[0283] ●If inSize is smaller than refYnum, the reference chromaticity information needs to be scaled down.
[0284] ●If inSize is larger than refYnum, the reference chromaticity information needs to be scaled up.
[0285] The size reduction operation process mentioned in the processing process for the first case is specifically as follows: Taking reference brightness information as an example, let refYnum be the number of reference brightness information values obtained from adjacent regions.
[0286] ●When reducing the size using a fixed-interval point selection method, that is, by arranging refYnum reference luminance pixels in a one-dimensional vector according to a certain positional relationship, and then selecting points at fixed intervals based on the relationship between inSize and refYnum, the size of the reference luminance information can be reduced. Here, the method of arranging in a one-dimensional vector and the starting position of the fixed-interval selection can be freely set, and the embodiments of this application are not limited to these.
[0287] As an example, as shown in Figure 8, the reference luminance information refY obtained from a 1x1 "L" shaped reference region can be rearranged into a one-dimensional vector refY' based on the positional relationship from bottom left to top left, and then from top left to top right.
[0288] Here, the fixed interval used for size reduction is subDist = (refYnum + inSize - 1) / inSize. Starting from the first pixel position of refY' obtained above, one pixel is selected for every (subDist - 1) pixel positions, ultimately obtaining inSize reference luminance information in_refY. The detailed process is as follows:
[0289] for i = 0, ..., inSize-1 in_refY[i]=refY'[i×subDist] (33) ●When performing size reduction using a continuous position selection method, that is, refYnum reference luminance pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then inSize pixels are continuously selected from a specific position in the one-dimensional vector to obtain in_refY, and if, for example, selection starts from the posth position of refY', the detailed process is as follows.
[0290] for i = 0, ..., inSize-1 in_refY[i]=refY'[pos+i] (34) The size expansion operation process mentioned in the processing process for the first case is specifically as follows: Taking reference chromaticity information as an example, let refCnum be the number of reference chromaticity information obtained from adjacent regions.
[0291] ●When a fixed-interval interpolation method is used to enlarge the size, that is, refCnum reference chromaticity pixels are arranged in a one-dimensional vector based on a certain positional relationship, and then points are selected at fixed intervals based on the relationship between inSize and refCnum, thereby enlargeing the size of the reference chromaticity information. Here, the method of arranging in the one-dimensional vector and the starting position of the fixed-interval interpolation can be freely set, and the embodiments of this application are not limited to this. After arranging refY in the same manner as for size reduction, a one-dimensional vector refY' is obtained, and then the fixed interval used for size enlargement is subDist=(refCnum+inSize-1) / refCnum, and starting from the first pixel position of refY', inSize reference luminance information in_refY is finally obtained, and when a linear interpolation method is used, the detailed process is as follows.
[0292] for i = 0, ..., inSize-1 if (i%subDist==0) in_refY[i]=refY'[i×subDist] (35) else
number
[0293]
number
[0294] ●If recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required.
[0295] ●If recSizeW is larger than predSizeW, or if recSizeH is larger than predSizeH, it is necessary to reduce the size of the reconstructed luminance information recY.
[0296] ●If recSizeW is smaller than predSizeW, or if recSizeH is smaller than predSizeH, it is necessary to enlarge the size of the reconstructed luminance information recY.
[0297] The size reduction operation process mentioned in the processing process for the second case is specifically as follows: First, the horizontal downsampling factor downHor is calculated based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed luminance information recY. Similarly, the vertical downsampling factor downVer is calculated based on the height predSizeH determined by the core parameters and the height recSizeH of the reconstructed luminance information recY. The calculation method is as follows:
[0298] downHor=recSizeW / predSizeW (37) downVer=recSizeH / predSizeH (38) Next, downsampling is performed according to the following conditions to generate the reconstructed luminance information in_recY.
[0299] (1) When downHor is greater than 1 and downVer is equal to 1, only horizontal downsampling is required, and the specific formula is as follows:
[0300] in_recY[x][y]=(recY[downHor×x-1][y] +2×recY[downHor×x][y] +recY[downHor×x+1][y]+2)>>2 (39) (2) When downHor is equal to 1 and downVer is greater than 1, only vertical downsampling is required, and the specific formula is as follows:
[0301] in_recY[x][y]=(recY[x][downVer×y-1]+2×recY[x][downVer×y] +recY[x][downVer×y+1]+2)>>2 (40) (3) If both downHor and downVer are greater than 1, downsampling must be performed in both the horizontal and vertical directions, and the specific formula is as follows:
[0302] in_recY[x][y]= (recY[downHor×x-1][downVer×y] +recY[downHor×x-1][downVer×y+1] +2*recY[downHor×x][downVer×y] +2*recY[downHor×x][downVer×y+1] +recY[downHor×x+1][downVer×y] +recY[downHor×x+1][downVer×y+1]+4)>>3 (41) The size scaling operation process mentioned in the processing process for the second case is specifically as follows: First, the horizontal upsampling factor upHor is calculated based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed luminance information recY. Similarly, the vertical upsampling factor upVer is calculated based on the height predSizeH determined by the core parameters and the height recSizeH of the reconstructed luminance information recY. The calculation method is as follows:
[0303] upHor=predSizeW / recSizeW (42) upVer=predSizeH / recSizeH (43) Next, upsampling is performed according to the following conditions to generate the input reconstructed luminance information in_recY.
[0304] First, the upper reference reconstructed luminance pixel refY_T is input into the upper row in_recY[x][-1] of the input reconstructed luminance information, and the left reference reconstructed luminance pixel refY_L is input into the left column in_recY[-1][y] of the input reconstructed luminance information. Here, x=0,...,predSizeW-1 and y=0,...,predSizeH-1. In this case, recY is substituted into the corresponding positions in in_recY ((x+1)×upHor-1,(y+1)×upVer-1) using the following formula.
[0305] in_recY[(x+1)×upHor-1][(y+1)×upVer-1]=recY[x][y](44) If in_recY is divided equally into recSizeW × recSizeH subblocks, the assigned position can be understood as the lower right corner of each subblock. Referring to Figure 12, as an example, if predSizeW=8 and predSizeH=8, and the current block size is 4×4, then the shaded area represents the upper reference reconstructed luminance pixel refY_T, the vertical area represents the left reference reconstructed luminance pixel refY_L, and the grid area represents the position where the current block's reconstructed luminance information recY is input.
[0306] ●When the horizontal upsampling factor upHor is greater than 1, horizontal upsampling is performed first, and the upsampling process is as shown by the following formula.
[0307]
number
[0308] Linear interpolation upsampling is employed as the upsampling method; that is, all values of each point (horizontal line fill) obtained by interpolation between two upsampling luminance reference points (grid fill) are the weighted average of the two upsampling reference luminance points. According to equations (45) and (46), the weight of the left upsampling reference chromaticity point is (upHor-dX) / upHor, and the weight of the right upsampling reference chromaticity point is dX / upHor, where dX = 1, ..., upHor-1 (i.e., the distance between the current interpolation point and the left reference point). Thus, when performing horizontal interpolation, the weights are related only to the horizontal upsampling factor upHor. Figure 14 shows an example of the weights. In this example, upHor = 4. Here, for the first interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 3 / 4 and the weight of the right upsampling reference chromaticity point is 1 / 4; for the second interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 2 / 4 and the weight of the right upsampling reference chromaticity point is 2 / 4; and for the third interpolation point in Figure 14, the weight of the left upsampling reference chromaticity point is 1 / 4 and the weight of the right upsampling reference chromaticity point is 3 / 4.
[0309] ●If the vertical upsampling factor upVer is greater than 1, vertical upsampling is required, and this process is the same as the horizontal upsampling process. The specific process is as follows:
[0310] sum=(upVer-dY)×rec_Y[xVer][yVer]+dY×rec_Y[xVer][yVer+upVer](47)
number
[0311] Similarly, the upsampling method employs linear interpolation, and according to equations (47) and (48), the weight of the upper upsampling reference point is (upVer-dY) / upVer, and the weight of the lower reference point is dY / upVer, where dY = 1, ..., upVer-1 (i.e., the distance between the current interpolation point and the upper reference point). Thus, when performing vertical interpolation, the weights are related only to the vertical upsampling factor upVer.
[0312] Thus, the final in_recY is obtained through the above process. Regarding the above size expansion process, in addition to the "horizontal first, then vertical" upsampling method, a "vertical first, then horizontal" upsampling method may also be adopted. Furthermore, the reconstructed luminance value in_recY can be obtained by averaging the reconstructed luminance value upsampled "horizontal first, then vertical" and the reconstructed luminance value upsampled "vertical first, then horizontal," or a convolutional operation in a neural network can be adopted instead of the upsampling operation, and the embodiments of this application are not limited to these.
[0313] In this way, the final input target information obtained may include inSize reference chromaticity information refC, inSize reference luminance information refY, and reconstructed luminance information recY of the current prediction block.
[0314] In step S1103, a weight-based chromaticity prediction calculation is performed based on the target information to determine the predicted block for the current block.
[0315] In step S1103, the predicted chromaticity value within the pre-set size specified by the core parameter is C pred Represented by [i][j], where i=0,…,predSizeW-1 and j=0,…,predSizeH-1, which are obtained one by one. Note that predSizeH and predSizeW are core parameters and may or may not be the same as the current block height nTbH or width nTbW. Thus, under certain conditions, it is also possible to perform the following calculation on only a portion of the pixels to be predicted within the current block.
[0316] Here, the chromaticity prediction calculation in WCP mode may involve obtaining weights and then performing weighted predictions based on those weights to obtain weight-based chromaticity prediction values. The weight acquisition process involves constructing a luminance difference vector and calculating the weights. The detailed calculation process is as follows:
[0317] If i=0, ..., predSizeW-1 and j=0, ..., predSizeH-1 When k = 0, 1, ..., inSize-1 Construct each element of the luminance difference vector, diffY[i][j][k]. The element cWeight[i][j][k] (or cWeightFloat[i][j][k]) of the weight vector is calculated, and then the chromaticity prediction value Cpred[i][j] is calculated using cWeight[i][j] (or cWeightFloat[i][j][k]) and refC.
[0318] In one particular embodiment, referring to Figure 16, an exemplary flowchart 3 of the decoding method according to an embodiment of the present application is shown. As shown in Figure 16, the method may include the following steps:
[0319] In step S1601, for each pixel to be predicted, a luminance difference vector is constructed using the reference chromaticity information, reference luminance information, and the reconstructed luminance information of the current block included in the target information.
[0320] Furthermore, for each predicted pixel Cpred[i][j] within the size specified by the core parameters, its corresponding reconstructed luminance information recY[i][j] is subtracted from the inSize reference luminance information refY, and the absolute value of the subtracted difference is calculated to obtain the luminance difference vector diffY[i][j][k]. The specific calculation formula is as follows:
[0321] diffY[i][j][k]=abs(refY[k]-recY[i][j]) (49) Here,
number
[0322] Furthermore, under certain conditions, linear or nonlinear numerical processing can be performed on the brightness difference vector of the target pixel. For example, the numerical value of the brightness difference vector of the target pixel can be scaled based on a control parameter S in the core parameters.
[0323] In step S1602, for each pixel to be predicted, a weight vector is calculated using a nonlinear function based on the brightness difference vector.
[0324] In the embodiment of this application, a weight model is used for each prediction target pixel C pred The luminance difference vector diffY[i][j] corresponding to [i][j] is processed to obtain the corresponding floating-point weight vector cWeightFloat[i][j]. The weight model here includes, but is not limited to, nonlinear functions such as nonlinear normalization functions and nonlinear exponential normalization functions, and this application is not limited to them.
[0325] For example, a nonlinear Softmax function can be used as the weight model, where the brightness difference vector diffY[i][j] corresponding to each target pixel becomes the input to the weight model, and the weight model outputs a floating-point weight vector cWeightFloat[i][j] corresponding to each target pixel, with the calculation formula being as follows.
[0326]
number
[0327]
number
[0328] Thus, after the calculations in equation (50) or equation (51) above are completed, the cWeightFloat can be converted to a fixed-point number as shown below.
[0329] cWeight[i][j][k]=round(cWeightFloat[i][j][k]×2 Shift ) (52) Here, round(x) = Sign(x) × Floor(abs(x) + 0.5). Here, Floor(x) represents the largest integer less than or equal to x.
number
[0330] In step S1603, a weighted calculation is performed for each target pixel based on the weight vector and the reference chromaticity information included in the target information to obtain a chromaticity prediction value.
[0331] Furthermore, the predicted chromaticity value of each pixel to be predicted is calculated based on the weight vector cWeight[i][j] (or cWeightFloat[i][j]) corresponding to each pixel to be predicted and the reference chromaticity information refC. Specifically, for each pixel to be predicted C pred The reference chromaticity information refC of [i][j] is matched with the weight vector elements corresponding to each target pixel for prediction and multiplied to obtain subC[i][j] (or subCFloat[i][j]). The result of accumulating the multiplication results is the chromaticity prediction value C for each target pixel. pred [i][j] is obtained, and weighted prediction for the chromaticity component is realized.
[0332] In one possible embodiment, a weighting calculation is performed based on floating-point weighting coefficients and reference chromaticity information to obtain an initial predicted value for the target pixel, and then a fixed-point conversion process is performed on the initial predicted value to obtain a target predicted value for the target pixel.
[0333] As an example, the calculation formula is as follows:
[0334] When k = 0, 1, ..., inSize-1 subCFloat[i][j][k]=(cWeightFloat[i][j][k]×refC[k]) (53) After the calculation is complete, the subCFloat[i][j][k] can be further converted to a fixed-point number. In order to maintain a certain level of calculation precision during the fixed-point conversion process, a coefficient can be multiplied at this stage, specifically as shown below.
[0335] subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift ) (54) or In the case where i=0,…,predSizeW-1,j=0,…,predSizeH-1
number
[0336] C pred [i][j]=round(C pred Float[i][j]) (56) In another possible embodiment, a weighting calculation is performed based on a fixed-point weighting coefficient and reference chromaticity information to obtain an initial predicted value for the target pixel, and a fixed-point compensation process is performed on the initial predicted value to obtain a target predicted value for the target pixel.
[0337] As an example, the calculation formula is as follows:
[0338] When k = 0, 1, ..., inSize-1 subC[i][j][k]=(cWeight[i][j][k]×refC[k]) (57) Next, the calculation is performed using the fixed-point subC[i][j][k], specifically as shown below.
[0339] In the case where i=0,…,predSizeW-1,j=0,…,predSizeH-1
number
[0340] In step S1604, for each pixel to be predicted, a correction process is performed on the calculated chrominance prediction value to determine the prediction block of the current block.
[0341] Note that the chrominance prediction value should be restricted within a pre-set range. When it exceeds the pre-set range, corresponding correction operations need to be performed. Exemplarily, in one possible embodiment, a clamp operation can be performed on the chrominance prediction value of C pred [i][j], specifically as follows.
[0342] ● If the value of C pred [i][j] is less than 0, set it to 0; ● If the value of C pred [i][j] is greater than (1 << BitDepth) - 1, set it to (1 << BitDepth) - 1.
[0343] Here, BitDepth is the bit depth required for the chrominance pixel value, so that all chrominance prediction values within the prediction block are within the range of 0 to (1 << BitDepth) - 1.
[0344] That is, C pred [i][j] = Clip3(0, (1 << BitDepth) - 1, C pred [i][j]) (59) Here,
Equation
[0345]
number
[0346] Furthermore, after the weight-based chromaticity prediction outputs a chromaticity prediction value (predWcp), under certain conditions, post-processing operations are necessary to obtain the final chromaticity prediction value (predSamples). Otherwise, the final chromaticity prediction value predSamples will be predWcp.
[0347] For example, to reduce the instability caused by independent and parallel prediction for each pixel in WCP, a smoothing filter can be applied to predWcp to obtain the final chromaticity prediction value predSamples. Alternatively, to further improve the accuracy of the WCP prediction value, a position-related correction process can be applied to predWcp. For instance, a chromaticity compensation value can be calculated for each pixel to be predicted using a reference pixel with a nearby spatial position, and this chromaticity compensation value can be used to correct predWcp, with the corrected prediction value becoming the final chromaticity prediction value predSamples. Alternatively, to further improve the accuracy of the WCP prediction value, the chromaticity prediction value predWcp calculated in WCP can be weighted and merged with the chromaticity prediction value predWcp calculated in another chromaticity prediction mode, and the merging result becomes the final chromaticity prediction value predSamples. For example, the chromaticity prediction value predWcp calculated in CCLM mode and the chromaticity prediction value predWcp calculated in WCP can be weighted equally or unequally, and the weighted result becomes the final chromaticity prediction value predSamples. Alternatively, to improve the prediction performance of WCP, the prediction output predWcp of WCP may be modified using a neural network model, and the embodiments of this application are not limited to this.
[0348] Furthermore, in the embodiments of the present application, if reference chromaticity information redCref and reference luminance information redYref, having parameter sizes of inSize determined in WCP mode, and reconstruction luminance information redYrec for the current block, having parameter sizes of (predSizeW × predSizeH) determined in WCP mode, are already obtained, then some of the above three pieces of information may have already undergone upsampling, downsampling, or size reduction / expansion operations, or have not undergone such operations, and therefore spatial redundancy still exists between them. In this case, filtering operations can be performed on the reference chromaticity information redCref, reference luminance information redYref, and reconstruction luminance information redYrec, and different filtering operations can be employed depending on the different parameter values of inSize and predSizeW × predSizeH determined in WCP mode to obtain three new sets of information, including reference chromaticity information redCref', reference luminance information redYref', and reconstruction luminance information redYrec'. For example, filtering can be performed on redCref, redYref, and redYrec using linear and nonlinear filtering methods such as mean filtering, median filtering, and Gaussian filtering, or methods such as neural networks. Furthermore, these filtering operations can be performed before upsampling, downsampling, or resizing / expanding operations to obtain three new sets of information, including reference chromaticity information refC', reference luminance information refY', and reconstructed luminance information recY', which can then be upsampling, downsampling, or resizing / expanding.
[0349] Furthermore, in the embodiment of this application, the number of reference chromaticity information refC obtained from adjacent regions is refSizeC, the number of reference luminance information refY obtained from adjacent regions is refSizeY, the size of the reconstructed luminance information recY obtained from the current block is recSizeW × recSizeH, where recSizeW is the block width of the reconstructed luminance information recY and recSizeH is the block height of the reconstructed luminance information recY. All of this reference chromaticity information, reference luminance information, and reconstructed luminance information can be matched by the neural network to inSize and (predSizeW × predSizeH) specified in the step of determining the core parameters, and these three pieces of information can employ the same or different neural network models depending on the situation, i.e., upsampling, downsampling, or size reduction / expansion operations can all be replaced by the neural network model. In addition, the filtering operation according to the above embodiment can be performed before or after using the neural network model to obtain three new sets of information, including reference luminance information, reference chromaticity information, and reconstructed luminance information.
[0350] Furthermore, it can be understood that in the embodiments of this application, the reference information used for predicting a given chromaticity pixel is fixed in the weighted chromaticity prediction of the WCP mode, which inevitably affects the prediction accuracy. Therefore, we propose here a method for changing the reference pixel for each pixel, and the detailed process is as follows.
[0351] First, the core parameters include, but are not limited to, the control parameter (S), the number of weight-based chromaticity prediction inputs inSize[i][j], and the number of weight-based chromaticity prediction outputs (predWcp) (arranged in predSizeW × predSizeH). Here, inSize[i][j] represents the number of reference pixels used for a given prediction target pixel Cpred[i][j], where i=0,…,predSizeW-1, and j=0,…,predSizeH-1.
[0352] Next, the reference chromaticity information refC and reference luminance information refY are obtained from adjacent regions. Obtaining the reference chromaticity information includes, but is not limited to, selecting the reference chromaticity reconstruction values for the upper region and the left region of the current block. Obtaining the reference luminance information includes, but is not limited to, obtaining the corresponding reference luminance information based on the reference chromaticity information location.
[0353] The method for obtaining the reconstructed luminance information recY of the current block includes, but is not limited to, obtaining the corresponding reconstructed luminance information as the reconstructed luminance information of the current block based on the position of the chromaticity information within the current block.
[0354] Thirdly, for different predicted positions of blocks of size predSizeW × predSizeH, different reference luminance information refY[i][j] and reference chromaticity information refC[i][j] are selected from the reference chromaticity information refC and reference luminance information refY obtained from adjacent regions, and the detailed process is as follows.
[0355] In the case where i=0,…,predSizeW-1,j=0,…,predSizeH-1 When k = 0, 1, ..., inSize-1 Obtaining the input target information includes obtaining inSize[i][j] reference chromaticity information refC, obtaining inSize[i][j] reference luminance information refY, and obtaining reconstructed luminance information recY[i][j].
[0356] Fourthly, for each predictable pixel C within the size specified by the core parameters, pred For each [i][j], subtract the inSize[i][j] reference luminance information refY[i][j] from the corresponding reconstructed luminance information recY[i][j], and obtain the luminance difference vector diffY[i][j][k] by calculating the absolute value of the subtracted difference. Here, refY[i][j] is the pixel to be predicted.
number
[0357] In the case where i=0,…,predSizeW-1,j=0,…,predSizeH-1 When k = 0, 1, ..., inSize[i][j] - 1 diffY[i][j][k]=abs(refY[i][j][k]-recY[i][j]) (62) Under certain conditions, linear or nonlinear numerical processing can be performed on the brightness difference vector of the target pixel. For example, the numerical value of the brightness difference vector of the target pixel can be scaled based on a control parameter S in the core parameters.
[0358] Fifth, the predicted chromaticity value of each pixel is calculated based on the weight vector cWeight[i][j] and reference chromaticity information refC corresponding to each pixel to be predicted. Specifically, the reference chromaticity information refC[i][j] of each pixel to be predicted Cpred[i][j] is matched with the weight vector elements corresponding to each pixel to be predicted and multiplied to obtain subC[i][j]. The cumulative result of these multiplications is the predicted chromaticity value Cpred[i][j] (i.e., the weighted prediction) for each pixel to be predicted. Here, refC[i][j] is the reference chromaticity of the pixel C pred This is the set of reference chromaticity vectors corresponding to [i] and [j], and the formula for calculating them is as follows:
[0359] When k = 0, 1, ..., inSize-1 subCFloat[i][j][k]=(cWeightFloat[i][j][k]·refC[i][j][k]) (63) After the calculation is complete, the subCFloat can be converted to a fixed-point number. In order to maintain a certain level of calculation precision during the fixed-point conversion process, a coefficient can be added, specifically as shown in the following formula.
[0360] subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift ) (64) or subC[i][j][k]=(cWeight[i][j][k]×refC[i][j][k]) (65) Furthermore, it can be understood that in the embodiments of this application, the adjacent region is the same as that used in other existing chromaticity prediction modes, and therefore inevitably affects the prediction accuracy. Thus, it is also possible to change the adjacent region. Exemplarily, the reference region of the WCP prediction technique can be extended using the existing multi-reference row technique in H.266, and as shown in Figure 17, it can be extended to adjacent regions of multiple rows or multiple columns such as 0, 1, 2, 3, 4, 5, 6, 7, etc., and used as the reference region of the current block, but is not limited to this technique, and the reference rows or reference columns can also be increased or decreased, and the embodiments of this application are not limited to this.
[0361] This embodiment provides a decoding method and, through this embodiment, describes in detail the specific implementation of the previously described embodiment, demonstrating that the technical solutions of the previously described embodiment can improve the accuracy of the WCP prediction technology. Specifically, by optimizing the target information acquisition process, under different core parameter conditions, different processing methods (including filtering methods such as upsampling, downsampling, size reduction, and size expansion) are used depending on the current different color format information or the number of different acquired information to match the number of acquired information with the number of information specified in the WCP, completing the target information correction process and obtaining the final chromaticity prediction value. In the case of different color format information, the spatial characteristics exhibited by all pixels of the reference luminance pixels and reference chromaticity pixels acquired from adjacent regions differ depending on the image with different content characteristics. Therefore, by upsampling or downsampling processing, the continuity of their spatial correlation can be strengthened to some extent, or some information with relatively weak spatial correlation can be removed, and this can be used as the target information finally input to the WCP prediction technology. This improves the accuracy of the prediction value, enhances the accuracy of chromaticity prediction, and improves encoding and decoding performance while saving bitrate.
[0362] In another embodiment of the present application, referring to Figure 18, an exemplary flowchart 1 of the encoding method according to an embodiment of the present application is shown. As shown in Figure 18, the method may include the following steps:
[0363] In step S1801, the reference information for the current block is determined.
[0364] Furthermore, the encoding method of the embodiment of the present application can be applied to an encoding device or an encoding device (also called an "encoder") that integrates such an encoding device. More specifically, the encoding method of the embodiment of the present application may refer to an intra-prediction method, and more specifically, a weight-based chromaticity prediction preprocessing operation method.
[0365] In embodiments of the present invention, a video image can be divided into a plurality of coded blocks, each coded block may include a first color component, a second color component, and a third color component, where the current block refers to the coded block currently intra-predicted within the video image. Furthermore, if the current block makes a prediction for the first color component and it is assumed that the first color component is the luminance component, that is, if it is assumed that the component to be predicted is the luminance component, then the current block is also called a luminance prediction block. Alternatively, if a prediction for the second color component is made for the current block and it is assumed that the second color component is the chromaticity component, that is, if it is assumed that the component to be predicted is the chromaticity component, then the current block is also called a chromaticity prediction block.
[0366] Furthermore, in embodiments of the present application, the reference information for the current block may include the values of the first color component sample points in the adjacent region of the current block and the values of the second color component sample points in the adjacent region of the current block, and these sample points can be determined based on encoded pixels in the adjacent region of the current block. In some embodiments, the adjacent region of the current block may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0367] Furthermore, the reference information of the current block may also include the reconstructed values of the first reference color component sample points within the current block. Therefore, in some embodiments, determining the reference information of the current block is This may include determining the reference information for the current block based on the values of the first color component sample points in the adjacent region of the current block, the values of the second color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block.
[0368] In the embodiments of this application, the reference pixel of the current block may refer to a reference pixel point adjacent to the current block, and is also called the first color component sample point or second color component sample point in the adjacent region of the current block, and is represented as Neighboring Sample or Reference Sample. Here, adjacent means spatially adjacent, but is not limited to this. For example, adjacent means adjacent in the time domain, adjacent in the space and time domains, and furthermore, the reference pixel of the current block may be a reference pixel obtained by performing a specific process on a spatially adjacent reference pixel point, a reference pixel point adjacent in the time domain, or a reference pixel point adjacent in the space and time domains, and the embodiments of this application are not limited to these.
[0369] Furthermore, in the embodiments of this application, the first color component is the luminance component, and the second color component is the chromaticity component. Then, the value of the first color component sample point in the adjacent region of the current block is shown as reference luminance information corresponding to the reference pixel of the current block, and the value of the second color component sample point in the adjacent region of the current block is shown as reference chromaticity information corresponding to the reference pixel of the current block.
[0370] In step S1802, filtering is performed on some of the reference information of the current block to determine the target information of the current block.
[0371] In the embodiments of the present invention, there are cases where the number of values of the first color component sample points in the adjacent region of the current block differs from the number of values of the second color component sample points. In this case, it may be necessary to perform filtering on either the values of the first color component sample points or the values of the second color component sample points in order to make the numbers of both equal.
[0372] In one possible embodiment, filtering a portion of the reference information of the current block to determine the target information of the current block is performed by performing a first filtering process on the values of the first color component sample points in the adjacent region of the current block to obtain filtered sample values of the first color component in the adjacent region of the current block. This may include determining the target information of the current block based on filtered sample values of the first color component in the adjacent region of the current block.
[0373] In the embodiments of the present invention, the number of filtered sample values of the first color component in the adjacent region of the current block is equal to L, where L represents the number of values of the second color component sample points in the adjacent region of the current block, and L is a positive integer.
[0374] In one particular embodiment, the first filtering process may be a downsampling filtering process. Exemplarily, since the number of reference luminance information points in the current block is usually greater than the number of reference chromaticity information points, a downsampling filtering process can be performed on the reference luminance information of the current block to make the number of reference luminance information points equal to the number of reference chromaticity information points.
[0375] Furthermore, since the number of reference luminance information and reference chromaticity information for the current block is affected by the color format information, in some embodiments the method may further include performing a first filtering process on the values of the first color component sample points in the adjacent region of the current block based on the color format information to obtain filtered sample values of the first color component in the adjacent region of the current block.
[0376] In one particular embodiment, the first filtering process is: When the color format information indicates 4:4:4 sampling, downsampling filtering is not performed on the values of the first color component sample points in the adjacent regions of the current block. When the color format information indicates 4:2:2 sampling, downsampling filtering is performed on the values of the first color component sample points in the adjacent regions of the current block. If the color format information indicates 4:2:0 sampling, this may further include performing downsampling filtering on the values of the first color component sample points in adjacent regions of the current block.
[0377] In the embodiments of this application, when the color format information indicates 4:2:0 sampling, the downsampling rate is the reciprocal of a positive integer multiple of 2.
[0378] Thus, the downsampling filtering performed on the reference luminance information obtained from the adjacent region may involve employing a multi-tap filter (e.g., a 4-tap filter, a 5-tap filter, a 6-tap filter, etc.) to perform downsampling, or it may involve obtaining a specific pixel from among multiple reference luminance pixels at the corresponding positions of the reference chromaticity pixels, or it may involve other downsampling methods, and the embodiments of this application are not limited thereto.
[0379] Furthermore, if the number of downsampled and filtered reference luminance information is L and is the same as the number of reference chromaticity information, then L must be matched to a preset number. Therefore, in some embodiments, the method is This involves comparing L with a pre-set number, Based on the comparison result between L and a pre-set number, a second filtering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. This may further include determining the target information of the current block based on the filtered adjacent sample values of the first color component of the current block and the filtered adjacent sample values of the second color component of the current block.
[0380] In one particular embodiment, based on the comparison result of L with a predetermined number, a second filtering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If L is greater than a preset number, a first subfiltering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. If L is less than a preset number, this may include performing a second subfiltering process on the filtered sample value of the first color component in the adjacent region of the current block and the value of the second color component sample point in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0381] In the embodiments of this application, the pre-set number can be represented by inSize. Specifically, if L is equal to the pre-set number, no operation is required; if L is greater than the pre-set number, a first sub-filtering process (i.e., size reduction) must be performed on the reference luminance information and reference chromaticity information; and if L is less than the pre-set number, a second sub-filtering process (i.e., size expansion) must be performed on the reference luminance information and reference chromaticity information.
[0382] In another possible embodiment, filtering a portion of the reference information of the current block to determine the target information of the current block involves performing a third filtering process on the values of the second color component sample points in the adjacent region of the current block to obtain filtered sample values of the second color component in the adjacent region of the current block. This may include determining the target information of the current block based on filtered sample values of the second color component in the adjacent region of the current block.
[0383] In the embodiments of the present invention, the number of filtered sample values of the second color component in the adjacent region of the current block is equal to K, where K represents the number of values of the first color component sample points in the adjacent region of the current block, and K is a positive integer.
[0384] In one particular embodiment, the third filtering process is an upsampling filtering process. Exemplarily, since the number of reference luminance information points in the current block is usually greater than the number of reference chromaticity information points, an upsampling filtering process can be applied to the reference chromaticity information of the current block in order to make the number of reference luminance information points equal to the number of reference chromaticity information points.
[0385] Since the number of reference luminance information and reference chromaticity information for a current block is affected by the color format information, in some embodiments, the method may further include performing a third filtering process on the values of the second color component sample points in the adjacent region of the current block based on the color format information to obtain filtered sample values of the second color component in the adjacent region of the current block.
[0386] In one particular embodiment, the third filtering process is: When the color format information indicates 4:4:4 sampling, upsampling filtering is not performed on the values of the second color component sample points in the adjacent region of the current block. When the color format information indicates 4:2:2 sampling, upsampling filtering is performed on the values of the second color component sample points in the adjacent region of the current block. If the color format information indicates 4:2:0 sampling, this may further include performing upsampling filtering on the values of the second color component sample points in adjacent regions of the current block.
[0387] In the embodiment of this application, when the color format information indicates 4:2:0 sampling, the upsampling rate is a positive integer multiple of 2. In this way, if the number of reference luminance information points obtained from adjacent regions differs from the number of reference chromaticity information points, upsampling filtering can be performed on the reference chromaticity information points obtained from adjacent regions to match the number of reference luminance information points.
[0388] Thus, the upsampling filtering performed on the reference chromaticity information obtained from adjacent regions may involve upsampling using methods such as linear interpolation or nonlinear interpolation, or it may involve duplicating specific reference chromaticity pixels, or it may involve other upsampling methods, and the embodiments of this application are not limited thereto.
[0389] Furthermore, if the number of upsampled and filtered reference chromaticity information is K and the same as the number of reference luminance information, then K must be matched to a preset number. Therefore, in some embodiments, the method is This involves comparing K to a pre-set number, Based on the comparison result between K and a pre-set number, a fourth filtering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block. This may further include determining the target information of the current block based on the filtered adjacent sample values of the first color component of the current block and the filtered adjacent sample values of the second color component of the current block.
[0390] In one particular embodiment, based on the comparison result between K and a preset number, a fourth filtering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If K is greater than a preset number, a first subfiltering process is performed on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. If K is less than a preset number, this may include performing a second subfiltering operation on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0391] In the embodiments of this application, the pre-set number can be represented by inSize. Specifically, if K is equal to inSize, no operation is required; if K is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference luminance information and reference chromaticity information; and if K is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference luminance information and reference chromaticity information.
[0392] Furthermore, it can be understood that, in the embodiments of this application, if color format information is not considered, the number of reference luminance information obtained from adjacent regions and the number of reference chromaticity information can be made the same by directly matching them with inSize.
[0393] In one possible embodiment, filtering a portion of the reference information of the current block to determine the target information of the current block involves determining the quantity of the values of the first color component sample points in the adjacent region of the current block as the first quantity. Based on the comparison result between the first quantity and a pre-set number, a fifth filtering process is performed on the values of the first color component sample points in the adjacent region of the current block, and the filtered adjacent sample values of the first color component of the current block are determined. This may include determining the target information of the current block based on the filtered neighboring sample values of the first color component of the current block.
[0394] In one particular embodiment, a fifth filtering process is performed on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block. If the first quantity is greater than a preset number, a first subfiltering process is performed on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block. If the first quantity is smaller than a preset number, the process may include performing a second subfiltering operation on the values of the first color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the first color component of the current block.
[0395] In the embodiment of this application, the number of reference luminance information points obtained from an adjacent region can be matched with a pre-set number. Here, the number of reference luminance information points obtained from an adjacent region (i.e., the first quantity) can be represented by refYnum, and the pre-set number can be represented by inSize. Specifically, if refYnum is equal to inSize, no operation is required; if refYnum is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference luminance information; and if refYnum is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference luminance information.
[0396] In another possible embodiment, filtering a portion of the reference information of the current block to determine the target information of the current block involves determining the number of values of the second color component sample points in the adjacent region of the current block as the second quantity. Based on the comparison result between the second quantity and the pre-set number, a sixth filtering process is performed on the values of the second color component sample points in the adjacent region of the current block, and the filtered adjacent sample values of the second color component of the current block are determined. This may further include determining the target information of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0397] In one particular embodiment, a sixth filtering process is performed on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block. If the second quantity is greater than a preset number, a first subfiltering process is performed on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block. If the second quantity is smaller than a preset number, the process may include performing a second subfiltering operation on the values of the second color component sample points in the adjacent region of the current block to determine the filtered adjacent sample values of the second color component of the current block.
[0398] Furthermore, in the embodiments of this application, the number of reference chromaticity information obtained from adjacent regions can be matched with a pre-set number. Here, the number of reference chromaticity information obtained from adjacent regions (i.e., the second quantity) can be represented by refCnum, and the pre-set number can be represented by inSize. Specifically, if refCnum is equal to inSize, no operation is required; if refCnum is greater than inSize, a first subfiltering process (i.e., size reduction) must be performed on the reference chromaticity information; and if refCnum is less than inSize, a second subfiltering process (i.e., size expansion) must be performed on the reference chromaticity information.
[0399] In the embodiments of this application, the first subfiltering process may be a downsampling filtering process. In addition, in some embodiments, the first subfiltering process is Subfiltering processing is performed using a fixed-interval position selection method, and This may further include at least one of the following: employing a continuous position selection method to perform subfiltering.
[0400] In the embodiments of the present application, the second subfiltering process may be an upsampling filtering process. In addition, in some embodiments, the second subfiltering process may further include performing subfiltering using a fixed-interval position interpolation method.
[0401] Furthermore, when predicting the chromaticity component for the current block, the reference information for the current block may also include the reconstructed luminance information for the current block. Therefore, the reference information for the current block can also be determined based on the reconstructed value of the first reference color component sample point within the current block.
[0402] In the embodiments of this application, the first reference color component may be a luminance component, in which case the reconstructed value of the first reference color component sample point in the current block is the reconstructed luminance information of the current block. Since the number of reconstructed luminance information points for the current block differs from a preset size, it is necessary to perform a filtering process on the reconstructed luminance information of the current block in order to convert the number of reconstructed luminance information points obtained from the current block to the preset size and input it. Here, the preset size is predSizeW × predSizeH, where predSizeW represents the width of the predicted block and predSizeH represents the height of the predicted block.
[0403] In some embodiments, filtering a portion of the reference information of the current block to determine the target information of the current block may include performing a seventh filtering process on the reconstructed values of the first reference color component sample points in the current block to determine the filtered sample values of the first reference color component sample points in the current block, and determining the target information of the current block based on the filtered sample values of the first reference color component sample points in the current block.
[0404] In one particular embodiment, a seventh filtering process is performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block. Currently, the first width and first height are determined based on the reconstruction value of the first reference color component sample point within the block. If the first width is greater than the width of the prediction block, or if the first height is greater than the height of the prediction block, a third subfiltering process is performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block. If the first width is less than the width of the prediction block, or if the first height is less than the height of the prediction block, a fourth subfiltering process may be performed on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block.
[0405] In the embodiment of this application, assuming that the number of reconstructed luminance information is recSizeW × recSizeH, recSizeW represents the first width and recSizeH represents the first height. Specifically, if recSizeW is equal to predSizeW and recSizeH is equal to predSizeH, no operation is required. If recSizeW is greater than predSizeW or recSizeH is greater than predSizeH, a first subfiltering process (i.e., size reduction) must be performed on the reconstructed luminance information. If recSizeW is less than predSizeW or recSizeH is less than predSizeH, a second subfiltering process (i.e., size expansion) must be performed on the reconstructed luminance information.
[0406] Furthermore, in the embodiments of this application, the third subfiltering process may be a downsampling filtering process. In addition, in some embodiments, the third subfiltering process is Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering. Currently, downsampling filtering is performed vertically on the reconstructed value of the first reference color component sample point within the block. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering, followed by vertical downsampling filtering, and This may further include at least one of the following: performing vertical downsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal downsampling filtering.
[0407] Here, first, a horizontal downsampling factor is calculated based on recSizeW and predSizeW, and a vertical downsampling factor is calculated based on recSizeH and predSizeH. Then, downsampling filtering can be performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical downsampling factor. Specifically, if the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is equal to 1, downsampling should be performed only in the horizontal direction on the reconstructed luminance information. If the horizontal downsampling factor is equal to 1 and the vertical downsampling factor is greater than 1, downsampling should be performed only in the vertical direction on the reconstructed luminance information. If the horizontal downsampling factor is greater than 1 and the vertical downsampling factor is greater than 1, downsampling should be performed on the reconstructed luminance information in both the horizontal and vertical directions. Here, horizontal downsampling may be performed first, followed by vertical downsampling, or vertical downsampling may be performed first, followed by horizontal downsampling. Furthermore, a convolutional operation in a neural network structure may be used instead of the downsampling operation here, and the embodiments of this application are not limited thereto.
[0408] Furthermore, in the embodiments of this application, the fourth subfiltering process is an upsampling filtering process. In addition, in some embodiments, the fourth subfiltering process is Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to vertical upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering, followed by vertical upsampling filtering, and This may further include at least one of the following: performing vertical upsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal upsampling filtering.
[0409] Here, first, the horizontal upsampling factor is calculated based on recSizeW and predSizeW, and the vertical upsampling factor is calculated based on recSizeH and predSizeH. Then, upsampling filtering is performed on the reconstructed luminance information based on the horizontal downsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, it is sufficient to perform upsampling only in the horizontal direction on the reconstructed luminance information. If the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, it is sufficient to perform upsampling only in the vertical direction on the reconstructed luminance information. If the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, it is necessary to perform upsampling in both the horizontal and vertical directions on the reconstructed luminance information. Here, it is possible to perform horizontal upsampling first and then vertical upsampling, or vertical upsampling first and then horizontal upsampling. Furthermore, it is possible to perform a weighted average of the upsampling results of "horizontal first, then vertical" and "vertical first, then horizontal" to determine the final upsampling result, or to employ a convolutional operation in a neural network structure instead of the upsampling operation here, and the embodiments of this application are not limited to these.
[0410] In other words, in the embodiments of the present application, the reference information of the current block may include the value of the first color component sample point in the adjacent region of the current block, the value of the second color component sample point in the adjacent region of the current block, and the reconstructed value of the first reference color component sample point within the current block, and the target information may include the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point within the current block. Here, if there is no need to perform filtering on the value of the first color component sample point in the adjacent region of the current block, the filtered adjacent sample value of the first color component of the current block is equal to the value of the first color component sample point in the adjacent region of the current block. Similarly, if filtering is not required for the values of the second color component sample points in the adjacent region of the current block, the filtered adjacent sample value of the second color component in the current block is equal to the value of the second color component sample point in the adjacent region of the current block. Similarly, if filtering is not required for the reconstructed values of the first reference color component sample points in the current block, the filtered sample value of the first reference color component sample points in the current block is equal to the reconstructed value of the first reference color component sample points in the current block.
[0411] In this way, the obtained target information may include filtered adjacent sample values of the first color component of the current block, filtered adjacent sample values of the second color component of the current block, and filtered sample values of the first reference color component sample points within the current block, that is, it may include inSize reference chromaticity information, inSize reference luminance information, and reconstructed luminance information that fits a preset size.
[0412] In step S1803, the weighting coefficient is determined based on the reference sample value of the first color component in the target information.
[0413] Furthermore, after determining the filtered adjacent sample value of the first color component of the current block, the filtered adjacent sample value of the second color component of the current block, and the filtered sample value of the first reference color component sample point in the current block, in some embodiments, the method may further include setting the reference sample value of the first color component in the target information to the absolute difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block.
[0414] In some embodiments, the method may further include setting the reference sample value of the second color component in the target information to the filtered adjacent sample value of the second color component in the current block.
[0415] Furthermore, considering filtering of the reference information, filtering can be performed only on the reference luminance information, only on the reconstructed luminance information, only on the reference luminance information and the reconstructed luminance information, or even on all of the reference chromaticity information, reference luminance information, and reconstructed luminance information, and there are no particular limitations here. Then, with regard to the calculation of the luminance difference, the method may further include setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in the adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block, or setting the reference sample value of the first color component in the target information to the absolute value of the difference between the filtered adjacent sample value of the first color component in the current block and the reconstructed value of the first reference color component sample point in the current block, and there are no particular limitations here.
[0416] In some embodiments, determining the weighting factor based on the reference sample value of the first color component in the target information may include: determining a value corresponding to the reference sample value of the first color component based on a pre-set mapping relationship; and setting the weighting factor equal to the value.
[0417] In the embodiments of the present application, the reference sample value of the first color component may be the absolute value of the difference between the filtered adjacent sample value of the first color component of the current block and the filtered sample value of the first reference color component sample point in the current block. Here, the first reference color component is the first color component, and the first color component is a color component different from the predicted second color component in the embodiments of the present application.
[0418] In the embodiments of the present application, in order to predict the chrominance component of the pixel to be predicted in the current block, at least one pixel to be predicted in the current block is selected, and the luminance difference |ΔY k | (represented by) between their reconstructed luminance and the reference luminance in the adjacent region can be calculated respectively. Here, when |ΔY k | is relatively small, it indicates that the similarity of the luminance values is relatively strong, and a large weight can be given to the corresponding weighting factor (represented by w k ). Conversely, when |ΔY k | is relatively large, it indicates that the similarity of the luminance values is relatively weak, and a small weight is given to w k . That is, in the pre-set mapping relationship, w k and |ΔY k | are approximately inversely proportional.
[0419] Furthermore, in some embodiments, determining a value corresponding to the reference sample value of the first color component based on the pre-set mapping relationship may include: determining a first factor; determining a first product value based on the first factor and the reference sample value of the first color component; and determining a value corresponding to the first product value based on the pre-set mapping relationship.
[0420] In one particular embodiment, determining the first factor may include the first factor being a predetermined constant value.
[0421] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the size parameter of the block.
[0422] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a mapping lookup table of pre-configured current block size parameters and first factor values.
[0423] Here, the current block size parameter may include at least one of the following: the current block width, the current block height, and the product of the current block width and height.
[0424] In the embodiments of this application, the value of the first factor can be fixed using a classification method. For example, the current block can be divided into three categories based on its size parameter, and the value of the first factor corresponding to each category can be determined. Exemplarily, Table 1 above shows an exemplary correspondence between the first factor and the size parameter of the current block.
[0425] In another specific embodiment, determining the first factor may include determining the value of the first factor based on the number of reference pixels in the current block.
[0426] Furthermore, in some embodiments, the method may further include determining the value of the first factor based on a mapping lookup table of a predetermined number of reference pixels in the current block and the value of the first factor.
[0427] In the embodiment of this application, the number of reference pixels can be divided into three categories, and the value of the first factor remains fixed in the classification method. Exemplarily, Table 2 above shows an exemplary correspondence between the first factor and the number of reference pixels in the current block.
[0428] Furthermore, regarding the first product value, determining the first product value based on the reference sample values of the first factor and the first color component is possible. The first product value is set to be equal to the product of the first factor and the reference sample value of the first color component, or The first product is set to a number obtained by performing a bit-right shift with respect to the reference sample value of the first color component, wherein the number of bits in the bit-right shift is equal to the first factor, or This may include setting the first product value to a number obtained by adding and bit-shifting the reference sample value of the first color component based on the first factor.
[0429] For example, assuming the first factor is equal to 0.25, and the reference sample value of the first color component is denoted by Ref, the first product is 0.25 × Ref, which can be expressed as Ref / 4, i.e., Ref >> 2. Furthermore, in the fixed-point calculation process, floating-point numbers may also be converted to addition and bit shift operations. In other words, the method for calculating the first product is not particularly limited.
[0430] Furthermore, it can be understood that in the embodiments of this application, the first reference color component may also be a chromaticity component, that is, at least one target pixel to be predicted that has a clear color difference within the current block is selected, and the chromaticity difference (represented by |ΔCk|) between its reconstructed chromaticity and the reference chromaticity in the adjacent region is calculated. Here, if |ΔCk| is relatively small, it indicates that the similarity of the chromaticity values is relatively strong, and the corresponding weighting coefficient (w k (represented by) can be given a large weight, and conversely, when |ΔCk| is relatively large, it indicates that the similarity of chromaticity values is relatively weak, and w k A small weight can be assigned to it; that is, when calculating the weighting coefficient, the reference sample value of the first color component can be |ΔCk|, and the weighting coefficient can be calculated based on that.
[0431] In short, in the embodiments of the present application, the reference sample value of the first color component may be |ΔCk|, i.e., the absolute value of the chromaticity difference, or |ΔYk|, i.e., the absolute value of the luminance difference, or |αΔYk|, i.e., the product of the absolute value of the luminance difference and a predetermined multiplier. The predetermined multiplier here is the second factor described in the embodiments of the present application.
[0432] Furthermore, with respect to the second factor, in one particular embodiment, the method may further include determining the second factor by performing a least-squares calculation based on the first color component value and the second color component value of the reference pixel.
[0433] In other words, assuming that there are N reference pixels, that the first color component value of a reference pixel is the reference luminance information of the current block, and that the second color component value of a reference pixel is the reference chromaticity information of the current block, then the second factor can be obtained by performing a least squares calculation (for example, the least squares regression calculation shown in equation (5) above) on the chromaticity and luminance component values of the N reference pixels.
[0434] Furthermore, regarding pre-defined mapping relationships, these pre-defined mapping relationships may be pre-defined functional relationships. In some embodiments, the pre-defined mapping relationship may be a Softmax function, as shown in equation (6) or equation (7) above. Here, the Softmax function is a normalized exponential function, but in the embodiments of this application, normalization may not be used, and its value is not limited to the range [0,1].
[0435] Furthermore, in addition to the Softmax function, in some other embodiments, the pre-defined mapping relationship may be a weighted function that is inversely proportional to the reference sample value of the first color component, as shown in equation (8) or (9) above.
[0436] Thus, the pre-set mapping relationship may be as shown in Formula (4), or may be as shown in Formula (6) or Formula (7), or may be as shown in Formula (8) or Formula (9). Furthermore, it may be a function model of a weighting coefficient constructed to adapt to the tendency that the closer the reference luminance value of the reference pixel is to the luminance reconstruction value of the pixel to be predicted in the current block, the higher the importance of the reference chrominance value of the reference pixel for the pixel to be predicted in the current block. Also, the pre-set mapping relationship may be in the form of a pre-set look-up table. For example, by adopting the array element look-up table method, some calculation operations can be reduced, but the embodiments of the present application are not limited thereto.
[0437] In this way, based on the reference sample value of the first color component (e.g., |ΔY kij |), the weighting coefficient can be determined. Specifically, it may include N weighting coefficients such as w1, w2,..., w N . Here, N represents the quantity of the reference sample values of the second color component. Here, theoretically, the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value between 0 and 1.
[0438] In step S1804, based on the weighting coefficient and the reference sample value of the second color component in the target information, the prediction block of the second color component of the current block is determined.
[0439] In step S1805, based on the prediction block, the prediction difference value of the sample points of the second color component of the current block is determined.
[0440] Note that after determining the weighting coefficient, by using the weighting coefficient to perform weighted calculation on the reference sample value of the second color component, the predicted value of the sample points of the second color component in the prediction block can be obtained.
[0441] In some embodiments, determining the prediction block of the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component in the target information is Determining a reference sample value of a second color component and a weighted value of a corresponding weighting coefficient, and setting a predicted value of a second color component sample point in a prediction block to a sum of N weighted values, where N represents the number of reference sample values of the second color component and N is a positive integer.
[0442] That is, when the number of reference sample values of the second color component is N, first, a reference sample value of each second color component and a weighted value of a corresponding weighting coefficient (i.e., w k C k ) are determined, and then the sum of these N weighted values is set as the predicted value of the second color component sample point in the prediction block. Specifically, the calculation formula is as shown in the above formula (16). Such a calculation method is suitable for parallel processing and can improve the calculation speed.
[0443] Furthermore, it should be further explained that in the embodiments of the present application, the first color component is a luminance component and the second color component is a chrominance component. Since the resolution of the luminance component may be different from the resolution of the chrominance component, performing filtering processing on the reference information includes performing downsampling filtering on the luminance component to match the resolution of the chrominance component, or performing upsampling filtering on the chrominance component to match the resolution of the luminance component.
[0444] Furthermore, the predicted value of the second color component sample point in the prediction block usually needs to be limited within a preset range. Therefore, in some embodiments, the method may further include performing a correction operation on the predicted value of the second color component sample point in the prediction block to determine a prediction block of the second color component of the current block.
[0445] Note that in the embodiments of the present application, the preset range may be a range of 0 to (1 << BitDepth)-1. When the predicted value exceeds the value of the preset range, a corresponding correction operation needs to be performed on the predicted value. Exemplarily,
Equation
[0446] Furthermore, after determining the prediction block, under specific conditions, the prediction block needs further post - processing to be used as the final prediction block. Thus, in some embodiments, the method may further include performing related processing on the prediction block and setting the processed prediction block as the prediction block of the second color component of the current block.
[0447] In one possible embodiment, performing related processing on the prediction block may include performing filtering enhancement processing on the prediction block and setting the processed prediction block as the prediction block of the second color component of the current block.
[0448] In another possible embodiment, performing related processing on the prediction block may include determining a compensation value for the second color component of the prediction block based on the reference sample values in the adjacent region of the current block, and performing correction processing on the predicted values of the second color component sample points within the prediction block based on the compensation value, and determining the prediction block of the second color component of the current block.
[0449] In another possible embodiment, performing related processing on the prediction block may include performing prediction processing on the second color component sample points within the prediction block according to at least one prediction mode, determining at least one initial predicted value of the second color component sample points within the prediction block, and performing weighted fusion processing based on the at least one initial predicted value and the predicted values of the second color component sample points within the prediction block, and determining the prediction block of the second color component of the current block.
[0450] In other words, to reduce the instability caused by performing independent and parallel predictions for each pixel in WCP regarding the related processing of prediction blocks, smoothing filtering can be applied to the prediction blocks to obtain the final chromaticity prediction value. Alternatively, to further improve the accuracy of the WCP prediction value, a position-related correction process can be performed on the prediction block. For example, a chromaticity compensation value can be calculated for each pixel to be predicted using a reference pixel with a nearby spatial position, and this chromaticity compensation value can be used to correct the prediction block, with the corrected prediction value becoming the final chromaticity prediction value. Alternatively, to further improve the accuracy of the WCP prediction value, the chromaticity prediction value calculated in WCP and the chromaticity prediction value calculated in other chromaticity prediction modes can be weighted and merged, and the merging result can become the final chromaticity prediction value. Alternatively, to improve the prediction performance of WCP, the chromaticity prediction value calculated in WCP may be corrected using a neural network model, and the embodiments of this application are not limited to this.
[0451] In some embodiments, after determining the prediction block, the following steps may be further included after step S1804, as shown in Figure 19.
[0452] In step S1901, the predicted value of the second color component sample point of the current block is determined based on the predicted block.
[0453] In step S1902, the predicted difference value of the second color component sample point of the current block is determined based on the original value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block.
[0454] In step S1903, the predicted difference value of the second color component sample point of the current block is encoded, and the resulting encoded bits are written to the bitstream.
[0455] In the embodiments of this application, the prediction block may include predicted values for at least some of the second color component sample points within the current block. If the prediction block includes predicted values for all of the second color component sample points within the current block, the predicted values for the second color component sample points within the current block can be set to be equal to the values in the prediction block. If the prediction block includes predicted values for some of the second color component sample points within the current block, upsampling filtering can be performed on the values in the prediction block, and the predicted values for the second color component sample points within the current block can be set to be equal to the output values after the upsampling filtering.
[0456] Furthermore, after determining the predicted value of the second color component sample point in the current block, the predicted difference value of the second color component sample point can be determined based on the original value of the second color component sample point and the predicted value of the second color component sample point. Specifically, the predicted difference value of the second color component sample point in the current block can be determined by subtracting the original value of the second color component sample point from the predicted value of the second color component sample point. In this way, after writing the predicted difference value of the second color component sample point to the bitstream, the predicted difference value of the second color component sample point can be obtained by decoding on the subsequent decoding side, thereby restoring the reconstructed value of the second color component sample point in the current block.
[0457] As can be seen from the above, taking the example of performing chromaticity prediction on the current block, in the embodiment of the present application, the reconstructed luminance information of the current block, the reference luminance information of the adjacent region, and the reference chromaticity information are all encoded reference information. Therefore, the embodiment of the present application proposes a weight-based chromaticity prediction technique that utilizes the above information, and in the process of determining the target information of the current block based on this information, the information of the adjacent region of the current block, the information of the current block, and the current color format information can be analyzed and processed, mainly including the following two aspects. The first is to select whether or not to downsample the reference luminance information of the adjacent region or whether or not to upsample the reference chromaticity information of the adjacent region based on the current color format information. The second is that the reference luminance information and reference chromaticity information of the adjacent region, and the reconstructed luminance information within the current block can be matched to a preset size of the core parameter by different size scaling operations, thereby improving the accuracy of the WCP prediction technique.
[0458] The embodiment of the present application further provides an encoding method in which reference information of the current block is determined, a filtering process is performed on a portion of the reference information of the current block, target information of the current block is determined, a weighting coefficient is determined based on the reference sample value of the first color component in the target information, the predicted block of the second color component of the current block is determined based on the weighting coefficient and the reference sample value of the second color component in the target information, and the predicted difference value of the sample point of the second color component of the current block is determined based on the predicted block. In this way, the characteristics of the color format information are sufficiently considered for the color component information in the adjacent region of the current block and the color component information within the current block, so that the accuracy of this reference information can be improved. Furthermore, by performing filtering processes such as upsampling and downsampling on this reference information, the continuity of spatial correlation can be strengthened to some extent, or some information with relatively weak spatial correlation can be removed. By using the target information obtained after filtering, chromaticity prediction can be performed more appropriately, thereby improving the accuracy of chromaticity prediction and improving encoding and decoding performance while saving bitrate.
[0459] In yet another embodiment of the present application, the embodiment further provides a bitstream, which is generated by bit encoding based on information to be encoded, wherein the information to be encoded includes at least the predicted difference values of the second color component sample points of the current block.
[0460] In the embodiment of this application, after the predicted difference value of the second color component sample point of the current block is transmitted from the encoding side to the decoding side, the decoding side can obtain the predicted difference value of the second color component sample point by decoding, and combine it with the predicted value of the second color component sample point of the current block to reconstruct the reconstructed value of the second color component sample point of the current block. In this way, by fully considering the characteristics of the input color format information, the accuracy of the reference information of adjacent regions can be improved, and by making full use of spatial correlation, filtering processes such as upsampling, downsampling, size expansion, and size reduction are performed on the reference information of adjacent regions and the reconstructed luminance information of the current block, not only is the accuracy of chromaticity prediction improved and bitrate saved, but encoding and decoding performance is also improved.
[0461] In yet another embodiment of the present application, based on the same inventive concept as the embodiments described above, with reference to Figure 20, an exemplary structural diagram of the configuration of the encoding device 300 according to the embodiment of the present application is shown. As shown in Figure 20, the encoding device 300 comprises a first decision unit 3001, a first filtering unit 3002, and a first prediction unit 3003, where, The first decision unit 3001 is configured to determine the reference information of the current block. The first filtering unit 3002 is configured to perform filtering on at least some of the reference information of the current block and to determine the target information of the current block. The first decision unit 3001 is further configured to determine a weighting coefficient based on the reference sample value of the first color component in the target information. The first prediction unit 3003 is configured to determine the predicted block of the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component in the target information. The first decision unit 3001 is further configured to determine the predicted difference value of the second color component sample point of the current block based on the prediction block.
[0462] In some embodiments, the prediction block includes predicted values for at least some of the second color component sample points within the current block.
[0463] In some embodiments, the first determination unit 3001 is further configured to determine reference information for the current block based on the values of the first color component sample points in the adjacent region of the current block, the values of the second color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block.
[0464] In some embodiments, the adjacent region of the current block includes at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0465] In some embodiments, the first filtering unit 3002 is further configured to perform a first filtering process on the values of the first color component sample points in the adjacent region of the current block to obtain filtered sample values of the first color component in the adjacent region of the current block, and to determine the target information of the current block based on the filtered sample values of the first color component in the adjacent region of the current block.
[0466] In some embodiments, the number of filtered sample values of the first color component in the adjacent region of the current block is equal to L, where L represents the number of values of the second color component sample points in the adjacent region of the current block, and L is a positive integer.
[0467] In some embodiments, the first filtering process is a downsampling filtering process.
[0468] In some embodiments, the first filtering unit 3002 is further configured to perform a first filtering process on the values of the first color component sample points in the adjacent region of the current block, based on color format information, to obtain filtered sample values of the first color component in the adjacent region of the current block.
[0469] In some embodiments, the first filtering unit 3002 is further configured to perform downsampling filtering on the values of the first color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the downsampling rate is the reciprocal of a positive integer multiple of 2.
[0470] In some embodiments, the first filtering unit 3002 is configured to further compare L with a preset number, and based on the comparison result between L and the preset number, perform a second filtering process on the filtered sample value of the first color component in the adjacent region of the current block and the value of the second color component sample point in the adjacent region of the current block, to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block, and to determine the target information of the current block based on the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0471] In some embodiments, the first filtering unit 3002 is further configured to perform a first subfiltering process on the filtered sample values of the first color component in the adjacent region of the current block and the values of the sample points of the second color component in the adjacent region of the current block if L is greater than a preset number, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block; and to perform a second subfiltering process on the filtered sample values of the first color component in the adjacent region of the current block and the values of the sample points of the second color component in the adjacent region of the current block if L is less than a preset number, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block.
[0472] In some embodiments, the first filtering unit 3002 is further configured to perform a third filtering process on the values of the second color component sample points in the adjacent region of the current block to obtain filtered sample values of the second color component in the adjacent region of the current block, and to determine the target information of the current block based on the filtered sample values of the second color component in the adjacent region of the current block.
[0473] In some embodiments, the number of filtered sample values of the second color component in the adjacent region of the current block is equal to K, where K represents the number of values of the first color component sample points in the adjacent region of the current block, and K is a positive integer.
[0474] In some embodiments, the third filtering process is an upsampling filtering process.
[0475] In some embodiments, the first filtering unit 3002 is further configured to perform a third filtering process on the values of the second color component sample points in the adjacent region of the current block, based on color format information, to obtain filtered sample values of the second color component in the adjacent region of the current block.
[0476] In some embodiments, the first filtering unit 3002 is further configured to perform upsampling filtering on the values of the second color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the upsampling rate is a positive integer multiple of 2.
[0477] In some embodiments, the first filtering unit 3002 is configured to further compare K with a preset number, and based on the comparison result between K and the preset number, perform a fourth filtering process on the values of the first color component sample points in the adjacent region of the current block and the filtered sample values of the second color component in the adjacent region of the current block, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block, and to determine the target information of the current block based on the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block.
[0478] In some embodiments, the first filtering unit 3002 is further configured to perform a first subfiltering process on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block if K is greater than a preset number, to determine the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block; and to perform a second subfiltering process on the value of the first color component sample point in the adjacent region of the current block and the filtered sample value of the second color component in the adjacent region of the current block if K is less than a preset number, to determine the filtered adjacent sample value of the first color component and the filtered adjacent sample value of the second color component of the current block.
[0479] In some embodiments, the first filtering unit 3002 is configured to further determine the number of values of the first color component sample points in the adjacent region of the current block as a first quantity, perform a fifth filtering process on the values of the first color component sample points in the adjacent region of the current block based on a comparison between the first quantity and a preset number, determine the filtered adjacent sample values of the first color component of the current block, and determine the target information of the current block based on the filtered adjacent sample values of the first color component of the current block.
[0480] In some embodiments, the first filtering unit 3002 is further configured to perform a first subfiltering process on the values of the first color component sample points in the adjacent region of the current block if the first quantity is greater than a preset number, in order to determine the filtered adjacent sample values of the first color component of the current block, and to perform a second subfiltering process on the values of the first color component sample points in the adjacent region of the current block if the first quantity is less than a preset number, in order to determine the filtered adjacent sample values of the first color component of the current block.
[0481] In some embodiments, the first filtering unit 3002 is configured to further determine the number of values of second color component sample points in the adjacent region of the current block as a second quantity, perform a sixth filtering process on the values of second color component sample points in the adjacent region of the current block based on a comparison between the second quantity and a preset number, determine the filtered adjacent sample values of the second color component of the current block, and determine the target information of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0482] In some embodiments, the first filtering unit 3002 is further configured to perform a first subfiltering process on the values of the second color component sample points in the adjacent region of the current block if the second quantity is greater than a preset number, in order to determine the filtered adjacent sample values of the second color component of the current block, and to perform a second subfiltering process on the values of the second color component sample points in the adjacent region of the current block if the second quantity is less than a preset number, in order to determine the filtered adjacent sample values of the second color component of the current block.
[0483] In some embodiments, the first filtering unit 3002 is further configured to set the reference sample value of the second color component in the target information to the filtered adjacent sample value of the second color component in the current block.
[0484] In some embodiments, the first subfiltering process is a downsampling filtering process.
[0485] In some embodiments, the first filtering unit 3002 further... Subfiltering processing is performed using a fixed-interval position selection method, and The system is configured to perform a first subfiltering process that includes at least one of the following: employing a continuous position selection method to perform subfiltering.
[0486] In some embodiments, the second subfiltering process is an upsampling filtering process.
[0487] In some embodiments, the first filtering unit 3002 is further configured to perform a second subfiltering process, which includes performing subfiltering by employing a fixed-interval position interpolation method.
[0488] In some embodiments, the first filtering unit 3002 is further configured to perform a seventh filtering process on the reconstructed values of the first reference color component sample points in the current block to determine the filtered sample values of the first reference color component sample points in the current block, and to determine the target information of the current block based on the filtered sample values of the first reference color component sample points in the current block.
[0489] In some embodiments, the first filtering unit 3002 is further configured to determine a first width and a first height based on the reconstructed value of the first reference color component sample point in the current block, and if the first width is greater than the width of the predicted block or the first height is greater than the height of the predicted block, to perform a third subfiltering process on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block, and if the first width is less than the width of the predicted block or the first height is less than the height of the predicted block, to perform a fourth subfiltering process on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block.
[0490] In some embodiments, the third subfiltering process is a downsampling filtering process.
[0491] In some embodiments, the first filtering unit 3002 further... Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering. Currently, downsampling filtering is performed vertically on the reconstructed value of the first reference color component sample point within the block. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering, followed by vertical downsampling filtering, and The system is configured to perform a third subfiltering process that includes at least one of the following: performing vertical downsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal downsampling filtering.
[0492] In some embodiments, the fourth subfiltering process is an upsampling filtering process.
[0493] In some embodiments, the first filtering unit 3002 further... Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to vertical upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering, followed by vertical upsampling filtering, and The system is configured to perform a fourth subfiltering process that includes at least one of the following: performing vertical upsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal upsampling filtering.
[0494] In some embodiments, the first filtering unit 3002 is further configured to set the reference sample value of the first color component in the target information to the absolute difference between the value of the first color component sample point in an adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block.
[0495] In some embodiments, the first filtering unit 3002 is further configured to set the reference sample value of the first color component in the target information to the absolute difference between the filtered adjacent sample value of the first color component in the current block and the filtered sample value of the first reference color component sample point in the current block.
[0496] In some embodiments, the first determination unit 3001 is further configured to determine a value corresponding to a reference sample value of the first color component based on a pre-configured mapping relationship, and to set the weighting coefficient to equal that value.
[0497] In some embodiments, the first determination unit 3001 is further configured to determine a first factor, determine a first product value based on the first factor and reference sample values of the first color component, and determine the corresponding value of the first product value based on a pre-defined mapping relationship.
[0498] In some embodiments, the first factor is a predetermined constant value.
[0499] In some embodiments, the first decision unit 3001 is further configured to determine the value of the first factor based on the size parameter of the current block, where the size parameter of the current block includes at least one of the parameters of the width of the current block and the height of the current block.
[0500] In some embodiments, the pre-configured mapping relationship is the Softmax function.
[0501] In some embodiments, the pre-defined mapping relationship is a weighting function that is inversely proportional to the reference sample value of the first color component.
[0502] In some embodiments, the first prediction unit 3003 is further configured to determine the reference sample values of the second color component and the corresponding weighting coefficients, and to set the predicted values of the second color component sample points in the prediction block to the sum of N weighting values, where N represents the number of reference sample values of the second color component and N is a positive integer.
[0503] In some embodiments, the first prediction unit 3003 is further configured to perform a modification operation on the predicted values of the second color component sample points in the prediction block to determine the prediction block for the second color component of the current block.
[0504] In some embodiments, the first prediction unit 3003 is further configured to perform filtering enhancement on the prediction block, so that the processed prediction block becomes the prediction block for the second color component of the current block.
[0505] In some embodiments, the first prediction unit 3003 is further configured to determine a compensation value for the second color component of the prediction block based on a reference sample value in an adjacent region of the current block, and to perform a correction process on the predicted value of the second color component sample point in the prediction block based on the compensation value to determine the prediction block for the second color component of the current block.
[0506] In some embodiments, the first prediction unit 3003 is further configured to perform a prediction process on second color component sample points in a prediction block according to at least one prediction mode, determine at least one initial predicted value for the second color component sample points in the prediction block, perform a weighted fusion process on the at least one initial predicted value and the predicted value for the second color component sample points in the prediction block, and determine the prediction block for the second color component of the current block.
[0507] In some embodiments, the first decision unit 3001 is further configured to determine the predicted value of the second color component sample point of the current block based on the prediction block, and to determine the predicted difference value of the second color component sample point of the current block based on the original value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block.
[0508] In some embodiments, referring to Figure 20, the encoding device 300 may further include an encoding unit 3004, which is configured to encode the predicted difference value of the second color component sample point of the current block and write the resulting encoded bits to a bitstream.
[0509] In the embodiments of this application, the "unit" may be part of a circuit, part of a processor, part of a program or software, and of course, the "unit" may be a module or a non-modular structure. Furthermore, each component in this embodiment may be integrated into a single processing unit, or each unit may be a separate, independent physical unit, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional module.
[0510] If the integrated unit is implemented in the form of a software function module rather than being sold or used as an independent product, it can be stored on a single computer-readable storage medium. Based on this understanding, an essential part of the technical solution of this embodiment, i.e., a part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a computer software product, which is stored on a single storage medium and contains several instructions for causing a single computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage mediums include a variety of media capable of storing program code, such as U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0511] Accordingly, the embodiments of the present application provide a computer-readable storage medium applicable to an encoding device 300, the computer-readable storage medium storing a computer program, the computer program causing the first processor to execute the method in any of the above embodiments.
[0512] Referring to Figure 21, based on the configuration of the encoding device 300 and the computer-readable storage medium described above, a schematic diagram of the specific hardware structure of the encoding device 310 according to an embodiment of the present application is shown. As shown in Figure 21, the encoding device 310 may comprise a first communication interface 3101, a first memory 3102, and a first processor 3103, each component being coupled to one another by a first bus system 3104. Understandably, the first bus system 3104 is used to realize connection communication between these components. In addition to the data bus, the first bus system 3104 further includes a power bus, a control bus, and a status signal bus. However, for clarity of explanation, in Figure 21, the various buses are labeled as the first bus system 3104.
[0513] The first communication interface 3101 is configured to send and receive signals in the process of sending and receiving information with other external network elements. The first memory 3102 is configured to store a computer program that can be executed on the first processor 3103. The first processor 3103 is configured to perform the following steps by executing the computer program, and these steps are: Currently, the block's reference information is determined, Currently, a filtering process is performed on some of the reference information of the current block to determine the target information of the current block. The weighting coefficient is determined based on the reference sample value of the first color component in the target information, Based on the weighting coefficient and the reference sample value of the second color component in the target information, the predicted block for the second color component of the current block is determined, This includes determining the predicted difference value of the second color component sample point of the current block based on the predicted block.
[0514] It should be understood that the first memory 3102 in the embodiment of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Here, non-volatile memory may 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. Volatile memory may be random access memory (RAM) used as an external cache. To the extent that this is not an exhaustive description, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linkage dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The first memory 3102 in the systems and methods described herein includes, but is not limited to, these and any other suitable types of memory.
[0515] Furthermore, the processor 3103 may be an integrated circuit chip equipped with signal processing functions. In implementation, each step of the above method can be performed by a hardware-type integrated logic circuit or a software-type instruction in the first processor 3103. The first processor 3103 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, or transistor logic devices, discrete hardware components, etc., and can implement or execute each method, step and logic block diagram disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of this application may be performed directly by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software module can be placed in a conventional storage medium such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. The storage medium is placed in the first memory 3102, and the first processor 3103 reads the information in the first memory 3102 and combines it with its hardware to complete the steps of the method.
[0516] To ensure understanding, these embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. Regarding hardware implementations, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processing (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof. Regarding software implementations, the technology described herein can be implemented by modules (processes, functions, etc.) that perform the functions described herein. The software code may be stored in memory and executed by a processor. The memory may be implemented within or outside the processor.
[0517] Exemplary, in another embodiment, the first processor 3103 is further configured to perform the method described in any one of the above embodiments by executing the computer program.
[0518] This embodiment provides an encoding device, which may further include the encoding apparatus 300 described in the above embodiment. In the case of an encoding device, by fully considering the characteristics of the input color format information, the accuracy of the reference information of adjacent regions can be improved. Furthermore, by fully utilizing spatial correlation and performing filtering processes such as upsampling, downsampling, size expansion, and size reduction on the reference information of adjacent regions and the reconstructed luminance information of the current block, the accuracy of chromaticity prediction is improved, not only saving bitrate but also improving encoding and decoding performance.
[0519] Based on the same inventive concept as the above embodiment, Figure 22 shows an exemplary structural diagram of the configuration of the decoding device 320 according to the embodiment of the present application. As shown in Figure 22, the decoding device 320 may include a second determination unit 3201, a second filtering unit 3202, and a second prediction unit 3203, where, The second decision unit 3201 is configured to determine the reference information of the current block. The second filtering unit 3202 is configured to perform filtering on at least some of the reference information of the current block and to determine the target information of the current block. The second decision unit 3201 is further configured to determine a weighting coefficient based on the reference sample value of the first color component in the target information. The second prediction unit 3203 is configured to determine the predicted block of the second color component of the current block based on a weighting coefficient and a reference sample value of the second color component in the target information. The second decision unit 3201 is further configured to determine the reconstructed values of the second color component sample points of the current block based on the predicted block.
[0520] In some embodiments, the prediction block includes predicted values for at least some of the second color component sample points within the current block.
[0521] In some embodiments, the second determination unit 3201 is further configured to determine the reference information of the current block based on the values of the first color component sample points in the adjacent region of the current block, the values of the second color component sample points in the adjacent region of the current block, and the reconstructed values of the first reference color component sample points within the current block.
[0522] In some embodiments, the adjacent region of the current block may include at least one of the upper adjacent region, the upper right adjacent region, the left adjacent region, and the lower left adjacent region.
[0523] In some embodiments, the second filtering unit 3202 is further configured to perform a first filtering process on the values of the first color component sample points in the adjacent region of the current block to obtain filtered sample values of the first color component in the adjacent region of the current block, and to determine the target information of the current block based on the filtered sample values of the first color component in the adjacent region of the current block.
[0524] In some embodiments, the number of filtered sample values of the first color component in the adjacent region of the current block is equal to L, where L represents the number of values of the second color component sample points in the adjacent region of the current block, and L is a positive integer.
[0525] In some embodiments, the first filtering process is a downsampling filtering process.
[0526] In some embodiments, the second filtering unit 3202 is further configured to perform a first filtering process on the values of the first color component sample points in the adjacent region of the current block, based on color format information, to obtain filtered sample values of the first color component in the adjacent region of the current block.
[0527] In some embodiments, the second filtering unit 3202 is further configured to perform downsampling filtering on the values of the first color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the downsampling rate is the reciprocal of a positive integer multiple of 2.
[0528] In some embodiments, the second filtering unit 3202 is configured to further compare L with a preset number, and based on the comparison result of L with the preset number, perform a second filtering process on the filtered sample value of the first color component in the adjacent region of the current block and the value of the second color component sample point in the adjacent region of the current block, to determine the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block, and to determine the target information of the current block based on the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block.
[0529] In some embodiments, the second filtering unit 3202 is further configured to perform a first subfiltering process on the filtered sample values of the first color component in the adjacent region of the current block and the values of the sample points of the second color component in the adjacent region of the current block if L is greater than a preset number, thereby determining the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block; and to perform a second subfiltering process on the filtered sample values of the first color component in the adjacent region of the current block and the values of the sample points of the second color component in the adjacent region of the current block if L is less than a preset number, thereby determining the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block.
[0530] In some embodiments, the second filtering unit 3202 is configured to further perform a third filtering process on the values of the second color component sample points in the adjacent region of the current block to obtain filtered sample values of the second color component in the adjacent region of the current block, and to determine the target information of the current block based on the filtered sample values of the second color component in the adjacent region of the current block.
[0531] In some embodiments, the number of filtered sample values of the second color component in the adjacent region of the current block is equal to K, where K represents the number of values of the first color component sample points in the adjacent region of the current block, and K is a positive integer.
[0532] In some embodiments, the third filtering process is an upsampling filtering process.
[0533] In some embodiments, the second filtering unit 3202 is further configured to perform a third filtering process on the values of the second color component sample points in the adjacent region of the current block, based on color format information, to obtain filtered sample values of the second color component in the adjacent region of the current block.
[0534] In some embodiments, the second filtering unit 3202 is further configured to perform upsampling filtering on the values of the second color component sample points in adjacent regions of the current block when the color format information indicates 4:2:0 sampling, where the upsampling rate is a positive integer multiple of 2.
[0535] In some embodiments, the second filtering unit 3202 is configured to further compare K with a preset number, and based on the comparison result between K and the preset number, perform a fourth filtering process on the values of the first color component sample points in the adjacent region of the current block and the filtered sample values of the second color component in the adjacent region of the current block, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block, and to determine the target information of the current block based on the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block.
[0536] In some embodiments, the second filtering unit 3202 is further configured to perform a first subfiltering process on the values of the first color component sample points in the adjacent region of the current block and the filtered sample values of the second color component in the adjacent region of the current block if K is greater than a preset number, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block; and to perform a second subfiltering process on the values of the first color component sample points in the adjacent region of the current block and the filtered sample values of the second color component in the adjacent region of the current block if K is less than a preset number, to determine the filtered adjacent sample values of the first color component and the filtered adjacent sample values of the second color component of the current block.
[0537] In some embodiments, the second filtering unit 3202 is configured to further determine the number of values of the first color component sample points in the adjacent region of the current block as a first quantity, perform a fifth filtering process on the values of the first color component sample points in the adjacent region of the current block based on a comparison between the first quantity and a preset number, determine the filtered adjacent sample values of the first color component of the current block, and determine the target information of the current block based on the filtered adjacent sample values of the first color component of the current block.
[0538] In some embodiments, the second filtering unit 3202 is further configured to perform a first subfiltering process on the values of the first color component sample points in the adjacent region of the current block if the first quantity is greater than a preset number, in order to determine the filtered adjacent sample values of the first color component of the current block, and to perform a second subfiltering process on the values of the first color component sample points in the adjacent region of the current block if the first quantity is less than a preset number, in order to determine the filtered adjacent sample values of the first color component of the current block.
[0539] In some embodiments, the second filtering unit 3202 is configured to further determine the number of values of second color component sample points in the adjacent region of the current block as a second quantity, perform a sixth filtering process on the values of second color component sample points in the adjacent region of the current block based on the comparison result of the second quantity with a preset number, determine the filtered adjacent sample values of the second color component of the current block, and determine the target information of the current block based on the filtered adjacent sample values of the second color component of the current block.
[0540] In some embodiments, the second filtering unit 3202 is further configured to perform a first subfiltering process on the values of the second color component sample points in the adjacent region of the current block if the second quantity is greater than a preset number, in order to determine the filtered adjacent sample values of the second color component of the current block, and to perform a second subfiltering process on the values of the second color component sample points in the adjacent region of the current block if the second quantity is less than a preset number, in order to determine the filtered adjacent sample values of the second color component of the current block.
[0541] In some embodiments, the second filtering unit 3202 is further configured to set the reference sample value of the second color component in the target information to the filtered adjacent sample value of the second color component in the current block.
[0542] In some embodiments, the first subfiltering process is a downsampling filtering process.
[0543] In some embodiments, the first filtering unit 3002 further... Subfiltering processing is performed using a fixed-interval position selection method, and The system is configured to perform a first subfiltering process that includes at least one of the following: employing a continuous position selection method to perform subfiltering.
[0544] In some embodiments, the second subfiltering process is an upsampling filtering process.
[0545] In some embodiments, the first filtering unit 3002 is further configured to perform a second subfiltering process, which includes performing subfiltering by employing a fixed-interval position interpolation method.
[0546] In some embodiments, the second filtering unit 3202 is further configured to perform a seventh filtering process on the reconstructed values of the first reference color component sample points in the current block to determine the filtered sample values of the first reference color component sample points in the current block, and to determine the target information of the current block based on the filtered sample values of the first reference color component sample points in the current block.
[0547] In some embodiments, the second filtering unit 3202 is further configured to determine a first width and a first height based on the reconstructed value of the first reference color component sample point in the current block, and if the first width is greater than the width of the predicted block or the first height is greater than the height of the predicted block, to perform a third subfiltering process on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block, and if the first width is less than the width of the predicted block or the first height is less than the height of the predicted block, to perform a fourth subfiltering process on the reconstructed value of the first reference color component sample point in the current block to determine the filtered sample value of the first reference color component sample point in the current block.
[0548] In some embodiments, the third subfiltering process is a downsampling filtering process.
[0549] In some embodiments, the first filtering unit 3002 further... Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering. Currently, downsampling filtering is performed vertically on the reconstructed value of the first reference color component sample point within the block. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal downsampling filtering, followed by vertical downsampling filtering, and The system is configured to perform a third subfiltering process that includes at least one of the following: performing vertical downsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal downsampling filtering.
[0550] In some embodiments, the fourth subfiltering process is an upsampling filtering process.
[0551] In some embodiments, the second filtering unit 3202 further... Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to vertical upsampling filtering. Currently, the reconstruction value of the first reference color component sample point within the block is subjected to horizontal upsampling filtering, followed by vertical upsampling filtering, and The system is configured to perform a fourth subfiltering process that includes at least one of the following: performing vertical upsampling filtering on the reconstructed value of the first reference color component sample point within the current block, followed by horizontal upsampling filtering.
[0552] In some embodiments, the second filtering unit 3202 is further configured to set the reference sample value of the first color component in the target information to the absolute difference between the value of the first color component sample point in an adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block.
[0553] In some embodiments, the second filtering unit 3202 is further configured to set the reference sample value of the first color component in the target information to the absolute difference between the filtered adjacent sample value of the first color component in the current block and the filtered sample value of the first reference color component sample point in the current block.
[0554] In some embodiments, the second determination unit 3201 is further configured to determine a value corresponding to the reference sample value of the first color component based on a pre-configured mapping relationship, and to set the weighting coefficient to equal that value.
[0555] In some embodiments, the second determination unit 3201 is further configured to determine the first factor, determine the first product value based on the first factor and the reference sample values of the first color component, and determine the corresponding value of the first product value based on a pre-configured mapping relationship.
[0556] In some embodiments, the first factor is a predetermined constant value.
[0557] In some embodiments, the second decision unit 3201 is further configured to determine the value of the first factor based on the size parameter of the current block, where the size parameter of the current block includes at least one of the parameters of the width of the current block and the height of the current block.
[0558] In some embodiments, the pre-configured mapping relationship is the Softmax function.
[0559] In some embodiments, the pre-defined mapping relationship is a weighting function that is inversely proportional to the reference sample value of the first color component.
[0560] In some embodim...
Claims
1. A decryption method, Currently, the block's reference information is determined, The process involves filtering at least a portion of the reference information of the current block to determine the target information of the current block, The weighting coefficient is determined based on the reference sample value of the first color component in the target information, Based on the weighting coefficient and the reference sample value of the second color component in the target information, the predicted block of the second color component of the current block is determined. A decoding method comprising determining the reconstructed value of the second color component sample point of the current block based on the predicted block.
2. Determining the reference information of the current block is: The process includes determining the reference information of the current block based on the value of the first color component sample point in the adjacent region of the current block, the value of the second color component sample point in the adjacent region of the current block, and the reconstructed value of the first reference color component sample point within the current block. The decoding method according to claim 1.
3. Filtering at least some of the reference information of the current block to determine the target information of the current block is: A first filtering process is performed on the value of the first color component sample point in the adjacent region of the current block to obtain the filtered sample value of the first color component in the adjacent region of the current block. This includes determining the target information of the current block based on the filtered sample values of the first color component in the adjacent region of the current block, The decoding method according to claim 2.
4. The quantity of filtered sample values of the first color component in the adjacent region of the current block is equal to L, where L represents the quantity of values of the second color component sample points in the adjacent region of the current block, and L is a positive integer. The decoding method according to claim 3.
5. The aforementioned decryption method is The method further includes performing a first filtering process on the values of the first color component sample points in the adjacent region of the current block based on color format information, thereby obtaining filtered sample values of the first color component in the adjacent region of the current block. The decoding method according to claim 3.
6. The aforementioned decryption method is Comparing L to a predetermined number, Based on the comparison result between L and a pre-set number, a second filtering process is performed on the filtered sample value of the first color component in the adjacent region of the current block and the value of the sample point of the second color component in the adjacent region of the current block, thereby determining the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the second color component of the current block. The further includes determining the target information of the current block based on the filtered adjacent sample values of the first color component of the current block and the filtered adjacent sample values of the second color component of the current block. The decoding method according to claim 4.
7. Filtering at least some of the reference information of the current block to determine the target information of the current block is: A third filtering process is performed on the values of the second color component sample points in the adjacent region of the current block to obtain filtered sample values of the second color component in the adjacent region of the current block. This includes determining the target information of the current block based on filtered sample values of the second color component in the adjacent region of the current block, The decoding method according to claim 2.
8. Filtering at least some of the reference information of the current block to determine the target information of the current block is: A seventh filtering process is performed on the reconstructed value of the first reference color component sample point in the current block, and the filtered sample value of the first reference color component sample point in the current block is determined. This includes determining the target information of the current block based on the filtered sample values of the first reference color component sample points within the current block, The decoding method according to claim 2 or 6.
9. The aforementioned decryption method is The further includes setting the reference sample value of the first color component in the target information to the absolute value of the difference between the value of the first color component sample point in the adjacent region of the current block and the reconstructed value of the first reference color component sample point in the current block. The decoding method according to claim 8.
10. Determining the predicted block for the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component in the target information is: Determine the reference sample value of the second color component and the corresponding weighted value of the weighting coefficient, The method includes setting the predicted value of the second color component sample point within the prediction block to the sum of N weighted values, where N represents the number of reference sample values for the second color component, and N is a positive integer. The decoding method according to claim 1.
11. Based on the predicted block, determining the reconstruction value of the second color component sample point of the current block is: The predicted difference value of the second color component sample point of the current block is determined, Based on the aforementioned prediction block, the predicted value of the second color component sample point of the current block is determined, This includes determining the reconstructed value of the second color component sample point of the current block based on the predicted difference value of the second color component sample point of the current block and the predicted value of the second color component sample point of the current block. The decoding method according to claim 1.
12. An encoding method, Currently, the block's reference information is determined, The process involves filtering at least a portion of the reference information of the current block to determine the target information of the current block, The weighting coefficient is determined based on the reference sample value of the first color component in the target information, Based on the weighting coefficient and the reference sample value of the second color component in the target information, the predicted block of the second color component of the current block is determined. An encoding method comprising determining the predicted difference value of the second color component sample point of the current block based on the predicted block.
13. A method for transmitting a bitstream, The video encoder generates a bitstream by performing the following steps, which include determining reference information for the current block, filtering at least a portion of the reference information for the current block, determining target information for the current block, determining a weighting coefficient based on the reference sample value of the first color component in the target information, determining a predicted block for the second color component of the current block based on the weighting coefficient and the reference sample value of the second color component in the target information, determining a predicted difference value for the sample point of the second color component of the current block based on the predicted block, encoding the predicted difference value, and writing the resulting encoded bits to the bitstream. The video encoder stores and transmits the bitstream, A method for transmitting a bitstream, comprising: a video decoder receiving and decoding the bitstream.