WO2023197192A1 - 编解码方法、装置、编码设备、解码设备以及存储介质 - Google Patents

编解码方法、装置、编码设备、解码设备以及存储介质 Download PDF

Info

Publication number
WO2023197192A1
WO2023197192A1 PCT/CN2022/086469 CN2022086469W WO2023197192A1 WO 2023197192 A1 WO2023197192 A1 WO 2023197192A1 CN 2022086469 W CN2022086469 W CN 2022086469W WO 2023197192 A1 WO2023197192 A1 WO 2023197192A1
Authority
WO
WIPO (PCT)
Prior art keywords
current block
color component
value
sampling point
filtered
Prior art date
Application number
PCT/CN2022/086469
Other languages
English (en)
French (fr)
Inventor
霍俊彦
马彦卓
杨付正
张振尧
王丹妮
李明
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/086469 priority Critical patent/WO2023197192A1/zh
Publication of WO2023197192A1 publication Critical patent/WO2023197192A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Definitions

  • the embodiments of the present application relate to the field of video coding and decoding technology, and in particular, to a coding and decoding method, device, encoding device, decoding device, and storage medium.
  • JVET Joint Video Exploration Team
  • H.266/VVC includes inter-color component prediction technology.
  • inter-color component prediction technology of H.266/VVC and the original value, which results in low prediction accuracy, resulting in a decrease in the quality of the decoded video and reduced encoding performance.
  • Embodiments of the present application provide a coding and decoding method, device, coding equipment, decoding equipment and storage medium, which can not only improve the accuracy of chroma prediction and save code rate, but also improve coding and decoding performance.
  • embodiments of the present application provide a decoding method, including:
  • the reconstructed value of the second color component sampling point of the current block is determined.
  • embodiments of the present application provide an encoding method, including:
  • the prediction difference value of the second color component sampling point of the current block is determined.
  • embodiments of the present application provide a coding device, including a first determination unit, a first filtering unit and a first prediction unit; wherein,
  • a first determination unit configured to determine reference information of the current block
  • the first filtering unit is configured to filter part of the information in the reference information of the current block and determine the target information of the current block;
  • the first determination unit is further configured to determine the weighting coefficient according to the reference sample value of the first color component in the target information
  • a first prediction unit configured to determine a 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
  • the first determination unit is further configured to determine the prediction difference value of the second color component sampling point of the current block according to the prediction block.
  • embodiments of the present application provide an encoding device, including a first memory and a first processor; wherein,
  • a first memory for storing a computer program capable of running on the first processor
  • the first processor is configured to execute the method described in the second aspect when running the computer program.
  • embodiments of the present application provide a decoding device, including a second determination unit, a second filtering unit and a second prediction unit; wherein,
  • a second determination unit configured to determine the reference information of the current block
  • the second filtering unit is configured to filter part of the information in the reference information of the current block and determine the target information of the current block;
  • the second determination unit is further configured to determine the weighting coefficient according to the reference sample value of the first color component in the target information
  • the second prediction unit is configured to determine 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;
  • the second determination unit is further configured to determine the reconstruction value of the second color component sampling point of the current block according to the prediction block.
  • embodiments of the present application provide a decoding device including a second memory and a second processor; wherein,
  • a second memory for storing a computer program capable of running on the second processor
  • the second processor is configured to execute the method described in the first aspect when running the computer program.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program When the computer program is executed, the method described in the first aspect is implemented, or the method described in the first aspect is implemented. The methods described in the two aspects.
  • Embodiments of the present application provide a coding and decoding method, device, coding device, decoding device and storage medium. Whether it is the coding end or the decoding end, by determining the reference information of the current block; performing part of the information in the reference information of the current block. Filter processing to determine the target information of the current block; determine the weighting coefficient according to the reference sample value of the first color component in the target information; determine the third 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. Prediction block for two color components.
  • the prediction difference value of the second color component sampling point of the current block can be determined based on the prediction block; so that at the decoding end, the reconstructed value of the second color component sampling point of the current block can be determined based on the prediction block.
  • the accuracy of the reference information can be improved; and by upgrading the reference information Filtering processes such as sampling and downsampling can enhance the continuity of spatial correlation to a certain extent or remove some information with weak spatial correlation.
  • the target information obtained after filtering can be used to better predict chroma. , thereby improving the accuracy of chroma prediction, saving bit rate, and improving encoding and decoding performance.
  • Figure 1 is a schematic diagram of the distribution of effective adjacent areas
  • Figure 2 is a schematic diagram of the distribution of selected areas under different prediction modes
  • Figure 3 is a schematic flow chart of a model parameter derivation scheme
  • Figure 4A is a schematic block diagram of an encoder provided by an embodiment of the present application.
  • Figure 4B is a schematic block diagram of a decoder provided by an embodiment of the present application.
  • Figure 5 is a schematic flowchart 1 of a decoding method provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram 1 of a reference area of a current block provided by an embodiment of the present application.
  • Figure 7A is a schematic diagram of a downsampling position of reference brightness information provided by an embodiment of the present application.
  • Figure 7B is a schematic diagram of an upsampling position of reference chromaticity information provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of the rearranged position of reference brightness information provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of weighted prediction of a WCP mode and other prediction modes provided by the embodiment of the present application.
  • Figure 10 is a schematic diagram of a weight-based chroma prediction framework provided by an embodiment of the present application.
  • Figure 11 is a schematic flow chart 2 of a decoding method provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram 1 of an upsampling interpolation processing process provided by an embodiment of the present application.
  • Figure 13 is a schematic diagram 2 of an upsampling interpolation processing process provided by an embodiment of the present application.
  • Figure 14 is a schematic diagram of weight values for upsampling interpolation provided by an embodiment of the present application.
  • Figure 15 is a schematic diagram 3 of an upsampling interpolation processing process provided by an embodiment of the present application.
  • Figure 16 is a schematic flowchart 3 of a decoding method provided by an embodiment of the present application.
  • Figure 17 is a schematic diagram 2 of a reference area of a current block provided by an embodiment of the present application.
  • Figure 18 is a schematic flow chart 1 of an encoding method provided by an embodiment of the present application.
  • Figure 19 is a schematic flow chart 2 of an encoding method provided by an embodiment of the present application.
  • Figure 20 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • Figure 21 is a schematic diagram of the specific hardware structure of an encoding device provided by an embodiment of the present application.
  • Figure 22 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • Figure 23 is a schematic diagram of the specific hardware structure of a decoding device provided by an embodiment of the present application.
  • Figure 24 is a schematic structural diagram of a coding and decoding system provided by an embodiment of the present application.
  • the first color component, the second color component and the third color component are generally used to represent the coding block (CB); among them, these three color components are a brightness component and a blue chrominance component respectively. and a red chrominance component.
  • the brightness component is usually represented by the symbol Y
  • the blue chroma component is usually represented by the symbol Cb or U
  • the red chroma component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or YUV Format representation.
  • the video image may also be in RGB format, YCgCo format, etc., and the embodiments of this application do not impose any limitations.
  • the cross-component prediction technology mainly includes the inter-component linear model (Cross-component Linear Model, CCLM) prediction mode and the multi-directional linear model (Multi-Directional Linear Model, MDLM) prediction mode, whether it is the model parameters derived according to the CCLM prediction mode or the model parameters derived according to the MDLM prediction mode, the corresponding prediction model can realize the first color component to the second color component, and the second color component to the third color component. Prediction between one color component, the first color component to the third color component, the third color component to the first color component, the second color component to the third color component, or the third color component to the second color component, etc. .
  • VVC Versatile Video Coding
  • i, j represents the position coordinates of the pixel to be predicted in the coding block, i represents the horizontal direction, and j represents the vertical direction;
  • Pred C (i, j) represents the correspondence of the pixel to be predicted at the position coordinate (i, j) in the coding block.
  • the chroma prediction value, Rec L (i, j) represents the brightness reconstruction value corresponding to the pixel to be predicted at the (downsampled) position coordinate (i, j) in the same coding block.
  • ⁇ and ⁇ represent model parameters, which can be derived from reference pixels.
  • H.266/VVC includes three cross-component linear model prediction modes, namely: left and upper adjacent intra-frame CCLM prediction mode (can be represented by INTRA_LT_CCLM), left and lower left adjacent intra-frame The CCLM prediction mode (can be represented by INTRA_L_CCLM) and the upper and upper right adjacent intra-frame CCLM prediction mode (can be represented by INTRA_T_CCLM).
  • each prediction mode can select a preset number (such as 4) of reference pixels for derivation of model parameters ⁇ and ⁇ . The biggest difference between these three prediction modes is that they are used to derive the model.
  • the selection areas corresponding to the reference pixels of parameters ⁇ and ⁇ are different.
  • the coding block size corresponding to the chroma component is W ⁇ H, assuming that the upper selection area corresponding to the reference pixel is W', and the left selection area corresponding to the reference pixel is H'; thus,
  • the selection area of INTRA_L_CCLM mode and INTRA_T_CCLM mode is defined as W+H, in actual applications, the selection area of INTRA_L_CCLM mode will be limited to H+H, and the selection area of INTRA_T_CCLM mode will be limited to W+W. ;so,
  • Figure 1 shows a schematic distribution diagram of effective adjacent areas.
  • the left adjacent area, the lower left adjacent area, the upper adjacent area and the upper right adjacent area are all valid; in addition, the block filled with gray is the position coordinate in the coding block (i, j) pixel to be predicted.
  • Figure 2 shows the selection areas for the three prediction modes, including the left adjacent area and the upper adjacent area; (b) shows the selection area of the INTRA_L_CCLM mode, including the left adjacent area. and the lower left adjacent area; (c) shows the selected area of the INTRA_T_CCLM mode, including the upper adjacent area and the upper right adjacent area.
  • pixel selection for model parameter derivation can be performed within the selection areas.
  • the pixels selected in this way can be called reference pixels, and usually the number of reference pixels is four; and for a W ⁇ H coding block with a certain size, the position of the reference pixel is generally determined.
  • the chromaticity prediction is currently performed according to the flow diagram of the model parameter derivation scheme shown in Figure 3.
  • the process can include:
  • VVC the step in which the effective reference pixel is 0 is judged based on the validity of adjacent areas.
  • the prediction model is constructed using the principle of "two points determine a straight line", and the two points here can be called fitting points.
  • two reference pixels with larger values and two reference pixels with smaller values in the brightness component are obtained through comparison; then based on the two reference pixels with larger values, Find a mean point (can be expressed by mean max ), and find another mean point (can be expressed by mean min ) based on the two reference pixels with smaller values, and you can get two mean points mean max and mean min ; Then, using mean max and mean min as two fitting points, the model parameters (represented by ⁇ and ⁇ ) can be derived; finally, a prediction model is constructed based on ⁇ and ⁇ , and the prediction processing of the chroma component is performed based on the prediction model.
  • coding blocks with different content characteristics use a simple linear model to map brightness to chroma to achieve chroma prediction, but not the mapping function from brightness to chroma in any coding block is the same. It can be accurately fitted by this simple linear model, which results in inaccurate prediction results of some coding blocks.
  • pixels at different positions in the coding block use the same model parameters ⁇ and ⁇ .
  • embodiments of the present application provide a coding method by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; Determine the weighting coefficient based on the reference sample value of the color component; determine 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; determine the second prediction block of the current block based on the prediction block.
  • the predicted difference of color component sampling points by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; Determine the weighting coefficient based on the reference sample value of the color component; determine 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; determine the second prediction block of the current block based on the prediction block.
  • the predicted difference of color component sampling points are predicted difference of color component sampling points.
  • Embodiments of the present application also provide a decoding method, by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; according to the first color component in the target information
  • the reference sample value of the current block is used to determine the weighting coefficient; according to 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; according to the prediction block, the second color component of the current block is determined
  • the reconstructed value of the sampling point by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; according to the first color component in the target information
  • the reference sample value of the current block is used to determine the weighting coefficient; according to 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; according to the prediction block, the second color component of
  • the accuracy of the reference information can be improved due to the full consideration of the characteristics of the color format information; and by upgrading the reference information Filtering processes such as sampling and downsampling can also enhance the continuity of spatial correlation to a certain extent or remove some information with weak spatial correlation.
  • the target information obtained after filtering can be used to better perform chromaticity analysis. prediction, thereby improving the accuracy of chroma prediction, saving bit rate, and improving encoding and decoding performance.
  • the encoder 100 may include a transformation 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
  • the filter unit 108 can implement deblocking filtering and sample adaptive indentation (Sample Adaptive Offset, SAO ) filtering
  • the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Coding, CABAC).
  • a video coding block can be obtained by dividing the coding tree block (Coding Tree Unit, CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is processed through the transformation and quantization unit 101
  • the video coding block is transformed, including transforming the residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to Intra prediction is performed on the video encoding block; specifically, intra estimation unit 102 and intra prediction unit 103 are used to determine an intra prediction mode to be used to encode the video encoding block;
  • motion compensation unit 104 and motion estimation unit 105 is used to perform inter-frame prediction encoding of the received video encoding block with respect to one or more blocks in one or more reference frames to provide temporal prediction information; motion estimation performed by the motion estimation unit 105 is to generate a motion vector.
  • the motion vector can estimate the motion of the video encoding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 also is used to provide the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109; in addition, the inverse transformation and inverse quantization unit 106 is used for the video Reconstruction of the coding block, the residual block is reconstructed in the pixel domain, the reconstructed residual block removes block effect artifacts through the filter control analysis unit 107 and the filtering unit 108, and then the reconstructed residual block is added to the decoding A predictive block in the frame of the image cache unit 110 is used to generate a reconstructed video encoding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients.
  • the contextual content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra prediction mode and output the code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding blocks for Forecast reference. As the video image encoding proceeds, new reconstructed video encoding blocks will be continuously generated, and these reconstructed video encoding blocks will be stored in the decoded image cache unit 110 .
  • the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205 and a decoded image cache unit. 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the code stream of the video signal is output; the code stream is input into the decoder 200 and first passes through the decoding unit 201 to obtain the decoded transformation coefficient; for the transformation coefficient, the inverse Transform and inverse quantization unit 202 performs processing to generate a residual block in the pixel domain; intra prediction unit 203 may be operable to generate a current block based on the determined intra prediction mode and data from previously decoded blocks of the current frame or picture. Prediction data for the video decoding block; motion compensation unit 204 determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate predictive blocks for the video decoding block being decoded.
  • a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block produced by the intra prediction unit 203 or the motion compensation unit 204; the decoded video signal is formed by The filtering unit 205 removes blocking artifacts, which can improve video quality; the decoded video blocks are then stored in the decoded image cache unit 206, which stores reference images for subsequent intra prediction or motion compensation, At the same time, it is also used for the output of video signals, that is, the restored original video signals are obtained.
  • the method in the embodiment of the present application is mainly applied to the intra prediction unit 103 part as shown in FIG. 4A and the intra prediction unit 203 part as shown in FIG. 4B. That is to say, the embodiments of the present application can be applied to both encoders and decoders, or even to both encoders and decoders. However, the embodiments of the present application are not specifically limited.
  • the "current block” specifically refers to the coding block currently to be intra-predicted; when applied to the intra prediction unit 203 part, the "current block” specifically refers to Refers to the decoding block currently to be intra-predicted.
  • FIG. 5 shows a schematic flowchart 1 of a decoding method provided by an embodiment of the present application.
  • the method may include:
  • S501 Determine the reference information of the current block.
  • the decoding method in the embodiment of the present application is applied to a decoding device, or a decoding device integrated with the decoding device (which may also be referred to as a "decoder" for short).
  • the decoding method in the embodiment of the present application may specifically refer to an intra-frame prediction method, and more specifically, a pre-processing operation method of weight-based chroma prediction (Weight-based Chroma Prediction, WCP).
  • the video image may be divided into multiple decoding blocks, and each decoding block may include a first color component, a second color component, and a third color component, and the current block here refers to the current block to be processed in the video image.
  • Decoded block for intra prediction may be performed using any suitable decoding block.
  • the current block predicts the first color component, and the first color component is a brightness component, that is, the component to be predicted is a brightness component, then the current block can also be called a brightness prediction block; or, assuming that the current block predicts the second color Component prediction, and the second color component is a chroma component, that is, the component to be predicted is a chroma component, then the current block can also be called a chroma prediction block.
  • the reference information of the current block may include the value of the first color component sampling point in the adjacent area of the current block and the second color component in the adjacent area of the current block.
  • the value of the sampling point can be determined based on the decoded pixels in the adjacent area of the current block.
  • the adjacent area of the current block may include at least one of the following: an upper adjacent area, an upper right adjacent area, a left adjacent area, and a lower left adjacent area.
  • the upper adjacent area and the upper right adjacent area can be regarded as the upper area
  • the left adjacent area and the lower left adjacent area can be regarded as the left area
  • the adjacent area can also be Including the upper left area, see Figure 6 for details.
  • the upper area, left area and upper left area of the current block as adjacent areas can be called the reference area of the current block, and the pixels in the reference area are is the decoded reference pixel.
  • the reference information of the current block may also include the reconstructed value of the first reference color component sampling point in the current block. Therefore, in some embodiments, determining the reference information of the current block may include:
  • the value of the second color component sampling point in the adjacent area of the current block and the reconstructed value of the first reference color component sampling point in the current block determine the reference information of the current block.
  • the reference pixel of the current block may refer to the reference pixel point adjacent to the current block, and may also be called the first color component sampling point, the first color component sampling point, and the third color component sampling point in the adjacent area of the current block.
  • the second color component sampling point is represented by Neighboring Sample or Reference Sample.
  • the adjacency here may be spatial adjacency, but is not limited to this.
  • adjacency can also be adjacent in time domain, adjacent in space and time domain, and even the reference pixel of the current block can be a certain reference pixel point adjacent in space, adjacent in time domain, or adjacent in space and time domain.
  • the reference pixels obtained after such processing are not limited in any way by the embodiments of this application.
  • the first color component is the brightness component
  • the second color component is the chrominance component.
  • the value of the first color component sampling point in the adjacent area of the current block is represented by the reference brightness information corresponding to the reference pixel of the current block
  • the value of the second color component sampling point in the adjacent area of the current block is represented by It is the reference chromaticity information corresponding to the reference pixel of the current block.
  • determining the reference pixel of the current block may include: filtering pixels in adjacent areas of the current block to determine the reference pixel.
  • a first reference pixel set is formed according to pixels in adjacent areas of the current block; then the first reference pixel set can be filtered to determine the reference pixels.
  • the number of reference pixels can be M, and M is a positive integer.
  • M reference pixels can be selected from pixels in adjacent areas.
  • the value of M can generally be 4, but there is no specific limit.
  • filtering pixels in adjacent areas and determining reference pixels may include:
  • the reference pixel is determined from the pixels in the adjacent area.
  • the color component intensity can be represented by color component information, such as reference brightness information, reference chromaticity information, etc.; here, the larger the value of the color component information, the greater the color component intensity. high.
  • the pixels in the adjacent area can be filtered according to the position of the pixel, or according to the intensity of the color component, so that the reference pixel of the current block can be determined based on the filtered pixels, and further can The value of the first color component sampling point in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block are determined.
  • S502 Filter part of the information in the reference information of the current block to determine the target information of the current block.
  • the number of values of the first color component sampling point and the number of values of the second color component sampling point in the adjacent area of the current block are different, at this time, it may be necessary to adjust the value of the first color component sampling point.
  • the values of the sampling points of the first color component are filtered, or the values of the sampling points of the second color component are filtered so that the numbers of the two are the same.
  • the number of reconstructed values of the first reference color component sampling point in the current block is different from the preset size, it may also be necessary to filter the reconstructed values of the first reference color component sampling point in the current block at this time to obtain the desired result from the first reference color component sampling point.
  • the number of reconstructed values of the first reference color component sampling points obtained by the current block is converted into a preset size for input. That is to say, for the reference information of the current block, it may be that only the value of the first color component sampling point in the adjacent area of the current block is filtered, or it may be that only the value of the first color component sampling point in the adjacent area of the current block is filtered.
  • the values of the two color component sampling points can be filtered, or only the reconstructed value of the first reference color component sampling point in the current block can be filtered, or any two of them can be filtered, or even It is to perform filtering processing on all three, and the embodiment of this application does not impose any limitations. Each of these situations will be described below.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include:
  • Target information of the current block is determined based on filtered samples of the first color component in adjacent areas of the current block.
  • the number of filtered samples (Samples) of the first color component in the adjacent area of the current block is equal to L, where L represents the number of the second color component sampling points in the adjacent area of the current block.
  • the number of values (Sample), L is a positive integer.
  • the first filtering process may be a downsampling filtering process.
  • the amount of reference luminance information of the current block is usually greater than the amount of reference chrominance information. Therefore, the reference luminance information of the current block can be down-sampled and filtered so that the amount of reference luminance information is equal to that of the reference chrominance information.
  • the quantity is the same.
  • the method may also include: based on the color format information, Perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block to obtain the filtered sample value of the first color component in the adjacent area of the current block.
  • the first filtering process may also include:
  • color format information indicates 4:2:2 sampling, perform downsampling filtering on the value of the first color component sampling point in the adjacent area of the current block;
  • color format information indicates 4:2:0 sampling, then perform downsampling filtering on the value of the first color component sampling point in the adjacent area of the current block.
  • the down-sampling rate is the reciprocal of a positive integer multiple of 2.
  • the color format information may include 4:4:4 sampling, 4:2:2 sampling, 4:2:0 sampling, and so on.
  • 4:4:4 sampling also expressed as YUV444
  • the color format information indicates 4:2:2 sampling (also expressed as YUV422), that is, the ratio of luma to chroma samples is 4:2:2, or the color
  • 4:2:0 sampling can also be expressed as YUV420
  • the ratio of brightness and chroma samples is 4:1:1
  • the amount of reference brightness information obtained from adjacent areas is equal to the reference chroma
  • the reference brightness information obtained from the adjacent area needs to be down-sampled and
  • a multi-tap filter (such as a four-tap filter, a five-tap filter, a six-tap filter, etc.) can be used for down-sampling, or to obtain A certain pixel of multiple reference brightness pixels at the corresponding position of the reference chrominance pixel may even be another downsampling method, which is not specifically limited in the embodiment of the present application.
  • the method may further include:
  • the second filtering is performed on the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the filtered sample value of the first color component in the adjacent area of the current block and the second color component in the adjacent area of the current block are Performing a second filtering process on the value of the sampling point 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 may include:
  • the first sub-filtering is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • the second sub-filtering is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing determines a filtered adjacent sample of a first color component of the current block and a filtered adjacent sample of a second color component of the current block.
  • the preset number may be represented by inSize.
  • inSize represents the number of inputs when making predictions based on weighted coefficients
  • the value of inSize is related to the type of the current block. For example, assuming that the width of the current block is nTbW and the height of the current block is nTbH, the value of inSize can be 2 ⁇ nTbH+2 ⁇ nTbW, or 1.5 ⁇ nTbH+1.5 ⁇ nTbW, or even nTbH +nTbW, there are no specific limitations here.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include:
  • Target information of the current block is determined based on filtered samples of the second color component in adjacent areas of the current block.
  • the number of filtered samples of the second color component in the adjacent area of the current block is equal to K, where K represents the value of the first color component sampling point in the adjacent area of the current block.
  • K is a positive integer.
  • the third filtering process is an upsampling filtering process.
  • the amount of reference luminance information of the current block is usually greater than the amount of reference chrominance information. Therefore, the reference chrominance information of the current block can also be upsampled and filtered, so that the amount of reference luminance information is equal to the reference chrominance information. The amount of information is the same.
  • the method may also include: based on the color format information, The value of the second color component sampling point in the area is subjected to a third filtering process to obtain the filtered sample value of the second color component in the adjacent area of the current block.
  • the third filtering process may also include:
  • color format information indicates 4:2:2 sampling, perform upsampling filtering on the value of the second color component sampling point in the adjacent area of the current block;
  • upsampling filtering is performed on the value of the second color component sampling point in the adjacent area of the current block.
  • the upsampling rate is a positive integer multiple of 2.
  • the reference chrominance information obtained from adjacent areas can be upsampled and filtered to match the amount of reference luminance information.
  • linear interpolation or nonlinear interpolation can be used to upsample, or a certain reference chroma pixel can be copied, or even other upsampling methods can be used.
  • the sampling method is not specifically limited in the embodiments of this application.
  • the method may further include:
  • the fourth filtering is performed on the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the value of the first color component sampling point in the adjacent area of the current block and the second color in the adjacent area of the current block are The fourth filtering process is performed on the filtered samples of the component to determine the filtered adjacent samples of the first color component of the current block and the filtered adjacent samples of the second color component of the current block, which may include:
  • the first sub-filtering is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • the second sub-filtering is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing determines a filtered adjacent sample of a first color component of the current block and a filtered adjacent sample of a second color component of the current block.
  • the preset number may be represented by inSize. Specifically, if K is equal to inSize, then no operation is required; if K is greater than inSize, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reference brightness information and reference chrominance information; if K is less than inSize, then the reference brightness information and reference chroma information need to be reduced in size.
  • the reference luminance information and the reference chrominance information are used to perform the second sub-filtering process (ie, enlarging the size).
  • the number of reference brightness information and the number of reference chroma information obtained from adjacent areas can also be directly matched with inSize to Make the quantities of both the same.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include:
  • a fifth filtering process is performed on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent samples of the first color component of the current block. value;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block.
  • performing a fifth filtering process on the value of the first color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block may include :
  • the first number is greater than the preset number, then perform a first sub-filtering process on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the first color component of the current block.
  • the first number is less than the preset number, then perform a second sub-filtering process on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the first color component of the current block.
  • the number of reference brightness information obtained from adjacent areas can be matched with a preset number.
  • the number of reference brightness information obtained from adjacent areas ie, the first number
  • the preset number can be represented by inSize.
  • refYnum is equal to inSize, then no operation is required; if refYnum is greater than inSize, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reference brightness information; if refYnum is smaller than inSize, then the second sub-filtering process needs to be performed on the reference brightness information.
  • Two sub-filtering processes i.e. enlarging the size).
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may also include:
  • a sixth filtering process is performed on the values of the second color component sampling points in the adjacent area of the current block to determine the filtered adjacent samples of the second color component of the current block. value;
  • Target information of the current block is determined based on filtered adjacent samples of the second color component of the current block.
  • performing a sixth filtering process on the value of the second color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the second color component of the current block may include :
  • the second number is greater than the preset number, then perform a first sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the second color component of the current block.
  • the second number is less than the preset number, then perform a second sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the second color component of the current block.
  • the number of reference chromaticity information obtained from adjacent areas can be matched with a preset number.
  • the number of reference chromaticity information obtained from adjacent areas ie, the second number
  • refCnum the number of reference chromaticity information obtained from adjacent areas
  • the preset number can be represented by inSize.
  • refCnum is equal to inSize, then no operation is required; if refCnum is greater than inSize, then the reference chromaticity information needs to be first sub-filtered (i.e., reduced in size); if refCnum is smaller than inSize, then the reference chromaticity information needs to be filtered Perform the second sub-filtering process (i.e. enlarge the size).
  • the first sub-filtering process may be a down-sampling filtering process.
  • the first sub-filtering process may also include at least one of the following:
  • the continuous position selection method is used for sub-filtering processing.
  • the number of reference brightness information obtained from adjacent areas is refYnum. If the fixed interval position selection method is used to reduce the size, the refYnum reference brightness pixels are arranged into a one-dimensional vector according to a certain position relationship, and then fixed intervals are selected based on the size relationship between inSize and refYnum, which can reduce the size of the reference brightness information. As shown in Figure 8, the reference brightness information refY obtained in the "L"-shaped reference area of one row and one column can be rearranged into a one-dimensional vector refY according to the positional relationship from the lower left to the upper left, and then from the upper left to the upper right. '.
  • the arrangement as a one-dimensional vector and the starting position selected at fixed intervals can be set freely, and there are no restrictions here.
  • the fixed interval used for size reduction is subDist
  • starting from the first pixel position of the one-dimensional vector select a pixel every (subDist-1) pixel position, and finally obtain inSize amount of reference brightness information.
  • the refYnum reference brightness pixels are arranged into a one-dimensional vector according to a certain position relationship, and then the preset value of the one-dimensional vector is Select inSize pixels continuously at the position to get inSize amount of reference brightness information.
  • the preset position may be the first pixel position or the pos-th pixel position, and there is no limitation here.
  • the second sub-filtering process may be an upsampling filtering process.
  • the second sub-filtering process may also include: performing sub-filtering processing using interpolation at fixed intervals.
  • the refCnum reference chroma pixels are arranged into a one-dimensional vector according to a certain position relationship, and then points are selected at fixed intervals according to the size relationship between inSize and refCnum for enlargement. Dimensions for reference colorimetric information.
  • the arrangement as a one-dimensional vector and the starting position of the fixed interval interpolation can be set freely, and there are no restrictions here.
  • the inSize number can finally be obtained by interpolation reference brightness information.
  • the current block is determined based on the filtered adjacent sample values of the first color component of the current block.
  • the target information of the block may include: the filtered adjacent sample value of the first color component of the current block, the value of the second color component sampling point in the adjacent area of the current block and the first color component of the current block. The reconstructed value of the reference color component sampling point.
  • the target information of the current block is determined based on the filtered adjacent sample values of the second color component of the current block.
  • the target information at this time may include: the filtered adjacent sample value of the second color component of the current block, the value of the first color component sampling point in the adjacent area of the current block, and the first reference color component sample in the current block. The reconstructed value of the point. Or, perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block, and perform a second filtering process on the value of the second color component sampling point in the adjacent area of the current block.
  • the target information at this time may include: filtered adjacent samples of the first color component of the current block, filtered adjacent samples of the second color component of the current block, and filtered adjacent samples of the first reference color component sampling point in the current block. Rebuild value.
  • determining the reference information of the current block may further include: determining the reference information of the current block based on the reconstruction value of the first reference color component sampling point in the current block.
  • the first reference color component may be a brightness component; then, the reconstructed value of the first reference color component sampling point in the current block is the reconstructed brightness information of the current block.
  • the preset size is predSizeW ⁇ predSizeH; where predSizeW represents the width of the prediction block, and predSizeH represents the height of the prediction block.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include:
  • the target information of the current block is determined.
  • performing a seventh filtering process on the reconstructed value of the first reference color component sampling point in the current block to determine the filtered sample value of the first reference color component sampling point in the current block may include:
  • a third sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color in the current block. Filtered samples of component sampling points;
  • a fourth sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color in the current block.
  • the filtered sample value of the component sample point is the fourth sub-filtering process.
  • recSizeW represents the first width and recSizeH represents the first height.
  • recSizeW is equal to predSizeW
  • recSizeH is equal to predSizeH
  • no operation is required; if recSizeW is greater than predSizeW, or recSizeH is greater than predSizeH, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reconstructed brightness information; if recSizeW is less than predSizeW, or recSizeH is smaller than predSizeH, then the second sub-filtering process (ie, enlarging the size) needs to be performed on the reconstructed brightness information.
  • the third sub-filtering process may be a down-sampling filtering process.
  • the third sub-filtering process may also include at least one of the following:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to downsampling filtering in the horizontal direction and then downsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to down-sampling filtering in the vertical direction and then down-sampling and filtering is performed in the horizontal direction.
  • the horizontal downsampling factor can be calculated based on recSizeW and predSizeW
  • the vertical downsampling factor can be calculated based on recSizeH and predSizeH
  • the reconstructed brightness information is downsampled and filtered based on the horizontal downsampling factor and the vertical downsampling factor.
  • the horizontal down-sampling factor is greater than 1 and the vertical down-sampling factor is equal to 1, then only the reconstructed brightness information needs to be down-sampled in the horizontal direction; if the horizontal down-sampling factor is equal to 1 and the vertical down-sampling factor is greater than 1, then only The reconstructed brightness information needs to be down-sampled in the vertical direction; if the horizontal down-sampling factor is greater than 1 and the vertical down-sampling factor is greater than 1, then the reconstructed brightness information needs to be down-sampled in both the horizontal and vertical directions.
  • the fourth sub-filtering process is an upsampling filtering process.
  • the fourth sub-filtering process may also include at least one of the following:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the horizontal direction and then upsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the vertical direction and then upsampling and filtering is performed in the horizontal direction.
  • the horizontal upsampling factor is first calculated based on recSizeW and predSizeW, and the vertical upsampling factor is calculated based on recSizeH and predSizeH; then, the reconstructed brightness information is upsampled and filtered based on the horizontal upsampling factor and the vertical upsampling factor.
  • the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, then only the reconstructed brightness information needs to be upsampled in the horizontal direction; if the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, then only The reconstructed brightness information needs to be upsampled in the vertical direction; if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, then the reconstructed brightness information needs to be upsampled in both the horizontal and vertical directions. Among them, you can perform horizontal first You can also perform upsampling in the vertical direction first and then the horizontal direction.
  • the reference information of the current block may include: the value of the first color component sampling point in the adjacent area of the current block, the second color component sample in the adjacent area of the current block The value of the point and the reconstructed value of the first reference color component sampling point in the current block;
  • 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 value and the filtered sample value of the first reference color component sample point in the current block.
  • the filtered adjacent sample value of the first color component of the current block is equal to the first color component in the adjacent area of the current block.
  • the value of a color component sampling point similarly, if the value of the second color component sampling point in the adjacent area of the current block does not need to be filtered, then the filtered adjacent sample value of the second color component of the current block Equal to the value of the second color component sampling point in the adjacent area of the current block; if the reconstructed value of the first reference color component sampling point in the current block does not require filtering, then the first reference color component sampling point in the current block
  • the filtered sample value of is equal to the reconstructed value of the first reference color component sampling point in the current block.
  • the obtained target information may include: filtered adjacent samples of the first color component of the current block, filtered adjacent samples of the second color component of the current block, and filtered samples of the first reference color component in the current block.
  • Sample values that is: inSize number of reference chroma information, inSize number of reference luminance information and reconstructed luminance information that conforms to the preset size.
  • S503 Determine the weighting coefficient according to the reference sample value of the first color component in the target information.
  • the method may further include: setting the reference sample value of the first color component in the target information to the filtered adjacent sample value of the first color component of the current block and the first reference color in the current block. The absolute value of the difference between the filtered samples of the component sample points.
  • the method may further include: setting the reference sample of the second color component in the target information as a filtered adjacent sample of the second color component of the current block.
  • the filtering of the reference information it may be that only the reference brightness information is filtered, or only the reconstructed brightness information is filtered, or only the reference brightness information and the reconstructed brightness information are filtered, It is even possible to perform filtering processing on the reference chroma information, the reference luminance information and the reconstructed luminance information, without any limitation here. Then the calculation of the brightness difference can be the absolute value of the difference between the reference brightness information and the reconstructed brightness information, or the absolute value of the difference between the filtered reference brightness information and the reconstructed brightness information, or the reference brightness information and filtered The absolute value of the difference between the processed reconstructed brightness information may even be the absolute value of the difference between the filtered reference brightness information and the filtered reconstructed brightness information.
  • the method may also include: setting the reference sample value of the first color component in the target information as the phase of the current block.
  • determining the weighting coefficient based on the reference sample of the first color component in the target information may include:
  • the reference sample of the first color component may be the filtered adjacent sample of the first color component of the current block and the filtered sample of the first reference color component sampling point in the current block.
  • the absolute value of the difference is a first color component
  • the first color component is a color component different from the second color component to be predicted in this embodiment of the present application.
  • the embodiment of the present application mainly predicts the chrominance component of the pixel to be predicted in the current block.
  • First select at least one pixel to be predicted in the current block, and calculate the brightness difference between its reconstructed chromaticity and the reference chromaticity in the adjacent area (expressed by
  • the reference pixel position with the smallest chromaticity difference will follow the change of the pixel to be predicted in the current block.
  • the size of the chromaticity difference represents the degree of similarity between chromaticities.
  • 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 greater than or equal to 0 and less than or equal to 1, that is, 0 ⁇ w k ⁇ 1.
  • the sum of N weighting coefficients is equal to 1
  • the absolute value of the weighting coefficient can be greater than 1.
  • the normalized exponential function is a generalization of the logical function. It can "compress" an N-dimensional vector z containing any real number into another N-dimensional vector ⁇ (z), so that the range of each element is between (0, 1), and the sum of all elements is 1 , is often used as a nonlinear activation function for multi-classification neural networks.
  • the Softmax function is shown below,
  • the Softmax function can satisfy the conditional constraints of w k , but its function value increases with the increase of vector elements, which does not conform to the approximately inverse relationship between w k and
  • can be limited to a negative number. That is to say, when the first reference color component parameter is
  • determining the value corresponding to the reference sample of the first color component under the preset mapping relationship may include:
  • the first factor is a constant value less than zero.
  • represents the first factor
  • represents the first reference color component parameter
  • represents the first product value
  • determining the first factor may include: the first factor is a preset constant value.
  • the weighted coefficient distribution of adjacent chromaticities can be adjusted according to the relatively flat characteristics of the chromaticity, thereby capturing a weighted coefficient distribution suitable for natural image chromaticity prediction.
  • the given ⁇ set is traversed, and the appropriateness of ⁇ is measured by the difference between the predicted chroma and the original chroma under different ⁇ .
  • can take -2 ⁇ , where ⁇ 1,0,-1,-2,-3 ⁇ ; after experiments, it is found that in this ⁇ set, the best value of ⁇ is -0.25. Therefore, in a specific embodiment, ⁇ can be set to -0.25, but this is not specifically limited in the embodiment of the present application.
  • determining the first factor may include: determining the value of the first factor according to the size parameter of the current block.
  • the method may further include: determining the value of the first factor according to a preset mapping lookup table between the size parameter of the current block and the value of the first factor.
  • the size parameter of the current block may include at least one of the following parameters: the width of the current block, the height of the current block, and the product of the width and height of the current block.
  • a classification method may be used to fix the value of the first factor.
  • the current block size parameter is divided into three categories, and the value of the first factor corresponding to each category is determined.
  • embodiments of the present application may also pre-store a lookup table mapping the size parameters of the current block and the value of the first factor, and then determine the value of the first factor based on the lookup table.
  • Table 1 shows the correspondence between a first factor provided by the embodiment of the present application and the size parameter of the current block. It should be noted that Table 1 is only an exemplary lookup table and is not specifically limited.
  • determining the first factor may include: determining the value of the first factor based on the number of reference pixels in the current block.
  • the method may further include: determining the value of the first factor according to a preset mapping lookup table between the number of reference pixels of the current block and the value of the first factor.
  • this embodiment of the present application can divide the number of reference pixels into three categories, and still use a classification method to fix the value of the first factor.
  • the current block is divided into three categories according to the number of reference pixels, and the value of the first factor corresponding to each category is determined.
  • embodiments of the present application may also pre-store a lookup table mapping the number of reference pixels of the current block and the value of the first factor, and then determine the value of the first factor based on the lookup table.
  • Table 2 shows the correspondence between a first factor provided by the embodiment of the present application and the number of reference pixels of the current block. It should be noted that Table 2 is only an exemplary lookup table and is not specifically limited.
  • determining the first product value based on the first factor and the reference sample of the first color component may include:
  • the first product value is set to a value obtained by adding and bit-shifting the reference sample of the first color component according to the first factor.
  • the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref
  • the first product value can be equal to 0.25 ⁇ Ref
  • 0.25 ⁇ Ref can be expressed as Ref/4, that is, Ref>> 2.
  • floating-point numbers may be converted into addition and displacement operations; that is to say, for the first product value, there are no restrictions on its calculation method.
  • the first color component may also be a brightness component
  • the second color component may be a chrominance component.
  • at least one pixel to be predicted in the current block is selected, and its reconstructed brightness and value are calculated respectively.
  • the brightness difference between reference brightnesses in adjacent areas (expressed as
  • the corresponding weighting coefficient (expressed by w k ) can be given a larger weight; conversely, if
  • the similarity is relatively weak, and w k can be given a smaller weight. That is to say, when calculating the weighting coefficient, the reference sample value of the first color component can also be
  • the reference sample value of the first color component it can be
  • the preset multiplier here is the second factor described in the embodiment of this application.
  • the method may also include: performing a least squares calculation based on the first color component value of the reference pixel and the second color component value of the reference pixel, determining Second factor.
  • the least squares calculation is performed on the chrominance component values and brightness component values of the N reference pixels to obtain the second factor.
  • the least squares regression is calculated as follows,
  • Lk represents the brightness component value of the k-th reference pixel
  • Ck represents the chrominance component value of the k-th reference pixel
  • N represents the number of reference pixels
  • represents the second factor, which can be calculated using the least squares method. Regression is calculated. It should be noted that the second factor can also be a fixed value or be fine-tuned based on a fixed value, etc., which are not specifically limited in the embodiments of this application.
  • the preset mapping relationship may be a preset functional relationship.
  • the preset mapping relationship may be a Softmax function.
  • the Softmax function is a normalized exponential function, but the embodiment of the present application may not require normalization, and its value is not limited to the range [0,1].
  • the weighting coefficient w k corresponding to the k-th reference pixel can be calculated by formula (4), or can be replaced as follows:
  • S represents the control parameter
  • the relationship between S and the first factor ( ⁇ ) is:
  • the value of S is related to the size parameter of the current block.
  • the size parameters of the current block include the width and height of the current block. In a possible implementation, if the minimum value of the width and height is less than or equal to 4, then the value of S is equal to 8; if the minimum value of the width and height is greater than 4 and less than or equal to 16, then the value of S is equal to 12; If the minimum value of width and height is greater than 16, then the value of S is equal to 16.
  • the value of S is related to the number of reference pixels (R) of the current block. In a possible implementation, if R is less than 16, then the value of S is equal to 8; if R is greater than or equal to 16 and less than 32, then the value of S is equal to 12; if R is greater than or equal to 16, then the value of S The value is equal to 16; the embodiments of this application do not impose any limitation on this.
  • the preset mapping relationship may be a weighting function that has an inverse relationship with the reference sample value of the first color component.
  • the preset mapping relationship when it is a preset functional relationship, it can be as shown in Equation (4), as shown in Equation (6) or (7), or as shown in Equation (8) or Equation ( 9), it can even be that the closer the reference brightness value of the reference pixel is to the brightness reconstruction value of the pixel to be predicted in the current block, the more important the reference chromaticity value of the reference pixel is to the pixel to be predicted in the current block. The higher the trend, the function model of the weighting coefficient will be constructed, etc., which are not specifically limited in the embodiments of this application.
  • the preset mapping relationship may also be a preset look-up table method.
  • the embodiments of the present application can also simplify operations, for example, using an array element table lookup method to reduce part of the calculation operations.
  • the preset mapping relationship it can be: determining the array element value according to the preset reference sample value of the first color component, the first factor and the array element mapping lookup table; and then determining the array element value in the preset The corresponding value under the mapping relationship; then set the weighting coefficient equal to the value.
  • the f model for calculating weighted coefficients can be implemented through simplified operations, such as table lookup.
  • of the pixel (i, j) to be predicted can also be expressed by
  • ; in this way, the weighting coefficient w k ij f (
  • the numerator in the f model can be stored as an array index with the independent variable
  • the storage here can be divided into complete storage or partial storage.
  • complete storage is to store all molecules in the
  • value range multiplied by the number of S types) needs to be opened. array space.
  • the required storage array size is
  • is an integer in the range of 0 to 1023, and the number of S categories is 3.
  • and the number of S categories To store the molecule completely as an index into the 2D array storMole:
  • the complete storage can also set the corresponding array offset according to the classification of S, and then use (
  • the partial storage is to store a selected part of all the molecule values in the calculated weighting coefficient.
  • partial value range and/or the molecule values of the S partial category can be selected for storage.
  • the f model value within the selection range defaults to 0, and the required storage array size is (the selected
  • the storage range of partial storage can be stored according to actual needs, and is not limited to
  • the offset thus opens up a one-dimensional storage space for storage, which is not limited in the embodiments of this application.
  • the enlarged integer values can also be stored here; in this way, corresponding reduction operations need to be performed after the predicted values are determined.
  • the weighting coefficient can be determined based on the reference sample value of the first color component (for example
  • N represents The number of reference samples for the second color component.
  • the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value greater than or equal to 0 and less than or equal to 1.
  • the sum of N weighting coefficients is equal to 1
  • S504 Determine 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.
  • S505 Determine the reconstruction value of the second color component sampling point of the current block according to the prediction block.
  • the weighting coefficient can be used to perform weighted calculation on the reference sample value of the second color component, thereby obtaining the predicted value of the second color component sampling point in the prediction block.
  • determining the prediction block of the second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information may include:
  • the predicted value of the second color component sampling point in the prediction block is set equal to the 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.
  • Equation (16 ) obtains the predicted value of the chroma component at the (i,j) position in the prediction block.
  • this method is conducive to parallel processing and can speed up calculations.
  • the first color component is the brightness component
  • the second color component is the chrominance component. Since the resolution of the brightness component and the resolution of the chrominance component are different, in this case, the luminance component may be subjected to downsampling filtering to align the resolution of the chrominance component, or the chrominance component may be subjected to upsampling filtering to align the resolution of the luminance component.
  • the prediction block includes prediction values of at least some of the second color component sampling points in the current block. If the prediction block only contains the predicted values of some of the second color component sampling points in the current block or does not contain the predicted values of the second color component sampling points (the predicted values need to be filtered and enhanced to obtain the final predicted value), then The prediction block can also be filtered. At this time, the prediction block can be called the first prediction block, and then an upsampling filtering process is performed on the first prediction block to determine the second prediction block of the second color component of the current block. The second prediction block at this time is The prediction block of the final second color component of the current block, and includes the prediction values of all the second color component sampling points in the current block.
  • performing an upsampling filtering process on the first prediction block and determining the second prediction block of the second color component of the current block may include: the input of the upsampling filtering process is the first upsampling input block. ; The output of the upsampling filtering process is the first upsampling output block.
  • the upsampling filtering process may include:
  • the upsampling factor includes at least one of the following: a horizontal upsampling factor, a vertical upsampling factor;
  • upsampling and filtering is performed on the first upsampling input block according to the upsampling factor to obtain the first upsampling output block, which may include: if the horizontal upsampling factor is greater than 1, or the vertical upsampling factor If it is greater than 1, then upsampling filtering is performed on the first upsampling input block to obtain the first upsampling output block.
  • performing an upsampling filtering process on the first upsampling input block includes at least one of the following:
  • the first upsampling input block is subjected to upsampling filtering processing in the vertical direction and then upsampling filtering processing is performed in the horizontal direction.
  • the horizontal upsampling factor can first be calculated according to the width of the first upsampling input block and the width of the first upsampling output block, and the vertical upsampling factor can be calculated according to the height of the first upsampling input block and the height of the first upsampling output block. sampling factor; then, the first upsampling input block is upsampled and filtered according to the horizontal upsampling factor and the vertical upsampling factor. Specifically, if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, then only the first upsampling input block needs to be upsampled in the horizontal direction; if the horizontal upsampling factor is equal to 1, the vertical upsampling factor is greater than 1.
  • upsampling filtering is performed on the first prediction block to determine the second prediction block.
  • the method may further include: using the first prediction block as a first upsampling input block; using the first upsampling output block as a second prediction block of the second color component of the current block.
  • enhancement filtering is first performed on the first prediction block, and then upsampling filtering is performed to determine the second prediction block.
  • the method may also include: performing filtering enhancement processing on the first prediction block to determine the first enhanced prediction block; using the first enhanced prediction block as the first upsampling input block; and using the first upsampling output block as the current block.
  • the second prediction block of the second color component is
  • upsampling filtering is first performed on the first prediction block, and then enhancement filtering is performed to determine the second prediction block.
  • the method may also include: using the first prediction block as the first upsampling input block; using the first upsampling output block as the first upsampling filter prediction block; performing filtering enhancement on the first upsampling filter prediction block. Processing to determine a second prediction block of a second color component of the current block.
  • the first prediction block is first subjected to enhancement filtering, then upsampling filtering is performed, and then enhancement filtering is performed to determine the second prediction block.
  • the method may also 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 the first upsampling input block; and using the first upsampling output block As the second upsampling filter prediction block; perform a second filter enhancement process on the second upsampling filter prediction block to determine the second prediction block of the second color component of the current block.
  • the method may further include: performing a correction operation on the predicted value of the second color component sampling point in the prediction block, and determining the prediction block of the second color component of the current block.
  • the preset range may be between: 0 and (1 ⁇ BitDepth)-1; where BitDepth is the bit depth required for the chroma component. If the predicted value exceeds the preset range, the predicted value needs to be corrected accordingly. For example, one can Perform clamping operation as follows:
  • the method may further include:
  • Correlation processing is performed on the prediction block, and the processed prediction block is used as the prediction block of the second color component of the current block.
  • performing correlation processing on the prediction block may include: performing filtering enhancement processing on the prediction block, and using the processed prediction block as the prediction block of the second color component of the current block.
  • the prediction block in order to reduce the instability caused by independent and parallel prediction on a pixel-by-pixel basis, for example, the prediction block can be smoothed and filtered, and then the processed prediction block can be used as the final prediction block.
  • performing correlation processing on the prediction block may include: determining the compensation value of the second color component of the prediction block based on the reference sample value in the adjacent area of the current block; The predicted value of the second color component sampling point in the block is corrected to determine the predicted block of the second color component of the current block.
  • a position-related correction process can be performed on the prediction block. For example, reference pixels with close spatial positions are used to calculate the chromaticity compensation value for each second color component sampling point to be predicted, and this chromaticity compensation value is used to correct the second color component sampling point in the prediction block. According to the corrected The predicted value determines the final predicted value (predSamples) of the second color component sampling point, thereby obtaining the final predicted block.
  • performing correlation processing on the prediction block may include: performing prediction processing on the second color component sampling points in the prediction block according to at least one prediction mode, and determining the second color component in the prediction block. At least one initial prediction value of the sampling point; perform a weighted fusion process based on the at least one initial prediction value and the prediction value of the second color component sampling point in the prediction block to determine the prediction block of the second color component of the current block.
  • Chroma prediction block may include: planar mode, direct current (DC) mode, vertical mode, horizontal mode, CCLM mode, etc., and each prediction mode is connected to a switch. The switch is used to control whether the chroma prediction values in this prediction mode participate in the weighted fusion process.
  • DC direct current
  • the weight value corresponding to Planar mode is W_Planar
  • the weight value corresponding to DC mode is W_DC
  • the weight value corresponding to vertical mode is W_Ver
  • the weight value corresponding to horizontal mode is W_Hor
  • the weight value corresponding to CCLM mode is W_CCLM
  • the weight value corresponding to WCP mode The weight value is W_Wcp; for the chroma prediction value in Planar mode, the chroma prediction value in DC mode, the chroma prediction value in vertical mode, the chroma prediction value in horizontal mode and the chroma prediction value in CCLM mode , if only the switch connected in CCLM mode is in the closed state, then the chroma prediction value in CCLM mode and the chroma prediction value in WCP mode can be weighted and fused according to W_CCLM and W_Wcp, and the values of W_CCLM and W_Wcp can be determined It is to perform weighted fusion with equal weight or unequal weight.
  • determining the reconstruction value of the second color component sampling point of the current block according to the prediction block may include:
  • the prediction block determine the predicted value of the second color component sampling point of the current block
  • the reconstructed value of the second color component sampling point of the current block is determined according to the predicted difference value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.
  • determining the prediction difference (residual) of the second color component sampling point of the current block may be by parsing the code stream to determine the prediction difference of the second color component sampling point of the current block. value.
  • the prediction block may include prediction values of at least some of the second color component sampling points in the current block.
  • the prediction block contains the predicted values of all the second color component sampling points in the current block, then the predicted values of the second color component sampling points of the current block can be set equal to the value of the prediction block; if the prediction block contains the prediction values of the second color component sampling points in the current block, If the prediction value of some of the second color component sampling points is determined, upsampling filtering can be performed on the value of the prediction block, and the predicted value of the second color component sampling point of the current block is set equal to the output value after upsampling and filtering.
  • determining the predicted value of the second color component sampling point of the current block based on the prediction block may be to set the predicted value of the second color component sampling point of the current block equal to the value of the prediction block. ; Alternatively, it is also possible to filter the value of the prediction block, and then set the prediction value of the second color component sampling point of the current block to be equal to the filtered output value.
  • the chroma prediction difference of the current block is determined; then based on the prediction block, the chroma prediction value of the current block can be determined; then the chroma prediction value and the chroma prediction difference Values are added to obtain the chroma reconstruction value of the current block.
  • the embodiment of the present application is to optimize the acquisition process of input information in the prediction process of WCP mode, which mainly includes three aspects: on the one hand, fully consider the characteristics of the input color format information, and improve the reference brightness information and reference chromaticity information. Accuracy; on the other hand, make full use of spatial correlation to perform upsampling, downsampling, size enlargement or size reduction and other filtering processes on the reference brightness information, reference chroma information and reconstructed brightness information of the current block; on the other hand, fully Considering the relevant information of the prediction block, different filtering processing methods are used for the reference brightness information, reference chroma information and reconstructed brightness information of the current block to improve the accuracy of WCP prediction technology.
  • the embodiment of the present application also provides a weight-based chroma prediction framework.
  • Point recY[i][j] for each sample in the down-sampled reconstructed luminance information in the current block (i.e., the down-sampled luminance block)
  • Point recY[i][j] firstly obtain the brightness difference vector diffY[i][j] based on the absolute value of the difference between recY[i][j] and the adjacent brightness vector refY[k];
  • the normalized weight vector cWeight[i][j] again, use the weight vector to vectorize the weight vector with the adjacent chroma vector of the current block Multiplication, you can get the predicted chroma prediction value
  • Embodiments of the present application also provide a decoding method, by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; according to the first color component in the target information
  • the reference sample value of the current block is used to determine the weighting coefficient; according to 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; according to the prediction block, the second color component of the current block is determined
  • the reconstructed value of the sampling point by determining the reference information of the current block; filtering part of the information in the reference information of the current block to determine the target information of the current block; according to the first color component in the target information
  • the reference sample value of the current block is used to determine the weighting coefficient; according to 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; according to the prediction block, the second color component of
  • the accuracy of the reference information can be improved due to the full consideration of the characteristics of the color format information; and by upgrading the reference information Filtering processes such as sampling and downsampling can also enhance the continuity of spatial correlation to a certain extent or remove some information with weak spatial correlation.
  • the target information obtained after filtering can be used to better perform chromaticity analysis. prediction, thereby improving the accuracy of chroma prediction, saving bit rate, and improving encoding and decoding performance.
  • the embodiment of the present application proposes a weight-based chroma prediction technology 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 areas of the current block, the current block information and the current color format information are analyzed and processed.
  • the information of the adjacent area mainly refers to the position of the sampling point, reference brightness information and reference chroma information in the adjacent area.
  • the information of the current block mainly refers to the reconstructed brightness information in the current block.
  • the current color format information mainly refers to Refers to the InputChromaFormat parameter in the configuration file (*.cfg format) during the decoding process, which is the ratio of the brightness and chroma samples of the input video.
  • Input of WCP mode the position of the current block (xTbCmp, yTbCmp), the width of the current block nTbW and the height of the current block nTbH.
  • the prediction process of WCP mode can include steps such as determining core parameters, obtaining target information, weight-based chromaticity prediction, and post-processing processes, and a pre-processing step is added in the process of obtaining target information. After these steps, the chroma prediction value of the current block can be obtained.
  • FIG. 11 shows a schematic flowchart 2 of a decoding method provided by an embodiment of the present application.
  • the method may include:
  • S1101 Determine the core parameters of the WCP mode.
  • the core parameters involved in WCP mode are determined, that is, the core parameters of WCP mode can be obtained or inferred through configuration or in some way, for example, the core parameters are obtained from the code stream at the decoding end.
  • the core parameters of the WCP mode include but are not limited to the control parameter (S), the number of weight-based chroma prediction inputs (inSize), and the number of weight-based chroma prediction outputs (arranged in predSizeW ⁇ predSizeH).
  • the prediction block of the weight-based chroma prediction output can be represented by predWcp.
  • the control parameter (S) can be used to adjust the nonlinear function in subsequent links or to adjust the data involved in subsequent links.
  • the determination of core parameters is affected by the block size or block content or the number of pixels within the block under certain conditions. For example:
  • the current block can be processed according to its block size or block content or the number of pixels within the block. Classify and determine the same or different core parameters according to different categories. That is, the control parameters (S) corresponding to different categories or the number of weight-based chroma prediction inputs inSize or the number of weight-based chroma prediction outputs (arranged in predSizeW ⁇ predSizeH) may be the same or different. Note that predSizeW and predSizeH can also be the same or different.
  • WCP mode can classify the current block according to the width and height of the current block, and use wcpSizeId to indicate the type of block.
  • the control parameter (S) the number of weight-based chroma prediction inputs inSize, and the number of weight-based chroma prediction outputs (arranged in predSizeW ⁇ predSizeH) may be the same or different.
  • S control parameter
  • predSizeW ⁇ predSizeH predSizeW ⁇ predSizeH
  • the current block is divided into 3 categories according to the width and height of the current block.
  • the control parameters (S) of different categories can be set to different inSize and the number of weight-based chroma prediction outputs of different categories (arranged into predSizeW ⁇ predSizeH) Can be set to the same.
  • nTbW is the width of the current block
  • nTbH is the height of the current block
  • type of block wcpSizeId is defined as follows:
  • the control parameter (S) is 8
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the control parameter (S) is 12
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the control parameter (S) is 16
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the current block is divided into 3 categories according to the width and height of the current block.
  • the control parameters (S) of different categories can be set to different inSize and the number of weight-based chroma prediction outputs of different categories (arranged into predSizeW ⁇ predSizeH) Can be set to the same.
  • nTbW is the width of the current block
  • nTbH is the height of the current block
  • type of block wcpSizeId is defined as follows:
  • the control parameter (S) is 8
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the control parameter (S) is 12
  • inSize is (1.5 ⁇ nTbH+1.5 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH/2 ⁇ nTbW/2 chroma prediction values
  • wcpSizeId 2: indicates the current block with min(nTbW,nTbH)>16.
  • the WCP control parameter (S) is 16
  • inSize is (nTbH+nTbW)
  • the weight-based chroma prediction outputs nTbH/4 ⁇ nTbW/4 chroma prediction values
  • WCP mode can also classify the current block according to the width and height of the current block, and use wcpSizeId to indicate the type of block.
  • the control parameter (S) the number of weight-based chroma prediction inputs inSize, and the number of weight-based chroma prediction outputs (arranged in predSizeW ⁇ predSizeH) may be the same or different.
  • S control parameter
  • predSizeW ⁇ predSizeH predSizeW ⁇ predSizeH
  • the current block is divided into 3 categories according to the width and height of the current block.
  • the control parameters (S) of different categories can be set to different inSize and the number of weight-based chroma prediction outputs of different categories (arranged into predSizeW ⁇ predSizeH) Can be set to the same.
  • nTbW is the width of the current block
  • nTbH is the height of the current block
  • nTbW ⁇ nTbH represents the number of pixels in the current block.
  • the type of block wcpSizeId is defined as follows:
  • wcpSizeId 0: indicates the current block of (nTbW ⁇ nTbH) ⁇ 128.
  • the control parameter (S) is 10
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the control parameter (S) is 8
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • wcpSizeId 2: indicates (nTbW ⁇ nTbH)>256 current blocks.
  • the control parameter (S) is 1, inSize is (2 ⁇ nTbH+2 ⁇ nTbW), and the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values;
  • the current block is divided into 3 categories according to the width and height of the current block.
  • the control parameters (S) of different categories can be set to different inSize and the number of weight-based chroma prediction outputs of different categories (arranged into predSizeW ⁇ predSizeH) Can be set to the same.
  • nTbW is the width of the current block
  • nTbH is the height of the current block
  • nTbW ⁇ nTbH represents the number of pixels in the current block.
  • the type of block wcpSizeId is defined as follows:
  • wcpSizeId 0: indicates the current block of (nTbW ⁇ nTbH) ⁇ 64.
  • the control parameter (S) is 16
  • inSize is (2 ⁇ nTbH+2 ⁇ nTbW)
  • the weight-based chroma prediction outputs nTbH ⁇ nTbW chroma prediction values
  • the control parameter (S) is 4, inSize is (1.5 ⁇ nTbH+1.5 ⁇ nTbW), and the weight-based chroma prediction outputs nTbH/2 ⁇ nTbW/2 chroma prediction values;
  • wcpSizeId 2: indicates the current block of (nTbW ⁇ nTbH)>512.
  • the control parameter (S) is 1, inSize is (nTbH+nTbW), and the weight-based chroma prediction outputs nTbH/4 ⁇ nTbW/4 chroma prediction values;
  • S1102 Determine the target information after pre-processing based on the core parameters.
  • the target information may include reference chrominance information (refC), reference luminance information (refY) and reconstructed luminance information (recY).
  • reference chrominance information ie, input information
  • reference luminance information refY
  • recY reconstructed luminance information
  • the reference chromaticity information refC and the reference brightness information refY are obtained from adjacent areas.
  • the obtained reference chromaticity information includes but is not limited to: the reference chromaticity reconstruction value of the upper area of the selected current block, and/or the reference chromaticity reconstruction value of the left area.
  • the obtained reference brightness information includes but is not limited to: obtaining the corresponding reference brightness information according to the position of the reference chrominance information.
  • the acquisition method includes but is not limited to: acquiring the corresponding reconstructed brightness information according to the position of the chrominance information in the current block as the reconstructed brightness information of the current block.
  • the embodiment of the present application mainly focuses on the situation where the inSize specified in the step of determining the core parameters is different from the number of reference chromaticity information refC and reference brightness information refY obtained from the adjacent area, or the number of reference chroma information refY obtained from the current block is different.
  • the number of reconstructed brightness information recY is different from the preset size (predSizeW ⁇ predSizeH) specified in the step of determining the core parameters.
  • the reference brightness information refY obtained from the adjacent area The number is the same as the number of reference chromaticity information refC, no operation is required.
  • the ratio of brightness and chroma samples is 4:2:2, or the current color format information indicates 4:2: 0 sampling (that is, YUV420).
  • the ratio of brightness and chroma samples is 4:1:1
  • the reference brightness information refY obtained from the adjacent area needs to be down-sampled to match the reference chroma information refC.
  • the number; or the reference chrominance information refC obtained from the adjacent area is upsampled to match the number of reference luminance information refY.
  • the current color format information includes but is not limited to the color format information proposed above.
  • the processing principle is: when the ratio of brightness and chroma samples is different, the reference brightness information needs to be down-sampled or the reference chroma information needs to be up-sampled. sampling.
  • the downsampling process mentioned in the processing of the first case is as follows: for the reference chromaticity information refC of the refNum number obtained from the adjacent area, the downsampling of the reference brightness information refY can be used.
  • the embodiments of this application do not impose any limitations on the multi-tap filter for down-sampling, or obtaining a certain pixel of multiple reference brightness pixels at the corresponding position of the reference chroma pixel, or other down-sampling methods.
  • the color format information indicates 4:2:0 sampling
  • it needs to be down-sampled to an area of 4 ⁇ 2 pixel size as mentioned above
  • FIG. 7A (a) represents the reference brightness information refY
  • the bold box in (a) is the four brightness pixels corresponding to the same chroma pixel
  • (k, l) is the corresponding upper left corner pixel position.
  • the bold box in (b) is a certain brightness pixel after downsampling, and the same chroma pixel corresponding to the four brightness pixels in the bold box in (a) is the brightness and chroma at the same position.
  • the upsampling process mentioned in the processing of the first case is as follows: for the reference brightness information refY of the refNum number obtained from the adjacent area, the upsampling of the reference chroma information refC can use linear interpolation or nonlinearity
  • the embodiments of this application do not limit any upsampling methods such as interpolation, copying a certain reference chroma pixel, or other upsampling methods.
  • the color format information indicates 4:2:0 sampling
  • the adjacent area of 4 ⁇ 2 chroma pixel size it needs to be upsampled to an area of 8 ⁇ 4 pixel size, as shown in the figure As shown in 7B.
  • (a) represents the reference chromaticity information refC
  • (b) represents the upsampled reference chromaticity information refC'.
  • the four chroma pixels in the bold box in (b) are the upsampled chroma pixels corresponding to the bold box in (a), and (i, j) is the pixel position of the upper left corner.
  • the pixels in refC’ need to be linearly interpolated through adjacent points in the horizontal direction, for example:
  • offset 1 ⁇ (shift-1).
  • shift 1 ⁇ (shift-1).
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • coefficient combination is an example of a commonly used coefficient combination:
  • the pixels in refC’ need to be linearly interpolated through adjacent points in the vertical direction, for example:
  • offset 1 ⁇ (shift-1).
  • shift 1 ⁇ (shift-1).
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • ⁇ w0,w1,w2,w3,w4,w5,w6,w7 ⁇ and shift different choices can be made according to the block size or block content.
  • coefficient combination is an example of a commonly used coefficient combination:
  • the size reduction operation process mentioned in the processing of the first case is as follows: taking reference brightness information as an example, the amount of reference brightness information obtained from adjacent areas is refYnum.
  • the refYnum reference brightness pixels are arranged into a one-dimensional vector according to a certain position relationship, and then fixed-interval point selection is performed based on the size relationship between inSize and refYnum, which can reduce the size of the reference brightness information. .
  • the arrangement as a one-dimensional vector and the starting position selected at a fixed interval can be set freely, and the embodiments of the present application do not impose any restrictions.
  • the reference brightness information refY obtained in the "L"-shaped reference area of one row and one column can be rearranged according to the positional relationship from the lower left to the upper left, and then from the upper left to the upper right as One-dimensional vector refY'.
  • the refYnum reference brightness pixels are arranged into a one-dimensional vector according to a certain position relationship, and then inSize pixels are continuously selected from a certain position of the one-dimensional vector, which is in_refY.
  • in_refY a certain position of the one-dimensional vector
  • the operation process of enlarging the size mentioned in the processing of the first case is as follows: taking reference chromaticity information as an example, the number of reference chromaticity information obtained from adjacent areas is refCnum.
  • the refCnum reference chromaticity pixels are arranged into a one-dimensional vector according to a certain position relationship, and then points are selected at fixed intervals according to the size relationship between inSize and refCnum, so that the reference chromaticity information can be enlarged. size.
  • the arrangement into a one-dimensional vector and the starting position of the fixed-interval interpolation can be set freely, and are not subject to any limitations in the embodiments of this application. After refY is arranged in a manner similar to reducing the size, a one-dimensional vector refY' is obtained.
  • the second case If the number of reconstructed brightness information recY obtained from the current block (recSizeW ⁇ recSizeH) is different from the preset size (predSizeW ⁇ predSizeH) specified in the step of determining the core parameters, it is necessary to reconstruct the information obtained from the current block.
  • the amount of brightness information recY is converted into the preset size (predSizeW ⁇ predSizeH) specified in the step of determining the WCP core parameters for input.
  • the process is as follows:
  • recSizeW is greater than predSizeW, or recSizeH is greater than predSizeH, the reconstructed brightness information recY needs to be reduced in size.
  • recSizeW is smaller than predSizeW, or recSizeH is smaller than predSizeH, the reconstructed brightness information recY needs to be enlarged.
  • the size reduction operation process mentioned in the processing of the second case is as follows: first, calculate the horizontal downsampling factor downHor based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed brightness information recY; it is also determined based on the core parameters. The height predSizeH and the height recSizeH of the reconstructed brightness information recY are calculated to obtain the vertical downsampling factor downVer.
  • the calculation method is as follows:
  • the operation process of enlarging the size mentioned in the processing of the second case is as follows: first, calculate the horizontal upsampling factor upHor based on the width predSizeW determined by the core parameters and the width recSizeW of the reconstructed brightness information recY; it is also determined based on the core parameters The height predSizeH and the height recSizeH of the reconstructed brightness information recY are calculated to obtain the vertical upsampling factor upVer.
  • the calculation method is as follows:
  • in_recY is equally divided into recSizeW ⁇ recSizeH sub-blocks, and the position placed is the lower right corner of each sub-block.
  • the diagonal filling is the upper reference reconstructed brightness pixel refY_T
  • the vertical bar filling is the left reference reconstructed brightness pixel refY_L
  • the grid filling is The position where the reconstructed brightness information recY of the current block is filled.
  • the upsampling method uses linear interpolation upsampling, that is, the value of each interpolated point (bar filling) between two upsampling brightness reference points (grid filling) is the weighted average of the two upsampling reference brightness points. .
  • the weight of the upsampling reference chromaticity point on the left is (upHor-dX)/upHor
  • FIG 14 shows an example of weights.
  • upHor 4.
  • the weight of the upsampling reference chroma point on the left is 3/4, and the weight of the upsampling reference chroma point on the right is 1/4;
  • the weight of the upsampling reference chroma point on the left is 2/4, and the weight of the upsampling reference chroma point on the right is 2/4;
  • the weight of the upsampling reference chroma point on the left is 2/4.
  • the upsampling method also uses linear interpolation.
  • the weight of the upper upsampling reference point is (upVer-dY)/upVer
  • the weight is only related to the vertical upsampling factor upVer.
  • the final in_recY can be obtained according to the above process.
  • the reconstructed brightness value after "first vertical and then horizontal” upsampling is averaged to obtain the final input reconstructed brightness value in_recY.
  • the convolution operation in the neural network can also be used to replace the upsampling operation.
  • the embodiment of the present application does not do anything in this regard. limited.
  • the final acquired input target information may include: inSize number of reference chroma information refC, inSize number of reference brightness information refY, and reconstructed brightness information recY of the current prediction block.
  • S1103 Perform weight-based chroma prediction calculation according to the target information to determine the prediction block of the current block.
  • predSizeH and predSizeW are core parameters, which can be the same as or different from the height nTbH or width nTbW of the current block. In this way, under certain conditions, the following calculations can also be performed on only some of the pixels to be predicted in the current block.
  • the chroma prediction calculation in WCP mode may include the following operations: obtaining weights and performing weighted prediction based on the weights to obtain weight-based chroma prediction values.
  • the process of obtaining the weight includes constructing the brightness difference vector and calculating the weight. The detailed calculation process is as follows:
  • FIG. 16 shows a schematic flowchart 3 of a decoding method provided by an embodiment of the present application.
  • the method may include:
  • S1601 For each pixel to be predicted, construct a brightness difference vector using the reference chroma information, the reference brightness information included in the target information, and the reconstructed brightness information of the current block.
  • abs(x) represents the absolute value of x.
  • linear or nonlinear numerical processing can be performed on the brightness difference vector of the pixel to be predicted.
  • the value of the brightness difference vector of the pixel to be predicted can be scaled according to the control parameter S in the core parameter.
  • S1602 For each pixel to be predicted, use a nonlinear function to calculate a weight vector according to the brightness difference vector.
  • a weight model is used to process the brightness difference vector diffY[i][j] corresponding to each pixel to be predicted C pred [i][j] to obtain the corresponding floating point weight.
  • the weight model here includes but is not limited to nonlinear functions such as nonlinear normalization functions, nonlinear exponential normalization functions, etc., without any limitation.
  • the nonlinear Softmax function can be used as the weight model
  • the brightness difference vector diffY[i][j] corresponding to each pixel to be predicted is used as the input of the weight model
  • the weight model outputs the floating point corresponding to each pixel to be predicted.
  • Type weight vector cWeightFloat[i][j] the calculation formula is as follows:
  • the weight model can also be adjusted according to the control parameters (S) in the core parameters. For example, if the size of the current block is flexible, the weight model can be adjusted according to the control parameter (S). Taking the nonlinear Softmax function as an example, different control parameters can be selected to adjust the function according to the block classification category to which the current block belongs. , at this time, the weight vector calculation formula corresponding to each pixel to be predicted is as follows:
  • the weighting coefficient can also be fixed-point processed. Therefore, in some embodiments, the method further includes: if the weighting coefficient is a floating-point weighting coefficient, performing fixed-point processing on the floating-point weighting coefficient to obtain a fixed-point weighting coefficient.
  • cWeightFloat can be fixed-point processed, as follows:
  • round(x) Sign(x) ⁇ Floor(abs(x)+0.5).
  • Floor(x) represents the largest integer less than or equal to x
  • abs(x) represents the absolute value of x.
  • Shift is the shift amount set in the fixed-point operation to improve accuracy.
  • the chroma prediction value of the 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 chroma information refC.
  • the reference chromaticity information refC of each pixel to be predicted C pred [i][j] is multiplied one by one by the weight vector elements corresponding to each pixel to be predicted to obtain subC[i][j] (or subCFloat[ i][j]), the multiplication results are accumulated to obtain the chroma prediction value C pred [i][j] of each pixel to be predicted, that is, weighted prediction of the chroma component is achieved.
  • this may include: performing weighted calculations based on floating-point weighting coefficients and reference chromaticity information to obtain the initial prediction value of the pixel to be predicted; performing fixed-point processing on the initial prediction value to obtain the target of the pixel to be predicted. Predictive value.
  • calculation formula is as follows:
  • subCFloat[i][j][k] can also be fixed-point processed. In order to retain a certain calculation accuracy during the fixed-point process, it can be multiplied by a coefficient, as shown below:
  • C pred Float[i][j] is fixed-pointed, such as:
  • a weighted calculation can be performed based on the fixed-point weighting coefficient and the reference chromaticity information to obtain the initial prediction value of the pixel to be predicted; the initial prediction value is subjected to fixed-point compensation processing to obtain the target prediction of the pixel to be predicted. value.
  • calculation formula is as follows:
  • Offset 1 ⁇ (Shift 1 -1)
  • the chroma prediction value should be limited to a preset range. If it exceeds the preset range, corresponding corrective operations are required. For example, in a possible implementation, a clamping operation can be performed on the chroma prediction value of C pred [i][j], as follows:
  • BitDepth is the bit depth required for the chroma pixel value to ensure that all chroma prediction values in the prediction block are between 0 and (1 ⁇ BitDepth)-1.
  • S1104 Perform post-processing operations on the prediction block to determine the target prediction block of the current block.
  • predWcp chroma prediction value
  • predWcp can be smoothed and filtered as the final chroma prediction value predSamples.
  • a position-related correction process can be performed on predWcp. For example: use reference pixels with close spatial positions to calculate the chroma compensation value for each pixel to be predicted, use this chroma compensation value to correct predWcp, and use the corrected prediction value as the final chroma prediction value predSamples.
  • the chroma prediction values calculated by other chroma prediction modes can be weighted and fused with the chroma prediction value predWcp calculated by WCP, and this fusion result can be used as the final chroma prediction value predSamples .
  • the chroma prediction value predicted by CCLM mode and the chroma prediction value predWcp calculated by WCP can be weighted with equal or unequal weight, and the weighted result is used as the final chroma prediction value predSamples.
  • a neural network model can be used to modify the WCP prediction output predWcp, etc. This embodiment of the present application does not limit this in any way.
  • the reference chromaticity information redCref and the reference brightness information redYref of the inSize parameter size determined by the WCP mode have been obtained, and the (predSizeW ⁇ predSizeH) parameter size determined by the WCP mode Reconstructed brightness information redYrec of the current block. Since some of the above three information have been subjected to upsampling, downsampling or size reduction/enlargement operations, or have not undergone these operations, there is still spatial redundancy between them. At this time, the reference chroma information redCref, the reference brightness information redYref and the reconstructed brightness information redYrec can be filtered.
  • RedCref' reference chroma information
  • redYref' reference brightness information
  • redYrec' reconstructed brightness information
  • these filtering operations can also occur before upsampling, downsampling or size reduction/enlargement operations to obtain three new sets of information, including reference chroma information refC', reference luminance information refY' and reconstructed luminance information recY' , and then upsample, downsample or reduce/enlarge the size.
  • the number of reference chroma information refC obtained from the adjacent area is refSizeC
  • the number of reference brightness information refY is refSizeY
  • the size of the reconstructed brightness information recY obtained from the current block is recSizeW ⁇ recSizeH
  • recSizeW is the block width of reconstructed brightness information recY
  • recSizeH is the block height of reconstructed brightness information recY.
  • the filtering operations involved in the foregoing embodiments can also be performed before or after using the neural network model to obtain three new sets of information, including reference brightness information, reference chroma information and reconstructed brightness information.
  • the core parameters include but are not limited to control parameters (S), the number of weight-based chroma prediction inputs inSize[i][j], and the number of weight-based chroma prediction outputs (predWcp) (arranged as predSizeW ⁇ predSizeH).
  • S control parameters
  • predWcp weight-based chroma prediction outputs
  • the reference chromaticity information refC and the reference brightness information refY are obtained from the adjacent area.
  • the obtained reference chroma information includes but is not limited to: the reference chroma reconstruction value of the upper area of the current block and the reference chroma reconstruction value of the left area.
  • the obtained reference brightness information includes but is not limited to obtaining the corresponding reference brightness information according to the position of the reference chrominance information.
  • the acquisition method includes but is not limited to obtaining the corresponding reconstructed brightness information according to the position of the chrominance information in the current block as the reconstructed brightness information of the current block.
  • Obtaining the input target information includes: acquiring inSize[i][j] amount of reference chroma information refC, acquiring inSize[i][j] amount of reference brightness information refY, and acquiring reconstructed brightness information recY[i][j].
  • the corresponding reconstructed brightness information recY[i][j] and the number of reference brightness inSize[i][j] are The information refY[i][j] is subtracted and the absolute value is obtained to obtain the brightness difference vector diffY[i][j][k]. Among them, refY[i][j] is the pixel to be predicted The corresponding set of reference brightness vectors. The detailed calculation process is as follows:
  • linear or nonlinear numerical processing can be performed on the brightness difference vector of the pixel to be predicted.
  • the value of the brightness difference vector of the pixel to be predicted can be scaled according to the control parameter S in the core parameter.
  • the chromaticity prediction value of the pixel to be predicted is calculated based on the weight vector cWeight[i][j] corresponding to each pixel to be predicted and the reference chromaticity information refC.
  • the reference chroma information refC[i][j] of each pixel to be predicted C pred [i][j] is multiplied one by one by the weight vector elements corresponding to each pixel to be predicted to obtain subC[i][ j], the multiplication results are accumulated to obtain the chroma prediction value C pred [i][j] of each pixel to be predicted (ie, weighted prediction).
  • refC[i][j] is a set of reference chromaticity vectors corresponding to the pixel C pred [i][j] to be predicted.
  • the calculation formula is as follows:
  • subCFloat can be fixed-pointed. In order to retain a certain calculation accuracy during the fixed-pointing process, it can also be multiplied by a coefficient, as shown in the following formula:
  • adjacent areas are the same as those used in other existing chroma prediction modes, which will inevitably affect the prediction accuracy. Therefore, adjacent areas can also be changed.
  • the existing multi-reference row technology in H.266 can be used to extend the reference area of the WCP prediction technology. As shown in Figure 17, it can be extended to 0, 1, 2, 3, 4, 5, and 6. , 7 and other adjacent areas of multiple rows or columns are used as the reference area of the current block; however, it is not limited to this technology, and the reference rows or reference columns can also be increased or decreased, which is not specifically limited in the embodiment of the present application.
  • This embodiment provides a decoding method.
  • the specific implementation of the foregoing embodiment is described in detail. It can be seen that according to the technical solution of the foregoing embodiment, the accuracy of the WCP prediction technology can be improved.
  • different processing methods are adopted according to the current different color format information or different amounts of acquired information, including upsampling, downsampling, Filtering methods such as size reduction and size enlargement are used to match the obtained information with the amount of information specified by the WCP, complete the correction process of the target information, and then obtain the final chromaticity prediction value.
  • FIG. 18 shows a schematic flowchart 1 of an encoding method provided by an embodiment of the present application. As shown in Figure 18, the method may include:
  • the encoding method in the embodiment of the present application is applied to an encoding device, or an encoding device (which may also be referred to as an "encoder" for short) integrated with the encoding device.
  • the encoding method in the embodiment of the present application may specifically refer to an intra-frame prediction method, and more specifically, a pre-processing operation method for weight-based chroma prediction.
  • the video image may be divided into multiple coding blocks, and each coding block may include a first color component, a second color component, and a third color component
  • the current block here refers to the current block to be processed in the video image. Coding block for intra prediction.
  • the current block predicts the first color component
  • the first color component is a brightness component
  • the component to be predicted is a brightness component
  • the current block can also be called a brightness prediction block
  • the current block predicts the second color Component prediction
  • the second color component is a chroma component, that is, the component to be predicted is a chroma component
  • the current block can also be called a chroma prediction block.
  • the reference information of the current block may include the value of the first color component sampling point in the adjacent area of the current block and the second color component in the adjacent area of the current block.
  • the value of the sampling point can be determined based on the coded pixels in the adjacent area of the current block.
  • the adjacent area of the current block may include at least one of the following: an upper adjacent area, an upper right adjacent area, a left adjacent area, and a lower left adjacent area.
  • the reference information of the current block may also include the reconstructed value of the first reference color component sampling point in the current block. Therefore, in some embodiments, determining the reference information of the current block may include:
  • the value of the second color component sampling point in the adjacent area of the current block and the reconstructed value of the first reference color component sampling point in the current block determine the reference information of the current block.
  • the reference pixel of the current block may refer to the reference pixel point adjacent to the current block, and may also be called the first color component sampling point, the first color component sampling point, and the third color component sampling point in the adjacent area of the current block.
  • the second color component sampling point is represented by Neighboring Sample or Reference Sample.
  • the adjacency here may be spatial adjacency, but is not limited to this.
  • adjacency can also be adjacent in time domain, adjacent in space and time domain, and even the reference pixel of the current block can be a certain reference pixel point adjacent in space, adjacent in time domain, or adjacent in space and time domain.
  • the reference pixels obtained after such processing are not limited in any way by the embodiments of this application.
  • the first color component is the brightness component
  • the second color component is the chrominance component.
  • the value of the first color component sampling point in the adjacent area of the current block is represented by the reference brightness information corresponding to the reference pixel of the current block
  • the value of the second color component sampling point in the adjacent area of the current block is represented by It is the reference chromaticity information corresponding to the reference pixel of the current block.
  • S1802 Filter part of the information in the reference information of the current block to determine the target information of the current block.
  • the values of the sampling points of the first color component are filtered, or the values of the sampling points of the second color component are filtered so that the numbers of the two are the same.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include: sampling the first color component sampling point in the adjacent area of the current block Perform the first filtering process on the value of , and obtain the filtered sample value of the first color component in the adjacent area of the current block;
  • Target information of the current block is determined based on filtered samples of the first color component in adjacent areas of the current block.
  • the number of filtered samples of the first color component in the adjacent area of the current block is equal to L, where L represents the value of the second color component sampling point in the adjacent area of the current block.
  • L is a positive integer.
  • the first filtering process may be a downsampling filtering process.
  • the amount of reference luminance information of the current block is usually greater than the amount of reference chrominance information. Therefore, the reference luminance information of the current block can be down-sampled and filtered so that the amount of reference luminance information is equal to that of the reference chrominance information.
  • the quantity is the same.
  • the method may also include: based on the color format information, Perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block to obtain the filtered sample value of the first color component in the adjacent area of the current block.
  • the first filtering process may also include:
  • color format information indicates 4:2:2 sampling, perform downsampling filtering on the value of the first color component sampling point in the adjacent area of the current block;
  • color format information indicates 4:2:0 sampling, then perform downsampling filtering on the value of the first color component sampling point in the adjacent area of the current block.
  • the down-sampling rate is the reciprocal of a positive integer multiple of 2.
  • a multi-tap filter (such as a four-tap filter, a five-tap filter, a six-tap filter, etc.) can be used for down-sampling, or to obtain A certain pixel of multiple reference brightness pixels at the corresponding position of the reference chrominance pixel may even be another downsampling method, which is not specifically limited in the embodiment of the present application.
  • the method may further include:
  • the second filtering is performed on the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the filtered sample value of the first color component in the adjacent area of the current block and the second color component in the adjacent area of the current block are Performing a second filtering process on the value of the sampling point 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 may include:
  • the first sub-filtering is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • the second sub-filtering is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. Processing determines a filtered adjacent sample of a first color component of the current block and a filtered adjacent sample of a second color component of the current block.
  • the preset number may be represented by inSize. Specifically, if L is equal to the preset number, then no operation is required; if L is greater than the preset number, then the first sub-filtering process (ie, size reduction) needs to be performed on the reference brightness information and reference chrominance information; if L If the number is less than the preset number, then the second sub-filtering process (ie, enlarging the size) needs to be performed on the reference brightness information and the reference chrominance information.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include: sampling the second color component in the adjacent area of the current block. The value of the point is subjected to a third filtering process to obtain the filtered sample value of the second color component in the adjacent area of the current block;
  • Target information of the current block is determined based on filtered samples of the second color component in adjacent areas of the current block.
  • the number of filtered samples of the second color component in the adjacent area of the current block is equal to K, where K represents the value of the first color component sampling point in the adjacent area of the current block.
  • K is a positive integer.
  • the third filtering process is an upsampling filtering process.
  • the amount of reference luminance information of the current block is usually greater than the amount of reference chrominance information. Therefore, the reference chrominance information of the current block can also be upsampled and filtered, so that the amount of reference luminance information is equal to the reference chrominance information. The amount of information is the same.
  • the method may also include: based on the color format information, The value of the second color component sampling point in the area is subjected to a third filtering process to obtain the filtered sample value of the second color component in the adjacent area of the current block.
  • the third filtering process may also include:
  • color format information indicates 4:2:2 sampling, perform upsampling filtering on the value of the second color component sampling point in the adjacent area of the current block;
  • upsampling filtering is performed on the value of the second color component sampling point in the adjacent area of the current block.
  • the upsampling rate is a positive integer multiple of 2.
  • the reference chrominance information obtained from adjacent areas can be upsampled and filtered to match the amount of reference luminance information.
  • linear interpolation or nonlinear interpolation can be used to upsample, or a certain reference chroma pixel can be copied, or even other upsampling methods can be used.
  • the sampling method is not specifically limited in the embodiments of this application.
  • the method may further include:
  • the fourth filtering is performed on the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the value of the first color component sampling point in the adjacent area of the current block and the second color in the adjacent area of the current block are The fourth filtering process is performed on the filtered samples of the component to determine the filtered adjacent samples of the first color component of the current block and the filtered adjacent samples of the second color component of the current block, which may include:
  • the first sub-filtering is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing, determining filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block;
  • the second sub-filtering is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block. Processing determines a filtered adjacent sample of a first color component of the current block and a filtered adjacent sample of a second color component of the current block.
  • the preset number may be represented by inSize. Specifically, if K is equal to inSize, then no operation is required; if K is greater than inSize, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reference brightness information and reference chrominance information; if K is less than inSize, then the reference brightness information and reference chroma information need to be reduced in size.
  • the reference luminance information and the reference chrominance information are used to perform the second sub-filtering process (ie, enlarging the size).
  • the number of reference brightness information and the number of reference chroma information obtained from adjacent areas can also be directly matched with inSize to Make the quantities of both the same.
  • filtering part of the information in the reference information of the current block and determining the target information of the current block may include: determining the first color component sampling point in the adjacent area of the current block. The number of values is the first number;
  • a fifth filtering process is performed on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent samples of the first color component of the current block. value;
  • Target information of the current block is determined based on filtered adjacent samples of the first color component of the current block.
  • performing a fifth filtering process on the value of the first color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block may include :
  • the first number is greater than the preset number, then perform a first sub-filtering process on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the first color component of the current block.
  • the first number is less than the preset number, then perform a second sub-filtering process on the values of the first color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the first color component of the current block.
  • the number of reference brightness information obtained from adjacent areas can be matched with a preset number.
  • the number of reference brightness information obtained from adjacent areas ie, the first number
  • the preset number can be represented by inSize.
  • refYnum is equal to inSize, then no operation is required; if refYnum is greater than inSize, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reference brightness information; if refYnum is smaller than inSize, then the second sub-filtering process needs to be performed on the reference brightness information.
  • Two sub-filtering processes i.e. enlarging the size).
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may also include: determining the second color component in the adjacent area of the current block. The number of sampling point values is the second number;
  • a sixth filtering process is performed on the values of the second color component sampling points in the adjacent area of the current block to determine the filtered adjacent samples of the second color component of the current block. value;
  • Target information of the current block is determined based on filtered adjacent samples of the second color component of the current block.
  • performing a sixth filtering process on the value of the second color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the second color component of the current block may include :
  • the second number is greater than the preset number, then perform a first sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the second color component of the current block.
  • the second number is less than the preset number, then perform a second sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block to determine the filtered adjacent sample values of the second color component of the current block.
  • the number of reference chromaticity information obtained from adjacent areas can be matched with a preset number.
  • the number of reference chromaticity information obtained from adjacent areas ie, the second number
  • refCnum the number of reference chromaticity information obtained from adjacent areas
  • the preset number can be represented by inSize.
  • refCnum is equal to inSize, then no operation is required; if refCnum is greater than inSize, then the reference chromaticity information needs to be first sub-filtered (i.e., reduced in size); if refCnum is smaller than inSize, then the reference chromaticity information needs to be filtered Perform the second sub-filtering process (i.e. enlarge the size).
  • the first sub-filtering process may be a down-sampling filtering process.
  • the first sub-filtering process may also include at least one of the following:
  • the continuous position selection method is used for sub-filtering processing.
  • the second sub-filtering process may be an upsampling filtering process.
  • the second sub-filtering process may also include: performing sub-filtering processing using interpolation at fixed intervals.
  • the reference information of the current block may also include reconstructed luminance information of the current block. Therefore, the reference information of the current block can also be determined based on the reconstructed value of the first reference color component sampling point in the current block.
  • the first reference color component may be a brightness component; then, the reconstructed value of the first reference color component sampling point in the current block is the reconstructed brightness information of the current block. Since the amount of reconstructed brightness information of the current block is different from the preset size, the reconstructed brightness information of the current block also needs to be filtered to convert the amount of reconstructed brightness information obtained from the current block into the preset size for input.
  • the preset size is predSizeW ⁇ predSizeH; where predSizeW represents the width of the prediction block, and predSizeH represents the height of the prediction block.
  • filtering part of the information in the reference information of the current block to determine the target information of the current block may include: performing seventh filtering on the reconstructed value of the first reference color component sampling point in the current block. Processing: determine the filtered sample value of the first reference color component sampling point in the current block; determine the target information of the current block based on the filtered sample value of the first reference color component sampling point in the current block.
  • performing a seventh filtering process on the reconstructed value of the first reference color component sampling point in the current block to determine the filtered sample value of the first reference color component sampling point in the current block may include:
  • a third sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color in the current block. Filtered samples of component sampling points;
  • a fourth sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color in the current block.
  • the filtered sample value of the component sample point is the fourth sub-filtering process.
  • recSizeW represents the first width and recSizeH represents the first height.
  • recSizeW is equal to predSizeW
  • recSizeH is equal to predSizeH
  • no operation is required; if recSizeW is greater than predSizeW, or recSizeH is greater than predSizeH, then the first sub-filtering process (i.e., size reduction) needs to be performed on the reconstructed brightness information; if recSizeW is less than If predSizeW or recSizeH is smaller than predSizeH, then the second sub-filtering process (i.e. enlarging the size) needs to be performed on the reconstructed brightness information.
  • the third sub-filtering process may be a down-sampling filtering process.
  • the third sub-filtering process may also include at least one of the following:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to downsampling filtering in the horizontal direction and then downsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to down-sampling filtering in the vertical direction and then down-sampling and filtering is performed in the horizontal direction.
  • the horizontal downsampling factor can be calculated based on recSizeW and predSizeW
  • the vertical downsampling factor can be calculated based on recSizeH and predSizeH
  • the reconstructed brightness information is downsampled and filtered based on the horizontal downsampling factor and vertical downsampling factor.
  • the horizontal down-sampling factor is greater than 1 and the vertical down-sampling factor is equal to 1, then only the reconstructed brightness information needs to be down-sampled in the horizontal direction; if the horizontal down-sampling factor is equal to 1 and the vertical down-sampling factor is greater than 1, then only The reconstructed brightness information needs to be down-sampled in the vertical direction; if the horizontal down-sampling factor is greater than 1 and the vertical down-sampling factor is greater than 1, then the reconstructed brightness information needs to be down-sampled in both the horizontal and vertical directions.
  • the fourth sub-filtering process is an upsampling filtering process.
  • the fourth sub-filtering process may also include at least one of the following:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the horizontal direction and then upsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the vertical direction and then upsampling and filtering is performed in the horizontal direction.
  • the horizontal upsampling factor is first calculated based on recSizeW and predSizeW, and the vertical upsampling factor is calculated based on recSizeH and predSizeH; then, the reconstructed brightness information is upsampled and filtered based on the horizontal upsampling factor and the vertical upsampling factor.
  • the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is equal to 1, then only the reconstructed brightness information needs to be upsampled in the horizontal direction; if the horizontal upsampling factor is equal to 1 and the vertical upsampling factor is greater than 1, then only The reconstructed brightness information needs to be upsampled in the vertical direction; if the horizontal upsampling factor is greater than 1 and the vertical upsampling factor is greater than 1, then the reconstructed brightness information needs to be upsampled in both the horizontal and vertical directions. Among them, you can perform horizontal first You can also perform upsampling in the vertical direction first and then the horizontal direction.
  • the reference information of the current block may include: the value of the first color component sampling point in the adjacent area of the current block, the second color component sample in the adjacent area of the current block The value of the point and the reconstructed value of the first reference color component sampling point in the current block;
  • 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 value and the filtered sample value of the first reference color component sample point in the current block.
  • the filtered adjacent sample value of the first color component of the current block is equal to the first color component in the adjacent area of the current block.
  • the value of a color component sampling point similarly, if the value of the second color component sampling point in the adjacent area of the current block does not need to be filtered, then the filtered adjacent sample value of the second color component of the current block Equal to the value of the second color component sampling point in the adjacent area of the current block; if the reconstructed value of the first reference color component sampling point in the current block does not require filtering, then the first reference color component sampling point in the current block
  • the filtered sample value of is equal to the reconstructed value of the first reference color component sampling point in the current block.
  • the obtained target information may include: filtered adjacent samples of the first color component of the current block, filtered adjacent samples of the second color component of the current block, and filtered samples of the first reference color component in the current block.
  • Sample values that is: inSize number of reference chroma information, inSize number of reference luminance information and reconstructed luminance information that conforms to the preset size.
  • S1803 Determine the weighting coefficient according to the reference sample value of the first color component in the target information.
  • the method may further include: setting the reference sample value of the first color component in the target information to the filtered adjacent sample value of the first color component of the current block and the first reference color in the current block. The absolute value of the difference between the filtered samples of the component sample points.
  • the method may further include: setting the reference sample of the second color component in the target information to a filtered adjacent sample of the second color component of the current block.
  • the method may also include: setting the reference sample value of the first color component in the target information to the value of the first color component sampling point in the adjacent area of the current block and the value of the first color component sampling point in the current block.
  • the absolute value of the difference between the reconstructed values of a reference color component sampling point; or, the reference sample value of the first color component in the target information is set to the filtered adjacent sample value of the first color component of the current block and the filtered adjacent sample value of the current block.
  • determining the weighting coefficient based on the reference sample of the first color component in the target information may include:
  • the reference sample of the first color component may be the filtered adjacent sample of the first color component of the current block and the filtered sample of the first reference color component sampling point in the current block.
  • the absolute value of the difference is a first color component
  • the first color component is a color component different from the second color component to be predicted in this embodiment of the present application.
  • At least one pixel to be predicted in the current block can be selected, and its reconstructed brightness and the reference value in the adjacent area can be calculated respectively.
  • the difference in brightness between brightnesses (expressed by
  • if
  • are approximately inversely proportional.
  • determining the value corresponding to the reference sample of the first color component under the preset mapping relationship may include: determining the first factor; sample value, determine the first product value; determine the corresponding value of the first product value under the preset mapping relationship.
  • determining the first factor may include: the first factor is a preset constant value.
  • determining the first factor may include: determining the value of the first factor according to the size parameter of the current block.
  • the method may further include: determining the value of the first factor according to a preset mapping lookup table between the size parameter of the current block and the value of the first factor.
  • the size parameter of the current block may include at least one of the following parameters: the width of the current block, the height of the current block, and the product of the width and height of the current block.
  • a classification method may be used to fix the value of the first factor.
  • the current block size parameter is divided into three categories, and the value of the first factor corresponding to each category is determined.
  • Table 1 shows a schematic diagram of the correspondence between the first factor and the size parameter of the current block.
  • determining the first factor may include: determining the value of the first factor based on the number of reference pixels in the current block.
  • the method may further include: determining the value of the first factor according to a preset mapping lookup table between the number of reference pixels of the current block and the value of the first factor.
  • this embodiment of the present application can divide the number of reference pixels into three categories, and still use a classification method to fix the value of the first factor.
  • Table 2 shows a schematic diagram of the correspondence between the first factor and the number of reference pixels of the current block.
  • determining the first product value based on the first factor and the reference sample of the first color component may include:
  • the first product value is set to a value obtained by adding and bit-shifting the reference sample of the first color component according to the first factor.
  • the first factor is equal to 0.25 and the reference sample value of the first color component is represented by Ref
  • the first product value can be equal to 0.25 ⁇ Ref
  • 0.25 ⁇ Ref can be expressed as Ref/4, that is, Ref>> 2.
  • floating-point numbers may be converted into addition and displacement operations; that is to say, for the first product value, there are no restrictions on its calculation method.
  • the first reference color component can also be a chrominance component, that is, at least one to-be-predicted pixel with obvious color difference in the current block is selected, and its reconstructed chromaticity and the pixel in the adjacent area are respectively calculated.
  • the chromaticity difference between reference chromaticities (expressed as
  • the reference sample value of the first color component it can be
  • the preset multiplier here is the second factor described in the embodiment of this application.
  • the method may also include: performing a least squares calculation based on the first color component value of the reference pixel and the second color component value of the reference pixel, determining Second factor.
  • the second factor can be calculated by performing least squares calculation on the chrominance component values and brightness component values of the N reference pixels. For example, the least squares regression calculation is as shown in the aforementioned equation (5).
  • the preset mapping relationship may be a preset functional relationship.
  • the preset mapping relationship may be a Softmax function, as shown in the aforementioned equation (6) or equation (7).
  • the Softmax function is a normalized exponential function, but the embodiment of the present application may not require normalization, and its value is not limited to the range [0,1].
  • the preset mapping relationship may be a weighted function that has an inverse relationship with the reference sample value of the first color component, such as the aforementioned equation (8) or equation (9) shown.
  • the preset mapping relationship can be as shown in Equation (4), as shown in Equation (6) or Equation (7), as shown in Equation (8) or Equation (9), or even It can be that the closer the reference brightness value of other reference pixels to the brightness reconstruction value of the pixel to be predicted in the current block is, the more important the reference chromaticity value of the reference pixel is to the pixel to be predicted in the current block.
  • Function model, etc. in addition, the preset mapping relationship can also be a preset look-up table method, such as using an array element look-up table method to reduce a part of the calculation operations, etc., and the embodiments of this application are not specifically limited. .
  • the weighting coefficient can be determined according to the reference sample value of the first color component (for example
  • N represents The number of reference samples for the second color component.
  • the sum of these N weighting coefficients is equal to 1, and each weighting coefficient is a value greater than or equal to 0 and less than or equal to 1.
  • S1804 Determine 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.
  • S1805 Determine the prediction difference value of the second color component sampling point of the current block according to the prediction block.
  • the weighting coefficient can be used to perform weighted calculation on the reference sample value of the second color component, thereby obtaining the predicted value of the second color component sampling point in the prediction block.
  • determining the prediction block of the second color component of the current block according to the weighting coefficient and the reference sample value of the second color component in the target information may include:
  • the predicted value of the second color component sampling point in the prediction block is set equal to the 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.
  • the first color component is the brightness component
  • the second color component is the chrominance component. Since the resolution of the brightness component and the resolution of the chrominance component are different, in this case, the luminance component may be subjected to downsampling filtering to align the resolution of the chrominance component, or the chrominance component may be subjected to upsampling filtering to align the resolution of the luminance component.
  • the method may further include: performing a correction operation on the predicted value of the second color component sampling point in the prediction block, and determining the prediction block of the second color component of the current block.
  • the preset range may be between: 0 and (1 ⁇ BitDepth)-1. If the predicted value exceeds the preset range, the predicted value needs to be corrected accordingly. For example, one can A clamping operation is performed to ensure that the predicted values of all second color component sampling points in the prediction block are between 0 and (1 ⁇ BitDepth)-1.
  • the prediction block also requires post-processing operations under certain conditions to serve as the final prediction block. Therefore, in some embodiments, the method may further include:
  • Correlation processing is performed on the prediction block, and the processed prediction block is used as the prediction block of the second color component of the current block.
  • performing correlation processing on the prediction block may include: performing filtering enhancement processing on the prediction block, and using the processed prediction block as the prediction block of the second color component of the current block.
  • performing correlation processing on the prediction block may include: determining the compensation value of the second color component of the prediction block based on the reference sample value in the adjacent area of the current block; The predicted value of the second color component sampling point in the block is corrected to determine the predicted block of the second color component of the current block.
  • performing correlation processing on the prediction block may include: performing prediction processing on the second color component sampling points in the prediction block according to at least one prediction mode, and determining the second color component in the prediction block. At least one initial prediction value of the sampling point; perform a weighted fusion process based on the at least one initial prediction value and the prediction value of the second color component sampling point in the prediction block to determine the prediction block of the second color component of the current block.
  • the prediction block in order to reduce the instability caused by WCP pixel-by-pixel independent parallel prediction, the prediction block can be smoothed and filtered as the final chroma prediction value.
  • a position-related correction process can be performed on the prediction block. For example: use reference pixels with close spatial positions to calculate the chroma compensation value for each pixel to be predicted, use this chroma compensation value to correct the prediction block, and use the corrected prediction value as the final chroma prediction value.
  • the chroma prediction value calculated by other chroma prediction modes can be weighted and fused with the chroma prediction value calculated by WCP, and the fusion result can be used as the final chroma prediction value.
  • a neural network model can be used to correct the chromaticity prediction value calculated by the WCP, etc. This embodiment of the present application does not impose any limitation on this.
  • S1901 Determine the predicted value of the second color component sampling point of the current block according to the predicted block.
  • S1902 Determine the predicted difference value of the second color component sampling point of the current block based on the original value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.
  • S1903 Encode the prediction difference value of the second color component sampling point of the current block, and write the resulting encoded bits into the code stream.
  • the prediction block may include prediction values of at least some of the second color component sampling points in the current block.
  • the prediction block contains the predicted values of all the second color component sampling points in the current block, then the predicted values of the second color component sampling points of the current block can be set equal to the value of the prediction block; if the prediction block contains the prediction values of the second color component sampling points in the current block, If the prediction value of some of the second color component sampling points is determined, upsampling filtering can be performed on the value of the prediction block, and the predicted value of the second color component sampling point of the current block is set equal to the output value after upsampling and filtering.
  • the second color component sampling point can be determined based on the original value of the second color component sampling point and the predicted value of the second color component sampling point.
  • the predicted difference value of the color component sampling point may be calculated by subtracting the original value of the second color component sampling point and the predicted value of the second color component sampling point, so as to determine the second color component sampling point of the current block. Forecast difference.
  • the prediction difference value of the second color component sampling point can be obtained through decoding at the decoding end in order to restore the second color component of the current block. The reconstructed value of the sampling point.
  • the embodiment of the present application proposes a weight-based chroma prediction technology 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 areas of the current block, the current block information and the current color format information are analyzed and processed.
  • the reference brightness information, reference chroma information and reconstructed brightness information in the current block can be matched with the preset size of the core parameters through different enlargement/reduction operations, which can improve the accuracy of WCP prediction technology.
  • Embodiments of the present application also provide an encoding method that determines the reference information of the current block; performs filtering processing on part of the information in the reference information of the current block to determine the target information of the current block; and determines the target information of the current block according to the first color component in the target information.
  • the reference sample value of the current block is used to determine the weighting coefficient; according to 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; according to the prediction block, the second color component of the current block is determined The predicted difference of the sampling points.
  • the accuracy of the reference information can be improved due to the full consideration of the characteristics of the color format information; and by upgrading the reference information Filtering processes such as sampling and downsampling can also enhance the continuity of spatial correlation to a certain extent or remove some information with weak spatial correlation.
  • the target information obtained after filtering can be used to better perform chromaticity analysis. prediction, thereby improving the accuracy of chroma prediction, saving bit rate, and improving encoding and decoding performance.
  • the embodiment of the present application also provides a code stream, which is generated by bit encoding according to the information to be encoded; wherein the information to be encoded at least includes: the second color of the current block Predicted difference of component sample points.
  • the decoding end obtains the prediction difference value of the second color component sampling point through decoding, and then combines it with the current block
  • the predicted value of the second color component sampling point of the current block can be recovered, so that the reconstructed value of the second color component sampling point of the current block can be restored.
  • the accuracy of the reference information of adjacent areas is improved; and the spatial correlation is fully utilized to upsample and downsample the reference information of adjacent areas and the reconstructed brightness information of the current block. , enlarge size, reduce size and other filtering processes, which not only improves the accuracy of chroma prediction, saves bit rate, but also improves encoding and decoding performance.
  • FIG. 20 shows a schematic structural diagram of an encoding device 300 provided by an embodiment of the present application.
  • the encoding device 300 may include: a first determination unit 3001, a first filtering unit 3002, and a first prediction unit 3003; wherein,
  • the first determining unit 3001 is configured to determine the reference information of the current block
  • the first filtering unit 3002 is configured to filter part of the information in the reference information of the current block and determine the target information of the current block;
  • the first determination unit 3001 is further configured to determine the weighting coefficient according to the reference sample of the first color component in the target information
  • the first prediction unit 3003 is configured to determine 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;
  • the first determination unit 3001 is further configured to determine the prediction difference value of the second color component sampling point of the current block according to the prediction block.
  • the prediction block contains predicted values of at least some of the second color component sample points in the current block.
  • the first determining unit 3001 is also configured to determine the value of the first color component sampling point in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. and the reconstructed value of the first reference color component sampling point in the current block to determine the reference information of the current block.
  • the adjacent area of the current block includes at least one of the following: an upper adjacent area, an upper right adjacent area, a left adjacent area, and a lower left adjacent area.
  • the first filtering unit 3002 is further configured to perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block to obtain the first value of the first color component sampling point in the adjacent area of the current block. filtered samples of color components; and determining target information of the current block based on filtered samples of the first color component in adjacent areas of the current block.
  • the number of filtered samples of the first color component in the adjacent area of the current block is equal to L, where L represents the number of values of the second color component sampling points in the adjacent area of the current block. , L is a positive integer.
  • the first filtering process is a downsampling filtering process.
  • the first filtering unit 3002 is further configured to perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block based on the color format information to obtain the adjacent area of the current block. The filtered sample of the first color component in the region.
  • the first filtering unit 3002 is also configured to downsample the value of the first color component sampling point in the adjacent area of the current block if the color format information indicates 4:2:0 sampling. Filtering; where the downsampling rate is the reciprocal of a positive integer multiple of 2.
  • the first filtering unit 3002 is further configured to compare L with a preset number; and based on the comparison result between L and the preset number, filter the first color component in the adjacent area of the current block. Perform a second filtering process on the filtered sample value and the second color component sampling point value in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block and the second color component of the current block. filtered adjacent samples; and determining target information of the current block based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the first filtering unit 3002 is also configured to, if L is greater than a preset number, filter samples of the first color component in the adjacent area of the current block and filter samples of the first color component in the adjacent area of the current block.
  • the values of the second color component sampling points are all subjected to the first sub-filtering process 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 L is less than the predetermined Assuming a number, the second sub-filtering process is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block to determine the current The filtered adjacent sample of the first color component of the block and the filtered adjacent sample of the second color component of the current block.
  • the first filtering unit 3002 is also configured to perform a third filtering process on the value of the second color component sampling point in the adjacent area of the current block to obtain the second color component sampling point in the adjacent area of the current block. filtered samples of the color component; and determining target information of the current block based on filtered samples of the second color component in an adjacent area of the current block.
  • the number of filtered samples of the second color component in the adjacent area of the current block is equal to K, where K represents the number of values of the first color component sampling points in the adjacent area of the current block. , K is a positive integer.
  • the third filtering process is an upsampling filtering process.
  • the first filtering unit 3002 is further configured to perform a third filtering process on the values of the second color component sampling points in the adjacent areas of the current block based on the color format information to obtain the adjacent areas of the current block. Filtered samples of the second color component in the region.
  • the first filtering unit 3002 is also configured to upsample the value of the second color component sampling point in the adjacent area of the current block if the color format information indicates 4:2:0 sampling. Filtering; where the upsampling rate is a positive integer multiple of 2.
  • the first filtering unit 3002 is further configured to compare K with a preset number; and based on the comparison result between K and the preset number, filter the first color component in the adjacent area of the current block.
  • the value of the sampling point and the filtered sample value of the second color component in the adjacent area of the current block are subjected to a fourth filtering process to determine the filtered adjacent sample value of the first color component of the current block and the second color component of the current block.
  • filtered adjacent samples and determining target information of the current block based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the first filtering unit 3002 is also configured to, if K is greater than a preset number, compare the value of the first color component sampling point in the adjacent area of the current block with the value of the first color component sampling point in the adjacent area of the current block.
  • the filtered samples of the second color component of the current block are all subjected to the first sub-filtering process 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 the predetermined Assuming a number, the second sub-filtering process is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block to determine the current The filtered adjacent sample of the first color component of the block and the filtered adjacent sample of the second color component of the current block.
  • the first filtering unit 3002 is further configured to determine the number of values of the first color component sampling points in the adjacent area of the current block to be a first number; and according to the first number and the preset number As a comparison result, perform a fifth filtering process on the value of the first color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block; and based on the first color component of the current block Filtered adjacent samples of the color component determine the target information for the current block.
  • the first filtering unit 3002 is also configured to perform a first sub-filtering process on the value of the first color component sampling point in the adjacent area of the current block if the first number is greater than the preset number. , determine the filtered adjacent sample value of the first color component of the current block; if the first number is less than the preset number, perform a second sub-filtering on the value of the first color component sampling point in the adjacent area of the current block Processing to determine filtered adjacent samples of a first color component of the current block.
  • the first filtering unit 3002 is further configured to determine that the number of values of the second color component sampling points in the adjacent area of the current block is a second number; and according to the second number and the preset number As a comparison result, perform a sixth filtering process on the value of the second color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the second color component of the current block; and according to the second color component of the current block Filtered adjacent samples of the color component determine the target information for the current block.
  • the first filtering unit 3002 is also configured to perform a first sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block if the second number is greater than the preset number. , determine the filtered adjacent sample value of the second color component of the current block; if the second number is less than the preset number, perform a second sub-filtering on the value of the second color component sampling point in the adjacent area of the current block Processing to determine filtered adjacent samples of a second color component of the current block.
  • the first filtering unit 3002 is further configured to set the reference sample of the second color component in the target information as the filtered adjacent sample of the second color component of the current block.
  • the first sub-filtering process is a downsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following first sub-filtering processes:
  • the continuous position selection method is used for sub-filtering processing.
  • the second sub-filtering process is an upsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following second sub-filtering processes: sub-filtering using an interpolation method at fixed intervals.
  • the first filtering unit 3002 is also configured to perform a seventh filtering process on the reconstructed value of the first reference color component sampling point in the current block, and determine the filtered sample value of the first reference color component sampling point in the current block. ; and determine the target information of the current block based on the filtered sample value of the first reference color component sampling point in the current block.
  • the first filtering unit 3002 is further configured to determine the first width and the first height according to the reconstruction value of the first reference color component sampling point in the current block; and if the first width is greater than the width of the prediction block, Or the first height is greater than the height of the prediction block, then the third sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the filtered sample value of the first reference color component sampling point in the current block; if If the first width is smaller than the width of the prediction block, or the first height is smaller than the height of the prediction block, then the fourth sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color component sample in the current block. Filtered samples of points.
  • the third sub-filtering process is a downsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following third sub-filtering processes:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to downsampling filtering in the horizontal direction and then downsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to down-sampling filtering in the vertical direction and then down-sampling and filtering is performed in the horizontal direction.
  • the fourth sub-filtering process is an upsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following fourth sub-filtering processes:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the horizontal direction and then upsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the vertical direction and then upsampling and filtering is performed in the horizontal direction.
  • the first filtering unit 3002 is also configured to set the reference sample value of the first color component in the target information to the value of the first color component sampling point in the adjacent area of the current block and the current block The absolute value of the difference between the reconstructed values of the first reference color component sampling point in .
  • the first filtering unit 3002 is further configured to set the reference sample of the first color component in the target information to the filtered adjacent sample of the first color component of the current block and the first reference sample in the current block. The absolute value of the difference between the filtered samples of the color component sampling points.
  • the first determination unit 3001 is further configured to determine the value corresponding to the reference sample of the first color component under the preset mapping relationship; and set the weighting coefficient equal to the value.
  • the first determining unit 3001 is further configured to determine the first factor; and determine the first product value according to the first factor and the reference sample of the first color component; and determine the first product value at a preset value. The corresponding value under the mapping relationship.
  • the first factor is a preset constant value.
  • the first determining unit 3001 is further configured to determine the value of the first factor according to the size parameter of the current block; wherein the size parameter of the current block includes at least one of the following parameters: the width of the current block, The height of the current block.
  • the preset mapping relationship is a Softmax function.
  • the preset mapping relationship is a weighting function having an inverse relationship with the reference sample of the first color component.
  • the first prediction unit 3003 is further configured to determine the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; and set the predicted value of the second color component sampling point in the prediction block to Equal to the sum of N weighted values; where N represents the number of reference samples of the second color component, and N is a positive integer.
  • the first prediction unit 3003 is further configured to perform a correction operation on the prediction value of the second color component sampling point in the prediction block, and determine the prediction block of the second color component of the current block.
  • the first prediction unit 3003 is further configured to perform filter enhancement processing on the prediction block, and use the processed prediction block as the prediction block of the second color component of the current block.
  • the first prediction unit 3003 is further configured to determine the compensation value of the second color component of the prediction block based on the reference sample value in the adjacent area of the current block; and calculate the compensation value of the second color component in the prediction block based on the compensation value.
  • the predicted values of the two color component sampling points are corrected to determine the predicted block of the second color component of the current block.
  • the first prediction unit 3003 is further configured to perform prediction processing on the second color component sampling points in the prediction block according to at least one prediction mode, and determine at least one of the second color component sampling points in the prediction block.
  • Initial prediction value and performing a weighted fusion process on at least one initial prediction value and the prediction value of the second color component sampling point in the prediction block to determine the prediction block of the second color component of the current block.
  • the first determination unit 3001 is further configured to determine the predicted value of the second color component sampling point of the current block according to the prediction block; and according to the original value of the second color component sampling point of the current block and the current block The predicted value of the second color component sampling point of the current block is determined to determine the predicted difference value of the second color component sampling point of the current block.
  • the encoding device 300 may also include an encoding unit 3004 configured to encode the prediction difference value of the second color component sampling point of the current block, and write the resulting encoded bits into the code stream. .
  • the "unit" may be part of a circuit, part of a processor, part of a program or software, etc., and of course may also be a module, or may be non-modular.
  • each component in this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially either The part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes a number of instructions to make a computer device (can It is a personal computer, server, or network device, etc.) or processor that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage media include: U disk, mobile hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or optical disk and other media that can store program code.
  • the embodiment of the present application provides a computer-readable storage medium for use in the encoding device 300.
  • the computer-readable storage medium stores a computer program.
  • the computer program is executed by the first processor, any of the foregoing embodiments can be implemented. method described in one item.
  • the encoding device 310 may include: a first communication interface 3101, a first memory 3102, and a first processor 3103; the various components are coupled together through a first bus system 3104. It can be understood that the first bus system 3104 is used to implement connection communication between these components. In addition to the data bus, the first bus system 3104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clear explanation, various buses are labeled as the first bus system 3104 in FIG. 21 . in,
  • the first communication interface 3101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the first memory 3102 is used to store a computer program capable of running on the first processor 3103;
  • the first processor 3103 is configured to execute: when running the computer program:
  • the prediction difference value of the second color component sampling point of the current block is determined.
  • the first memory 3102 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • Synchlink DRAM SLDRAM
  • Direct Rambus RAM DRRAM
  • the first memory 3102 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
  • the first processor 3103 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the first processor 3103 .
  • the above-mentioned first processor 3103 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or a ready-made programmable gate array (Field Programmable Gate Array, FPGA). or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the first memory 3102.
  • the first processor 3103 reads the information in the first memory 3102 and completes the steps of the above method in combination with its hardware.
  • the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (FPGA), general-purpose processor, controller, microcontroller, microprocessor, and other devices used to perform the functions described in this application electronic unit or combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device Digital Signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable Logic Device
  • FPGA Field-Programmable Gate Array
  • the technology described in this application can be implemented through modules (such as procedures, functions, etc.) that perform the functions described in this application.
  • Software code may be stored in memory and executed by a processor.
  • the memory can be implemented in the processor or external to the processor.
  • the first processor 3103 is further configured to perform the method described in any one of the preceding embodiments when running the computer program.
  • This embodiment provides an encoding device, which may further include the encoding device 300 described in the previous embodiment.
  • the accuracy of the reference information of adjacent areas is improved by fully considering the characteristics of the input color format information; and making full use of spatial correlation, the reference information of adjacent areas and the reconstructed brightness information of the current block are improved.
  • Sampling, downsampling, size enlargement, size reduction and other filtering processes not only improve the accuracy of chroma prediction, save bit rate, but also improve encoding and decoding performance.
  • FIG. 22 shows a schematic structural diagram of a decoding device 320 provided by an embodiment of the present application.
  • the decoding device 320 may include: a second determination unit 3201, a second filtering unit 3202, and a second prediction unit 3203; wherein,
  • the second determination unit 3201 is configured to determine the reference information of the current block
  • the second filtering unit 3202 is configured to filter part of the information in the reference information of the current block and determine the target information of the current block;
  • the second determination unit 3201 is also configured to determine the weighting coefficient according to the reference sample of the first color component in the target information
  • the second prediction unit 3203 is configured to determine 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;
  • the second determination unit 3201 is further configured to determine the reconstruction value of the second color component sampling point of the current block according to the prediction block.
  • the prediction block contains predicted values of at least some of the second color component sample points in the current block.
  • the second determination unit 3201 is also configured to determine the value of the first color component sampling point in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block. and the reconstructed value of the first reference color component sampling point in the current block to determine the reference information of the current block.
  • the adjacent area of the current block may include at least one of the following: an upper adjacent area, an upper right adjacent area, a left adjacent area, and a lower left adjacent area.
  • the second filtering unit 3202 is also configured to perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block to obtain the first value of the first color component sampling point in the adjacent area of the current block. filtered samples of color components; and determining target information of the current block based on filtered samples of the first color component in adjacent areas of the current block.
  • the number of filtered samples of the first color component in the adjacent area of the current block is equal to L, where L represents the number of values of the second color component sampling points in the adjacent area of the current block. , L is a positive integer.
  • the first filtering process is a downsampling filtering process.
  • the second filtering unit 3202 is further configured to perform a first filtering process on the value of the first color component sampling point in the adjacent area of the current block based on the color format information to obtain the adjacent area of the current block. The filtered sample of the first color component in the region.
  • the second filtering unit 3202 is also configured to downsample the value of the first color component sampling point in the adjacent area of the current block if the color format information indicates 4:2:0 sampling. Filtering; where the downsampling rate is the reciprocal of a positive integer multiple of 2.
  • the second filtering unit 3202 is further configured to compare L with a preset number; and based on the comparison result between L and the preset number, filter the first color component in the adjacent area of the current block. Perform a second filtering process on the filtered sample value and the second color component sampling point value in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block and the second color component of the current block. filtered adjacent samples; and determining target information of the current block based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the second filtering unit 3202 is also configured to, if L is greater than a preset number, filter samples of the first color component in the adjacent area of the current block and filter samples of the first color component in the adjacent area of the current block.
  • the values of the second color component sampling points are all subjected to the first sub-filtering process 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 L is less than the predetermined Assuming a number, the second sub-filtering process is performed on both the filtered sample value of the first color component in the adjacent area of the current block and the value of the second color component sampling point in the adjacent area of the current block to determine the current The filtered adjacent sample of the first color component of the block and the filtered adjacent sample of the second color component of the current block.
  • the second filtering unit 3202 is also configured to perform a third filtering process on the value of the second color component sampling point in the adjacent area of the current block to obtain the second color component sampling point in the adjacent area of the current block. filtered samples of the color component; and determining target information of the current block based on filtered samples of the second color component in an adjacent area of the current block.
  • the number of filtered samples of the second color component in the adjacent area of the current block is equal to K, where K represents the number of values of the first color component sampling points in the adjacent area of the current block. , K is a positive integer.
  • the third filtering process is an upsampling filtering process.
  • the second filtering unit 3202 is further configured to perform a third filtering process on the values of the second color component sampling points in the adjacent areas of the current block based on the color format information to obtain the adjacent areas of the current block. Filtered samples of the second color component in the region.
  • the second filtering unit 3202 is also configured to upsample the value of the second color component sampling point in the adjacent area of the current block if the color format information indicates 4:2:0 sampling. Filtering; where the upsampling rate is a positive integer multiple of 2.
  • the second filtering unit 3202 is further configured to compare K with a preset number; and based on the comparison result between K and the preset number, filter the first color component in the adjacent area of the current block.
  • the value of the sampling point and the filtered sample value of the second color component in the adjacent area of the current block are subjected to a fourth filtering process to determine the filtered adjacent sample value of the first color component of the current block and the second color component of the current block.
  • filtered adjacent samples and determining target information of the current block based on filtered adjacent samples of the first color component of the current block and filtered adjacent samples of the second color component of the current block.
  • the second filtering unit 3202 is also configured to, if K is greater than a preset number, compare the value of the first color component sampling point in the adjacent area of the current block with the value of the first color component sampling point in the adjacent area of the current block.
  • the filtered samples of the second color component of the current block are all subjected to the first sub-filtering process 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 the predetermined Assuming a number, the second sub-filtering process is performed on both the value of the first color component sampling point in the adjacent area of the current block and the filtered sample value of the second color component in the adjacent area of the current block to determine the current The filtered adjacent sample of the first color component of the block and the filtered adjacent sample of the second color component of the current block.
  • the second filtering unit 3202 is further configured to determine the number of values of the first color component sampling points in the adjacent area of the current block to be a first number; and according to the first number and the preset number As a comparison result, perform a fifth filtering process on the value of the first color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the first color component of the current block; and based on the first color component of the current block Filtered adjacent samples of the color component determine the target information for the current block.
  • the second filtering unit 3202 is also configured to perform a first sub-filtering process on the value of the first color component sampling point in the adjacent area of the current block if the first number is greater than the preset number. , determine the filtered adjacent sample value of the first color component of the current block; if the first number is less than the preset number, perform a second sub-filtering on the value of the first color component sampling point in the adjacent area of the current block Processing to determine filtered adjacent samples of a first color component of the current block.
  • the second filtering unit 3202 is further configured to determine that the number of values of the second color component sampling points in the adjacent area of the current block is a second number; and according to the second number and the preset number As a comparison result, perform a sixth filtering process on the value of the second color component sampling point in the adjacent area of the current block to determine the filtered adjacent sample value of the second color component of the current block; and according to the second color component of the current block Filtered adjacent samples of the color component determine the target information for the current block.
  • the second filtering unit 3202 is also configured to perform a first sub-filtering process on the values of the second color component sampling points in the adjacent areas of the current block if the second number is greater than the preset number. , determine the filtered adjacent sample value of the second color component of the current block; if the second number is less than the preset number, perform a second sub-filtering on the value of the second color component sampling point in the adjacent area of the current block Processing to determine filtered adjacent samples of a second color component of the current block.
  • the second filtering unit 3202 is further configured to set the reference sample of the second color component in the target information as the filtered adjacent sample of the second color component of the current block.
  • the first sub-filtering process is a downsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following first sub-filtering processes:
  • the continuous position selection method is used for sub-filtering processing.
  • the second sub-filtering process is an upsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following second sub-filtering processes: sub-filtering using an interpolation method at fixed intervals.
  • the second filtering unit 3202 is also configured to perform a seventh filtering process on the reconstructed value of the first reference color component sampling point in the current block, and determine the filtered sample value of the first reference color component sampling point in the current block. ; and determine the target information of the current block based on the filtered sample value of the first reference color component sampling point in the current block.
  • the second filtering unit 3202 is further configured to determine the first width and the first height according to the reconstruction value of the first reference color component sampling point in the current block; and if the first width is greater than the width of the prediction block, Or the first height is greater than the height of the prediction block, then the third sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the filtered sample value of the first reference color component sampling point in the current block; if If the first width is smaller than the width of the prediction block, or the first height is smaller than the height of the prediction block, then the fourth sub-filtering process is performed on the reconstructed value of the first reference color component sampling point in the current block to determine the first reference color component sample in the current block. Filtered samples of points.
  • the third sub-filtering process is a downsampling filtering process.
  • the first filtering unit 3002 is also configured to perform at least one of the following third sub-filtering processes:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to downsampling filtering in the horizontal direction and then downsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to down-sampling filtering in the vertical direction and then down-sampling and filtering is performed in the horizontal direction.
  • the fourth sub-filtering process is an upsampling filtering process.
  • the second filtering unit 3202 is also configured to perform at least one of the following fourth sub-filtering processes:
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the horizontal direction and then upsampling and filtering in the vertical direction;
  • the reconstructed value of the first reference color component sampling point in the current block is subjected to upsampling filtering in the vertical direction and then upsampling and filtering is performed in the horizontal direction.
  • the second filtering unit 3202 is also configured to set the reference sample value of the first color component in the target information to the value of the first color component sampling point in the adjacent area of the current block and the current block The absolute value of the difference between the reconstructed values of the first reference color component sampling point in .
  • the second filtering unit 3202 is further configured to set the reference sample of the first color component in the target information to the filtered adjacent sample of the first color component of the current block and the first reference sample in the current block. The absolute value of the difference between the filtered samples of the color component sampling points.
  • the second determination unit 3201 is further configured to determine the value corresponding to the reference sample of the first color component under the preset mapping relationship; and set the weighting coefficient equal to the value.
  • the second determination unit 3201 is further configured to determine the first factor; and determine the first product value according to the first factor and the reference sample value of the first color component; and determine the first product value at a preset value. The corresponding value under the mapping relationship.
  • the first factor is a preset constant value.
  • the second determination unit 3201 is further configured to determine the value of the first factor according to the size parameter of the current block; wherein the size parameter of the current block includes at least one of the following parameters: the width of the current block, The height of the current block.
  • the preset mapping relationship is a Softmax function.
  • the preset mapping relationship is a weighting function having an inverse relationship with the reference sample of the first color component.
  • the second prediction unit 3203 is further configured to determine the weighted value of the reference sample value of the second color component and the corresponding weighting coefficient; and set the predicted value of the second color component sampling point in the prediction block to Equal to the sum of N weighted values; where N represents the number of reference samples of the second color component, and N is a positive integer.
  • the second prediction unit 3203 is further configured to perform a correction operation on the prediction value of the second color component sampling point in the prediction block, and determine the prediction block of the second color component of the current block.
  • the second prediction unit 3203 is further configured to perform filter enhancement processing on the prediction block, and use the processed prediction block as the prediction block of the second color component of the current block.
  • the second prediction unit 3203 is further configured to determine the compensation value of the second color component of the prediction block based on the reference sample value in the adjacent area of the current block; and calculate the compensation value of the second color component in the prediction block based on the compensation value.
  • the predicted values of the two color component sampling points are corrected to determine the predicted block of the second color component of the current block.
  • the second prediction unit 3203 is further configured to perform prediction processing on the second color component sampling points in the prediction block according to at least one prediction mode, and determine at least one of the second color component sampling points in the prediction block.
  • Initial prediction value and performing a weighted fusion process on at least one initial prediction value and the prediction value of the second color component sampling point in the prediction block to determine the prediction block of the second color component of the current block.
  • the second determination unit 3201 is further configured to determine the prediction difference value of the second color component sampling point of the current block; and determine the prediction value of the second color component sampling point of the current block according to the prediction block; and The reconstructed value of the second color component sampling point of the current block is determined according to the predicted difference value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.
  • the decoding device 320 may further include a decoding unit 3204 configured to parse the code stream and determine the prediction difference value of the second color component sampling point of the current block.
  • the "unit" may be part of a circuit, part of a processor, part of a program or software, etc., and of course may also be a module, or may be non-modular.
  • each component in this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this embodiment provides a computer-readable storage medium for use in the decoding device 320.
  • the computer-readable storage medium stores a computer program.
  • the computer program is executed by the second processor, the foregoing embodiments are implemented. any one of the methods.
  • the decoding device 330 may include: a second communication interface 3301, a second memory 3302, and a second processor 3303; the various components are coupled together through a second bus system 3304. It can be understood that the second bus system 3304 is used to implement connection communication between these components. In addition to the data bus, the second bus system 3304 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity of explanation, various buses are labeled as second bus system 3304 in FIG. 23 . in,
  • the second communication interface 3301 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the second memory 3302 is used to store computer programs that can run on the second processor 3303;
  • the second processor 3303 is used to execute: when running the computer program:
  • the reconstructed value of the second color component sampling point of the current block is determined.
  • the second processor 3303 is further configured to perform the method described in any one of the preceding embodiments when running the computer program.
  • This embodiment provides a decoding device, which may further include the decoding device 320 described in the previous embodiment.
  • the accuracy of the reference information of adjacent areas is improved by fully considering the characteristics of the input color format information; and making full use of spatial correlation, the reference information of adjacent areas and the reconstructed brightness information of the current block are improved.
  • Sampling, downsampling, size enlargement, size reduction and other filtering processes not only improve the accuracy of chroma prediction, save bit rate, but also improve encoding and decoding performance.
  • FIG. 24 shows a schematic structural diagram of a coding and decoding system provided by an embodiment of the present application.
  • the encoding and decoding system 340 may include an encoder 3401 and a decoder 3402.
  • the encoder 3401 can be a device integrated with the encoding device 300 described in the previous embodiment, or can also be the encoding device 310 described in the previous embodiment
  • the decoder 3402 can be a device integrated with the decoding device 320 described in the previous embodiment. device, or may also be the decoding device 330 described in the previous embodiment.
  • both the encoder 3401 and the decoder 3402 can fully consider the characteristics of the input color format information to improve the accuracy of the reference information of adjacent areas; and make full use of Spatial correlation, the reference information of adjacent areas and the reconstructed brightness information of the current block are filtered by upsampling, downsampling, size enlargement, size reduction, etc., which not only improves the accuracy of chroma prediction and saves code rate, but also It can also improve encoding and decoding performance.
  • the target information of the current block is determined by determining the reference information of the current block; performing filtering processing on part of the information in the reference information of the current block; and based on the first information in the target information.
  • the reference sample value of the color component is used to determine the weighting coefficient; 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.
  • the prediction difference of the second color component sampling point of the current block can be determined, and the prediction difference is written into the code stream; so that at the decoding end, based on the prediction block and the prediction difference obtained by decoding The reconstructed value of the second color component sampling point of the current block can be determined.
  • the accuracy of the reference information can be improved; and by upgrading the reference information Filtering processes such as sampling and downsampling can enhance the continuity of spatial correlation to a certain extent or remove some information with weak spatial correlation, so that the target information obtained after filtering can be used for chromaticity prediction, which can improve The accuracy of chroma prediction saves bit rate and improves encoding and decoding performance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

本申请实施例公开了一种编解码方法、装置、编码设备、解码设备以及存储介质,该方法包括:确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;根据预测块,确定当前块的第二颜色分量采样点的重建值。这样,不仅可以提高色度预测的准确性,节省码率,而且还能够提升编解码性能。

Description

编解码方法、装置、编码设备、解码设备以及存储介质 技术领域
本申请实施例涉及视频编解码技术领域,尤其涉及一种编解码方法、装置、编码设备、解码设备以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,高清和超高清视频等新视频应用形式应运而生。国际标组织ISO/IEC和ITU-T的联合视频研究组(Joint Video Exploration Team,JVET)制定了下一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC)。
H.266/VVC中包含了颜色分量间预测技术。然而,H.266/VVC的颜色分量间预测技术计算得到的编码块的预测值与原始值之间存在较大偏差,这导致预测准确度低,造成解码视频的质量下降,降低了编码性能。
发明内容
本申请实施例提供一种编解码方法、装置、编码设备、解码设备以及存储介质,不仅可以提高色度预测的准确性,节省码率,而且还能够提升编解码性能。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种解码方法,包括:
确定当前块的参考信息;
对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
根据目标信息中的第一颜色分量的参考样值,确定加权系数;
根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
根据预测块,确定当前块的第二颜色分量采样点的重建值。
第二方面,本申请实施例提供了一种编码方法,包括:
确定当前块的参考信息;
对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
根据目标信息中的第一颜色分量的参考样值,确定加权系数;
根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
根据预测块,确定当前块的第二颜色分量采样点的预测差值。
第三方面,本申请实施例提供了一种编码装置,包括第一确定单元、第一滤波单元和第一预测单元;其中,
第一确定单元,配置为确定当前块的参考信息;
第一滤波单元,配置为对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
第一确定单元,还配置为根据目标信息中的第一颜色分量的参考样值,确定加权系数;
第一预测单元,配置为根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
第一确定单元,还配置为根据预测块,确定当前块的第二颜色分量采样点的预测差值。
第四方面,本申请实施例提供了一种编码设备,包括第一存储器和第一处理器;其中,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;
第一处理器,用于在运行计算机程序时,执行如第二方面所述的方法。
第五方面,本申请实施例提供了一种解码装置,包括第二确定单元、第二滤波单元和第二预测单元;其中,
第二确定单元,配置为确定当前块的参考信息;
第二滤波单元,配置为对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
第二确定单元,还配置为根据目标信息中的第一颜色分量的参考样值,确定加权系数;
第二预测单元,配置为根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二 颜色分量的预测块;
第二确定单元,还配置为根据预测块,确定当前块的第二颜色分量采样点的重建值。
第六方面,本申请实施例提供了一种解码设备,包括第二存储器和第二处理器;其中,
第二存储器,用于存储能够在第二处理器上运行的计算机程序;
第二处理器,用于在运行计算机程序时,执行如第一方面所述的方法。
第七方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。
本申请实施例提供了一种编解码方法、装置、编码设备、解码设备以及存储介质,无论是编码端还是解码端,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块。这样,在编码端根据预测块,能够确定当前块的第二颜色分量采样点的预测差值;使得在解码端,根据预测块可以确定出当前块的第二颜色分量采样点的重建值。如此,对于当前块的相邻区域中的颜色分量信息与当前块内的颜色分量信息,由于充分考虑了颜色格式信息的特性,能够提高这些参考信息的准确性;而且通过对这些参考信息进行上采样、下采样等滤波处理,可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,利用滤波处理后得到的目标信息能够更好地进行色度预测,从而提高了色度预测的准确性,节省码率,同时提升编解码性能。
附图说明
图1为一种有效相邻区域的分布示意图;
图2为一种不同预测模式下选择区域的分布示意图;
图3为一种模型参数推导方案的流程示意图;
图4A为本申请实施例提供的一种编码器的组成框图示意图;
图4B为本申请实施例提供的一种解码器的组成框图示意图;
图5为本申请实施例提供的一种解码方法的流程示意图一;
图6为本申请实施例提供的一种当前块的参考区域示意图一;
图7A为本申请实施例提供的一种参考亮度信息的下采样位置示意图;
图7B为本申请实施例提供的一种参考色度信息的上采样位置示意图;
图8为本申请实施例提供的一种参考亮度信息的重排列位置示意图;
图9为本申请实施例提供的一种WCP模式与其他预测模式的加权预测示意图;
图10为本申请实施例提供的一种基于权重的色度预测的框架示意图;
图11为本申请实施例提供的一种解码方法的流程示意图二;
图12为本申请实施例提供的一种上采样插值的处理过程示意图一;
图13为本申请实施例提供的一种上采样插值的处理过程示意图二;
图14为本申请实施例提供的一种上采样插值的权重取值示意图;
图15为本申请实施例提供的一种上采样插值的处理过程示意图三;
图16为本申请实施例提供的一种解码方法的流程示意图三;
图17为本申请实施例提供的一种当前块的参考区域示意图二;
图18为本申请实施例提供的一种编码方法的流程示意图一;
图19为本申请实施例提供的一种编码方法的流程示意图二;
图20为本申请实施例提供的一种编码装置的组成结构示意图;
图21为本申请实施例提供的一种编码设备的具体硬件结构示意图;
图22为本申请实施例提供的一种解码装置的组成结构示意图;
图23为本申请实施例提供的一种解码设备的具体硬件结构示意图;
图24为本申请实施例提供的一种编解码系统的组成结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解 的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
在视频图像中,一般采用第一颜色分量、第二颜色分量和第三颜色分量来表征编码块(Coding Block,CB);其中,这三个颜色分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量。示例性地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。除此之外,视频图像也可以是RGB格式、YCgCo格式等,本申请实施例不作任何限定。
可以理解,在当前的视频图像或者视频编解码过程中,对于跨分量预测技术,主要包括分量间线性模型(Cross-component Linear Model,CCLM)预测模式和多方向线性模型(Multi-Directional Linear Model,MDLM)预测模式,无论是根据CCLM预测模式推导的模型参数,还是根据MDLM预测模式推导的模型参数,其对应的预测模型均可以实现第一颜色分量到第二颜色分量、第二颜色分量到第一颜色分量、第一颜色分量到第三颜色分量、第三颜色分量到第一颜色分量、第二颜色分量到第三颜色分量、或者第三颜色分量到第二颜色分量等颜色分量间的预测。
以第一颜色分量到第二颜色分量的预测为例,假定第一颜色分量为亮度分量,第二颜色分量为色度分量,为了减少亮度分量与色度分量之间的冗余,在H.266/多功能视频编码(Versatile Video Coding,VVC)中使用CCLM预测模式,即根据同一编码块的亮度重建值来构造色度的预测值,如:Pred C(i,j)=α·Rec L(i,j)+β。
其中,i,j表示编码块中待预测像素的位置坐标,i表示水平方向,j表示竖直方向;Pred C(i,j)表示编码块中位置坐标(i,j)的待预测像素对应的色度预测值,Rec L(i,j)表示同一编码块中(经过下采样的)位置坐标(i,j)的待预测像素对应的亮度重建值。另外,α和β表示模型参数,可通过参考像素推导得到。
对于编码块而言,其相邻区域可以分为五部分:左侧相邻区域、上侧相邻区域、左下侧相邻区域、左上侧相邻区域和右上侧相邻区域。在H.266/VVC中包括三种跨分量线性模型预测模式,分别为:左侧及上侧相邻的帧内CCLM预测模式(可以用INTRA_LT_CCLM表示)、左侧及左下侧相邻的帧内CCLM预测模式(可以用INTRA_L_CCLM表示)和上侧及右上侧相邻的帧内CCLM预测模式(可以用INTRA_T_CCLM表示)。在这三种预测模式中,每种预测模式都可以选取预设数量(比如4个)的参考像素用于模型参数α和β的推导,而这三种预测模式的最大区别在于用于推导模型参数α和β的参考像素对应的选择区域是不同的。
具体地,针对色度分量对应的编码块尺寸为W×H,假定参考像素对应的上侧选择区域为W′,参考像素对应的左侧选择区域为H′;这样,
对于INTRA_LT_CCLM模式,参考像素可以在上侧相邻区域和左侧相邻区域进行选取,即W′=W,H′=H;
对于INTRA_L_CCLM模式,参考像素可以在左侧相邻区域和左下侧相邻区域进行选取,即H′=W+H,并设置W′=0;
对于INTRA_T_CCLM模式,参考像素可以在上侧相邻区域和右上侧相邻区域进行选取,即W′=W+H,并设置H′=0。
需要注意的是,在VTM中,对于右上侧相邻区域内最多只存储了W范围的像素点,对于左下侧相邻区域内最多只存储了H范围的像素点。虽然INTRA_L_CCLM模式和INTRA_T_CCLM模式的选择区域的范围定义为W+H,但是在实际应用中,INTRA_L_CCLM模式的选择区域将限制在H+H之内,INTRA_T_CCLM模式的选择区域将限制在W+W之内;这样,
对于INTRA_L_CCLM模式,参考像素可以在左侧相邻区域和左下侧相邻区域进行选取,H′=min{W+H,H+H};
对于INTRA_T_CCLM模式,参考像素可以在上侧相邻区域和右上侧相邻区域进行选取,W′=min{W+H,W+W}。
参见图1,其示出了一种有效相邻区域的分布示意图。在图1中,左侧相邻区域、左下侧相邻区域、上侧相邻区域和右上侧相邻区域都是有效的;另外,灰色填充的块即为编码块中位置坐标为(i,j)的待预测像素。
如此,在图1的基础上,针对三种预测模式的选择区域如图2所示。其中,在图2中,(a)表示了INTRA_LT_CCLM模式的选择区域,包括了左侧相邻区域和上侧相邻区域;(b)表示了INTRA_L_CCLM 模式的选择区域,包括了左侧相邻区域和左下侧相邻区域;(c)表示了INTRA_T_CCLM模式的选择区域,包括了上侧相邻区域和右上侧相邻区域。这样,在确定出三种预测模式的选择区域之后,可以在选择区域内进行用于模型参数推导的像素选取。如此选取到的像素可以称为参考像素,通常参考像素的个数为4个;而且对于一个尺寸确定的W×H的编码块,其参考像素的位置一般是确定的。
在获取到预设数量的参考像素之后,目前是按照图3所示的模型参数推导方案的流程示意图进行色度预测。根据图3所示的流程,假定预设数量为4个,该流程可以包括:
S301:在选择区域中获取参考像素。
S302:判断有效参考像素的个数。
S303:若有效参考像素的个数为0,则将模型参数α设置为0,β设置为默认值。
S304:色度预测值填充为默认值。
S305:若有效参考像素的个数为4,则经过比较获得亮度分量中较大值的两个参考像素和较小值的两个参考像素。
S306:计算较大值对应的均值点和较小值对应的均值点。
S307:根据两个均值点推导得到模型参数α和β。
S308:使用α和β所构建的预测模型进行色度预测。
需要说明的是,在VVC中,有效参考像素为0的这一步骤是根据相邻区域的有效性进行判断的。
还需要说明的是,利用“两点确定一条直线”原则来构建预测模型,这里的两点可以称为拟合点。目前的技术方案中,在获取到4个参考像素之后,经过比较获得亮度分量中较大值的两个参考像素和较小值的两个参考像素;然后根据较大值的两个参考像素,求取一均值点(可以用mean max表示),根据较小值的两个参考像素,求取另一均值点(可以用mean min表示),即可得到两个均值点mean max和mean min;再将mean max和mean min作为两个拟合点,能够推导出模型参数(用α和β表示);最后根据α和β构建出预测模型,并根据该预测模型进行色度分量的预测处理。
然而,在相关技术中,针对每个编码块都使用简单的线性模型Pred C(i,j)=α·Rec L(i,j)+β来预测色度分量,并且每个编码块任意位置像素都使用相同的模型参数α和β进行预测。这样会导致以下缺陷:一方面,不同内容特性的编码块都利用简单线性模型进行亮度到色度的映射,以此实现色度预测,但是并非任意编码块内的亮度到色度的映射函数都可以准确由此简单线性模型拟合,这导致部分编码块预测效果不够准确;另一方面,在预测过程中,编码块内不同位置的像素点均使用相同的模型参数α和β,编码块内不同位置的预测准确性的同样存在较大差异;又一方面,在CCLM技术的预测过程中,未充分考虑当前块的重建亮度信息与相邻区域的参考信息之间的高度相关性,这会导致部分编码块在此技术下无法准确预测,从而影响该技术的增益效果。简单来说,目前的CCLM技术下部分编码块的预测值与原始值之间存在较大偏差,导致预测准确度低,造成质量下降,进而降低了编解码效率。
基于此,本申请实施例提供了一种编码方法,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;根据预测块,确定当前块的第二颜色分量采样点的预测差值。
本申请实施例还提供了一种解码方法,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;根据预测块,确定当前块的第二颜色分量采样点的重建值。
这样,对于当前块的相邻区域中的颜色分量信息与当前块内的颜色分量信息,由于充分考虑了颜色格式信息的特性,能够提高这些参考信息的准确性;而且通过对这些参考信息进行上采样、下采样等滤波处理,还可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,利用滤波处理后得到的目标信息能够更好地进行色度预测,从而提高了色度预测的准确性,节省码率,同时提升编解码性能。
下面将结合附图对本申请各实施例进行详细说明。
参见图4A,其示出了本申请实施例提供的一种编码器的组成框图示意图。如图4A所示,编码器(具体为“视频编码器”)100可以包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可以实现去方块滤波及样本自适应缩进(Sample Adaptive 0ffset,SAO)滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmetic Coding,CABAC)。针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧 间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。
参见图4B,其示出了本申请实施例提供的一种解码器的组成框图示意图。如图4B所示,解码器(具体为“视频解码器”)200包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现去方块滤波以及SAO滤波。输入的视频信号经过图4A的编码处理之后,输出该视频信号的码流;该码流输入解码器200中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。
需要说明的是,本申请实施例的方法主要应用在如图4A所示的帧内预测单元103部分和如图4B所示的帧内预测单元203部分。也就是说,本申请实施例既可以应用于编码器,也可以应用于解码器,甚至还可以同时应用于编码器和解码器,但是本申请实施例不作具体限定。
还需要说明的是,当应用于帧内预测单元103部分时,“当前块”具体是指当前待进行帧内预测的编码块;当应用于帧内预测单元203部分时,“当前块”具体是指当前待进行帧内预测的解码块。
在本申请的一实施例中,参见图5,其示出了本申请实施例提供的一种解码方法的流程示意图一。如图5所示,该方法可以包括:
S501:确定当前块的参考信息。
需要说明的是,本申请实施例的解码方法应用于解码装置,或者集成有该解码装置的解码设备(也可简称为“解码器”)。另外,本申请实施例的解码方法具体可以是指一种帧内预测方法,更具体地,是一种基于权重的色度预测(Weight-based Chroma Prediction,WCP)的前处理操作方法。
在本申请实施例中,视频图像可以划分为多个解码块,每个解码块可以包括第一颜色分量、第二颜色分量和第三颜色分量,而这里的当前块是指视频图像中当前待进行帧内预测的解码块。另外,假定当前块进行第一颜色分量的预测,而且第一颜色分量为亮度分量,即待预测分量为亮度分量,那么当前块也可以称为亮度预测块;或者,假定当前块进行第二颜色分量的预测,而且第二颜色分量为色度分量,即待预测分量为色度分量,那么当前块也可以称为色度预测块。
还需要说明的是,在本申请实施例中,当前块的参考信息可以包括当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量采样点的取值,这些采样点(Sample)可以是根据当前块的相邻区域中的已解码像素确定的。在一些实施例中,当前块的相邻区域可以包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
在这里,上侧相邻区域和右上侧相邻区域整体可以看作上方区域,左侧相邻区域和左下侧相邻区域整体可以看作左方区域;除此之外,相邻区域还可以包括左上方区域,详见图6所示。其中,在对当前块进行第二颜色分量的预测时,当前块的上方区域、左方区域和左上方区域作为相邻区域均可被称为当 前块的参考区域,而且参考区域中的像素都是已解码的参考像素。
另外,当前块的参考信息还可以包括当前块中第一参考颜色分量采样点的重建值。因此,在一些实施例中,确定当前块的参考信息,可以包括:
根据当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值,确定当前块的参考信息。
需要说明的是,在本申请实施例中,当前块的参考像素可以是指与当前块相邻的参考像素点,也可称为当前块的相邻区域中的第一颜色分量采样点、第二颜色分量采样点,用Neighboring Sample或Reference Sample表示。其中,这里的相邻可以是空间相邻,但是并不局限于此。例如,相邻也可以是时域相邻、空间与时域相邻,甚至当前块的参考像素还可以是对空间相邻、时域相邻、空间和时域相邻的参考像素点进行某种处理后得到的参考像素等等,本申请实施例不作任何限定。
还需要说明的是,在本申请实施例中,第一颜色分量为亮度分量,第二颜色分量为色度分量。那么,当前块的相邻区域中的第一颜色分量采样点的取值表示为当前块的参考像素对应的参考亮度信息,当前块的相邻区域中的第二颜色分量采样点的取值表示为当前块的参考像素对应的参考色度信息。
在一些实施例中,对于当前块的参考像素的确定,可以包括:对当前块的相邻区域中的像素进行筛选处理,确定参考像素。
具体来说,在本申请实施例中,根据当前块的相邻区域中的像素,组成第一参考像素集合;那么可以对第一参考像素集合进行筛选处理,确定参考像素。在这里,参考像素的数量可以为M个,M为正整数。换句话说,可以从相邻区域中的像素中选取出M个参考像素。其中,M的取值一般可以为4,但是并不作具体限定。
还需要说明的是,在当前块的相邻区域中的像素中,可能会存在部分不重要的像素(例如,这些像素的相关性较差)或者部分异常的像素,为了保证预测的准确性,需要将这些像素剔除掉,以便得到有效的参考像素。
在一种具体的实施例中,对相邻区域中的像素进行筛选处理,确定参考像素,可以包括:
基于相邻区域中的像素的位置和/或颜色分量强度,确定待选择像素位置;
根据待选择像素位置,从相邻区域中的像素中确定参考像素。
需要说明的是,在本申请实施例中,颜色分量强度可以用颜色分量信息来表示,比如参考亮度信息、参考色度信息等;这里,颜色分量信息的值越大,表明了颜色分量强度越高。这样,针对相邻区域中的像素进行筛选,可以是根据像素的位置来进行筛选的,也可以是根据颜色分量强度来进行筛选的,从而根据筛选出的像素确定当前块的参考像素,进一步可以确定出当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量采样点的取值。
S502:对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息。
在本申请实施例中,由于当前块的相邻区域中的第一颜色分量采样点的取值的数量和第二颜色分量采样点的取值的数量存在不同的情况,这时候可能需要对第一颜色分量采样点的取值进行滤波处理,或者对第二颜色分量采样点的取值进行滤波处理,以使得两者的数量相同。另外,由于当前块中第一参考颜色分量采样点的重建值的数量与预设尺寸不同,这时候还可能需要对当前块中第一参考颜色分量采样点的重建值进行滤波处理,以将从当前块获取的第一参考颜色分量采样点的重建值的数量转换为预设尺寸进行输入。也就是说,对于当前块的参考信息,可以是仅对当前块的相邻区域中的第一颜色分量采样点的取值进行滤波处理,也可以是仅对当前块的相邻区域中的第二颜色分量采样点的取值进行滤波处理,还可以是仅对当前块中第一参考颜色分量采样点的重建值进行滤波处理,还可以是对其中的任意两者进行滤波处理,甚至还可以是对这三者全部进行滤波处理,本申请实施例不作任何限定。下面将分别对这些情况进行描述。
在一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:
对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值;
根据当前块的相邻区域中的第一颜色分量的滤波样值,确定当前块的目标信息。
在本申请实施例中,当前块的相邻区域中的第一颜色分量的滤波样值(Sample)的数量等于L,其中,L表示当前块的相邻区域中的第二颜色分量采样点的取值(Sample)的数量,L为正整数。
在一种具体的实施例中,第一滤波处理可以为下采样滤波处理。示例性地,当前块的参考亮度信息的数量通常多于参考色度信息的数量,因此可以对当前块的参考亮度信息进行下采样滤波处理,以使得参考亮度信息的数量与参考色度信息的数量相同。
还需要说明的是,由于当前块的参考亮度信息的数量和参考色度信息的数量也会受到颜色格式信息 的影响;因此,在一些实施例中,该方法还可以包括:基于颜色格式信息,对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值。
在一种具体的实施例中,对于第一滤波处理而言,还可以包括:
若颜色格式信息指示为4:4:4采样,则不对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;
若颜色格式信息指示为4:2:2采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;
若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波。
需要说明的是,在本申请实施例中,当颜色格式信息指示为4:2:0采样时,下采样率是2的正整数倍的倒数。
还需要说明的是,在本申请实施例中,颜色格式信息可以包括4:4:4采样、4:2:2采样、4:2:0采样等等。其中,如果颜色格式信息指示为4:4:4采样(也可表示为YUV444),即亮度与色度样本之比为4:4:4,那么从相邻区域中获取的参考亮度信息的数量与参考色度信息的数量相同,无需任何操作;如果颜色格式信息指示为4:2:2采样(也可表示为YUV422),即亮度与色度样本之比为4:2:2,或者颜色格式信息指示为4:2:0采样(也可表示为YUV420),即亮度与色度样本之比为4:1:1,那么从相邻区域中获取的参考亮度信息的数量与参考色度信息的数量不同,这时候需要对从相邻区域中获取的参考亮度信息进行下采样滤波,以匹配参考色度信息的数量。
这样,对于从相邻区域中获取到的参考亮度信息进行的下采样滤波,可以采用多抽头滤波器(如四抽头滤波器、五抽头滤波器、六抽头滤波器等)进行下采样,或者获取参考色度像素对应位置的多个参考亮度像素的某个像素,甚至也可以是其它下采样方式,本申请实施例并不作具体限定。
示例性地,如图7A所示,当颜色格式信息指示为4:2:0采样时,以8×4亮度像素大小的相邻区域为例,这时候需要将其下采样为4×2像素大小的区域。其中,(a)表示参考亮度信息refY,加粗框内为同一色度像素所对应的4个亮度像素,(k,l)为其所对应的左上角像素位置;(b)表示下采样后的参考亮度信息refY’,加粗框内为下采样后的某个亮度像素,并且与(a)中加粗框内的4个亮度像素所对应的同个色度像素为同位置的亮度和色度像素对;(i,j)为该下采样后的亮度像素在下采样后的参考亮度信息中所处的位置;其中,i=0,…,3,j=0,1。
进一步地,在经过下采样滤波后的参考亮度信息的数量为L且与参考色度信息的数量相同时,此时还需要将L与预设个数进行匹配。因此,在一些实施例中,该方法还可以包括:
将L与预设个数进行比较;
根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,可以包括:
若L大于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
若L小于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,预设个数可以用inSize表示。其中,inSize表示基于加权系数进行预测时的输入个数,而且inSize的取值与当前块的种类有关。示例性地,假定当前块的宽度为nTbW,当前块的高度为nTbH,那么inSize的取值可以为2×nTbH+2×nTbW,也可以为1.5×nTbH+1.5×nTbW,甚至还可以为nTbH+nTbW,这里并不作具体限定。
还需要说明的是,在本申请实施例中,如果L等于预设个数,那么无需任何操作;如果L大于预设个数,那么需要对参考亮度信息和参考色度信息进行第一子滤波处理(即缩小尺寸);如果L小于预设个数,那么需要对参考亮度信息和参考色度信息进行第二子滤波处理(即放大尺寸)。
在另一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的 目标信息,可以包括:
对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值;
根据当前块的相邻区域中的第二颜色分量的滤波样值,确定当前块的目标信息。
在本申请实施例中,当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
在一种具体的实施例中,第三滤波处理为上采样滤波处理。示例性地,当前块的参考亮度信息的数量通常多于参考色度信息的数量,因此也可以对当前块的参考色度信息进行上采样滤波处理,以使得参考亮度信息的数量与参考色度信息的数量相同。
由于当前块的参考亮度信息的数量和参考色度信息的数量也会受到颜色格式信息的影响;因此,在一些实施例中,该方法还可以包括:基于颜色格式信息,对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值。
在一种具体的实施例中,对于第三滤波处理而言,还可以包括:
若颜色格式信息指示为4:4:4采样,则不对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;
若颜色格式信息指示为4:2:2采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;
若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波。
需要说明的是,在本申请实施例中,当颜色格式信息指示为4:2:0采样时,上采样率是2的正整数倍。这样,在从相邻区域中获取的参考亮度信息的数量与参考色度信息的数量不同时,可以对从相邻区域中获取的参考色度信息进行上采样滤波,以匹配参考亮度信息的数量。
这样,对于从相邻区域中获取到的参考色度信息进行的上采样滤波,可以采用线性插值或非线性插值等方式进行上采样,或者复制某个参考色度像素,甚至也可以是其它上采样方式,本申请实施例并不作具体限定。
示例性地,如图7B所示,当颜色格式信息指示为4:2:0采样时,以4×2色度像素大小的相邻区域为例,这时候需要将其上采样为8×4像素大小的区域。在图7B中,(a)表示参考色度信息refC,(b)表示上采样后的参考色度信息refC’;其中,(a)中加粗框内为(b)中加粗框内4个上采样后的色度像素所对应的色度像素,k=0,…,3,l=0,1。(b)中加粗框内4个色度像素为(a)中加粗框对应的上采样后的色度像素,(i,j)为左上角的像素位置。
进一步地,在经过上采样滤波后的参考色度信息的数量为K且与参考亮度信息的数量相同时,此时还需要将K与预设个数进行匹配。因此,在一些实施例中,该方法还可以包括:
将K与预设个数进行比较;
根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,可以包括:
若K大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
若K小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,预设个数可以用inSize表示。具体来讲,如果K等于inSize,那么无需任何操作;如果K大于inSize,那么需要对参考亮度信息和参考色度信息进行第一子滤波处理(即缩小尺寸);如果K小于inSize,那么需要对参考亮度信息和参考色度信息进行第二子滤波处理(即放大尺寸)。
还可以理解地,在本申请实施例中,如果不考虑颜色格式信息,那么还可以直接将从相邻区域中获 取到的参考亮度信息的数量、参考色度信息的数量与inSize进行匹配,以使得两者的数量相同。
在一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:
确定当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;
根据第一数量与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值,可以包括:
若第一数量大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值;
若第一数量小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,可以将从相邻区域中获取到的参考亮度信息的数量与预设个数进行匹配。其中,从相邻区域中获取到的参考亮度信息的数量(即第一数量)可以用refYnum表示;预设个数可以用inSize表示。具体来讲,如果refYnum等于inSize,那么无需任何操作;如果refYnum大于inSize,那么需要对参考亮度信息进行第一子滤波处理(即缩小尺寸);如果refYnum小于inSize,那么需要对参考亮度信息进行第二子滤波处理(即放大尺寸)。
在另一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,还可以包括:
确定当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;
根据第二数量与预设个数的比较结果,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值;
根据当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值,可以包括:
若第二数量大于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定当前块的第二颜色分量的滤波相邻样值;
若第二数量小于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定当前块的第二颜色分量的滤波相邻样值。
还需要说明的是,在本申请实施例中,可以将从相邻区域中获取到的参考色度信息的数量与预设个数进行匹配。其中,从相邻区域中获取到的参考色度信息的数量(即第二数量)可以用refCnum表示;预设个数可以用inSize表示。具体来讲,如果refCnum等于inSize,那么无需任何操作;如果refCnum大于inSize,那么需要对参考色度信息进行第一子滤波处理(即缩小尺寸);如果refCnum小于inSize,那么需要对参考色度信息进行第二子滤波处理(即放大尺寸)。
在这里,第一子滤波处理可以为下采样滤波处理。除此之外,在一些实施例中,第一子滤波处理,还可以包括下述至少一项:
采用固定间隔位置的选择方式进行子滤波处理;
采用连续位置的选择方式进行子滤波处理。
需要说明的是,以参考亮度信息为例,从相邻区域中获取到的参考亮度信息的数量为refYnum。如果采用固定间隔位置的选择方式进行缩小尺寸,即将refYnum个参考亮度像素按照一定位置关系排列为一维向量,然后根据inSize与refYnum的大小关系进行固定间隔选点,可以缩小参考亮度信息的尺寸。如图8所示,“L”形的一行和一列的参考区域中获取到的参考亮度信息refY,可以将其按照从左下到左上、再从左上到右上的位置关系重新排列为一维向量refY’。在这里,排列为一维向量的方式与固定间隔选择的起始位置均可以自由设置,这里并不作任何限定。这样,假定缩小尺寸采用的固定间隔为subDist,那么从该一维向量的第一个像素位置开始,每隔(subDist-1)个像素位置选择一个像素,最终可以得到inSize数量的参考亮度信息。
还需要说明的是,仍以参考亮度信息为例,如果采用连续位置的选择方式进行缩小尺寸,即将refYnum个参考亮度像素按照一定位置关系排列为一维向量,然后从该一维向量的预设位置连续选择inSize个像素,即可得到inSize数量的参考亮度信息。其中,预设位置可以是第一个像素位置,也可以是第pos个像素位置,这里也不作任何限定。
另外,第二子滤波处理可以为上采样滤波处理。除此之外,在一些实施例中,第二子滤波处理,还 可以包括:采用固定间隔位置的插值方式进行子滤波处理。
需要说明的是,如果采用固定间隔位置的插值方式进行放大尺寸,即将refCnum个参考色度像素按照一定位置关系排列为一维向量,然后根据inSize与refCnum的大小关系进行固定间隔选点,进行放大参考色度信息的尺寸。其中,排列为一维向量的方式与固定间隔插值的起始位置均可以自由设置,这里并不作任何限定。这样,对于参考亮度信息经过类似于缩小尺寸的排列方式后,得到一维向量;然后基于放大尺寸采用的固定间隔,从该一维向量的第一个像素位置开始,最终也可以插值得到inSize数量的参考亮度信息。
另外,需要注意的是,在对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理之后,根据当前块的第一颜色分量的滤波相邻样值,确定当前块的目标信息,这时候的目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值。同理,在对当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理之后,根据当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息,这时候的目标信息可以包括:当前块的第二颜色分量的滤波相邻样值、当前块的相邻区域中的第一颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值。或者,在对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,以及对当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理之后,这时候的目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的重建值。
还可以理解地,如果对当前块进行色度分量的预测,那么当前块的参考信息还可以包括当前块的重建亮度信息。因此,在一些实施例中,所述确定当前块的参考信息,还可以包括:基于当前块中第一参考颜色分量采样点的重建值,确定当前块的参考信息。
需要说明的是,在本申请实施例中,第一参考颜色分量可以为亮度分量;那么,当前块中第一参考颜色分量采样点的重建值即为当前块的重建亮度信息。
还需要说明的是,在本申请实施例中,由于当前块的重建亮度信息的数量与预设尺寸不同,因此还需要对当前块的重建亮度信息进行滤波处理,以将从当前块获取的重建亮度信息的数量转换为预设尺寸进行输入。在这里,预设尺寸为predSizeW×predSizeH;其中,predSizeW表示预测块的宽度,predSizeH表示预测块的高度。
在一些实施例中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:
对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;
根据当前块中第一参考颜色分量采样点的滤波样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值,可以包括:
根据当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;
若第一宽度大于预测块的宽度,或者第一高度大于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;
若第一宽度小于预测块的宽度,或者第一高度小于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值。
需要说明的是,在本申请实施例中,假定重建亮度信息的数量为recSizeW×recSizeH,那么recSizeW表示第一宽度,recSizeH表示第一高度。具体来讲,如果recSizeW等于predSizeW,并且recSizeH等于predSizeH,那么无需任何操作;如果recSizeW大于predSizeW,或者recSizeH大于predSizeH,那么需要对重建亮度信息进行第一子滤波处理(即缩小尺寸);如果recSizeW小于predSizeW,或者recSizeH小于predSizeH,那么需要对重建亮度信息进行第二子滤波处理(即放大尺寸)。
还需要说明的是,在本申请实施例中,第三子滤波处理可以为下采样滤波处理。除此之外,在一些实施例中,第三子滤波处理,还可以包括下述至少一项:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
在这里,首先可以根据recSizeW和predSizeW计算水平下采样因子,根据recSizeH和predSizeH 计算垂直下采样因子;然后,根据水平下采样因子和垂直下采样因子对重建亮度信息进行下采样滤波。具体来说,如果水平下采样因子大于1,垂直下采样因子等于1,那么只需要对重建亮度信息在水平方向进行下采样;如果水平下采样因子等于1,垂直下采样因子大于1,那么只需要对重建亮度信息在垂直方向进行下采样;如果水平下采样因子大于1,垂直下采样因子大于1,那么对重建亮度信息在水平方向和垂直方向都需要进行下采样,其中,可以执行先水平方向再垂直方向的下采样,也可以执行先垂直方向再水平方向的下采样,甚至还可以采用神经网络结构中的卷积操作代替这里的下采样操作,本申请实施例不作任何限定。
还需要说明的是,在本申请实施例中,第四子滤波处理为上采样滤波处理。除此之外,在一些实施例中,第四子滤波处理,还可以包括下述至少一项:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
在这里,首先根据recSizeW和predSizeW计算水平上采样因子,根据recSizeH和predSizeH计算垂直上采样因子;然后,根据水平上采样因子和垂直上采样因子对重建亮度信息进行上采样滤波。具体来说,如果水平上采样因子大于1,垂直上采样因子等于1,那么只需要对重建亮度信息在水平方向进行上采样;如果水平上采样因子等于1,垂直上采样因子大于1,那么只需要对重建亮度信息在垂直方向进行上采样;如果水平上采样因子大于1,垂直上采样因子大于1,那么对重建亮度信息在水平方向和垂直方向都需要进行上采样,其中,可以执行先水平方向再垂直方向的上采样,也可以执行先垂直方向再水平方向的上采样,甚至还可以将“先水平方向再垂直方向”的上采样结果和“先垂直方向再水平方向”的上采样结果进行加权平均以确定出最终的上采样结果,甚至还可以采用神经网络结构中的卷积操作代替这里的上采样操作,本申请实施例不作任何限定。
也就是说,在本申请实施例中,当前块的参考信息可以包括:当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值;目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值。其中,如果当前块的相邻区域中的第一颜色分量采样点的取值不需要进行滤波处理,那么当前块的第一颜色分量的滤波相邻样值等于当前块的相邻区域中的第一颜色分量采样点的取值;同理,如果当前块的相邻区域中的第二颜色分量采样点的取值不需要进行滤波处理,那么当前块的第二颜色分量的滤波相邻样值等于当前块的相邻区域中的第二颜色分量采样点的取值;如果当前块中第一参考颜色分量采样点的重建值不需要进行滤波处理,那么当前块中第一参考颜色分量采样点的滤波样值等于当前块中第一参考颜色分量采样点的重建值。
这样,所得到的目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值,也即:inSize数量的参考色度信息、inSize数量的参考亮度信息和符合预设尺寸的重建亮度信息。
S503:根据目标信息中的第一颜色分量的参考样值,确定加权系数。
需要说明的是,在确定出当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值之后,在一些实施例中,该方法还可以包括:将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
在一些实施例中,该方法还可以包括:将目标信息中的第二颜色分量的参考样值设置为当前块的第二颜色分量的滤波相邻样值。
另外,考虑到对参考信息的滤波处理,可以是仅对参考亮度信息进行滤波处理,也可以是仅对重建亮度信息进行滤波处理,还可以是仅对参考亮度信息和重建亮度信息进行滤波处理,甚至还可以是对参考色度信息、参考亮度信息和重建亮度信息都进行滤波处理,这里并不作任何限定。那么对于亮度差的计算,可以是参考亮度信息和重建亮度信息之差的绝对值,也可以是滤波处理后的参考亮度信息和重建亮度信息之差的绝对值,还可以是参考亮度信息和滤波处理后的重建亮度信息之差的绝对值,甚至还可以是滤波处理后的参考亮度信息和滤波处理后的重建亮度信息之差的绝对值。因此,在本申请实施例中,对于目标信息中的第一颜色分量的参考样值而言,该方法还可以包括:将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的重建值之差的绝对值;或者,将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分 量的滤波相邻样值与当前块中第一参考颜色分量采样点的重建值之差的绝对值;或者,将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值,这里对此不作具体限定。
在一些实施例中,所述根据目标信息中的第一颜色分量的参考样值,确定加权系数,可以包括:
确定在预设映射关系下第一颜色分量的参考样值对应的取值;
将加权系数设置为等于取值。
需要说明的是,在本申请实施例中,第一颜色分量的参考样值可以为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。其中,第一参考颜色分量为第一颜色分量,且第一颜色分量是与本申请实施例待预测的第二颜色分量不同的颜色分量。
示例性地,假定第一颜色分量为色度分量,第二颜色分量为亮度分量,本申请实施例主要是对当前块中待预测像素的色度分量进行预测。首先选取当前块中的至少一个待预测像素,分别计算其重建色度与相邻区域中的参考色度之间的亮度差(用|ΔC k|表示);不同位置的待预测像素在相邻区域的色度差存在差异,色度差最小的参考像素位置会跟随当前块中待预测像素的变化,通常色度差的大小代表色度之间的相近程度。如果|ΔC k|较小,表明色度值的相似性比较强,对应的加权系数(用w k表示)可以赋予较大的权重;反之,如果|ΔC k|较大,表明色度值的相似性比较弱,w k可以赋予较小的权重。也就是说,w k与|ΔC k|之间的关系近似呈反比。这样,根据|ΔC k|可以建立预设的映射关系,如下所示,
w k=f(|ΔC k|)                                  (1)
在这里,以式(1)为例,|ΔC k|表示第一颜色分量的参考样值,f(|ΔC k|)表示在预设映射关系下第一颜色分量的参考样值对应的取值,w k表示加权系数,即将w k设置为等于f(|ΔC k|)。
还需要说明的是,在本申请实施例中,如果第二颜色分量的参考样值的数量为N个,那么加权系数的数量也为N个;其中,N个加权系数之和等于1,且每一个加权系数均为大于或等于0且小于或等于1的值,即0≤w k≤1。但是需要注意的是,“N个加权系数之和等于1”仅属于理论概念;在实际的定点化实现过程中,加权系数的绝对值可以大于1。
可以理解地,在概率论和相关领域中,归一化指数函数,或称Softmax函数,是逻辑函数的一种推广。它能将一个含任意实数的N维向量z“压缩”到另一个N维向量σ(z)中,使得每一个元素的范围都在(0,1)之间,并且所有元素的和为1,经常被作为多分类神经网络的非线性激活函数。Softmax函数如下所示,
Figure PCTCN2022086469-appb-000001
然而,Softmax函数可以满足w k的条件约束,但是其函数值随向量元素的增大而增大,不符合w k与|ΔC k|近似反比的关系。因此,为了适应w k的设计,并且满足对w k非线性的期望,可以提出带参数γ的Softmax函数来实现式(1)的f函数,具体如下所示,
Figure PCTCN2022086469-appb-000002
其中,为了实现w k与|ΔC k|近似反比的关系,可以将γ限定为负数。也就是说,在第一参考颜色分量参数为|ΔC k|的情况下,|ΔC k|与w k之间的映射关系可以表示为:
Figure PCTCN2022086469-appb-000003
根据式(4),在一些实施例中,所述确定在预设映射关系下第一颜色分量的参考样值对应的取值,可以包括:
确定第一因子;
根据第一因子和第一颜色分量的参考样值,确定第一乘积值;
确定第一乘积值在预设映射关系下对应的取值。
需要说明的是,在本申请实施例中,第一因子为小于零的常数值。其中,以Softmax函数为例,在式(4)中,γ表示第一因子,|ΔC k|表示第一参考颜色分量参数,γ|ΔC k|表示第一乘积值,w k表示加权系数;k=1,2,…,N。
在一种具体的实施例中,所述确定第一因子,可以包括:第一因子是预设常数值。
需要说明的是,在这种情况下,对于γ而言,可以根据色度相对平坦的特性调整邻近色度的加权系数分布,从而捕获适合自然图像色度预测的加权系数分布。为了确定适合自然图像色度预测的参数γ,遍历给定的γ集合,通过不同γ下预测色度与原始色度间的差距来衡量γ合适与否。示例性地,γ可以取-2ε,其中ε∈{1,0,-1,-2,-3};经过试验发现,在此γ集合中,γ的最佳取值为-0.25。因此,在一种具体的实施例中,γ可以设置为-0.25,但是本申请实施例并不作具体限定。
在另一种具体的实施例中,所述确定第一因子,可以包括:根据当前块的尺寸参数,确定第一因子 的取值。
进一步地,在一些实施例中,该方法还可以包括:根据预设的当前块的尺寸参数与第一因子的取值映射查找表,确定第一因子的取值。
在这里,当前块的尺寸参数可以包括以下参数的至少之一:当前块的宽度,当前块的高度、当前块的宽度与高度的乘积。
需要说明的是,本申请实施例可以采用分类方式固定第一因子的取值。例如,将根据当前块的尺寸参数分为三类,确定每一类对应的第一因子的取值。针对这种情况,本申请实施例还可以预先存储当前块的尺寸参数与第一因子的取值映射查找表,然后根据该查找表即可确定出第一因子的取值。示例性地,表1示出了本申请实施例提供的一种第一因子与当前块的尺寸参数之间的对应关系。需要注意的是,表1仅是一种示例性查找表,并不作具体限定。
表1
当前块的尺寸参数 第一因子
Min(W,H)<=4 -0.125
Min(W,H)>4&&Min(W,H)<=16 -0.0833
Min(W,H)>16 -0.0625
在又一种具体的实施例中,所述确定第一因子,可以包括:根据当前块的参考像素数量,确定第一因子的取值。
进一步地,在一些实施例中,该方法还可以包括:根据预设的当前块的参考像素数量与第一因子的取值映射查找表,确定第一因子的取值。
需要说明的是,本申请实施例可以将参考像素数量划分为三类,仍然采用分类方式固定第一因子的取值。例如,将根据当前块的参考像素数量划分为三类,确定每一类对应的第一因子的取值。针对这种情况,本申请实施例也可以预先存储当前块的参考像素数量与第一因子的取值映射查找表,然后根据该查找表即可确定出第一因子的取值。示例性地,表2示出了本申请实施例提供的一种第一因子与当前块的参考像素数量之间的对应关系。需要注意的是,表2仅是一种示例性查找表,并不作具体限定。
表2
参考像素数量 第一因子
0<R<16 -0.1113
16<=R<32 -0.0773
R>=32 -0.0507
进一步地,对于第一乘积值而言,所述根据第一因子和第一颜色分量的参考样值,确定第一乘积值,可以包括:
将第一乘积值设置为等于第一因子和第一颜色分量的参考样值的乘积;或者,
将第一乘积值设置为等于对第一颜色分量的参考样值进行比特右移后得到的数值,其中,比特右移的位数等于第一因子;或者,
将第一乘积值设置为根据第一因子对第一颜色分量的参考样值进行加法和比特移位操作后得到的数值。
示例性地,假定第一因子等于0.25,第一颜色分量的参考样值用Ref表示,那么第一乘积值可以等于0.25×Ref,而0.25×Ref又可表示为Ref/4,即Ref>>2。另外,在定点化计算过程中,还有可能会将浮点数转换为加法和位移操作;也就是说,对于第一乘积值而言,其计算方式不作任何限定。
还可以理解地,在本申请实施例中,第一颜色分量也可以为亮度分量,第二颜色分量为色度分量,这时候选取当前块中的至少一个待预测像素,分别计算其重建亮度与相邻区域中的参考亮度之间的亮度差(用|ΔY k|表示)。其中,如果|ΔY k|较小,表明亮度值的相似性比较强,对应的加权系数(用w k表示)可以赋予较大的权重;反之,如果|ΔY k|较大,表明亮度值的相似性比较弱,w k可以赋予较小的权重,也就是说,在计算加权系数时,第一颜色分量的参考样值也可以为|ΔY k|,进而计算出加权系数。
需要注意的是,在对当前块中待预测像素的色度分量进行预测时,由于待预测像素的色度分量值无法直接确定,因而参考像素与待预测像素之间的色度差|ΔC k|也无法直接得到;但是当前块的局部区域内,分量间存在强相关性,这时候可以根据参考像素与待预测像素之间的亮度差|ΔY k|来推导得到|ΔC k|;即根据|ΔY k|和第二因子的乘积,可以得到|ΔC k|;这样,第一乘积值等于第一因子与|ΔY k|的乘积。
也就是说,在本申请实施例中,对于第一颜色分量的参考样值而言,其可以是|ΔC k|,即色度差的绝对值;或者也可以是|ΔY k|,即亮度差的绝对值;或者还可以是|αΔY k|,即亮度差的绝对值与预设乘子之积等等。其中,这里的预设乘子即为本申请实施例所述的第二因子。
进一步地,对于第二因子而言,在一种具体的实施例中,该方法还可以包括:根据参考像素的第一颜色分量值与参考像素的第二颜色分量值进行最小二乘法计算,确定第二因子。
也就是说,假定参考像素的数量为N个,参考像素的第一颜色分量值即为当前块的参考亮度信息,参考像素的第二颜色分量值即为当前块的参考色度信息,那么可以对N个参考像素的色度分量值和亮度分量值进行最小二乘法计算,得到第二因子。示例性地,最小二乘法回归计算如下所示,
Figure PCTCN2022086469-appb-000004
其中,L k表示第k个参考像素的亮度分量值,C k表示第k个参考像素的色度分量值,N表示参考像素的个数;α表示第二因子,其可以是采用最小二乘法回归计算得到。需要注意的是,第二因子也可以是固定取值或者基于固定取值进行微调整等等,本申请实施例并不作具体限定。
另外,对于预设映射关系而言,在一些实施例中,预设映射关系可以为预设函数关系。在一些实施例中,预设映射关系可以是Softmax函数。其中,Softmax函数是归一化指数函数,但是本申请实施例也可以不用归一化,其取值并不局限在[0,1]范围内。
示例性地,以|ΔY k|作为第一颜色分量的参考样值为例,那么第k个参考像素对应的加权系数w k可以由式(4)计算得到,也可以替换如下:
Figure PCTCN2022086469-appb-000005
Figure PCTCN2022086469-appb-000006
其中,S表示控制参数,S与第一因子(γ)之间的关系为:
Figure PCTCN2022086469-appb-000007
示例性地,S的取值与当前块的尺寸参数有关。其中,当前块的尺寸参数包括当前块的宽度和高度。在一种可能的实现方式中,如果宽度和高度的最小值小于或等于4,那么S的取值等于8;如果宽度和高度的最小值大于4且小于或等于16,那么S的取值等于12;如果宽度和高度的最小值大于16,那么S的取值等于16。在另一种可能的实现方式中,如果宽度和高度的最小值小于或等于4,那么S的取值等于7;如果宽度和高度的最小值大于4且小于或等于16,那么S的取值等于11;如果宽度和高度的最小值大于16,那么S的取值等于15。或者,S的取值与当前块的参考像素数量(R)有关。在一种可能的实现方式中,如果R小于16,那么S的取值等于8;如果R大于或等于16且小于32,那么S的取值等于12;如果R大于或等于16,那么S的取值等于16;本申请实施例对此均不作任何限定。
还需要说明的是,除了Softmax函数之外,在另一些实施例中,预设映射关系可以是与第一颜色分量的参考样值具有反比关系的加权函数。
示例性地,仍以|ΔY k|作为第一颜色分量的参考样值为例,还可以将式(4)的Softmax函数替换如下:
Figure PCTCN2022086469-appb-000008
Figure PCTCN2022086469-appb-000009
其中,k=1,2,…N,offset=1或2或0.5或0.25。
这样,预设映射关系为预设函数关系时,可以是如式(4)所示,也可以是如式(6)或式(7)所示,还可以是如式(8)或式(9)所示,甚至还可以是其他能够拟合参考像素的参考亮度值与当前块中待预测像素的亮度重建值越接近、参考像素的参考色度值对当前块中待预测像素的重要性越高的趋势构建加权系数的函数模型等,本申请实施例不作具体限定。
除此之外,在一些实施例中,预设映射关系还可以为预设的查表(look-up table)方式。也就是说,本申请实施例还可以简化操作,例如采用数组元素查表方式来减少一部分的计算操作。其中,对于预设映射关系而言,可以是:根据预设的第一颜色分量的参考样值、第一因子与数组元素的映射查找表,确定数组元素值;然后确定数组元素值在预设映射关系下对应的取值;再将加权系数设置为等于该取值。
具体来说,可以将计算加权系数的f模型通过简化操作实现,比如查表方式。其中,对于待预测像素(i,j)的亮度差|ΔY k|,也可以用|ΔY kij|表示;这样,通过f模型计算加权系数w kij=f(|ΔY kij|)。在这里,可将f模型中的分子以自变量|ΔY kij|和S种类数作为数组索引进行存储,后续f模型中涉及与分子计算相同的操作均通过查表得到,从而能够避免分子、分母部分的计算操作。
需要说明的是,在本申请实施例中,这里的存储可以分为完全存储或部分存储。
在一种具体的实施例中,完全存储是将|ΔY kij|值域范围、S种类数的分子全部存储,完全存储下需要开辟(|ΔY kij|值域范围乘以S种类数)大小的数组空间。其中,所需存储数组大小为|ΔY kij|值域范围大小,此时性能不变。
示例性地,以10比特(bit)像素、式(7)为例,变量|ΔY kij|值域范围为0~1023内的整数,S种类数为3,以|ΔY kij|和S种类数作为二维数组storMole的索引来完全存储分子:
Figure PCTCN2022086469-appb-000010
这时候,式(7)的加权系数计算可简化为:
Figure PCTCN2022086469-appb-000011
如此,二维数组storMole[索引1][索引2]的元素如表3所示。
表3
Figure PCTCN2022086469-appb-000012
进一步地,完全存储也可依照S的分类设置对应的数组偏移量,再根据(|ΔY kij|加偏移量)作为一维数组ostorMole的索引来完全存储分子,具体如下所示:
Figure PCTCN2022086469-appb-000013
这时候,式(7)的加权系数计算可简化为:
Figure PCTCN2022086469-appb-000014
如此,一维数组ostorMole[索引]的元素如表4所示。
表4
Figure PCTCN2022086469-appb-000015
Figure PCTCN2022086469-appb-000016
在另一种具体的实施例中,部分存储是将计算加权系数中的所有分子值选取部分进行存储,可选取|ΔY kij|部分值域范围和/或S部分种类的分子值进行存储,不在选取范围内的f模型值默认为0,所需的存储数组大小为(选取的|ΔY kij|值域范围乘以S的选取种类数)大小。
示例性地,以10bit像素、式(7)为例,假设选取|ΔY kij|值域范围为0~99整数、3种S的分子值进行部分存储,那么|ΔY kij|值域范围为0~99内的整数,S种类数为3,以此|ΔY kij|和S种类数作为二维数组partstorMole的索引来存储分子:
Figure PCTCN2022086469-appb-000017
这时候,式(7)的加权系数计算可简化为:
Figure PCTCN2022086469-appb-000018
如此,二维数组partstorMole[索引1][索引2]的元素如表5所示。
表5
Figure PCTCN2022086469-appb-000019
也就是说,部分存储的存储范围可根据实际需求进行存储,不局限于示例中的|ΔY kij|在100整数以内、3种S种类;部分存储同样也可对选取的部分S种类设置对应的偏移量从而开辟一维存储空间存储,本申请实施例对此不作任何限定。另外,对于表3~表5来说,为了定点化计算,这里也可以存储放大后的整数值;这样,后续在确定出预测值之后还需要进行相应的缩小操作。
这样,根据第一颜色分量的参考样值(例如|ΔY kij|),即可确定出加权系数,具体可以包括:w 1、w 2、…、w N等N个加权系数,其中,N表示第二颜色分量的参考样值的数量。在这里,理论上而言,这N个加权系数之和等于1,而且每一个加权系数均为大于或等于0且小于或等于1的值。但是需要注意的是,“N个加权系数之和等于1”仅属于理论概念;在实际的定点化实现过程中,加权系数的绝对值可以大于1。
S504:根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块。
S505:根据预测块,确定当前块的第二颜色分量采样点的重建值。
需要说明的是,在确定出加权系数之后,可以利用加权系数对第二颜色分量的参考样值进行加权计算,从而得到预测块中的第二颜色分量采样点的预测值。
在一些实施例中,根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块,可以包括:
确定第二颜色分量的参考样值与对应的加权系数的加权值;
将预测块中的第二颜色分量采样点的预测值设置为等于N个加权值之和;其中,N表示第二颜色分量的参考样值的数量,N是正整数。
也就是说,如果第二颜色分量的参考样值的数量有N个,那么首先确定每一个第二颜色分量的参考样值与对应的加权系数的加权值(即w kC k),然后将这N个加权值之和作为预测块中的第二颜色分量采样点的预测值。具体地,其计算公式具体如下,
Figure PCTCN2022086469-appb-000020
示例性地,首先根据当前块中(i,j)位置的重建亮度信息与相邻区域中的参考亮度信息,计算绝对亮度差值;然后再根据Softmax函数计算加权系数,进而可以利用式(16)得到预测块中(i,j)位置的色度分量的预测值。特别地,需要注意的是,这种方式利于并行处理,可以加快计算速度。
还需要说明的是,在本申请实施例中,第一颜色分量为亮度分量,第二颜色分量为色度分量,由于亮度分量的分辨率与色度分量的分辨率存在不同的情况,在对参考信息进行滤波处理时,包括对亮度分量经过下采样滤波方式以对齐色度分量的分辨率,或者对色度分量经过上采样滤波方式以对齐亮度分量的分辨率。
在本申请实施例中,预测块包含当前块中至少部分第二颜色分量采样点的预测值。如果预测块仅包含当前块中部分第二颜色分量采样点的预测值或者并未包含第二颜色分量采样点的预测值(需要对预测值进行滤波增强以得到最终的预测值)的情况,那么还可以对该预测块进行滤波处理。这时候,可以将该预测块称为第一预测块,然后对第一预测块进行上采样滤波处理,确定当前块的第二颜色分量的第二预测块,此时的第二预测块即为当前块最终的第二颜色分量的预测块,且包含当前块中全部第二颜色分量采样点的预测值。具体地,在一些实施例中,对第一预测块进行上采样滤波处理,确定当前块的第二颜色分量的第二预测块,可以包括:上采样滤波处理的输入是第一上采样输入块;上采样滤波处理的输出是第一上采样输出块。
进一步地,在一些实施例中,上采样滤波处理,可以包括:
确定上采样因子,其中,上采样因子包括以下至少之一:水平上采样因子、垂直上采样因子;
根据上采样因子对第一上采样输入块进行上采样滤波处理,得到第一上采样输出块。
在一种可能的实现方式中,根据上采样因子对第一上采样输入块进行上采样滤波处理,得到第一上采样输出块,可以包括:若水平上采样因子大于1,或者垂直上采样因子大于1,则对第一上采样输入块进行上采样滤波处理,得到第一上采样输出块。
在本申请实施例中,对第一上采样输入块进行上采样滤波处理,包括下述至少一项:
对第一上采样输入块在水平方向进行上采样滤波处理;
对第一上采样输入块在垂直方向进行上采样滤波处理;
对第一上采样输入块在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
对第一上采样输入块在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
在这里,首先可以根据第一上采样输入块的宽度和第一上采样输出块的宽度计算水平上采样因子,根据第一上采样输入块的高度和第一上采样输出块的高度计算垂直上采样因子;然后,根据水平上采样因子和垂直上采样因子对第一上采样输入块进行上采样滤波。具体来说,如果水平上采样因子大于1,垂直上采样因子等于1,那么只需要对第一上采样输入块在水平方向进行上采样;如果水平上采样因子等于1,垂直上采样因子大于1,那么只需要对第一上采样输入块在垂直方向进行上采样;如果水平上采样因子大于1,垂直上采样因子大于1,那么对第一上采样输入块在水平方向和垂直方向都需要进行上采样,其中,可以执行先水平方向再垂直方向的上采样,也可以执行先垂直方向再水平方向的上采样,甚至还可以采用神经网络结构中的卷积操作代替这里的上采样滤波操作,本申请实施例不作任何限定。
在另一种可能的实现方式中,对第一预测块进行上采样滤波,确定第二预测块。这时候,该方法还可以包括:将第一预测块作为第一上采样输入块;将第一上采样输出块作为当前块的第二颜色分量的第二预测块。
在另一种可能的实现方式中,对第一预测块先进行增强滤波,然后再进行上采样滤波,确定第二预测块。这时候,该方法还可以包括:对第一预测块进行滤波增强处理,确定第一增强预测块;将第一增强预测块作为第一上采样输入块;将第一上采样输出块作为当前块的第二颜色分量的第二预测块。
在又一种可能的实现方式中,对第一预测块先进行上采样滤波,然后再进行增强滤波,确定第二预测块。这时候,该方法还还可以包括:将第一预测块作为第一上采样输入块;将第一上采样输出块作为第一上采样滤波预测块;对第一上采样滤波预测块进行滤波增强处理,确定当前块的第二颜色分量的第二预测块。
在再一种可能的实现方式中,对第一预测块先进行增强滤波,再进行上采样滤波,然后再进行增强 滤波,确定第二预测块。这时候,该方法还还可以包括:对第一预测块进行第一滤波增强处理,确定第二增强预测块;将第二增强预测块作为第一上采样输入块;将第一上采样输出块作为第二上采样滤波预测块;对第二上采样滤波预测块进行第二滤波增强处理,确定当前块的第二颜色分量的第二预测块。
进一步地,对于预测块中的第二颜色分量采样点的预测值,通常还需要限定在一预设范围内。因此,在一些实施例中,该方法还可以包括:对预测块中的第二颜色分量采样点的预测值进行修正操作,确定当前块的第二颜色分量的预测块。
需要说明的是,在本申请实施例中,预设范围可以为:0到(1<<BitDepth)-1之间;其中,BitDepth为色度分量所要求的比特深度。如果预测值超出该预设范围的取值,那么需要对预测值进行相应的修正操作。示例性地,可以对
Figure PCTCN2022086469-appb-000021
进行钳位操作,具体如下:
Figure PCTCN2022086469-appb-000022
的值小于0时,将其置为0;
Figure PCTCN2022086469-appb-000023
的值大于或等于0且小于或等于(1<<BitDepth)-1时,其等于
Figure PCTCN2022086469-appb-000024
Figure PCTCN2022086469-appb-000025
的值大于(1<<BitDepth)-1时,其置为(1<<BitDepth)-1。
这样,在对预测值进行修正处理之后,可以保证预测块中所有第二颜色分量采样点的预测值都在0到(1<<BitDepth)-1之间。
进一步地,在确定出预测块之后,该预测块在一定条件下还需要后处理作为最终的预测块。因此,在一些实施例中,该方法还可以包括:
对预测块进行相关处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
在一种可能的实现方式中,对预测块进行相关处理,可以包括:对预测块进行滤波增强处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
需要说明的是,在WCP模式下,为了降低逐像素独立且并行预测带来的不稳定性,例如可以对预测块进行平滑滤波处理,然后将处理后的预测块作为最终的预测块。
在另一种可能的实现方式中,对预测块进行相关处理,可以包括:根据当前块的相邻区域中的参考样值,确定预测块的第二颜色分量的补偿值;根据补偿值对预测块中的第二颜色分量采样点的预测值进行修正处理,确定当前块的第二颜色分量的预测块。
需要说明的是,为了进一步提升WCP模式下的预测准确度,可以对预测块进行位置相关的修正过程。例如,利用空间位置接近的参考像素对每个待预测第二颜色分量采样点计算色度补偿值,用此色度补偿值对预测块中的第二颜色分量采样点进行修正,根据修正后的预测值确定第二颜色分量采样点的最终预测值(predSamples),进而得到最终的预测块。
在又一种可能的实现方式中,对预测块进行相关处理,可以包括:根据至少一种预测模式对预测块中的第二颜色分量采样点进行预测处理,确定预测块中的第二颜色分量采样点的至少一个初始预测值;根据至少一个初始预测值与预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定当前块的第二颜色分量的预测块。
需要说明的是,为了进一步提升WCP模式下的预测准确度,还可以将其他预测模式下计算的色度预测值与WCP模式下计算的色度预测值进行加权融合,根据此融合结果确定最终的色度预测块。示例性地,如图9所示,其他预测模式可以包括:平面(Planar)模式、直流(DC)模式、垂直模式、水平模式和CCLM模式等,而且每一个预测模式均与一个开关连接,该开关用于控制这种预测模式下的色度预测值是否参与加权融合处理。假定Planar模式对应的权重值为W_Planar、DC模式对应的权重值为W_DC、垂直模式对应的权重值为W_Ver、水平模式对应的权重值为W_Hor、CCLM模式对应的权重值为W_CCLM、WCP模式对应的权重值为W_Wcp;对于Planar模式下的色度预测值、DC模式下的色度预测值、垂直模式下的色度预测值、水平模式下的色度预测值和CCLM模式下的色度预测值,如果只有CCLM模式连接的开关处于闭合状态,那么可以根据W_CCLM和W_Wcp对CCLM模式下的色度预测值和WCP模式下的色度预测值进行加权融合,而根据W_CCLM和W_Wcp的取值可以决定是进行等权重或不等权重的加权融合,加权结果即为第二颜色分量采样点的最终色度预测值,进而得到最终的预测块。
在一些实施例中,在确定出预测块之后,所述根据所述预测块,确定所述当前块的第二颜色分量采样点的重建值,可以包括:
确定当前块的第二颜色分量采样点的预测差值;
根据预测块,确定当前块的第二颜色分量采样点的预测值;
根据当前块的第二颜色分量采样点的预测差值和当前块的第二颜色分量采样点的预测值,确定当前块的第二颜色分量采样点的重建值。
需要说明的是,在本申请实施例中,确定当前块的第二颜色分量采样点的预测差值(residual),可 以是通过解析码流,确定当前块的第二颜色分量采样点的预测差值。
还需要说明的是,在本申请实施例中,预测块可以包含当前块中至少部分第二颜色分量采样点的预测值。其中,如果预测块包含当前块中全部第二颜色分量采样点的预测值,那么可以将当前块的第二颜色分量采样点的预测值设置为等于预测块的值;如果预测块包含当前块中部分第二颜色分量采样点的预测值,那么可以对预测块的值进行上采样滤波,将当前块的第二颜色分量采样点的预测值设置为等于所述上采样滤波后的输出值。
也就是说,在本申请实施例中,根据预测块确定当前块的第二颜色分量采样点的预测值,可以是将当前块的第二颜色分量采样点的预测值设置为等于预测块的值;或者,还可以是对预测块的值进行滤波,然后将当前块的第二颜色分量采样点的预测值设置为等于所述滤波的输出值。
这样,以色度分量为例,通过解析码流,确定当前块的色度预测差值;然后根据预测块,可以确定当前块的色度预测值;然后对色度预测值和色度预测差值进行加法计算,可以得到当前块的色度重建值。
可以理解地,本申请实施例是对WCP模式的预测过程中输入信息的获取过程优化,主要包括三方面:一方面,充分考虑输入颜色格式信息的特性,提高参考亮度信息和参考色度信息的准确性;另一方面,充分利用空间相关性,对参考亮度信息、参考色度信息和当前块的重建亮度信息进行上采样、下采样、放大尺寸或缩小尺寸等滤波处理;又一方面,充分考虑预测块的相关信息,针对参考亮度信息、参考色度信息和当前块的重建亮度信息采用不同的滤波处理方法,以提高WCP预测技术的准确性。
简单来说,本申请实施例还提供了一种基于权重的色度预测的框架,如图10所示,对于下采样的当前块内重建亮度信息(即下采样亮度块)中的每个采样点recY[i][j],首先根据recY[i][j]与相邻亮度向量refY[k]的差值的绝对值得到亮度差向量diffY[i][j];其次,根据与diffY[i][j]相关的非线性映射模型,导出归一化权值向量cWeight[i][j];再次,利用权值向量,将权值向量与当前块的相邻色度向量进行向量乘法,可以得到预测的色度预测值
Figure PCTCN2022086469-appb-000026
本申请实施例还提供了一种解码方法,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;根据预测块,确定当前块的第二颜色分量采样点的重建值。这样,对于当前块的相邻区域中的颜色分量信息与当前块内的颜色分量信息,由于充分考虑了颜色格式信息的特性,能够提高这些参考信息的准确性;而且通过对这些参考信息进行上采样、下采样等滤波处理,还可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,利用滤波处理后得到的目标信息能够更好地进行色度预测,从而提高了色度预测的准确性,节省码率,同时提升编解码性能。
在本申请的另一实施例中,基于前述实施例所述的解码方法,以当前块进行色度预测为例,在本申请实施例中,当前块的重建亮度信息、相邻区域的参考亮度信息及参考色度信息都是已解码的参考信息。因此,本申请实施例提出了一种利用上述这些信息的基于权重的色度预测技术,并在根据这些信息确定当前块的目标信息过程中,可以对当前块的相邻区域的信息、当前块的信息及当前的颜色格式信息进行分析和处理。其中,相邻区域的信息主要是指相邻区域中采样点的位置、参考亮度信息及参考色度信息,当前块的信息主要是指当前块内的重建亮度信息,当前的颜色格式信息主要是指解码过程时的配置文件(*.cfg格式)中的InputChromaFormat参数,即输入视频的亮度与色度样本之比。
可以理解地,在本申请实施例中,主要提出了:(1)根据当前的颜色格式信息选择是否对相邻区域的参考亮度信息进行下采样或者选择是否对相邻区域的参考色度信息进行上采样;(2)相邻区域的参考亮度信息、参考色度信息和当前块内的重建亮度信息可以通过不同的放大/缩小尺寸的操作与核心参数的预设尺寸进行匹配。
在这里,WCP模式的色度预测过程的详细步骤如下:
WCP模式的输入:当前块的位置(xTbCmp,yTbCmp),当前块的宽度nTbW及当前块的高度nTbH。
WCP模式的输出:当前块的预测值predSamples[x][y],其中以当前块内左上角位置为坐标原点,x=0,...,nTbW-1,y=0,...,nTbH-1。
其中,WCP模式的预测过程可以包含确定核心参数、获取目标信息、基于权重的色度预测、后处理过程等步骤,而且在获取目标信息的过程中添加了前处理步骤。经过这些步骤之后,可以得到当前块的色度预测值。
在一种具体的实施例中,参见图11,其示出了本申请实施例提供的一种解码方法的流程示意图二。如图11所示,该方法可以包括:
S1101:确定WCP模式的核心参数。
需要说明的是,对于S1101而言,对WCP模式涉及的核心参数进行确定,即可以通过配置或通过 某种方式获取或推断WCP模式的核心参数,例如在解码端从码流获取核心参数。
在这里,WCP模式的核心参数包括但不限于控制参数(S)、基于权重的色度预测输入的个数(inSize)、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)。其中,基于权重的色度预测输出的预测块可以用predWcp表示,这里基于权重的色度预测输出的个数可以设置为相同的值(如predSizeW=predSizeH=T/4)或者与当前块的尺寸参数相关(如predSizeW=nTbW,predSizeH=nTbH)。其中,控制参数(S)可以用于对后续环节中非线性函数进行调整或用来对后续环节涉及的数据进行调整。
对于核心参数的确定,在一定条件下受块尺寸或块内容或块内像素数的影响。例如:
如果WCP模式应用的块尺寸种类较多或块尺寸之间的差异较大或块内容差异很大或块内像素数差异较大,可以对当前块根据其块尺寸或块内容或块内像素数进行分类,根据不同的类别确定相同或不同的核心参数。即不同类别对应的控制参数(S)或基于权重的色度预测输入的个数inSize或基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以相同或不同。注意,predSizeW和高predSizeH也可以相同或不同。
下面为了更好说明核心参数的确定,以两种简单分类为例进行说明:
分类示例1:WCP模式可以根据当前块的宽度和高度将当前块分类,用wcpSizeId表示块的种类。对不同种类的块,控制参数(S)、基于权重的色度预测输入的个数inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以相同或不同。这里以分为3类的一种示例进行说明:
根据当前块的宽度和高度将当前块分为3类,不同类别的控制参数(S)可以设为不同,不同类别的inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以设为相同。nTbW为当前块的宽度,nTbH为当前块的高度,块的种类wcpSizeId的定义如下:
wcpSizeId=0:表示min(nTbW,nTbH)<=4的当前块。其中,控制参数(S)为8,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=1:表示4<min(nTbW,nTbH)<=16的当前块。其中,控制参数(S)为12,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=2:表示min(nTbW,nTbH)>16的当前块。其中,控制参数(S)为16,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
以表格形式表示上述核心参数的数量关系,如表6所示。
表6
wcpSizeId S inSize predSizeH predSizeW
0 8 2×nTbH+2×nTbW nTbH nTbW
1 12 2×nTbH+2×nTbW nTbH nTbW
2 16 2×nTbH+2×nTbW nTbH nTbW
分为3类还可以另一种示例进行说明:
根据当前块的宽度和高度将当前块分为3类,不同类别的控制参数(S)可以设为不同,不同类别的inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以设为相同。nTbW为当前块的宽度,nTbH为当前块的高度,块的种类wcpSizeId的定义如下:
wcpSizeId=0:表示min(nTbW,nTbH)<=4的当前块。其中,控制参数(S)为8,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=1:表示4<min(nTbW,nTbH)<=16的当前块。其中,控制参数(S)为12,inSize为(1.5×nTbH+1.5×nTbW),基于权重的色度预测输出nTbH/2×nTbW/2个色度预测值;
wcpSizeId=2:表示min(nTbW,nTbH)>16的当前块。其中,WCP控制参数(S)为16,inSize为(nTbH+nTbW),基于权重的色度预测输出nTbH/4×nTbW/4个色度预测值;
以表格形式表示上述核心参数的数量关系,如表7所示。
表7
wcpSizeId S inSize predSizeH predSizeW
0 8 2×nTbH+2×nTbW nTbH nTbW
1 12 1.5×nTbH+1.5×nTbW nTbH/2 nTbW/2
2 16 nTbH+nTbW nTbH/4 nTbW/4
分类示例2:WCP模式也可以根据当前块的宽度和高度将当前块分类,用wcpSizeId表示块的种类。 对不同种类的块,控制参数(S)、基于权重的色度预测输入的个数inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以相同或不同。这里以分为3类的一种示例进行说明:
根据当前块的宽度和高度将当前块分为3类,不同类别的控制参数(S)可以设为不同,不同类别的inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以设为相同。nTbW为当前块的宽度,nTbH为当前块的高度,nTbW×nTbH表示当前块的像素数。块的种类wcpSizeId的定义如下:
wcpSizeId=0:表示(nTbW×nTbH)<128的当前块。其中,控制参数(S)为10,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=1:表示128<=(nTbW×nTbH)<=256的当前块。其中,控制参数(S)为8,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=2:表示(nTbW×nTbH)>256当前块。其中,控制参数(S)为1,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
以表格形式表示上述核心参数的数量关系,如表8所示。
表8
wcpSizeId S inSize predSizeH predSizeW
0 10 2×nTbH+2×nTbW nTbH nTbW
1 8 2×nTbH+2×nTbW nTbH nTbW
2 1 2×nTbH+2×nTbW nTbH nTbW
分为3类还可以另一种示例进行说明:
根据当前块的宽度和高度将当前块分为3类,不同类别的控制参数(S)可以设为不同,不同类别的inSize、基于权重的色度预测输出的个数(排列成predSizeW×predSizeH)可以设为相同。nTbW为当前块的宽度,nTbH为当前块的高度,nTbW×nTbH表示当前块的像素数。块的种类wcpSizeId的定义如下:
wcpSizeId=0:表示(nTbW×nTbH)<64的当前块。其中,控制参数(S)为16,inSize为(2×nTbH+2×nTbW),基于权重的色度预测输出nTbH×nTbW个色度预测值;
wcpSizeId=1:表示64<=(nTbW×nTbH)<=512的当前块。其中,控制参数(S)为4,inSize为(1.5×nTbH+1.5×nTbW),基于权重的色度预测输出nTbH/2×nTbW/2个色度预测值;
wcpSizeId=2:表示(nTbW×nTbH)>512的当前块。其中,控制参数(S)为1,inSize为(nTbH+nTbW),基于权重的色度预测输出nTbH/4×nTbW/4个色度预测值;
以表格形式表示上述核心参数的数量关系,如表9所示。
表9
wcpSizeId S inSize predSizeH predSizeW
0 16 2×nTbH+2×nTbW nTbH nTbW
1 4 1.5×nTbH+1.5×nTbW nTbH/2 nTbW/2
2 1 nTbH+nTbW nTbH/4 nTbW/4
S1102:根据核心参数,确定经过前处理操作后的目标信息。
需要说明的是,对于S1102而言,目标信息可以包括参考色度信息(refC)、参考亮度信息(refY)和重建亮度信息(recY)。其中,对于目标信息(即输入信息)的获取,在预测当前块时,当前块的上方区域、左上方区域及左方区域作为当前块的相邻区域(也可被称为“参考区域”),如前述的图6所示,相邻区域中的像素都是已解码的参考像素。
还需要说明的是,从相邻区域中获取参考色度信息refC和参考亮度信息refY。获取的参考色度信息包括但不限于:选取当前块的上方区域的参考色度重建值,和/或,左方区域的参考色度重建值。获取的参考亮度信息包括但不限于:根据参考色度信息位置获取对应的参考亮度信息。
获取当前块的重建亮度信息recY,获取方式包括但不限于:根据当前块内的色度信息位置获取对应的重建亮度信息作为当前块的重建亮度信息。
可以理解地,当上述中的从相邻区域中获取的参考色度信息refC、参考亮度信息refY这两者的数量与确定核心参数步骤中所规定的inSize存在部分不同或完全不同时,或者,当前块中获取到的重建亮度信息recY的数量与确定核心参数步骤中所规定的预设尺寸(predSizeW×predSizeH)不同时,那么需要对所获取的三个信息进行相关处理,此步骤发生在预测过程之前,因此将其命名为前处理操作的过 程。
在这里,本申请实施例主要针对确定核心参数步骤中所规定的inSize与从相邻区域中获取的参考色度信息refC的数量和参考亮度信息refY的数量不同的情况,或者当前块中获取到的重建亮度信息recY的数量与确定核心参数步骤中所规定的预设尺寸(predSizeW×predSizeH)不同的情况。下面将分别对这两种情况进行详细介绍:
第一种情况:若确定核心参数步骤中所规定的inSize与从相邻区域中获取的参考色度信息refC的数量和参考亮度信息refY的数量不同时,需要对从相邻区域中获取的参考色度信息refC和参考亮度信息refY的像素数转换为确定核心参数步骤中所规定的inSize进行输入,而当前的颜色格式信息也决定着参考色度信息与参考亮度信息的数量,那么第一种情况的前处理操作的具体过程如下:
(1)若考虑当前的颜色格式信息,通常将从相邻区域中获取的参考亮度信息与参考色度信息的数量进行统一后,再进行与核心参数中的inSize进行匹配,处理过程如下:
a、统一从相邻区域中获取的参考亮度信息与参考色度信息的数量为refNum。
●若当前的颜色格式信息指示为4:4:4采样(即为YUV444),此时亮度与色度样本之比为4:4:4时,从相邻区域中获取的参考亮度信息refY的数量与参考色度信息refC的数量相同,无需任何操作。
●若当前的颜色格式信息指示为4:2:2采样(即为YUV422),此时亮度与色度样本之比为4:2:2时,或者当前的颜色格式信息指示为4:2:0采样(即为YUV420),此时亮度与色度样本之比为4:1:1时,需要对从相邻区域中获取的参考亮度信息refY进行下采样,以匹配参考色度信息refC的数量;或者对从相邻区域中获取的参考色度信息refC进行上采样,以匹配参考亮度信息refY的数量。
●当前的颜色格式信息包括但不限于以上所提出的颜色格式信息,处理原则均为:当亮度与色度样本之比不同时,需要对参考亮度信息进行下采样或者对参考色度信息进行上采样。
b、将参考信息的数量refNum与核心参数中的inSize进行匹配。
●若inSize等于refNum,则无需任何操作。
●若inSize小于refNum,则需要对参考亮度信息和参考色度信息进行缩小尺寸。
●若inSize大于refNum,则需要对参考亮度信息和参考色度信息进行放大尺寸。
需要说明的是,第一种情况的处理过程中所提到的下采样过程具体如下:对于从相邻区域中获取的refNum数量的参考色度信息refC,对参考亮度信息refY的下采样可以采用多抽头滤波器进行下采样,或者获取参考色度像素对应位置的多个参考亮度像素的某个像素,以及其它下采样方式,本申请实施例不作任何限定。
示例性地,当颜色格式信息指示为4:2:0采样时,以8×4亮度像素大小的相邻区域为例,那么需要将其下采样为4×2像素大小的区域,如前述的图7A所示。在图7A中,(a)表示参考亮度信息refY,(b)表示下采样后的参考亮度信息refY’。其中,(a)中加粗框内为同一色度像素所对应的4个亮度像素,(k,l)为其所对应的左上角像素位置。(b)中加粗框内为下采样后的某个亮度像素,并且与这(a)中加粗框内的4个亮度像素所对应的同个色度像素为同位置的亮度和色度像素对,(i,j)为该下采样后的亮度像素在下采样后的参考亮度信息refY’中所处的位置;其中,i=0,…,3,j=0,1。
●若采用4抽头滤波器进行下采样,比如滤波器系数为[1,1,1,1],则refY’中的像素点的计算过程如下:
for i=0,…,3 and j=0,1
Figure PCTCN2022086469-appb-000027
●若采用5抽头滤波器进行下采样,比如滤波器系数为[1,1,4,1,1],则refY’中的像素点的计算过程如下:
for i=0,…,3 and j=0,1
Figure PCTCN2022086469-appb-000028
●若采用6抽头滤波器进行下采样,比如滤波器系数为[1,2,1,1,2,1],则refY’中的像素点的计算过程如下:
for i=0,…,3 and j=0,1
Figure PCTCN2022086469-appb-000029
●若获取参考色度像素对应位置的多个参考亮度像素的某个像素的方式进行下采样,比如左上角像素位置,则refY’中的像素点的计算过程如下:
for i=0,…,3 and j=0,1
refY′[i][j]=refY[k][l]                               (20)
第一种情况的处理过程中所提到的上采样过程具体如下:对于从相邻区域中获取的refNum数量的参考亮度信息refY,对参考色度信息refC的上采样可以采用线性插值或非线性插值等方式进行上采样,或者复制某个参考色度像素,以及其它上采样方式,本申请实施例也不作任何限定。
示例性地,当颜色格式信息指示为4:2:0采样时,以4×2色度像素大小的相邻区域为例,则需要将其上采样为8×4像素大小的区域,如图7B所示。在图7B中,(a)表示参考色度信息refC,(b)表示上采样后的参考色度信息refC’。其中,(a)中加粗框内为(b)中加粗框内4个上采样后的色度像素所对应的色度像素,k=0,…,3,l=0,1。(b)中加粗框内4个色度像素为(a)中加粗框对应的上采样后的色度像素,(i,j)为左上角的像素位置。
●若采用水平方向的线性插值进行上采样,则refC’中的像素点需要通过水平方向相邻的点进行线性插值,比如:
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         (24)
其中,offset=1<<(shift-1)。对于{w0,w1,w2,w3,w4,w5,w6,w7}和shift可以根据块尺寸或块内容进行不同的选择,这里举例一种常用的系数组合:
Figure PCTCN2022086469-appb-000030
●若采用垂直方向的线性插值进行上采样,则refC’中的像素点需要通过垂直方向相邻的点进行线性插值,比如:
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)
其中,offset=1<<<(shift-1)。对于{w0,w1,w2,w3,w4,w5,w6,w7}和shift可以根据块尺寸或块内容进行不同的选择,这里举例一种常用的系数组合:
Figure PCTCN2022086469-appb-000031
●若采用复制某个参考色度像素进行上采样,则refC’中的像素点的计算过程如下:
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)若不考虑当前的颜色格式信息,只需与核心参数中的inSize进行匹配,处理过程如下:
a、将从相邻参考区域获取到的参考亮度信息的数量refYnum与核心参数中的inSize进行匹配。
●若inSize等于refYnum,则无需任何操作。
●若inSize小于refYnum,则需要对参考亮度信息进行缩小尺寸。
●若inSize大于refYnum,则需要对参考亮度信息进行放大尺寸。
b、将从参考区域获取到的参考色度信息的数量refCnum与WCP核心参数的inSize进行匹配。
●若inSize等于refYnum,则无需任何操作。
●若inSize小于refYnum,则需要对参考色度信息进行缩小尺寸。
●若inSize大于refYnum,则需要对参考色度信息进行放大尺寸。
第一种情况的处理过程中所提到的缩小尺寸的操作过程具体如下:以参考亮度信息为例,从相邻区域中获取到的参考亮度信息的数量为refYnum。
●若采用固定间隔的选点方式进行缩小尺寸,即将refYnum个参考亮度像素按照一定位置关系排列为一维向量,然后根据inSize与refYnum的大小关系进行固定间隔选点,可以缩小参考亮度信息的尺寸。其中,排列为一维向量的方式与固定间隔选择的起始位置均可以自由设置,本申请实施例不作任何限定。
示例性地,如图8所示,“L”形的一行和一列的参考区域中获取到的参考亮度信息refY,可以将其按照从左下到左上、再从左上到右上的位置关系重新排列为一维向量refY’。
在这里,缩小尺寸采用的固定间隔subDist=(refYnum+inSize-1)/inSize,从上述得到的refY’的第一个像素位置开始,每隔(subDist-1)个像素位置选择一个像素,最终得到inSize数量的参考亮度信息in_refY,详细过程如下:
for i=0,…,inSize-1
in_refY[i]=refY′[i×subDist]                           (33)
●若采用连续位置的选择方式进行缩小尺寸,即将refYnum个参考亮度像素按照一定位置关系排列为一维向量,然后从该一维向量的某个位置连续选择inSize个像素,即为in_refY,比如从refY’的第pos个位置开始选择,则详细过程如下:
for i=0,…,inSize-1
in_refY[i]=refY′[pos+i]                               (34)
第一种情况的处理过程中所提到的放大尺寸的操作过程具体如下:以参考色度信息为例,从相邻区域中获取到的参考色度信息的数量为refCnum。
●若采用固定间隔的插值方式进行放大尺寸,即将refCnum个参考色度像素按照一定位置关系排列为一维向量,然后根据inSize与refCnum的大小关系进行固定间隔选点,可以放大参考色度信息的尺寸。其中,排列为一维向量的方式与固定间隔插值的起始位置均可以自由设置,本申请实施例也不作任何限定。refY经过类似于缩小尺寸的排列方式后,得到了一维向量refY’,然后,放大尺寸采用的固定间隔subDist=(refCnum+inSize-1)/refCnum,从refY’的第一个像素位置开始,最终得到inSize数量的参考亮度信息in_refY,若采用线性插值的方式,则详细过程如下:
for i=0,…,inSize-1
if(i%subDist==0)
in_refY[i]=refY′[i×subDist]                               (35)
else
Figure PCTCN2022086469-appb-000032
其中,{w0,w1}根据固定间隔的值大小随位置而改变,offset=1<<(shift-1),shift可以根据块尺寸或块内容进行不同的选择,若subDist=3,这里举例一种常用的系数组合:
Figure PCTCN2022086469-appb-000033
第二种情况:若从当前块获取的重建亮度信息recY的数量(recSizeW×recSizeH)与确定核心参数步骤中所规定的预设尺寸(predSizeW×predSizeH)不同时,需要将从当前块获取的重建亮度信息recY的数量转换为确定WCP核心参数步骤中所规定的预设尺寸(predSizeW×predSizeH)进行输入,该过程具体如下:
●若recSizeW等于predSizeW,并且recSizeH等于predSizeH,则无需任何操作;
●若recSizeW大于predSizeW,或recSizeH大于predSizeH,则需要对重建亮度信息recY进行缩小尺寸。
●若recSizeW小于predSizeW,或recSizeH小于predSizeH,则需要对重建亮度信息recY进行放大尺寸。
第二种情况的处理过程中所提到的缩小尺寸的操作过程具体如下:首先根据核心参数确定的宽度predSizeW和重建亮度信息recY的宽度recSizeW,计算得到水平下采样因子downHor;同样根据核心参数确定的高度predSizeH和重建亮度信息recY的高度recSizeH,计算得到垂直下采样因子downVer,计算方法如下所示:
downHor=recSizeW/predSizeW                             (37)
downVer=recSizeH/predSizeH                             (38)
接着按照如下情况进行下采样,从而生成输入的重建亮度信息in_recY:
(1)若downHor大于1,downVer等于1,则只需要水平方向进行下采样,具体公式如下:
in_recY[x][y]=(recY[downHor×x-1][y]+2×recY[downHor×x][y]+recY[downHor×x+1][y]+2)>>2                  (39)
(2)若downHor等于1,downVer大于1,则只需要垂直方向进行下采样,具体公式如下:
in_recY[x][y]=(recY[x][downVer×y-1]+2×recY[x][downVer×y]+recY[x][downVer×y+1]+2)>>2               (40)
(3)若downHor和downVer都大于1,则水平和垂直方向都需要进行下采样,具体公式如下:
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)
第二种情况的处理过程中所提到的放大尺寸的操作过程具体如下:首先根据核心参数确定的宽度predSizeW和重建亮度信息recY的宽度recSizeW,计算得到水平上采样因子upHor;同样根据核心参数确定的高度predSizeH和重建亮度信息recY的高度recSizeH,计算得到垂直上采样因子upVer,计算方法如下所示:
upHor=predSizeW/recSizeW                                (42)
upVer=predSizeH/recSizeH                                 (43)
接着按照如下情况进行上采样,从而生成输入的重建亮度信息in_recY:
先将上参考重建亮度像素refY_T填入到将要输入的重建亮度信息的上一行in_recY[x][-1],将左参考重建亮度像素refY_L填入到将要输入的重建亮度信息的左一列in_recY[-1][y]。其中,x=0,…,predSizeW-1,y=0,…,predSizeH-1。此时通过下式将recY放入in_recY中对应位置((x+1)×upHor-1,(y+1)×upVer-1)中:
in_recY[(x+1)×upHor-1][(y+1)×upVer-1]=recY[x][y]          (44)
可以理解为将in_recY均等划分为recSizeW×recSizeH个子块,则放入的位置就是每个子块的右下角位置。参见图12,以predSizeW=8和predSizeH=8、当前块尺寸为4×4为例,其中,斜纹填充为上参考重建亮度像素refY_T,竖条填充为左参考重建亮度像素refY_L,网格填充为当前块的重建亮度信息recY填入的位置。
●若水平上采样因子upHor大于1,则先进行水平方向上的上采样,上采样过程如下式所示:
sum=(upHor-dX)×rec_Y[xHor][yHor]+dX×rec_Y[xHor+upHor][yHor]          (45)
Figure PCTCN2022086469-appb-000034
该过程参见图13,以predSizeW=8和predSizeH=8、当前块尺寸为4×4为例,水平上采样时左参考亮度像素refY_L中与rec_Y填入水平位置对应的点也会作为上采样的参考点,这里也将其用网格填充标识。则此时网格填充点均为上采样的参考点,水平方向上每两个网格填充点之间通过线性插值得到的预测点用横条填充标识。
上采样方法采用线性插值上采样,即两个上采样亮度参考点(网格填充)之间的每个插值出来的点(横条填充)的值都是两个上采样参考亮度点的加权平均。根据式(45)和式(46),左侧上采样参考色度点的权重为(upHor-dX)/upHor,右侧上采样参考色度点的权重为dX/upHor,其中,dX=1,…,upHor-1(即当前插值点与左侧参考点之间的距离)。这样,在水平方向插值时,权重仅与水平上采样因子upHor有关。图14展示了一个权重的示例。在该示例中,upHor=4。其中,对于图14中的第一个插值点,左侧上采样参考色度点的权重为3/4,右侧上采样参考色度点的权重为1/4;对于图14中的第二个插值点,左侧上采样参考色度点的权重为2/4,右侧上采样参考色度点的权重为2/4;对于图14中的第三个插值点,左侧上采样参考色度点的权重为1/4,右侧上采样参考色度点的权重为3/4。
●若垂直上采样因子upVer大于1,需要进行垂直方向上的上采样,该过程与水平上采样过程类似。具体过程如下式所示:
sum=(upVer-dY)×rec_Y[xVer][yVer]+dY×rec_Y[xVer][yVer+upVer]             (47)
Figure PCTCN2022086469-appb-000035
该过程参见图15,以predSizeW=8和predSizeH=8、当前块尺寸为4×4为例,在完成如图13所示的水平上采样后,上参考亮度像素refY_T和in_recY所有已有的点都将作为垂直上采样的参考点,这里也都将其用网格填充标识。那么此时网格填充点均为上采样的参考点,垂直方向上每两个网格填充点之间通过线性插值得到预测点用横条填充标识。
上采样方法同样使用线性插值,根据式(47)和式(48),上侧上采样参考点的权重为(upVer-dY)/upVer,下侧参考点的权重为dY/upVer,其中,dY=1,…,upVer-1(即当前插值点与上侧参考点之间的距离)。 这样,在垂直插值时,权重仅与垂直上采样因子upVer有关。
这样,根据上述过程即可得到最终的in_recY。针对上述放大尺寸的过程,除了采用“先水平再垂直”的上采样方法,也可以采用“先垂直再水平”的上采样方法,还可以将“先水平再垂直”上采样后的重建亮度值和“先垂直再水平”上采样后的重建亮度值进行平均以得到最终输入的重建亮度值in_recY,也可以采用神经网络中的卷积操作代替上采样操作,本申请实施例对此均不作任何限定。
如此,最终获取输入的目标信息可以包括:inSize数量的参考色度信息refC、inSize数量的参考亮度信息refY以及当前预测块的重建亮度信息recY。
S1103:根据目标信息进行基于权重的色度预测计算,确定当前块的预测块。
需要说明的是,对于S1103而言,对于核心参数所规定的预设尺寸内的色度预测值用C pred[i][j]表示,其中,i=0,…,predSizeW-1,j=0,…,predSizeH-1,逐个进行获取。注意,predSizeH和predSizeW为核心参数,可与当前块的高度nTbH或宽度nTbW相同或不同。这样在一定条件下,也可只对当前块内的部分待预测像素进行以下计算。
其中,WCP模式的色度预测计算可以包括以下操作:通过获取权重、根据权重进行加权预测得到基于权重的色度预测值。而权重的获取过程包括构造亮度差向量和计算权重。其详细计算过程如下:
对于i=0,…,predSizeW-1,j=0,…,predSizeH-1
对于k=0,1...,inSize-1
构造亮度差向量中各个元素diffY[i][j][k]
计算权重向量中各个元素cWeight[i][j][k](或cWeightFloat[i][j][k]),然后由cWeight[i][j](或cWeightFloat[i][j][k])和refC计算色度预测值C pred[i][j]。
在一种具体的实施例中,参见图16,其示出了本申请实施例提供的一种解码方法的流程示意图三。如图16所示,该方法可以包括:
S1601:对于每个待预测像素,利用目标信息所包括的参考色度信息、参考亮度信息和当前块的重建亮度信息构造亮度差向量。
需要说明的是,对核心参数所规定尺寸内的每个待预测像素C pred[i][j],将其对应的重建亮度信息recY[i][j]与inSize数量的参考亮度信息refY相减并取绝对值得到亮度差向量diffY[i][j][k]。具体计算公式如下:
diffY[i][j][k]=abs(refY[k]-recY[i][j])                             (49)
其中,
Figure PCTCN2022086469-appb-000036
abs(x)表示x的绝对值。
还需要说明的是,在一定条件下,可以对待预测像素的亮度差向量进行线性或非线性数值处理。例如,可根据核心参数中的控制参数S来缩放待预测像素的亮度差向量的数值。
S1602:对于每个待预测像素,根据亮度差向量,利用非线性函数计算权重向量。
需要说明的是,在本申请实施例中,采用权重模型对每个待预测像素C pred[i][j]对应的亮度差向量diffY[i][j]进行处理得到对应的浮点型权重向量cWeightFloat[i][j]。这里的权重模型包括但不限于非线性归一化函数、非线性指数归一化函数等等非线性函数,并不作任何限定。
示例性地,可以采用非线性Softmax函数作为权重模型,每个待预测像素对应的亮度差向量diffY[i][j]作为权重模型的输入,该权重模型输出每个待预测像素对应的浮点型权重向量cWeightFloat[i][j],计算公式如下所示:
Figure PCTCN2022086469-appb-000037
在一定条件下,也可以根据核心参数中的控制参数(S)对权重模型进行调整。示例性地,如果当前块的尺寸灵活,那么可以根据控制参数(S)调整权重模型,以非线性Softmax函数为例,可根据当前块所属的块分类类别不同,选取不同的控制参数来调整函数,此时每个待预测像素对应的权重向量计算公式如下所示:
Figure PCTCN2022086469-appb-000038
在本申请实施例中,还可以对加权系数进行定点化处理。因此,在一些实施例中,该方法还包括:若加权系数为浮点加权系数,则对浮点加权系数进行定点化处理,得到定点加权系数。
如此,在上述式(50)或者式(51)计算完毕之后,可以对cWeightFloat进行定点化处理,如下所示:
cWeight[i][j][k]=round(cWeightFloat[i][j][k]×2 Shift)                (52)
其中,round(x)=Sign(x)×Floor(abs(x)+0.5)。这里,Floor(x)表示小于或等于x的最大整数,
Figure PCTCN2022086469-appb-000039
Figure PCTCN2022086469-appb-000040
abs(x)表示x的绝对值。另外,Shift是为了提高精度采取的定点化操作中所设置的移位量。
S1603:对于每个待预测像素,根据权重向量与目标信息所包括的参考色度信息进行加权计算,得到色度预测值。
需要说明的是,根据每个待预测像素对应的权重向量cWeight[i][j](或cWeightFloat[i][j])和参考色度信息refC计算待预测像素的色度预测值。具体地,将每个待预测像素C pred[i][j]的参考色度信息refC与每个待预测像素对应的权重向量元素逐一对应相乘得到subC[i][j](或subCFloat[i][j]),将相乘结果累加即为每个待预测像素的色度预测值C pred[i][j],即实现对色度分量的加权预测。
在一种可能的实现方式中,可以包括:根据浮点加权系数和参考色度信息进行加权计算,得到待预测像素的初始预测值;对初始预测值进行定点化处理,得到待预测像素的目标预测值。
示例性地,计算公式如下所示:
对于k=0,1,...,inSize-1
subCFloat[i][j][k]=(cWeightFloat[i][j][k]×refC[k])               (53)
在计算完毕之后,还可以对subCFloat[i][j][k]进行定点化处理,定点化过程中为保留一定的计算精度,这里可以乘上一个系数,具体如下所示:
subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift)             (54)
或者:
对于i=0,…,predSizeW-1,j=0,…,predSizeH-1
Figure PCTCN2022086469-appb-000041
在计算完毕后,对C predFloat[i][j]进行定点化,如:
C pred[i][j]=round(C predFloat[i][j])                            (56)
在另一种可能的实现方式中,可以根据定点加权系数和参考色度信息进行加权计算,得到待预测像素的初始预测值;对初始预测值进行定点化补偿处理,得到待预测像素的目标预测值。
示例性地,计算公式如下所示:
对于k=0,1,...,inSize-1
subC[i][j][k]=(cWeight[i][j][k]×refC[k])                         (57)
然后使用定点化的subC[i][j][k]进行计算,具体如下:
对于i=0,…,predSizeW-1,j=0,…,predSizeH-1
Figure PCTCN2022086469-appb-000042
其中,Offset=1<<(Shift 1-1),Shift 1是在计算cWeight[i][j][k]或者subC[i][j][k]时(Shift 1=Shift),也可以是其他环节为了提高精度采取的定点化操作中需要的移位量。
S1604:对于每个待预测像素,对计算得到的色度预测值进行修正处理,确定当前块的预测块。
需要说明的是,色度预测值应该限定在一预设范围内。如果超出该预设范围,那么需要进行相应的修正操作。示例性地,在一种可能的实现方式中,可以对C pred[i][j]的色度预测值进行钳位操作,具体如下:
●当C pred[i][j]的值小于0时,将其置为0;
●当C pred[i][j]的值大于(1<<BitDepth)-1时,其置为(1<<BitDepth)-1。
其中,BitDepth为色度像素值所要求的比特深度,以保证预测块中所有色度预测值都在0到(1<<BitDepth)-1之间。
即:
C pred[i][j]=Clip3(0,(1<<BitDepth)-1,C pred[i][j])                   (59)
其中,
Figure PCTCN2022086469-appb-000043
或者,将式(59)和式(60)进行合并,得到如下公式所示:
Figure PCTCN2022086469-appb-000044
S1104:对该预测块进行后处理操作,确定当前块的目标预测块。
需要说明的是,基于权重的色度预测输出的色度预测值(predWcp)之后,在一定条件下还需要后处理操作后作为最终的色度预测值(predSamples),否则最终的色度预测值predSamples即为predWcp。
示例性地,为了降低WCP逐像素独立并行预测带来的不稳定性,可以对predWcp进行平滑滤波作 为最终的色度预测值predSamples。或者,为了进一步提升WCP预测值的准确性,可以对predWcp进行位置相关的修正过程。比如:利用空间位置接近的参考像素对每个待预测像素计算色度补偿值,用此色度补偿值对predWcp进行修正,将修正后的预测值作为最终的色度预测值predSamples。或者,为了进一步提升WCP预测值的准确性,可以将其他色度预测模式计算的色度预测值与WCP计算的色度预测值predWcp进行加权融合,将此融合结果作为最终的色度预测值predSamples。比如:可以将CCLM模式预测得到的色度预测值与WCP计算的色度预测值predWcp进行等权重或不等权重加权,加权结果作为最终的色度预测值predSamples。或者,为了提高WCP预测性能,可以采用神经网络模型对WCP的预测输出predWcp进行修正等等,本申请实施例对此不作任何限定。
还可以理解地,在本申请实施例中,如果已经得到了WCP模式所确定的inSize参数大小的参考色度信息redCref和参考亮度信息redYref,以及WCP模式所确定的(predSizeW×predSizeH)参数大小的当前块的重建亮度信息redYrec。由于上述三个信息的某些已经经过上采样、下采样或缩小/放大尺寸的操作,或者并未经过这些操作,但它们之间仍旧存在空间冗余。这时候,可以将参考色度信息redCref、参考亮度信息redYref和重建亮度信息redYrec进行滤波操作,可以根据WCP模式所确定的inSize和predSizeW×predSizeH的不同参数值下采用不同的滤波操作,得到新的三组信息,包括参考色度信息redCref’、参考亮度信息redYref’和重建亮度信息redYrec’。例如,通过均值、中值和高斯的线性滤波和非线性滤波或者神经网络等方法对redCref、redYref和redYrec进行滤波等等。另外,这些滤波操作也可以发生在上采样、下采样或缩小/放大尺寸的操作之前,以得到新的三组信息,包括参考色度信息refC’、参考亮度信息refY’和重建亮度信息recY’,再对其进行上采样、下采样或缩小/放大尺寸的操作。
还可以理解地,在本申请实施例中,从相邻区域中获取的参考色度信息refC的数量为refSizeC,参考亮度信息refY的数量为refSizeY;从当前块获取的重建亮度信息recY的尺寸为recSizeW×recSizeH,recSizeW为重建亮度信息recY的块宽度,recSizeH为重建亮度信息recY的块高度。这些参考色度信息、参考亮度信息和重建亮度信息均使用神经网络与确定核心参数步骤中所规定的inSize和(predSizeW×predSizeH)进行匹配,三者可根据各类情况采用相同或者不同的神经网络模型,即上采样、下采样或缩小/放大尺寸的操作均由神经网络模型所替代。另外,前述实施例所涉及的滤波操作也可以发生在使用神经网络模型之前或者之后进行实施,以得到新的三组信息,包括参考亮度信息、参考色度信息和重建亮度信息。
还可以理解地,在本申请实施例中,WCP模式的基于权重的色度预测中某个预测色度像素所采用的参考信息是固定的,这必然会影响预测准确度。因此,这里还提出一种将每个像素的参考像素进行改变的方案,详细过程如下:
首先,核心参数包括但不限于控制参数(S)、基于权重的色度预测输入的个数inSize[i][j]、基于权重的色度预测输出(predWcp)的个数(排列成predSizeW×predSizeH)。其中,inSize[i][j]表示某个待预测像素C pred[i][j]所使用的参考像素数目,i=0,…,predSizeW-1,j=0,…,predSizeH-1。
其次,从相邻区域中获取参考色度信息refC和参考亮度信息refY。获取的参考色度信息包括但不限于:选取当前块的上方区域的参考色度重建值,和左方区域的参考色度重建值。获取的参考亮度信息包括但不限于根据参考色度信息位置获取对应的参考亮度信息。
获取当前块的重建亮度信息recY,获取方式包括但不限于根据当前块内色度信息位置获取对应的重建亮度信息作为当前块的重建亮度信息。
再次,针对predSizeW×predSizeH尺寸块的不同的预测位置,从相邻区域中获取参考色度信息refC和参考亮度信息refY中选择不同的参考亮度信息refY[i][j]与参考色度信息refC[i][j],详细过程如下:
对于i=0,…,predSizeW-1,j=0,…,predSizeH-1
对于k=0,1,...,inSize-1
获取输入的目标信息包括:获取inSize[i][j]数量的参考色度信息refC、获取inSize[i][j]数量的参考亮度信息refY及获取重建亮度信息recY[i][j]。
再次,对核心参数所规定尺寸内的每个待预测像素C pred[i][j],将其对应的重建亮度信息recY[i][j]与inSize[i][j]数量的参考亮度信息refY[i][j]相减并取绝对值得到亮度差向量diffY[i][j][k]。其中,refY[i][j]为待预测像素
Figure PCTCN2022086469-appb-000045
所对应的一组参考亮度向量。详细计算过程如下:
对于i=0,…,predSizeW-1,j=0,…,predSizeH-1
对于k=0,1,...,inSize[i][j]-1
diffY[i][j][k]=abs(refY[i][j][k]-recY[i][j])                         (62)
在一定条件下,可对待预测像素的亮度差向量进行线性或非线性数值处理。示例性地,可根据核心参数中的控制参数S缩放待预测像素的亮度差向量的数值。
再次,根据每个待预测像素对应的权重向量cWeight[i][j]和参考色度信息refC计算待预测像素的色 度预测值。具体地,将每个待预测像素C pred[i][j]的参考色度信息refC[i][j]与每个待预测像素对应的权重向量元素逐一对应相乘得到subC[i][j],将相乘结果累加即为每个待预测像素的色度预测值C pred[i][j](即加权预测)。其中,refC[i][j]为待预测像素C pred[i][j]所对应的一组参考色度向量,计算公式如下所示:
对于k=0,1,...,inSize-1
subCFloat[i][j][k]=(cWeightFloat[i][j][k]·refC[i][j][k])                   (63)
在计算完毕之后,可以对subCFloat进行定点化,定点化过程中为保留一定的计算精度,还可以乘上一个系数,如下式所示:
subC[i][j][k]=round(subCFloat[i][j][k]×2 Shift)                      (64)
或者,
subC[i][j][k]=(cWeight[i][j][k]×refC[i][j][k])                        (65)
还可以理解地,在本申请实施例中,相邻区域与其他已有的色度预测模式所采用的相邻区域是相同的,这必然会影响预测准确度。因此,还可以将相邻区域进行变化。示例性地,可以将H.266中已有的多参考行技术用来进行扩展WCP预测技术的参考区域,如图17所示,可以扩展到0、1、2、3、4、5、6、7等多行或多列的相邻区域作为当前块的参考区域;但并不局限于此技术,也可以将参考行或参考列进行增多或者减少,本申请实施例并不作具体限定。
本实施例提供了一种解码方法,通过本实施例对前述实施例的具体实现进行详细阐述,从中可以看出,根据前述实施例的技术方案,可以提高WCP预测技术的准确性。具体地,通过对获取目标信息过程的优化,在不同的核心参数的情况下,根据当前不同的颜色格式信息或者不同的获取到信息的数量,采用不同的处理方式,包括上采样、下采样、缩小尺寸与放大尺寸等滤波方法实现获取信息与WCP所规定信息的数量进行匹配,完成目标信息的修正过程,进而得到最终的色度预测值。由于从相邻区域获取的参考亮度像素和参考色度像素中所有像素在不同颜色格式信息的情况下,它们所呈现的空间特性依据不同内容特性的图像而不尽相同,通过上采样或者下采样进行处理,可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,从而用作WCP预测技术的最终输入的目标信息,可以使得预测值更加准确;从而提高了色度预测的准确性,节省码率,同时提升编解码性能。
在本申请的又一实施例中,参见图18,其示出了本申请实施例提供的一种编码方法的流程示意图一。如图18所示,该方法可以包括:
S1801:确定当前块的参考信息。
需要说明的是,本申请实施例的编码方法应用于编码装置,或者集成有该编码装置的编码设备(也可简称为“编码器”)。另外,本申请实施例的编码方法具体可以是指一种帧内预测方法,更具体地,是一种基于权重的色度预测的前处理操作方法。
在本申请实施例中,视频图像可以划分为多个编码块,每个编码块可以包括第一颜色分量、第二颜色分量和第三颜色分量,而这里的当前块是指视频图像中当前待进行帧内预测的编码块。另外,假定当前块进行第一颜色分量的预测,而且第一颜色分量为亮度分量,即待预测分量为亮度分量,那么当前块也可以称为亮度预测块;或者,假定当前块进行第二颜色分量的预测,而且第二颜色分量为色度分量,即待预测分量为色度分量,那么当前块也可以称为色度预测块。
还需要说明的是,在本申请实施例中,当前块的参考信息可以包括当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量采样点的取值,这些采样点(Sample)可以是根据当前块的相邻区域中的已编码像素确定的。在一些实施例中,当前块的相邻区域可以包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
另外,当前块的参考信息还可以包括当前块中第一参考颜色分量采样点的重建值。因此,在一些实施例中,确定当前块的参考信息,可以包括:
根据当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值,确定当前块的参考信息。
需要说明的是,在本申请实施例中,当前块的参考像素可以是指与当前块相邻的参考像素点,也可称为当前块的相邻区域中的第一颜色分量采样点、第二颜色分量采样点,用Neighboring Sample或Reference Sample表示。其中,这里的相邻可以是空间相邻,但是并不局限于此。例如,相邻也可以是时域相邻、空间与时域相邻,甚至当前块的参考像素还可以是对空间相邻、时域相邻、空间和时域相邻的参考像素点进行某种处理后得到的参考像素等等,本申请实施例不作任何限定。
还需要说明的是,在本申请实施例中,第一颜色分量为亮度分量,第二颜色分量为色度分量。那么,当前块的相邻区域中的第一颜色分量采样点的取值表示为当前块的参考像素对应的参考亮度信息,当前块的相邻区域中的第二颜色分量采样点的取值表示为当前块的参考像素对应的参考色度信息。
S1802:对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息。
在本申请实施例中,由于当前块的相邻区域中的第一颜色分量采样点的取值的数量和第二颜色分量采样点的取值的数量存在不同的情况,这时候可能需要对第一颜色分量采样点的取值进行滤波处理,或者对第二颜色分量采样点的取值进行滤波处理,以使得两者的数量相同。
在一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值;
根据当前块的相邻区域中的第一颜色分量的滤波样值,确定当前块的目标信息。
在本申请实施例中,当前块的相邻区域中的第一颜色分量的滤波样值的数量等于L,其中,L表示当前块的相邻区域中的第二颜色分量采样点的取值的数量,L为正整数。
在一种具体的实施例中,第一滤波处理可以为下采样滤波处理。示例性地,当前块的参考亮度信息的数量通常多于参考色度信息的数量,因此可以对当前块的参考亮度信息进行下采样滤波处理,以使得参考亮度信息的数量与参考色度信息的数量相同。
还需要说明的是,由于当前块的参考亮度信息的数量和参考色度信息的数量也会受到颜色格式信息的影响;因此,在一些实施例中,该方法还可以包括:基于颜色格式信息,对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值。
在一种具体的实施例中,对于第一滤波处理而言,还可以包括:
若颜色格式信息指示为4:4:4采样,则不对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;
若颜色格式信息指示为4:2:2采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;
若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波。
需要说明的是,在本申请实施例中,当颜色格式信息指示为4:2:0采样时,下采样率是2的正整数倍的倒数。
这样,对于从相邻区域中获取到的参考亮度信息进行的下采样滤波,可以采用多抽头滤波器(如四抽头滤波器、五抽头滤波器、六抽头滤波器等)进行下采样,或者获取参考色度像素对应位置的多个参考亮度像素的某个像素,甚至也可以是其它下采样方式,本申请实施例并不作具体限定。
进一步地,在经过下采样滤波后的参考亮度信息的数量为L且与参考色度信息的数量相同时,此时还需要将L与预设个数进行匹配。因此,在一些实施例中,该方法还可以包括:
将L与预设个数进行比较;
根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,可以包括:
若L大于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
若L小于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,预设个数可以用inSize表示。具体来讲,如果L等于预设个数,那么无需任何操作;如果L大于预设个数,那么需要对参考亮度信息和参考色度信息进行第一子滤波处理(即缩小尺寸);如果L小于预设个数,那么需要对参考亮度信息和参考色度信息进行第二子滤波处理(即放大尺寸)。
在另一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值;
根据当前块的相邻区域中的第二颜色分量的滤波样值,确定当前块的目标信息。
在本申请实施例中,当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
在一种具体的实施例中,第三滤波处理为上采样滤波处理。示例性地,当前块的参考亮度信息的数量通常多于参考色度信息的数量,因此也可以对当前块的参考色度信息进行上采样滤波处理,以使得参考亮度信息的数量与参考色度信息的数量相同。
由于当前块的参考亮度信息的数量和参考色度信息的数量也会受到颜色格式信息的影响;因此,在一些实施例中,该方法还可以包括:基于颜色格式信息,对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值。
在一种具体的实施例中,对于第三滤波处理而言,还可以包括:
若颜色格式信息指示为4:4:4采样,则不对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;
若颜色格式信息指示为4:2:2采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;
若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波。
需要说明的是,在本申请实施例中,当颜色格式信息指示为4:2:0采样时,上采样率是2的正整数倍。这样,在从相邻区域中获取的参考亮度信息的数量与参考色度信息的数量不同时,可以对从相邻区域中获取的参考色度信息进行上采样滤波,以匹配参考亮度信息的数量。
这样,对于从相邻区域中获取到的参考色度信息进行的上采样滤波,可以采用线性插值或非线性插值等方式进行上采样,或者复制某个参考色度像素,甚至也可以是其它上采样方式,本申请实施例并不作具体限定。
进一步地,在经过上采样滤波后的参考色度信息的数量为K且与参考亮度信息的数量相同时,此时还需要将K与预设个数进行匹配。因此,在一些实施例中,该方法还可以包括:
将K与预设个数进行比较;
根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,可以包括:
若K大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;
若K小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,预设个数可以用inSize表示。具体来讲,如果K等于inSize,那么无需任何操作;如果K大于inSize,那么需要对参考亮度信息和参考色度信息进行第一子滤波处理(即缩小尺寸);如果K小于inSize,那么需要对参考亮度信息和参考色度信息进行第二子滤波处理(即放大尺寸)。
还可以理解地,在本申请实施例中,如果不考虑颜色格式信息,那么还可以直接将从相邻区域中获取到的参考亮度信息的数量、参考色度信息的数量与inSize进行匹配,以使得两者的数量相同。
在一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:确定当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;
根据第一数量与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值;
根据当前块的第一颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值,可以包括:
若第一数量大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值;
若第一数量小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值。
需要说明的是,在本申请实施例中,可以将从相邻区域中获取到的参考亮度信息的数量与预设个数进行匹配。其中,从相邻区域中获取到的参考亮度信息的数量(即第一数量)可以用refYnum表示;预设个数可以用inSize表示。具体来讲,如果refYnum等于inSize,那么无需任何操作;如果refYnum大于inSize,那么需要对参考亮度信息进行第一子滤波处理(即缩小尺寸);如果refYnum小于inSize,那么需要对参考亮度信息进行第二子滤波处理(即放大尺寸)。
在另一种可能的实现方式中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,还可以包括:确定当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;
根据第二数量与预设个数的比较结果,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值;
根据当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值,可以包括:
若第二数量大于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定当前块的第二颜色分量的滤波相邻样值;
若第二数量小于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定当前块的第二颜色分量的滤波相邻样值。
还需要说明的是,在本申请实施例中,可以将从相邻区域中获取到的参考色度信息的数量与预设个数进行匹配。其中,从相邻区域中获取到的参考色度信息的数量(即第二数量)可以用refCnum表示;预设个数可以用inSize表示。具体来讲,如果refCnum等于inSize,那么无需任何操作;如果refCnum大于inSize,那么需要对参考色度信息进行第一子滤波处理(即缩小尺寸);如果refCnum小于inSize,那么需要对参考色度信息进行第二子滤波处理(即放大尺寸)。
在本申请实施例中,第一子滤波处理可以为下采样滤波处理。除此之外,在一些实施例中,第一子滤波处理,还可以包括下述至少一项:
采用固定间隔位置的选择方式进行子滤波处理;
采用连续位置的选择方式进行子滤波处理。
在本申请实施例中,第二子滤波处理可以为上采样滤波处理。除此之外,在一些实施例中,第二子滤波处理,还可以包括:采用固定间隔位置的插值方式进行子滤波处理。
还可以理解地,如果对当前块进行色度分量的预测,那么当前块的参考信息还可以包括当前块的重建亮度信息。因此,还可以基于当前块中第一参考颜色分量采样点的重建值,确定当前块的参考信息。
在本申请实施例中,第一参考颜色分量可以为亮度分量;那么,当前块中第一参考颜色分量采样点的重建值即为当前块的重建亮度信息。由于当前块的重建亮度信息的数量与预设尺寸不同,因此还需要对当前块的重建亮度信息进行滤波处理,以将从当前块获取的重建亮度信息的数量转换为预设尺寸进行输入。在这里,预设尺寸为predSizeW×predSizeH;其中,predSizeW表示预测块的宽度,predSizeH表示预测块的高度。
在一些实施例中,所述对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息,可以包括:对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;根据当前块中第一参考颜色分量采样点的滤波样值,确定当前块的目标信息。
在一种具体的实施例中,对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值,可以包括:
根据当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;
若第一宽度大于预测块的宽度,或者第一高度大于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;
若第一宽度小于预测块的宽度,或者第一高度小于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值。
需要说明的是,在本申请实施例中,假定重建亮度信息的数量为recSizeW×recSizeH,那么recSizeW表示第一宽度,recSizeH表示第一高度。具体来讲,如果recSizeW等于predSizeW,并且recSizeH等于predSizeH,那么无需任何操作;如果recSizeW大于predSizeW,或者recSizeH大于predSizeH,那么需要对重建亮度信息进行第一子滤波处理(即缩小尺寸);如果recSizeW小于predSizeW,或者recSizeH 小于predSizeH,那么需要对重建亮度信息进行第二子滤波处理(即放大尺寸)。
还需要说明的是,在本申请实施例中,第三子滤波处理可以为下采样滤波处理。除此之外,在一些实施例中,第三子滤波处理,还可以包括下述至少一项:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
在这里,首先可以根据recSizeW和predSizeW计算水平下采样因子,根据recSizeH和predSizeH计算垂直下采样因子;然后,根据水平下采样因子和垂直下采样因子对重建亮度信息进行下采样滤波。具体来说,如果水平下采样因子大于1,垂直下采样因子等于1,那么只需要对重建亮度信息在水平方向进行下采样;如果水平下采样因子等于1,垂直下采样因子大于1,那么只需要对重建亮度信息在垂直方向进行下采样;如果水平下采样因子大于1,垂直下采样因子大于1,那么对重建亮度信息在水平方向和垂直方向都需要进行下采样,其中,可以执行先水平方向再垂直方向的下采样,也可以执行先垂直方向再水平方向的下采样,甚至还可以采用神经网络结构中的卷积操作代替这里的下采样操作,本申请实施例不作任何限定。
还需要说明的是,在本申请实施例中,第四子滤波处理为上采样滤波处理。除此之外,在一些实施例中,第四子滤波处理,还可以包括下述至少一项:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
在这里,首先根据recSizeW和predSizeW计算水平上采样因子,根据recSizeH和predSizeH计算垂直上采样因子;然后,根据水平上采样因子和垂直上采样因子对重建亮度信息进行上采样滤波。具体来说,如果水平上采样因子大于1,垂直上采样因子等于1,那么只需要对重建亮度信息在水平方向进行上采样;如果水平上采样因子等于1,垂直上采样因子大于1,那么只需要对重建亮度信息在垂直方向进行上采样;如果水平上采样因子大于1,垂直上采样因子大于1,那么对重建亮度信息在水平方向和垂直方向都需要进行上采样,其中,可以执行先水平方向再垂直方向的上采样,也可以执行先垂直方向再水平方向的上采样,甚至还可以将“先水平方向再垂直方向”的上采样结果和“先垂直方向再水平方向”的上采样结果进行加权平均以确定出最终的上采样结果,甚至还可以采用神经网络结构中的卷积操作代替这里的上采样操作,本申请实施例不作任何限定。
也就是说,在本申请实施例中,当前块的参考信息可以包括:当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值;目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值。其中,如果当前块的相邻区域中的第一颜色分量采样点的取值不需要进行滤波处理,那么当前块的第一颜色分量的滤波相邻样值等于当前块的相邻区域中的第一颜色分量采样点的取值;同理,如果当前块的相邻区域中的第二颜色分量采样点的取值不需要进行滤波处理,那么当前块的第二颜色分量的滤波相邻样值等于当前块的相邻区域中的第二颜色分量采样点的取值;如果当前块中第一参考颜色分量采样点的重建值不需要进行滤波处理,那么当前块中第一参考颜色分量采样点的滤波样值等于当前块中第一参考颜色分量采样点的重建值。
这样,所得到的目标信息可以包括:当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值,也即:inSize数量的参考色度信息、inSize数量的参考亮度信息和符合预设尺寸的重建亮度信息。
S1803:根据目标信息中的第一颜色分量的参考样值,确定加权系数。
需要说明的是,在确定出当前块的第一颜色分量的滤波相邻样值、当前块的第二颜色分量的滤波相邻样值和当前块中第一参考颜色分量采样点的滤波样值之后,在一些实施例中,该方法还可以包括:将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
在一些实施例中,该方法还可以包括:将目标信息中的第二颜色分量的参考样值设置为当前块的第 二颜色分量的滤波相邻样值。
另外,考虑到对参考信息的滤波处理,可以是仅对参考亮度信息进行滤波处理,也可以是仅对重建亮度信息进行滤波处理,还可以是仅对参考亮度信息和重建亮度信息进行滤波处理,甚至还可以是对参考色度信息、参考亮度信息和重建亮度信息都进行滤波处理,这里并不作任何限定。那么对于亮度差的计算,该方法还可以包括:将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的重建值之差的绝对值;或者,将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的重建值之差的绝对值;或者,将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值,这里对此不作具体限定。
在一些实施例中,所述根据目标信息中的第一颜色分量的参考样值,确定加权系数,可以包括:
确定在预设映射关系下第一颜色分量的参考样值对应的取值;
将加权系数设置为等于取值。
需要说明的是,在本申请实施例中,第一颜色分量的参考样值可以为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。其中,第一参考颜色分量为第一颜色分量,且第一颜色分量是与本申请实施例待预测的第二颜色分量不同的颜色分量。
需要说明的是,在本申请实施例中,对当前块中待预测像素的色度分量进行预测,可以选取当前块中的至少一个待预测像素,分别计算其重建亮度与相邻区域中的参考亮度之间的亮度差(用|ΔY k|表示)。其中,如果|ΔY k|较小,表明亮度值的相似性比较强,对应的加权系数(用w k表示)赋予较大的权重;反之,如果|ΔY k|较大,表明亮度值的相似性比较弱,w k赋予较小的权重。也就是说,预设映射关系下,w k与|ΔY k|之间近似呈反比。
进一步地,在一些实施例中,所述确定在预设映射关系下第一颜色分量的参考样值对应的取值,可以包括:确定第一因子;根据第一因子和第一颜色分量的参考样值,确定第一乘积值;确定第一乘积值在预设映射关系下对应的取值。
在一种具体的实施例中,所述确定第一因子,可以包括:第一因子是预设常数值。
在另一种具体的实施例中,所述确定第一因子,可以包括:根据当前块的尺寸参数,确定第一因子的取值。
进一步地,在一些实施例中,该方法还可以包括:根据预设的当前块的尺寸参数与第一因子的取值映射查找表,确定第一因子的取值。
在这里,当前块的尺寸参数可以包括以下参数的至少之一:当前块的宽度,当前块的高度、当前块的宽度与高度的乘积。
需要说明的是,本申请实施例可以采用分类方式固定第一因子的取值。例如,将根据当前块的尺寸参数分为三类,确定每一类对应的第一因子的取值。示例性地,前述的表1示出了一种第一因子与当前块的尺寸参数之间的对应关系示意。
在又一种具体的实施例中,所述确定第一因子,可以包括:根据当前块的参考像素数量,确定第一因子的取值。
进一步地,在一些实施例中,该方法还可以包括:根据预设的当前块的参考像素数量与第一因子的取值映射查找表,确定第一因子的取值。
需要说明的是,本申请实施例可以将参考像素数量划分为三类,仍然采用分类方式固定第一因子的取值。示例性地,前述的表2示出了一种第一因子与当前块的参考像素数量之间的对应关系示意。
进一步地,对于第一乘积值而言,所述根据第一因子和第一颜色分量的参考样值,确定第一乘积值,可以包括:
将第一乘积值设置为等于第一因子和第一颜色分量的参考样值的乘积;或者,
将第一乘积值设置为等于对第一颜色分量的参考样值进行比特右移后得到的数值,其中,比特右移的位数等于第一因子;或者,
将第一乘积值设置为根据第一因子对第一颜色分量的参考样值进行加法和比特移位操作后得到的数值。
示例性地,假定第一因子等于0.25,第一颜色分量的参考样值用Ref表示,那么第一乘积值可以等于0.25×Ref,而0.25×Ref又可表示为Ref/4,即Ref>>2。另外,在定点化计算过程中,还有可能会将浮点数转换为加法和位移操作;也就是说,对于第一乘积值而言,其计算方式不作任何限定。
还可以理解地,在本申请实施例中,第一参考颜色分量也可以为色度分量,即选取当前块中色差明显的至少一个待预测像素,分别计算其重建色度与相邻区域中的参考色度之间的色度差(用|ΔC k|表示)。 其中,如果|ΔC k|较小,表明色度值的相似性比较强,对应的加权系数(用w k表示)可以赋予较大的权重;反之,如果|ΔC k|较大,表明色度值的相似性比较弱,w k可以赋予较小的权重,也就是说,在计算加权系数时,第一颜色分量的参考样值也可以为|ΔC k|,进而计算出加权系数。
简单来说,在本申请实施例中,对于第一颜色分量的参考样值而言,其可以是|ΔC k|,即色度差的绝对值;或者也可以是|ΔY k|,即亮度差的绝对值;或者还可以是|αΔY k|,即亮度差的绝对值与预设乘子之积等等。其中,这里的预设乘子即为本申请实施例所述的第二因子。
进一步地,对于第二因子而言,在一种具体的实施例中,该方法还可以包括:根据参考像素的第一颜色分量值与参考像素的第二颜色分量值进行最小二乘法计算,确定第二因子。
也就是说,假定参考像素的数量为N个,参考像素的第一颜色分量值即为当前块的参考亮度信息,参考像素的第二颜色分量值即为当前块的参考色度信息,那么可以对N个参考像素的色度分量值和亮度分量值进行最小二乘法计算,例如最小二乘法回归计算如前述的式(5)所示,可以计算得到第二因子。
另外,对于预设映射关系而言,预设映射关系可以为预设函数关系。在一些实施例中,预设映射关系可以是Softmax函数,如前述的式(6)或式(7)所示。其中,Softmax函数是归一化指数函数,但是本申请实施例也可以不用归一化,其取值并不局限在[0,1]范围内。
还需要说明的是,除了Softmax函数之外,在另一些实施例中,预设映射关系可以是与第一颜色分量的参考样值具有反比关系的加权函数,如前述的式(8)或式(9)所示。
这样,预设映射关系可以是如式(4)所示,也可以是如式(6)或式(7)所示,还可以是如式(8)或式(9)所示,甚至还可以是其他能够拟合参考像素的参考亮度值与当前块中待预测像素的亮度重建值越接近、参考像素的参考色度值对当前块中待预测像素的重要性越高的趋势构建加权系数的函数模型等;另外,预设映射关系还可以为预设的查表(look-up table)方式,例如采用数组元素查表方式来减少一部分的计算操作等等,本申请实施例不作具体限定。
如此,根据第一颜色分量的参考样值(例如|ΔY kij|),即可确定出加权系数,具体可以包括:w 1、w 2、…、w N等N个加权系数,其中,N表示第二颜色分量的参考样值的数量。在这里,理论上而言,这N个加权系数之和等于1,而且每一个加权系数均为大于或等于0且小于或等于1的值。
S1804:根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块。
S1805:根据预测块,确定当前块的第二颜色分量采样点的预测差值。
需要说明的是,在确定出加权系数之后,可以利用加权系数对第二颜色分量的参考样值进行加权计算,从而得到预测块中的第二颜色分量采样点的预测值。
在一些实施例中,根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块,可以包括:
确定第二颜色分量的参考样值与对应的加权系数的加权值;
将预测块中的第二颜色分量采样点的预测值设置为等于N个加权值之和;其中,N表示第二颜色分量的参考样值的数量,N是正整数。
也就是说,如果第二颜色分量的参考样值的数量有N个,那么首先确定每一个第二颜色分量的参考样值与对应的加权系数的加权值(即w kC k),然后将这N个加权值之和作为预测块中的第二颜色分量采样点的预测值。具体地,其计算公式如前述的式(16)所示,而且这种计算方式利于并行处理,可以加快计算速度。
还需要说明的是,在本申请实施例中,第一颜色分量为亮度分量,第二颜色分量为色度分量,由于亮度分量的分辨率与色度分量的分辨率存在不同的情况,在对参考信息进行滤波处理时,包括对亮度分量经过下采样滤波方式以对齐色度分量的分辨率,或者对色度分量经过上采样滤波方式以对齐亮度分量的分辨率。
进一步地,对于预测块中的第二颜色分量采样点的预测值,通常需要限定在一预设范围内。因此,在一些实施例中,该方法还可以包括:对预测块中的第二颜色分量采样点的预测值进行修正操作,确定当前块的第二颜色分量的预测块。
需要说明的是,在本申请实施例中,预设范围可以为:0到(1<<BitDepth)-1之间。如果预测值超出该预设范围的取值,那么需要对预测值进行相应的修正操作。示例性地,可以对
Figure PCTCN2022086469-appb-000046
进行钳位操作,从而能够保证预测块中所有第二颜色分量采样点的预测值都在0到(1<<BitDepth)-1之间。
进一步地,在确定出预测块之后,该预测块在一定条件下还需要后处理操作来作为最终的预测块。因此,在一些实施例中,该方法还可以包括:
对预测块进行相关处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
在一种可能的实现方式中,对预测块进行相关处理,可以包括:对预测块进行滤波增强处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
在另一种可能的实现方式中,对预测块进行相关处理,可以包括:根据当前块的相邻区域中的参考样值,确定预测块的第二颜色分量的补偿值;根据补偿值对预测块中的第二颜色分量采样点的预测值进行修正处理,确定当前块的第二颜色分量的预测块。
在又一种可能的实现方式中,对预测块进行相关处理,可以包括:根据至少一种预测模式对预测块中的第二颜色分量采样点进行预测处理,确定预测块中的第二颜色分量采样点的至少一个初始预测值;根据至少一个初始预测值与预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定当前块的第二颜色分量的预测块。
也就是说,针对预测块的相关处理,为了降低WCP逐像素独立并行预测带来的不稳定性,可以对预测块进行平滑滤波作为最终的色度预测值。或者,为了进一步提升WCP预测值的准确性,可以对预测块进行位置相关的修正过程。比如:利用空间位置接近的参考像素对每个待预测像素计算色度补偿值,用此色度补偿值对预测块进行修正,将修正后的预测值作为最终的色度预测值。或者,为了进一步提升WCP预测值的准确性,可以将其他色度预测模式计算的色度预测值与WCP计算的色度预测值进行加权融合,将此融合结果作为最终的色度预测值。或者,为了提高WCP预测性能,可以采用神经网络模型对WCP计算的色度预测值进行修正等等,本申请实施例对此不作任何限定。
在一些实施例中,在确定出预测块之后,如图19所示,在S1804之后,还可以包括以下步骤:
S1901:根据预测块,确定当前块的第二颜色分量采样点的预测值。
S1902:根据当前块的第二颜色分量采样点的原始值和当前块的第二颜色分量采样点的预测值,确定当前块的第二颜色分量采样点的预测差值。
S1903:对当前块的第二颜色分量采样点的预测差值进行编码,将所得到的编码比特写入码流。
需要说明的是,在本申请实施例中,预测块可以包含当前块中至少部分第二颜色分量采样点的预测值。其中,如果预测块包含当前块中全部第二颜色分量采样点的预测值,那么可以将当前块的第二颜色分量采样点的预测值设置为等于预测块的值;如果预测块包含当前块中部分第二颜色分量采样点的预测值,那么可以对预测块的值进行上采样滤波,将当前块的第二颜色分量采样点的预测值设置为等于所述上采样滤波后的输出值。
还需要说明的是,在确定出当前块的第二颜色分量采样点的预测值后,根据第二颜色分量采样点的原始值和第二颜色分量采样点的预测值,即可确定出第二颜色分量采样点的预测差值,具体可以是对第二颜色分量采样点的原始值和第二颜色分量采样点的预测值进行减法计算,从而能够确定出当前块的第二颜色分量采样点的预测差值。这样,在将第二颜色分量采样点的预测差值写入码流后,后续在解码端,通过解码即可获得第二颜色分量采样点的预测差值,以便恢复当前块的第二颜色分量采样点的重建值。
综上可知,以当前块进行色度预测为例,在本申请实施例中,当前块的重建亮度信息、相邻区域的参考亮度信息及参考色度信息都是已编码的参考信息。因此,本申请实施例提出了一种利用上述这些信息的基于权重的色度预测技术,并在根据这些信息确定当前块的目标信息过程中,可以对当前块的相邻区域的信息、当前块的信息及当前的颜色格式信息进行分析和处理。其中,主要包括:一方面,根据当前的颜色格式信息选择是否对相邻区域的参考亮度信息进行下采样或者选择是否对相邻区域的参考色度信息进行上采样;另一方面,相邻区域的参考亮度信息、参考色度信息和当前块内的重建亮度信息可以通过不同的放大/缩小尺寸的操作与核心参数的预设尺寸进行匹配,能够提高WCP预测技术的准确性。
本申请实施例还提供了一种编码方法,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;根据预测块,确定当前块的第二颜色分量采样点的预测差值。这样,对于当前块的相邻区域中的颜色分量信息与当前块内的颜色分量信息,由于充分考虑了颜色格式信息的特性,能够提高这些参考信息的准确性;而且通过对这些参考信息进行上采样、下采样等滤波处理,还可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,利用滤波处理后得到的目标信息能够更好地进行色度预测,从而提高了色度预测的准确性,节省码率,同时提升编解码性能。
在本申请的又一实施例中,本申请实施例还提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息至少包括:当前块的第二颜色分量采样点的预测差值。
在本申请实施例中,在当前块的第二颜色分量采样点的预测差值由编码端传递到解码端之后,解码端通过解码获得第二颜色分量采样点的预测差值,然后结合当前块的第二颜色分量采样点的预测值,从而能够恢复出当前块的第二颜色分量采样点的重建值。这样,通过充分考虑输入颜色格式信息的特性,提高相邻区域的参考信息的准确性;并且充分利用空间相关性,对相邻区域的参考信息和当前块的重建 亮度信息进行上采样、下采样、放大尺寸、缩小尺寸等滤波处理,从而不仅提高了色度预测的准确性,节省码率,而且还能够提升编解码性能。
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图20,其示出了本申请实施例提供的一种编码装置300的组成结构示意图。如图20所示,该编码装置300可以包括:第一确定单元3001、第一滤波单元3002和第一预测单元3003;其中,
第一确定单元3001,配置为确定当前块的参考信息;
第一滤波单元3002,配置为对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
第一确定单元3001,还配置为根据目标信息中的第一颜色分量的参考样值,确定加权系数;
第一预测单元3003,配置为根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
第一确定单元3001,还配置为根据预测块,确定当前块的第二颜色分量采样点的预测差值。
在一些实施例中,预测块包含当前块中至少部分第二颜色分量采样点的预测值。
在一些实施例中,第一确定单元3001,还配置为当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和所述当前块中第一参考颜色分量采样点的重建值,确定所述当前块的参考信息。
在一些实施例中,当前块的相邻区域包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
在一些实施例中,第一滤波单元3002,还配置为对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值;以及根据当前块的相邻区域中的第一颜色分量的滤波样值,确定当前块的目标信息。
在一些实施例中,当前块的相邻区域中的第一颜色分量的滤波样值的数量等于L,其中,L表示当前块的相邻区域中的第二颜色分量采样点的取值的数量,L为正整数。
在一些实施例中,第一滤波处理为下采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为基于颜色格式信息,对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值。
在一些实施例中,第一滤波单元3002,还配置为若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;其中,下采样率是2的正整数倍的倒数。
在一些实施例中,第一滤波单元3002,还配置为将L与预设个数进行比较;以及根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第一滤波单元3002,还配置为若L大于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;若L小于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第一滤波单元3002,还配置为对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值;以及根据当前块的相邻区域中的第二颜色分量的滤波样值,确定当前块的目标信息。
在一些实施例中,当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
在一些实施例中,第三滤波处理为上采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为基于颜色格式信息,对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值。
在一些实施例中,第一滤波单元3002,还配置为若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;其中,上采样率是2的正整数倍。
在一些实施例中,第一滤波单元3002,还配置为将K与预设个数进行比较;以及根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分 量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第一滤波单元3002,还配置为若K大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;若K小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第一滤波单元3002,还配置为确定当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;以及根据第一数量与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第一滤波单元3002,还配置为若第一数量大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值;若第一数量小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值。
在一些实施例中,第一滤波单元3002,还配置为确定当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;以及根据第二数量与预设个数的比较结果,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值;以及根据当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第一滤波单元3002,还配置为若第二数量大于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定当前块的第二颜色分量的滤波相邻样值;若第二数量小于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第一滤波单元3002,还配置为将目标信息中的第二颜色分量的参考样值设置为当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第一子滤波处理为下采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第一子滤波处理:
采用固定间隔位置的选择方式进行子滤波处理;
采用连续位置的选择方式进行子滤波处理。
在一些实施例中,第二子滤波处理为上采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第二子滤波处理:采用固定间隔位置的插值方式进行子滤波处理。
在一些实施例中,第一滤波单元3002,还配置为对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;以及根据当前块中第一参考颜色分量采样点的滤波样值,确定当前块的目标信息。
在一些实施例中,第一滤波单元3002,还配置为根据当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;以及若第一宽度大于预测块的宽度,或者第一高度大于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;若第一宽度小于预测块的宽度,或者第一高度小于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值。
在一些实施例中,第三子滤波处理为下采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第三子滤波处理:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
在一些实施例中,第四子滤波处理为上采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第四子滤波处理:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的重建值之差的绝对值。
在一些实施例中,第一滤波单元3002,还配置为将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
在一些实施例中,第一确定单元3001,还配置为确定在预设映射关系下第一颜色分量的参考样值对应的取值;以及将加权系数设置为等于取值。
在一些实施例中,第一确定单元3001,还配置为确定第一因子;以及根据第一因子和第一颜色分量的参考样值,确定第一乘积值;以及确定第一乘积值在预设映射关系下对应的取值。
在一些实施例中,第一因子是预设常数值。
在一些实施例中,第一确定单元3001,还配置为根据当前块的尺寸参数,确定第一因子的取值;其中,当前块的尺寸参数包括以下参数的至少之一:当前块的宽度,当前块的高度。
在一些实施例中,预设映射关系是Softmax函数。
在一些实施例中,预设映射关系是与第一颜色分量的参考样值具有反比关系的加权函数。
在一些实施例中,第一预测单元3003,还配置为确定第二颜色分量的参考样值与对应的加权系数的加权值;以及将预测块中的第二颜色分量采样点的预测值设置为等于N个加权值之和;其中,N表示第二颜色分量的参考样值的数量,N是正整数。
在一些实施例中,第一预测单元3003,还配置为对预测块中的第二颜色分量采样点的预测值进行修正操作,确定当前块的第二颜色分量的预测块。
在一些实施例中,第一预测单元3003,还配置为对预测块进行滤波增强处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
在一些实施例中,第一预测单元3003,还配置为根据当前块的相邻区域中的参考样值,确定预测块的第二颜色分量的补偿值;以及根据补偿值对预测块中的第二颜色分量采样点的预测值进行修正处理,确定当前块的第二颜色分量的预测块。
在一些实施例中,第一预测单元3003,还配置为根据至少一种预测模式对预测块中的第二颜色分量采样点进行预测处理,确定预测块中的第二颜色分量采样点的至少一个初始预测值;以及根据至少一个初始预测值与预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定当前块的第二颜色分量的预测块。
在一些实施例中,第一确定单元3001,还配置为根据预测块,确定当前块的第二颜色分量采样点的预测值;以及根据当前块的第二颜色分量采样点的原始值和当前块的第二颜色分量采样点的预测值,确定当前块的第二颜色分量采样点的预测差值。
在一些实施例中,参见图20,该编码装置300还可以包括编码单元3004,配置为对当前块的第二颜色分量采样点的预测差值进行编码,将所得到的编码比特写入码流。
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机可读存储介质,应用于编码装置300,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。
基于上述编码装置300的组成以及计算机可读存储介质,参见图21,其示出了本申请实施例提供 的编码设备310的具体硬件结构示意图。如图21所示,编码设备310可以包括:第一通信接口3101、第一存储器3102和第一处理器3103;各个组件通过第一总线系统3104耦合在一起。可理解,第一总线系统3104用于实现这些组件之间的连接通信。第一总线系统3104除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图21中将各种总线都标为第一总线系统3104。其中,
第一通信接口3101,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器3102,用于存储能够在第一处理器3103上运行的计算机程序;
第一处理器3103,用于在运行所述计算机程序时,执行:
确定当前块的参考信息;
对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
根据目标信息中的第一颜色分量的参考样值,确定加权系数;
根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
根据预测块,确定当前块的第二颜色分量采样点的预测差值。
可以理解,本申请实施例中的第一存储器3102可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器3102旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器3103可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器3103中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器3103可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器3102,第一处理器3103读取第一存储器3102中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器3103还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
本实施例提供了一种编码设备,该编码设备还可以包括前述实施例所述的编码装置300。对于编码设备而言,通过充分考虑输入颜色格式信息的特性,提高相邻区域的参考信息的准确性;并且充分利用空间相关性,对相邻区域的参考信息和当前块的重建亮度信息进行上采样、下采样、放大尺寸、缩小尺寸等滤波处理,从而不仅提高了色度预测的准确性,节省码率,而且还能够提升编解码性能。
基于前述实施例相同的发明构思,参见图22,其示出了本申请实施例提供的一种解码装置320的组成结构示意图。如图22所示,该解码装置320可以包括:第二确定单元3201、第二滤波单元3202和第二预测单元3203;其中,
第二确定单元3201,配置为确定当前块的参考信息;
第二滤波单元3202,配置为对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标 信息;
第二确定单元3201,还配置为根据目标信息中的第一颜色分量的参考样值,确定加权系数;
第二预测单元3203,配置为根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
第二确定单元3201,还配置为根据预测块,确定当前块的第二颜色分量采样点的重建值。
在一些实施例中,预测块包含当前块中至少部分第二颜色分量采样点的预测值。
在一些实施例中,第二确定单元3201,还配置为当前块的相邻区域中的第一颜色分量采样点的取值、当前块的相邻区域中的第二颜色分量采样点的取值和当前块中第一参考颜色分量采样点的重建值,确定所述当前块的参考信息。
在一些实施例中,当前块的相邻区域可以包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
在一些实施例中,第二滤波单元3202,还配置为对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值;以及根据当前块的相邻区域中的第一颜色分量的滤波样值,确定当前块的目标信息。
在一些实施例中,当前块的相邻区域中的第一颜色分量的滤波样值的数量等于L,其中,L表示当前块的相邻区域中的第二颜色分量采样点的取值的数量,L为正整数。
在一些实施例中,第一滤波处理为下采样滤波处理。
在一些实施例中,第二滤波单元3202,还配置为基于颜色格式信息,对当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到当前块的相邻区域中的第一颜色分量的滤波样值。
在一些实施例中,第二滤波单元3202,还配置为若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;其中,下采样率是2的正整数倍的倒数。
在一些实施例中,第二滤波单元3202,还配置为将L与预设个数进行比较;以及根据L与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第二滤波单元3202,还配置为若L大于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;若L小于预设个数,则对当前块的相邻区域中的第一颜色分量的滤波样值和当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第二滤波单元3202,还配置为对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值;以及根据当前块的相邻区域中的第二颜色分量的滤波样值,确定当前块的目标信息。
在一些实施例中,当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
在一些实施例中,第三滤波处理为上采样滤波处理。
在一些实施例中,第二滤波单元3202,还配置为基于颜色格式信息,对当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到当前块的相邻区域中的第二颜色分量的滤波样值。
在一些实施例中,第二滤波单元3202,还配置为若颜色格式信息指示为4:2:0采样,则对当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;其中,上采样率是2的正整数倍。
在一些实施例中,第二滤波单元3202,还配置为将K与预设个数进行比较;以及根据K与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第二滤波单元3202,还配置为若K大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量的滤波相邻样值;若K小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值和当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值和当前块的第二颜色分量 的滤波相邻样值。
在一些实施例中,第二滤波单元3202,还配置为确定当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;以及根据第一数量与预设个数的比较结果,对当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定当前块的第一颜色分量的滤波相邻样值;以及根据当前块的第一颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第二滤波单元3202,还配置为若第一数量大于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定当前块的第一颜色分量的滤波相邻样值;若第一数量小于预设个数,则对当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定当前块的第一颜色分量的滤波相邻样值。
在一些实施例中,第二滤波单元3202,还配置为确定当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;以及根据第二数量与预设个数的比较结果,对当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定当前块的第二颜色分量的滤波相邻样值;以及根据当前块的第二颜色分量的滤波相邻样值,确定当前块的目标信息。
在一些实施例中,第二滤波单元3202,还配置为若第二数量大于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定当前块的第二颜色分量的滤波相邻样值;若第二数量小于预设个数,则对当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第二滤波单元3202,还配置为将目标信息中的第二颜色分量的参考样值设置为当前块的第二颜色分量的滤波相邻样值。
在一些实施例中,第一子滤波处理为下采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第一子滤波处理:
采用固定间隔位置的选择方式进行子滤波处理;
采用连续位置的选择方式进行子滤波处理。
在一些实施例中,第二子滤波处理为上采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第二子滤波处理:采用固定间隔位置的插值方式进行子滤波处理。
在一些实施例中,第二滤波单元3202,还配置为对当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;以及根据当前块中第一参考颜色分量采样点的滤波样值,确定当前块的目标信息。
在一些实施例中,第二滤波单元3202,还配置为根据当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;以及若第一宽度大于预测块的宽度,或者第一高度大于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值;若第一宽度小于预测块的宽度,或者第一高度小于预测块的高度,则对当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定当前块中第一参考颜色分量采样点的滤波样值。
在一些实施例中,第三子滤波处理为下采样滤波处理。
在一些实施例中,第一滤波单元3002,还配置为下述至少一项的第三子滤波处理:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
在一些实施例中,第四子滤波处理为上采样滤波处理。
在一些实施例中,第二滤波单元3202,还配置为下述至少一项的第四子滤波处理:
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
对当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
在一些实施例中,第二滤波单元3202,还配置为将目标信息中的第一颜色分量的参考样值设置为当前块的相邻区域中的第一颜色分量采样点的取值与当前块中第一参考颜色分量采样点的重建值之差 的绝对值。
在一些实施例中,第二滤波单元3202,还配置为将目标信息中的第一颜色分量的参考样值设置为当前块的第一颜色分量的滤波相邻样值与当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
在一些实施例中,第二确定单元3201,还配置为确定在预设映射关系下第一颜色分量的参考样值对应的取值;以及将加权系数设置为等于取值。
在一些实施例中,第二确定单元3201,还配置为确定第一因子;以及根据第一因子和第一颜色分量的参考样值,确定第一乘积值;以及确定第一乘积值在预设映射关系下对应的取值。
在一些实施例中,第一因子是预设常数值。
在一些实施例中,第二确定单元3201,还配置为根据当前块的尺寸参数,确定第一因子的取值;其中,当前块的尺寸参数包括以下参数的至少之一:当前块的宽度,当前块的高度。
在一些实施例中,预设映射关系是Softmax函数。
在一些实施例中,预设映射关系是与第一颜色分量的参考样值具有反比关系的加权函数。
在一些实施例中,第二预测单元3203,还配置为确定第二颜色分量的参考样值与对应的加权系数的加权值;以及将预测块中的第二颜色分量采样点的预测值设置为等于N个加权值之和;其中,N表示第二颜色分量的参考样值的数量,N是正整数。
在一些实施例中,第二预测单元3203,还配置为对预测块中的第二颜色分量采样点的预测值进行修正操作,确定当前块的第二颜色分量的预测块。
在一些实施例中,第二预测单元3203,还配置为对预测块进行滤波增强处理,将处理后的预测块作为当前块的第二颜色分量的预测块。
在一些实施例中,第二预测单元3203,还配置为根据当前块的相邻区域中的参考样值,确定预测块的第二颜色分量的补偿值;以及根据补偿值对预测块中的第二颜色分量采样点的预测值进行修正处理,确定当前块的第二颜色分量的预测块。
在一些实施例中,第二预测单元3203,还配置为根据至少一种预测模式对预测块中的第二颜色分量采样点进行预测处理,确定预测块中的第二颜色分量采样点的至少一个初始预测值;以及根据至少一个初始预测值与预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定当前块的第二颜色分量的预测块。
在一些实施例中,第二确定单元3201,还配置为确定当前块的第二颜色分量采样点的预测差值;以及根据预测块,确定当前块的第二颜色分量采样点的预测值;以及根据当前块的第二颜色分量采样点的预测差值和当前块的第二颜色分量采样点的预测值,确定当前块的第二颜色分量采样点的重建值。
在一些实施例中,参见图22,该解码装置320还可以包括解码单元3204,配置为解析码流,确定当前块的第二颜色分量采样点的预测差值。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机可读存储介质,应用于解码装置320,该计算机可读存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的方法。
基于上述解码装置320的组成以及计算机可读存储介质,参见图23,其示出了本申请实施例提供的解码设备330的具体硬件结构示意图。如图23所示,解码设备330可以包括:第二通信接口3301、第二存储器3302和第二处理器3303;各个组件通过第二总线系统3304耦合在一起。可理解,第二总线系统3304用于实现这些组件之间的连接通信。第二总线系统3304除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图23中将各种总线都标为第二总线系统3304。其中,
第二通信接口3301,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器3302,用于存储能够在第二处理器3303上运行的计算机程序;
第二处理器3303,用于在运行所述计算机程序时,执行:
确定当前块的参考信息;
对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;
根据目标信息中的第一颜色分量的参考样值,确定加权系数;
根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块;
根据预测块,确定当前块的第二颜色分量采样点的重建值。
可选地,作为另一个实施例,第二处理器3303还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
可以理解,第二存储器3302与第一存储器3102的硬件功能类似,第二处理器3303与第一处理器3103的硬件功能类似;这里不再详述。
本实施例提供了一种解码设备,该解码设备还可以包括前述实施例所述的解码装置320。对于解码设备而言,通过充分考虑输入颜色格式信息的特性,提高相邻区域的参考信息的准确性;并且充分利用空间相关性,对相邻区域的参考信息和当前块的重建亮度信息进行上采样、下采样、放大尺寸、缩小尺寸等滤波处理,从而不仅提高了色度预测的准确性,节省码率,而且还能够提升编解码性能。
在本申请的再一实施例中,参见图24,其示出了本申请实施例提供的一种编解码系统的组成结构示意图。如图24所示,编解码系统340可以包括编码器3401和解码器3402。其中,编码器3401可以为集成有前述实施例所述编码装置300的设备,或者也可以为前述实施例所述的编码设备310;解码器3402可以为集成有前述实施例所述解码装置320的设备,或者也可以为前述实施例所述的解码设备330。
在本申请实施例中,在该编解码系统340中,无论是编码器3401还是解码器3402,均可以充分考虑输入颜色格式信息的特性,提高相邻区域的参考信息的准确性;并且充分利用空间相关性,对相邻区域的参考信息和当前块的重建亮度信息进行上采样、下采样、放大尺寸、缩小尺寸等滤波处理,从而不仅提高了色度预测的准确性,节省码率,而且还能够提升编解码性能。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例中,无论是编码端还是解码端,通过确定当前块的参考信息;对当前块的参考信息中的部分信息进行滤波处理,确定当前块的目标信息;根据目标信息中的第一颜色分量的参考样值,确定加权系数;根据加权系数和目标信息中的第二颜色分量的参考样值,确定当前块的第二颜色分量的预测块。这样,在编码端根据预测块,能够确定当前块的第二颜色分量采样点的预测差值,将预测差值写入码流中;使得在解码端,根据预测块和解码得到的预测差值可以确定出当前块的第二颜色分量采样点的重建值。如此,对于当前块的相邻区域中的颜色分量信息与当前块内的颜色分量信息,由于充分考虑了颜色格式信息的特性,能够提高这些参考信息的准确性;而且通过对这些参考信息进行上采样、下采样等滤波处理,可以在一定程度上增强其空间相关性的连续性或者去除一些空间相关性较弱的某些信息,从而利用滤波处理后得到的目标信息进行色度预测,能够提高色度预测的准确性,节省码率,同时提升编解码性能。

Claims (100)

  1. 一种解码方法,包括:
    确定当前块的参考信息;
    对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息;
    根据所述目标信息中的第一颜色分量的参考样值,确定加权系数;
    根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块;
    根据所述预测块,确定所述当前块的第二颜色分量采样点的重建值。
  2. 根据权利要求1所述的方法,其中,所述预测块包含所述当前块中至少部分所述第二颜色分量采样点的预测值。
  3. 根据权利要求1所述的方法,其中,所述确定当前块的参考信息,包括:
    根据所述当前块的相邻区域中的第一颜色分量采样点的取值、所述当前块的相邻区域中的第二颜色分量采样点的取值和所述当前块中第一参考颜色分量采样点的重建值,确定所述当前块的参考信息。
  4. 根据权利要求3所述的方法,其中,所述当前块的相邻区域包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
  5. 根据权利要求3所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到所述当前块的相邻区域中的第一颜色分量的滤波样值;
    根据所述当前块的相邻区域中的第一颜色分量的滤波样值,确定所述当前块的目标信息。
  6. 根据权利要求5所述的方法,其中,所述当前块的相邻区域中的第一颜色分量的滤波样值的数量等于L,其中,L表示所述当前块的相邻区域中的第二颜色分量采样点的取值的数量,L为正整数。
  7. 根据权利要求5所述的方法,其中,所述第一滤波处理为下采样滤波处理。
  8. 根据权利要求5所述的方法,其中,所述方法还包括:
    基于颜色格式信息,对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到所述当前块的相邻区域中的第一颜色分量的滤波样值。
  9. 根据权利要求8所述的方法,其中,所述第一滤波处理,还包括:
    若颜色格式信息指示为4:2:0采样,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;其中,下采样率是2的正整数倍的倒数。
  10. 根据权利要求6所述的方法,其中,所述方法还包括:
    将L与预设个数进行比较;
    根据L与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  11. 根据权利要求10所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,包括:
    若L大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    若L小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值。
  12. 根据权利要求3所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到所述当前块的相邻区域中的第二颜色分量的滤波样值;
    根据所述当前块的相邻区域中的第二颜色分量的滤波样值,确定所述当前块的目标信息。
  13. 根据权利要求12所述的方法,其中,所述当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示所述当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
  14. 根据权利要求12所述的方法,其中,所述第三滤波处理为上采样滤波处理。
  15. 根据权利要求12所述的方法,其中,所述方法还包括:
    基于颜色格式信息,对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到所述当前块的相邻区域中的第二颜色分量的滤波样值。
  16. 根据权利要求15所述的方法,其中,所述第三滤波处理,还包括:
    若颜色格式信息指示为4:2:0采样,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;其中,上采样率是2的正整数倍。
  17. 根据权利要求13所述的方法,其中,所述方法还包括:
    将K与预设个数进行比较;
    根据K与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  18. 根据权利要求17所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,包括:
    若K大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    若K小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值。
  19. 根据权利要求3所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    确定所述当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;
    根据所述第一数量与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  20. 根据权利要求19所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值,包括:
    若所述第一数量大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值;
    若所述第一数量小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值。
  21. 根据权利要求3所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,还包括:
    确定所述当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;
    根据所述第二数量与预设个数的比较结果,对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  22. 根据权利要求21所述的方法,其中,所述对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值,包括:
    若所述第二数量大于所述预设个数,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值;
    若所述第二数量小于所述预设个数,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值。
  23. 根据权利要求10、17或21所述的方法,其中,所述方法还包括:
    将所述目标信息中的第二颜色分量的参考样值设置为所述当前块的第二颜色分量的滤波相邻样值。
  24. 根据权利要求11、18、20或22所述的方法,其中,所述第一子滤波处理为下采样滤波处理。
  25. 根据权利要求11、18、20或22所述的方法,其中,所述第一子滤波处理,包括下述至少一项:
    采用固定间隔位置的选择方式进行子滤波处理;
    采用连续位置的选择方式进行子滤波处理。
  26. 根据权利要求11、18、20或22所述的方法,其中,所述第二子滤波处理为上采样滤波处理。
  27. 根据权利要求11、18、20或22所述的方法,其中,所述第二子滤波处理,包括:
    采用固定间隔位置的插值方式进行子滤波处理。
  28. 根据权利要求3或10所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值;
    根据所述当前块中第一参考颜色分量采样点的滤波样值,确定所述当前块的目标信息。
  29. 根据权利要求28所述的方法,其中,所述对所述当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值,包括:
    根据所述当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;
    若所述第一宽度大于所述预测块的宽度,或者所述第一高度大于所述预测块的高度,则对所述当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值;
    若所述第一宽度小于所述预测块的宽度,或者所述第一高度小于所述预测块的高度,则对所述当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值。
  30. 根据权利要求29所述的方法,其中,所述第三子滤波处理为下采样滤波处理。
  31. 根据权利要求30所述的方法,其中,所述第三子滤波处理,包括下述至少一项:
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
  32. 根据权利要求29所述的方法,其中,所述第四子滤波处理为上采样滤波处理。
  33. 根据权利要求32所述的方法,其中,所述第四子滤波处理,包括下述至少一项:
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
  34. 根据权利要求28所述的方法,其中,所述方法还包括:
    将所述目标信息中的第一颜色分量的参考样值设置为所述当前块的相邻区域中的第一颜色分量采样点的取值与所述当前块中第一参考颜色分量采样点的重建值之差的绝对值。
  35. 根据权利要求28所述的方法,其中,所述方法还包括:
    将所述目标信息中的第一颜色分量的参考样值设置为所述当前块的第一颜色分量的滤波相邻样值与所述当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
  36. 根据权利要求1所述的方法,其中,所述根据所述目标信息中的第一颜色分量的参考样值,确定加权系数,包括:
    确定在预设映射关系下所述第一颜色分量的参考样值对应的取值;
    将所述加权系数设置为等于所述取值。
  37. 根据权利要求36所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    确定第一因子;
    根据所述第一因子和所述第一颜色分量的参考样值,确定第一乘积值;
    确定所述第一乘积值在所述预设映射关系下对应的取值。
  38. 根据权利要求37所述的方法,其中,所述确定第一因子,包括:
    所述第一因子是预设常数值。
  39. 根据权利要求37所述的方法,其中,所述确定第一因子,包括:
    根据所述当前块的尺寸参数,确定所述第一因子的取值;
    其中,所述当前块的尺寸参数包括以下参数的至少之一:所述当前块的宽度,所述当前块的高度。
  40. 根据权利要求36所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    所述预设映射关系是Softmax函数。
  41. 根据权利要求36所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    所述预设映射关系是与所述第一颜色分量的参考样值具有反比关系的加权函数。
  42. 根据权利要求1所述的方法,其中,所述根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块,包括:
    确定所述第二颜色分量的参考样值与对应的所述加权系数的加权值;
    将所述预测块中的第二颜色分量采样点的预测值设置为等于N个所述加权值之和;其中,N表示所述第二颜色分量的参考样值的数量,N是正整数。
  43. 根据权利要求42所述的方法,其中,所述方法还包括:
    对所述预测块中的第二颜色分量采样点的预测值进行修正操作,确定所述当前块的第二颜色分量的预测块。
  44. 根据权利要求1所述的方法,其中,所述方法还包括:
    对所述预测块进行滤波增强处理,将处理后的预测块作为所述当前块的第二颜色分量的预测块。
  45. 根据权利要求1所述的方法,其中,所述方法还包括:
    根据所述当前块的相邻区域中的参考样值,确定所述预测块的第二颜色分量的补偿值;
    根据所述补偿值对所述预测块中的第二颜色分量采样点的预测值进行修正处理,确定所述当前块的第二颜色分量的预测块。
  46. 根据权利要求1所述的方法,其中,所述方法还包括:
    根据至少一种预测模式对所述预测块中的第二颜色分量采样点进行预测处理,确定所述预测块中的第二颜色分量采样点的至少一个初始预测值;
    根据所述至少一个初始预测值与所述预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定所述当前块的第二颜色分量的预测块。
  47. 根据权利要求1所述的方法,其中,所述根据所述预测块,确定所述当前块的第二颜色分量采样点的重建值,包括:
    确定所述当前块的第二颜色分量采样点的预测差值;
    根据所述预测块,确定所述当前块的第二颜色分量采样点的预测值;
    根据所述当前块的第二颜色分量采样点的预测差值和所述当前块的第二颜色分量采样点的预测值,确定所述当前块的第二颜色分量采样点的重建值。
  48. 一种编码方法,包括:
    确定当前块的参考信息;
    对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息;
    根据所述目标信息中的第一颜色分量的参考样值,确定加权系数;
    根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块;
    根据所述预测块,确定所述当前块的第二颜色分量采样点的预测差值。
  49. 根据权利要求48所述的方法,其中,所述预测块包含所述当前块中至少部分所述第二颜色分量采样点的预测值。
  50. 根据权利要求48所述的方法,其中,所述确定当前块的参考信息,包括:
    根据所述当前块的相邻区域中的第一颜色分量采样点的取值、所述当前块的相邻区域中的第二颜色分量采样点的取值和所述当前块中第一参考颜色分量采样点的重建值,确定所述当前块的参考信息。
  51. 根据权利要求50所述的方法,其中,所述当前块的相邻区域包括下述至少之一:上侧相邻区域、右上侧相邻区域、左侧相邻区域和左下侧相邻区域。
  52. 根据权利要求50所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到所述当前块的相 邻区域中的第一颜色分量的滤波样值;
    根据所述当前块的相邻区域中的第一颜色分量的滤波样值,确定所述当前块的目标信息。
  53. 根据权利要求52所述的方法,其中,所述当前块的相邻区域中的第一颜色分量的滤波样值的数量等于L,其中,L表示所述当前块的相邻区域中的第二颜色分量采样点的取值的数量,L为正整数。
  54. 根据权利要求52所述的方法,其中,所述第一滤波处理为下采样滤波处理。
  55. 根据权利要求52所述的方法,其中,所述方法还包括:
    基于颜色格式信息,对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一滤波处理,得到所述当前块的相邻区域中的第一颜色分量的滤波样值。
  56. 根据权利要求55所述的方法,其中,所述第一滤波处理,还包括:
    若颜色格式信息指示为4:2:0采样,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行下采样滤波;其中,下采样率是2的正整数倍的倒数。
  57. 根据权利要求53所述的方法,其中,所述方法还包括:
    将L与预设个数进行比较;
    根据L与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  58. 根据权利要求57所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,包括:
    若L大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值均进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    若L小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量的滤波样值和所述当前块的相邻区域中的第二颜色分量采样点的取值均进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值。
  59. 根据权利要求50所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到所述当前块的相邻区域中的第二颜色分量的滤波样值;
    根据所述当前块的相邻区域中的第二颜色分量的滤波样值,确定所述当前块的目标信息。
  60. 根据权利要求59所述的方法,其中,所述当前块的相邻区域中的第二颜色分量的滤波样值的数量等于K,其中,K表示所述当前块的相邻区域中的第一颜色分量采样点的取值的数量,K为正整数。
  61. 根据权利要求59所述的方法,其中,所述第三滤波处理为上采样滤波处理。
  62. 根据权利要求59所述的方法,其中,所述方法还包括:
    基于颜色格式信息,对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第三滤波处理,得到所述当前块的相邻区域中的第二颜色分量的滤波样值。
  63. 根据权利要求62所述的方法,其中,所述第三滤波处理,还包括:
    若颜色格式信息指示为4:2:0采样,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行上采样滤波;其中,上采样率是2的正整数倍。
  64. 根据权利要求60所述的方法,其中,所述方法还包括:
    将K与预设个数进行比较;
    根据K与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  65. 根据权利要求64所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值进行第四滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值,包括:
    若K大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前 块的相邻区域中的第二颜色分量的滤波样值均进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值;
    若K小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值和所述当前块的相邻区域中的第二颜色分量的滤波样值均进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值和所述当前块的第二颜色分量的滤波相邻样值。
  66. 根据权利要求49所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    确定所述当前块的相邻区域中的第一颜色分量采样点的取值的数量为第一数量;
    根据所述第一数量与预设个数的比较结果,对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值;
    根据所述当前块的第一颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  67. 根据权利要求66所述的方法,其中,所述对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第五滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值,包括:
    若所述第一数量大于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第一子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值;
    若所述第一数量小于所述预设个数,则对所述当前块的相邻区域中的第一颜色分量采样点的取值进行第二子滤波处理,确定所述当前块的第一颜色分量的滤波相邻样值。
  68. 根据权利要求50所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,还包括:
    确定所述当前块的相邻区域中的第二颜色分量采样点的取值的数量为第二数量;
    根据所述第二数量与预设个数的比较结果,对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值;
    根据所述当前块的第二颜色分量的滤波相邻样值,确定所述当前块的目标信息。
  69. 根据权利要求68所述的方法,其中,所述对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第六滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值,包括:
    若所述第二数量大于所述预设个数,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第一子滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值;
    若所述第二数量小于所述预设个数,则对所述当前块的相邻区域中的第二颜色分量采样点的取值进行第二子滤波处理,确定所述当前块的第二颜色分量的滤波相邻样值。
  70. 根据权利要求57、64或68所述的方法,其中,所述方法还包括:
    将所述目标信息中的第二颜色分量的参考样值设置为所述当前块的第二颜色分量的滤波相邻样值。
  71. 根据权利要求58、65、67或69所述的方法,其中,所述第一子滤波处理为下采样滤波处理。
  72. 根据权利要求58、65、67或69所述的方法,其中,所述第一子滤波处理,包括下述至少一项:
    采用固定间隔位置的选择方式进行子滤波处理;
    采用连续位置的选择方式进行子滤波处理。
  73. 根据权利要求58、65、67或69所述的方法,其中,所述第二子滤波处理为上采样滤波处理。
  74. 根据权利要求58、65、67或69所述的方法,其中,所述第二子滤波处理,包括:
    采用固定间隔位置的插值方式进行子滤波处理。
  75. 根据权利要求50或57所述的方法,其中,所述对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息,包括:
    对所述当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值;
    根据所述当前块中第一参考颜色分量采样点的滤波样值,确定所述当前块的目标信息。
  76. 根据权利要求75所述的方法,其中,所述对所述当前块中第一参考颜色分量采样点的重建值进行第七滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值,包括:
    根据所述当前块中第一参考颜色分量采样点的重建值,确定第一宽度和第一高度;
    若所述第一宽度大于所述预测块的宽度,或者所述第一高度大于所述预测块的高度,则对所述当前块中第一参考颜色分量采样点的重建值进行第三子滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值;
    若所述第一宽度小于所述预测块的宽度,或者所述第一高度小于所述预测块的高度,则对所述当前块中第一参考颜色分量采样点的重建值进行第四子滤波处理,确定所述当前块中第一参考颜色分量采样点的滤波样值。
  77. 根据权利要求76所述的方法,其中,所述第三子滤波处理为下采样滤波处理。
  78. 根据权利要求77所述的方法,其中,所述第三子滤波处理,包括下述至少一项:
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行下采样滤波处理后再在垂直方向进行下采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行下采样滤波处理后再在水平方向进行下采样滤波处理。
  79. 根据权利要求76所述的方法,其中,所述第四子滤波处理为上采样滤波处理。
  80. 根据权利要求79所述的方法,其中,所述第四子滤波处理,包括下述至少一项:
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在水平方向进行上采样滤波处理后再在垂直方向进行上采样滤波处理;
    对所述当前块中第一参考颜色分量采样点的重建值在垂直方向进行上采样滤波处理后再在水平方向进行上采样滤波处理。
  81. 根据权利要求75所述的方法,其中,所述方法还包括:
    将所述目标信息中的第一颜色分量的参考样值设置为所述当前块的相邻区域中的第一颜色分量采样点的取值与所述当前块中第一参考颜色分量采样点的重建值之差的绝对值。
  82. 根据权利要求75所述的方法,其中,所述方法还包括:
    将所述目标信息中的第一颜色分量的参考样值设置为所述当前块的第一颜色分量的滤波相邻样值与所述当前块中第一参考颜色分量采样点的滤波样值之差的绝对值。
  83. 根据权利要求48所述的方法,其中,所述根据所述目标信息中的第一颜色分量的参考样值,确定加权系数,包括:
    确定在预设映射关系下所述第一颜色分量的参考样值对应的取值;
    将所述加权系数设置为等于所述取值。
  84. 根据权利要求83所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    确定第一因子;
    根据所述第一因子和所述第一颜色分量的参考样值,确定第一乘积值;
    确定所述第一乘积值在所述预设映射关系下对应的取值。
  85. 根据权利要求84所述的方法,其中,所述确定第一因子,包括:
    所述第一因子是预设常数值。
  86. 根据权利要求84所述的方法,其中,所述确定第一因子,包括:
    根据所述当前块的尺寸参数,确定所述第一因子的取值;
    其中,所述当前块的尺寸参数包括以下参数的至少之一:所述当前块的宽度,所述当前块的高度。
  87. 根据权利要求83所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    所述预设映射关系是Softmax函数。
  88. 根据权利要求83所述的方法,其中,所述确定在预设映射关系下所述第一颜色分量的参考样值对应的取值,包括:
    所述预设映射关系是与所述第一颜色分量的参考样值具有反比关系的加权函数。
  89. 根据权利要求48所述的方法,其中,所述根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块,包括:
    确定所述第二颜色分量的参考样值与对应的所述加权系数的加权值;
    将所述预测块中的第二颜色分量采样点的预测值设置为等于N个所述加权值之和;其中,N表示所述第二颜色分量的参考样值的数量,N是正整数。
  90. 根据权利要求89所述的方法,其中,所述方法还包括:
    对所述预测块中的第二颜色分量采样点的预测值进行修正操作,确定所述当前块的第二颜色分量的预测块。
  91. 根据权利要求48所述的方法,其中,所述方法还包括:
    对所述预测块进行滤波增强处理,将处理后的预测块作为所述当前块的第二颜色分量的预测块。
  92. 根据权利要求48所述的方法,其中,所述方法还包括:
    根据所述当前块的相邻区域中的参考样值,确定所述预测块的第二颜色分量的补偿值;
    根据所述补偿值对所述预测块中的第二颜色分量采样点的预测值进行修正处理,确定所述当前块的第二颜色分量的预测块。
  93. 根据权利要求48所述的方法,其中,所述方法还包括:
    根据至少一种预测模式对所述预测块中的第二颜色分量采样点进行预测处理,确定所述预测块中的第二颜色分量采样点的至少一个初始预测值;
    根据所述至少一个初始预测值与所述预测块中的第二颜色分量采样点的预测值进行加权融合处理,确定所述当前块的第二颜色分量的预测块。
  94. 根据权利要求48所述的方法,其中,所述根据所述预测块,确定所述当前块的第二颜色分量采样点的预测差值,包括:
    根据所述预测块,确定所述当前块的第二颜色分量采样点的预测值;
    根据所述当前块的第二颜色分量采样点的原始值和所述当前块的第二颜色分量采样点的预测值,确定所述当前块的第二颜色分量采样点的预测差值。
  95. 根据权利要求94所述的方法,其中,所述方法还包括:
    对所述当前块的第二颜色分量采样点的预测差值进行编码,将所得到的编码比特写入码流。
  96. 一种编码装置,包括第一确定单元、第一滤波单元和第一预测单元;其中,
    所述第一确定单元,配置为确定当前块的参考信息;
    所述第一滤波单元,配置为对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息;
    所述第一确定单元,还配置为根据所述目标信息中的第一颜色分量的参考样值,确定加权系数;
    所述第一预测单元,配置为根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块;
    所述第一确定单元,还配置为根据所述预测块,确定所述当前块的第二颜色分量采样点的预测差值。
  97. 一种编码设备,包括第一存储器和第一处理器;其中,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求48至95任一项所述的方法。
  98. 一种解码装置,包括第二确定单元、第二滤波单元和第二预测单元;其中,
    所述第二确定单元,配置为确定当前块的参考信息;
    所述第二滤波单元,配置为对所述当前块的参考信息中的至少部分信息进行滤波处理,确定所述当前块的目标信息;
    所述第二确定单元,还配置为根据所述目标信息中的第一颜色分量的参考样值,确定加权系数;
    所述第二预测单元,配置为根据所述加权系数和所述目标信息中的第二颜色分量的参考样值,确定所述当前块的第二颜色分量的预测块;
    所述第二确定单元,还配置为根据所述预测块,确定所述当前块的第二颜色分量采样点的重建值。
  99. 一种解码设备,包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至47任一项所述的方法。
  100. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至47任一项所述的方法、或者实现如权利要求48至95任一项所述的方法。
PCT/CN2022/086469 2022-04-12 2022-04-12 编解码方法、装置、编码设备、解码设备以及存储介质 WO2023197192A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/086469 WO2023197192A1 (zh) 2022-04-12 2022-04-12 编解码方法、装置、编码设备、解码设备以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/086469 WO2023197192A1 (zh) 2022-04-12 2022-04-12 编解码方法、装置、编码设备、解码设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2023197192A1 true WO2023197192A1 (zh) 2023-10-19

Family

ID=88328758

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086469 WO2023197192A1 (zh) 2022-04-12 2022-04-12 编解码方法、装置、编码设备、解码设备以及存储介质

Country Status (1)

Country Link
WO (1) WO2023197192A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020029202A1 (zh) * 2018-08-09 2020-02-13 Oppo广东移动通信有限公司 视频图像分量的预测方法和装置、及计算机存储介质
US20200177878A1 (en) * 2017-06-21 2020-06-04 Lg Electronics Inc Intra-prediction mode-based image processing method and apparatus therefor
CN112292863A (zh) * 2018-06-12 2021-01-29 光云大学校产学协力团 基于分量之间的参考的视频信号处理方法及装置
CN113497937A (zh) * 2020-03-20 2021-10-12 Oppo广东移动通信有限公司 图像编码方法、图像解码方法及相关装置
CN113545063A (zh) * 2019-02-22 2021-10-22 华为技术有限公司 使用线性模型进行帧内预测的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200177878A1 (en) * 2017-06-21 2020-06-04 Lg Electronics Inc Intra-prediction mode-based image processing method and apparatus therefor
CN112292863A (zh) * 2018-06-12 2021-01-29 光云大学校产学协力团 基于分量之间的参考的视频信号处理方法及装置
WO2020029202A1 (zh) * 2018-08-09 2020-02-13 Oppo广东移动通信有限公司 视频图像分量的预测方法和装置、及计算机存储介质
CN113545063A (zh) * 2019-02-22 2021-10-22 华为技术有限公司 使用线性模型进行帧内预测的方法及装置
CN113497937A (zh) * 2020-03-20 2021-10-12 Oppo广东移动通信有限公司 图像编码方法、图像解码方法及相关装置

Similar Documents

Publication Publication Date Title
CN113596482B (zh) 环路滤波实现方法、装置及计算机存储介质
US11843781B2 (en) Encoding method, decoding method, and decoder
WO2021120122A1 (zh) 图像分量预测方法、编码器、解码器以及存储介质
WO2022087901A1 (zh) 图像预测方法、编码器、解码器以及计算机存储介质
WO2020132908A1 (zh) 解码预测方法、装置及计算机存储介质
WO2023197191A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2023197192A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2023197194A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2020192084A1 (zh) 图像预测方法、编码器、解码器以及存储介质
CN113395520B (zh) 解码预测方法、装置及计算机存储介质
WO2024007165A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2020056767A1 (zh) 视频图像分量的预测方法、装置及计算机存储介质
WO2023141781A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2023197189A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2023197193A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
WO2023197195A1 (zh) 视频编解码方法、编码器、解码器及存储介质
WO2023051654A1 (en) Method, apparatus, and medium for video processing
WO2023197190A1 (zh) 编解码方法、装置、编码设备、解码设备以及存储介质
TWI839923B (zh) 視頻編解碼系統中基於交叉分量線性模型的預測方法及裝置
WO2024098263A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024077520A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2023241634A1 (en) Method, apparatus, and medium for video processing
WO2023051653A1 (en) Method, apparatus, and medium for video processing
EP3952308B1 (en) Image component prediction method and device, and computer storage medium
WO2024078598A1 (en) Method, apparatus, and medium for video processing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22936846

Country of ref document: EP

Kind code of ref document: A1