Encoding and decoding methods and apparatuses, codec, bitstream, device, and storage medium

By sorting the index values ​​of candidate cross-component prediction models for video encoders and decoders, efficient encoding of digital videos is achieved, solving the problems of video transmission bandwidth and traffic pressure in the existing technology, and improving video encoding efficiency.

WO2024212190A1PCT designated stage expired Publication Date: 2024-10-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/088181
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

Existing digital video compression technology still has room for improvement in reducing video transmission bandwidth and traffic pressure, especially in the context of pursuing high video definition.

Method used

By providing a method for the encoder and decoder to determine the index value of the candidate cross-component prediction model, and sort the prediction error from small to large, the model with the small prediction error is selected for intra-frame prediction and the code stream overhead is reduced.

Benefits of technology

It effectively saves the bandwidth and traffic pressure of digital video transmission and improves video encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023088181_17102024_PF_FP_ABST
    Figure CN2023088181_17102024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose encoding and decoding methods and apparatuses, a codec, a bitstream, a device, and a storage medium. The encoding method comprises: determining a first candidate list, candidate cross-component prediction models in the first candidate list being arranged from least to greatest in order of prediction errors of the candidate cross-component prediction models or the sum of prediction errors in model groups in which the candidate cross-component prediction models are located; selecting from the first candidate list a first cross-component prediction model of a first color component, and performing intra-frame prediction on a first color component of a current block according to the first cross-component prediction model and a reconstruction value of a second color component of the current block, to obtain a first intra-frame prediction value; determining a first residual value of the first color component of the current block according to the first intra-frame prediction value and a sample value of the first color component of the current block; generating a bitstream according to the first residual value of the current block and an index value of the first cross-component prediction model in the first candidate list.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method and device, codec, code stream, device, storage medium Technical Field

[0001] The embodiments of the present application relate to video image technology, including but not limited to coding and decoding methods and devices, codecs, bit streams, devices, and storage media. Background Art

[0002] Digital video compression technology primarily compresses massive amounts of digital video data for easier transmission and storage. With the surge in Internet video usage and increasing demand for higher-quality video, while existing digital video compression standards can save significant amounts of video data, there is still a need for better digital video compression technologies to reduce bandwidth and traffic pressures associated with digital video transmission.

[0003] Summary of the Invention

[0004] In view of this, the encoding and decoding method and apparatus, codec, bitstream, device, and storage medium provided in the embodiments of the present application can save the bitstream overhead of the index value of the selected cross-component prediction model, thereby reducing the bandwidth and traffic pressure of digital video transmission; the encoding and decoding method and apparatus, codec, bitstream, device, and storage medium provided in the embodiments of the present application are implemented as follows:

[0005] According to one aspect of an embodiment of the present application, a coding method is provided, which is applied to an encoder, and the method includes: determining a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group to which the candidate cross-component prediction model belongs; selecting a first cross-component prediction model for a first color component from the first candidate list, and performing intra-frame prediction on the first color component of the current block based on the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; determining a first residual value of the first color component of the current block based on the first intra-frame prediction value and the sample value of the first color component of the current block; and generating a code stream based on the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

[0006] According to one aspect of an embodiment of the present application, a decoding method is provided, which is applied to a decoder, and the method includes: parsing a code stream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list; determining the first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group where the candidate cross-component prediction model is located; determining the first cross-component prediction model according to the index value of the first cross-component prediction model in the first candidate list and the first candidate list; performing intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; and determining the reconstructed value of the first color component of the current block according to the first intra-frame prediction value and the first residual value.

[0007] According to one aspect of an embodiment of the present application, there is provided an encoding device, which is applied to an encoder, and the device includes: a first determination module, configured to determine a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group to which the candidate cross-component prediction model belongs; a selection module, configured to select a first cross-component prediction model for a first color component from the first candidate list; a first prediction module, configured to perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; a second determination module, configured to determine a first residual value of the first color component of the current block according to the first intra-frame prediction value and the sample value of the first color component of the current block; and an encoding module, configured to generate a code stream according to the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

[0008] According to one aspect of an embodiment of the present application, an encoder is provided, comprising a first memory and a first processor; wherein the first memory is used to store a computer program that can be run on the first processor; and the first processor is used to execute the encoding method as described in the embodiment of the present application when running the computer program.

[0009] According to one aspect of an embodiment of the present application, a code stream is provided, where the code stream is obtained using the encoding method described in the embodiment of the present application.

[0010] According to one aspect of an embodiment of the present application, a decoding device is provided, which is applied to a decoder, and includes: a decoding module, configured to parse a bitstream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list; a third determination module, configured to determine the first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group to which the candidate cross-component prediction model belongs; a fourth determination module, configured to determine the first cross-component prediction model based on the index value of the first cross-component prediction model in the first candidate list and the first candidate list; a second prediction module, configured to perform intra-frame prediction on the first color component of the current block based on the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; and a fifth determination module, configured to determine the reconstructed value of the first color component of the current block based on the first intra-frame prediction value and the first residual value.

[0011] According to one aspect of an embodiment of the present application, a decoder is provided, comprising a second memory and a second processor; wherein the second memory is used to store a computer program that can be run on the second processor; and the second processor is used to execute the decoding method as described in the embodiment of the present application when running the computer program.

[0012] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor adapted to execute a computer program; and a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, the encoding method as described in the embodiment of the present application is implemented, or when the computer program is executed by the processor, the decoding method as described in the embodiment of the present application is implemented.

[0013] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the encoding method as described in the embodiment of the present application is implemented, or when the computer program is executed, the decoding method as described in the embodiment of the present application is implemented.

[0014] In an embodiment of the present application, the candidate cross-component prediction modes recorded in the first candidate list are arranged in order from small to large according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group to which the candidate cross-component prediction model belongs; in this way, since the candidate cross-component prediction model with a small prediction error has a higher probability of being selected for intra-frame prediction, the candidate cross-component prediction model with a small prediction error is arranged before the candidate cross-component prediction model with a large prediction error, which is beneficial to saving the code stream overhead of the index value of the selected candidate cross-component prediction model (i.e., the first cross-component prediction model), thereby reducing the bandwidth and traffic pressure of digital video transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings herein are incorporated into and constitute a part of this specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, serve to illustrate the technical solutions of the present application. Obviously, the drawings described below are merely some embodiments of the present application. Those skilled in the art can, without inventive effort, derive other drawings from these drawings.

[0016] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0017] FIG1 is a schematic diagram of the basic flow of a video codec;

[0018] FIG2 is a schematic diagram of an implementation flow of the encoding method provided in an embodiment of the present application;

[0019] FIG3 is a schematic diagram of a 5-tap cross filter provided in an embodiment of the present application;

[0020] FIG4 is a schematic diagram of a reconstruction area for deriving filter coefficients according to an embodiment of the present application;

[0021] FIG5 is a schematic diagram of an implementation flow of the encoding method provided in an embodiment of the present application;

[0022] FIG6 is a schematic diagram of adjacent positions of a current block provided in an embodiment of the present application;

[0023] FIG7 is a schematic diagram of a flow chart of a method for determining a first candidate list according to an embodiment of the present application;

[0024] FIG8 is a schematic diagram of an implementation flow of a decoding method provided in an embodiment of the present application;

[0025] FIG9 is a schematic diagram of an implementation flow of a decoding method provided in an embodiment of the present application;

[0026] FIG10A is a schematic diagram showing the positions of luminance and chrominance reconstruction samples for deriving α and β according to an embodiment of the present application;

[0027] FIG10B is a schematic diagram of establishing a linear relationship between luminance samples (Y) and chrominance samples (C);

[0028] FIG10C is a schematic diagram of dividing samples into two groups according to a threshold value and deriving two sets of linear models;

[0029] FIG11 is a schematic diagram of four Sobel operators used by the GLM provided in an embodiment of the present application to obtain gradients;

[0030] FIG12 is a schematic diagram of a template for reordering Cb and Cr components provided in an embodiment of the present application;

[0031] FIG13 is a schematic diagram of the structure of an encoding device provided in an embodiment of the present application;

[0032] FIG14 is a schematic structural diagram of a decoding device provided in an embodiment of the present application;

[0033] FIG15 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0034] FIG16 is a schematic diagram of the structure of the decoder provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0037] In the following description, references to “some embodiments,” “this embodiment,” “embodiments of the present application,” and examples, etc., describe a subset of all possible embodiments. However, it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.

[0038] The descriptions such as "first, second, third" appearing in the embodiments of this application are only for illustration and distinction of the described objects. There is no order, nor does it indicate any special limitation on the number of devices in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application.

[0039] The “current block” that appears in the embodiments of the present application can be understood as the “current encoding / decoding unit (CU)” or the “current prediction unit (PU)”, etc.

[0040] The “pixel” that appears in the embodiments of the present application can be understood as a “sample”.

[0041] The codec architecture and service scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that, with the evolution of codec architectures and the emergence of new service scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0042] Video compression includes multiple modules, including intra-frame prediction (i.e., spatial compression) and / or inter-frame prediction (i.e., temporal compression) to reduce or remove inherent redundancy in video; transformation, quantization, inverse quantization, and inverse transformation of residual information; and loop filtering and entropy coding to improve subjective and objective reconstruction quality. Most mainstream video compression standards describe block-based compression techniques. A video slice, a frame, or a sequence of pictures is divided into coding tree units (CTUs), which are further divided into blocks called coding units (CUs). Intra-frame blocks are predicted using neighboring pixels / samples as reference, while inter-frame blocks are predicted using spatially adjacent blocks and reference information from other frames. In contrast to the predicted information, the residual information is transformed, quantized, and entropy coded into a bitstream on a block-by-block basis. These techniques are described in standards and implemented in various fields related to video compression.

[0043] The basic process of a video codec is shown in Figure 1. At the encoder, a frame of image 101 is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The predicted block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix, which is then entropy encoded to generate a bitstream. At the decoder (not shown), intra-frame prediction or inter-frame prediction is used on the current block to generate a predicted block for the current block. The bitstream is then parsed to obtain a quantization coefficient matrix. The quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The predicted block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain a decoded image. The encoder also uses similar operations as the decoder to obtain a decoded image. The decoded image can be used as a reference image for inter-frame prediction in subsequent frames. The block division information determined by the encoder, as well as information about the prediction, transform, quantization, entropy coding, and loop filtering modes or parameters, must be included in the output bitstream if necessary. The decoder uses parsing and analysis based on existing information to determine the same block partitioning information as the encoder, as well as prediction, transform, quantization, entropy coding, and loop filtering mode or parameter information. This ensures that the decoded image obtained by the encoder and the decoder are identical. The decoded image obtained by the encoder is also often referred to as the reconstructed image. During prediction, the current block can be divided into prediction units (PUs), and during transform, the current block can be divided into transform units (TUs). The division of prediction units and transform units can be different.

[0044] The above is the basic process of the video codec under the block-based hybrid coding framework. As technology develops, some modules or steps of the framework or process may be optimized. The encoding and decoding method provided in the embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to this framework and process. It is known to those skilled in the art that with the evolution of encoders and decoders and the emergence of new business scenarios, the method provided in the embodiment of the present application is also applicable to similar technical problems.

[0045] It is understandable that there is a strong spatial correlation between adjacent parts or adjacent pixels / adjacent samples within an image. Intra-frame prediction is a method of predicting the current block using the reconstructed pixels / samples around the current block as a reference. In order to remove redundancy between different color channels, a cross-component intra-frame prediction mode has been proposed. For example, using the reconstructed luminance block to predict the chrominance component of the current block, the prediction needs to construct a linear or nonlinear relationship between luminance and chrominance based on the reconstructed values ​​of the luminance component and the reconstructed values ​​of the chrominance components.

[0046] The embodiment of the present application provides an encoding method, which is applied to an encoder. FIG2 is a schematic diagram of an implementation flow of the encoding method provided in the embodiment of the present application. As shown in FIG2 , the method includes the following steps 201 to 205:

[0047] Step 201: determine a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group where the candidate cross-component prediction model is located.

[0048] It can be understood that in the first candidate list, an index value can correspond to a candidate cross-component prediction model in the first candidate list; in other embodiments, in the first candidate list, an index value can also correspond to a group of candidate cross-component prediction models in the first candidate list, and the first candidate list includes N groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model for the first color component and a candidate cross-component prediction model for the third color component; wherein N is greater than or equal to 1. In some embodiments, N is a fixed value, for example, N=6.

[0049] For example, in some embodiments, the first color component and the third color component are both chromaticity components. For example, the first color component is a blue (Cb) chromaticity component, and the third color component is a red (Cr) chromaticity component; for another example, the first color component is a red (Cr) chromaticity component, and the third color component is a blue (Cb) chromaticity component.

[0050] In the embodiment of the present application, there is no limitation on whether the candidate cross-component prediction models of each color component in the first candidate list are sorted individually or in groups.

[0051] In some embodiments, the candidate cross-component prediction models for the first color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models for the first color component; and / or, the candidate cross-component prediction models for the third color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models for the third color component. That is, the candidate cross-component prediction models for the first color component and the candidate cross-component prediction models for the third color component are sorted separately in the first candidate list.

[0052] In other embodiments, the candidate cross-component prediction model groups in the first candidate list are arranged in ascending order according to the sum of the prediction errors of the candidate cross-component prediction model of the first color component and the prediction errors of the candidate cross-component prediction model of the third color component in the candidate cross-component prediction model group. It can be understood that a group of candidate cross-component prediction model groups includes candidate cross-component prediction models of the first color component and candidate cross-component prediction models of the third color component, and the candidate cross-component prediction models in the first candidate list are arranged in order in groups. A group of candidate cross-component prediction models inherits the cross-component prediction models for intra-frame prediction of different color components of the same reconstructed block.

[0053] It is understood that the prediction error of the candidate cross-component prediction model refers to the error when the candidate cross-component prediction model performs intra-frame prediction on the template area of ​​the current block, and the template area may be a reconstructed area. Specifically, reference may be made to the description of step 502 in the following embodiment.

[0054] Step 202: Select a first cross-component prediction model for a first color component from the first candidate list.

[0055] In the embodiments of the present application, there is no limitation on how the encoder selects the first cross-component prediction model. In short, it is sufficient to encode a legal bitstream that complies with the regulations. In some embodiments, the candidate cross-component prediction model with the lowest rate-distortion cost can be selected from the first candidate list based on rate-distortion optimization as the first cross-component prediction model.

[0056] Step 203 : Perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value.

[0057] Exemplarily, in some embodiments, the second color component is a luminance component, and the first color component is a chrominance component.

[0058] It can be understood that different types of the first cross-component prediction models may result in different methods for calculating the first intra-frame prediction value.

[0059] For example, the first cross-component prediction model is a CCLM model, and the expression of the model is shown in the following formula (1):

[0060] pred C (i,j)=α·rec L ′(i,j)+β (1);

[0061] In formula (1), pred C (i, j) represents the first intra-frame prediction value of the chrominance component at the coordinate position (i, j) in the current block, recL ′(i, j) represents the reconstructed value of the luminance component at the coordinate position (i, j) in the current block. The reconstructed value of the luminance component is obtained by downsampling the reconstructed values ​​of the luminance components of at least two samples. α and β are parameters of the model, that is, linear parameters.

[0062] In some embodiments, α and β may be determined based on the reconstructed values ​​of the chrominance components of the adjacent regions and / or non-adjacent regions of the current block and the reconstructed values ​​of the luminance components of the corresponding regions.

[0063] In ECM, α and β are derived using the least squares method, and the calculation formulas are shown in the following equations (2) and (3):

[0064] In formula (2) and formula (3), I represents the number of reconstructed samples, Rec C (i) represents the reconstructed value of the chrominance component of the i-th sample, Rec L '(i) represents the reconstructed value of the luminance component of the i-th sample.

[0065] For another example, the first cross-component prediction model is an MMLM model, which is similar to the CCLM model, except that it allows two CCLM models to be derived from one current block. Which of the two CCLM models is used for the sample to be predicted in the current block is controlled by a first threshold (Threshold). The first threshold can be determined based on the reconstructed values ​​of the luminance components of the adjacent areas and / or non-adjacent areas of the current block. For example, the first threshold is equal to the mean of the reconstructed values ​​of the luminance components of the adjacent areas and / or non-adjacent areas of the current block. The expression of the MMLM model is shown in the following equation (4):

[0066] The calculation method of α1 and α2 is the same as the calculation method of α in the above formula (2), except that when calculating α1, the reconstruction value of the luminance component in the adjacent area and / or non-adjacent area of ​​the current block is less than or equal to the reconstruction value of the Threshold and the reconstruction value of the chrominance component at the corresponding position of the sample with the reconstruction value of the luminance component less than or equal to the Threshold are used. Accordingly, when calculating β1, the reconstruction value of the luminance component in the adjacent area and / or non-adjacent area of ​​the current block is less than or equal to the reconstruction value of the Threshold and the reconstruction value of the chrominance component at the corresponding position of the sample with the reconstruction value of the luminance component less than or equal to the Threshold are used; and when calculating α2, the reconstruction value of the luminance component in the adjacent area and / or non-adjacent area of ​​the current block is greater than the reconstruction value of the Threshold and the reconstruction value of the chrominance component at the corresponding position of the sample with the reconstruction value of the luminance component greater than the Threshold are used. Accordingly, when calculating β1, the reconstruction value of the luminance component in the adjacent area and / or non-adjacent area of ​​the current block is greater than the reconstruction value of the Threshold and the reconstruction value of the chrominance component at the corresponding position of the sample with the reconstruction value of the luminance component greater than the Threshold are used.

[0067] In the prediction of the MMLM model, when Rec' L When (i, j) is less than or equal to the first threshold, the prediction of the current sample (i, j) uses Pred C (i,j)=α1×Rec' L (i,j)+β1, when Rec' L When (i, j) is greater than the first threshold, the prediction of the current sample (i, j) uses Pred C (i,j)=α2×Rec' L (i,j)+β2.

[0068] For example, the first cross-component prediction model is the CCCM model, whose model parameters are no longer simple α and β, but a set of filter parameters. The filter parameters of the CCCM model are a 7-tap filter, which consists of a 5-tap cross filter, a nonlinear term, and a bias term. As shown in Figure 3, the input of the 5-tap cross filter consists of the center (Center, C) luma sample (the downsampled luma sample at the position corresponding to the current chroma prediction position), the above (Above / North, N) luma sample, the below (Below / South, S) luma sample, the left (Left / West, W) luma sample, and the right (Right / East, E) luma sample.

[0069] As shown in the following equation (5), the nonlinear term P is determined by the luma input sample C at the middle position and the bit depth of the chroma component of the current block: P = (C × C + (1 < < (bitDepth-1))) > > bitDepth (5);

[0070] For example, when the bit precision of the chrominance component of the current block is 10 bits, P = (C×C+512)>>10;

[0071] The offset term B is set to (1<<(bitDepth-1)) in CCCM. For example, if the bit precision of the chrominance component of the current block is 10 bits, B=512.

[0072] As shown in the following equation (6), the first intra-frame prediction value predChromaVal based on CCCM can be determined according to the adaptively obtained 7-tap filter coefficients {c0,…,c6} and the luminance reconstruction value of the input sample: predChromaVal=c0C+c1N+c2S+c3E+c4W+c5P+c6B (6);

[0073] The following are instructions for obtaining the filter coefficients:

[0074] The filter coefficient is obtained by minimizing the mean square error between the total chrominance prediction value and the chrominance reconstruction value of the reconstructed area, as shown in Figure 4, which illustrates that the reconstructed area of ​​the chrominance component of the current block is composed of 6 rows and 6 columns of chrominance reconstruction values ​​around the current block. When there is an unfinished reconstruction position in the reconstructed area, the value at that position is filled with the chrominance value that has been reconstructed.

[0075] The calculation process of minimizing the mean square error is:

[0076] 1. Get the autocorrelation matrix of the input luminance sample and the cross-correlation vector between the input luminance sample and the output chrominance sample;

[0077] 2. The autocorrelation matrix is ​​decomposed by LDL, and the final filter coefficients are obtained by back-banding.

[0078] In the calculation of the autocorrelation matrix, since the values ​​of the input luma samples used are relatively large, a greater precision is required when calculating the convolution filter coefficients. Therefore, in CCCM, the input luma samples and the output chroma samples need to be subtracted from the corresponding offset values ​​offsetLuma, offsetCb, and offsetCr. The luma reconstruction value and chroma prediction value outside the upper left corner of the current block are used as offsets. Therefore, the CCCM input becomes as follows: C'=C–offsetLuma N'=N–offsetLuma S'=S–offsetLuma E'=E–offsetLuma W'=W–offsetLuma P'=nonLinear(C') B=midValue=1<<(bitDepth-1)

[0079] The chroma prediction value predChromaVal (ie, the first intra-frame prediction value) is calculated by the following formula (7), where offsetChroma is the offset value offset of the Cb or Cr component; predChromaVal=c0C'+c1N'+c2S'+c3E'+c4W'+c5P'+c6B+offsetChroma (7).

[0080] CCCM also supports two sets of filter coefficients for a block, similar to MMLM, for example, the use of a certain set of coefficients is controlled according to the corresponding configured threshold.

[0081] Since the parameter c of CCCM 0,···, c6 and the possible corresponding threshold and the second set of parameters are derived, so they do not need to be parsed from the bitstream at the decoding end.

[0082] Step 204: determining a first residual value of the first color component of the current block according to the first intra prediction value and the sample value of the first color component of the current block;

[0083] Step 205 : Generate a bitstream according to the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

[0084] In some embodiments, the encoder may use the CCMerge mode by default to perform cross-component intra prediction on the chroma components of the current block, or may determine whether to use the CCMerge mode to perform cross-component intra prediction on the chroma components of the current block based on a preset rule. It will be understood that when the encoder determines to use the CCMerge mode for intra prediction, the index value of the first cross-component prediction model in the first candidate list is written into the bitstream.

[0085] It can be understood that in an embodiment of the present application, the candidate cross-component prediction modes recorded in the first candidate list are arranged in order from small to large according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group to which the candidate cross-component prediction model belongs; in this way, since the candidate cross-component prediction model with a small prediction error has a higher probability of being selected for intra-frame prediction, the candidate cross-component prediction model with a small prediction error is arranged before the candidate cross-component prediction model with a large prediction error, which is beneficial to saving the code stream overhead of the index value of the selected candidate cross-component prediction model (i.e., the first cross-component prediction model), thereby reducing the bandwidth and traffic pressure of digital video transmission.

[0086] The embodiment of the present application further provides an encoding method, which is applied to an encoder. FIG5 is a schematic diagram of an implementation flow of the encoding method provided in the embodiment of the present application. As shown in FIG5 , the method includes the following steps 501 to 505:

[0087] Step 501, construct a second candidate list; wherein, the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model used for intra-frame prediction of the first color component and / or the third color component at an adjacent position and / or a non-adjacent position of the current block.

[0088] Step 502: Determine the first candidate list based on the second candidate list;

[0089] Step 503: Select a first inter-component prediction model for a first color component from the first candidate list, and perform intra-frame prediction on the first color component of the current block based on the first inter-component prediction model and a reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value.

[0090] Step 504: determining a first residual value of the first color component of the current block according to the first intra prediction value and the sample value of the first color component of the current block;

[0091] Step 505 : Generate a bitstream according to the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

[0092] In some embodiments, the encoder may use the CCMerge mode by default to perform cross-component intra prediction on the chroma components of the current block, or may determine whether to use the CCMerge mode to perform cross-component intra prediction on the chroma components of the current block based on a preset rule. It will be understood that when the encoder determines to use the CCMerge mode for intra prediction, the index value of the first cross-component prediction model in the first candidate list is written into the bitstream.

[0093] The following describes further optional implementations and related terms of each of the above steps.

[0094] In step 501, a second candidate list is constructed; wherein the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model adopted for intra-frame prediction of the first color component and / or the third color component at an adjacent position and / or a non-adjacent position of the current block.

[0095] Furthermore, in some embodiments, constructing the second candidate list may be implemented as follows: obtaining a set of second cross-component prediction models used for performing intra prediction on adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes cross-component prediction models of the first color component and / or the third color component;

[0096] Deduplication is performed on the obtained second span component prediction model to obtain a deduplicated second span component prediction model;

[0097] When the number of groups of the second cross-component prediction model after deduplication is less than N, the second cross-component prediction model after deduplication is used as a candidate cross-component prediction model in the second candidate list, and the candidate cross-component prediction model in the second candidate list is filled into N groups using a CCLM model with a specific slope;

[0098] When the number of groups of the second cross-component prediction model after deduplication is equal to N, the second cross-component prediction model after deduplication is used as a candidate cross-component prediction model in the second candidate list;

[0099] When the number of groups of the second cross-component prediction model after deduplication is greater than N, the second cross-component prediction model after deduplication is used as the candidate cross-component prediction model in the second candidate list.

[0100] It can be understood that the purpose of deduplication of the obtained second cross-component prediction model is to ensure that the prediction models of any two groups of candidate cross-component prediction models recorded in the second candidate list are different.

[0101] In the embodiment of the present application, the number of candidate cross-component prediction model groups in the second candidate list is not limited, and can be N groups or more than N groups. In the case where the number of candidate cross-component prediction model groups in the second candidate list is less than N groups, a CCLM model with a specific slope can be used to fill the candidate cross-component prediction models in the second candidate list to N groups.

[0102] In some embodiments, the second candidate list includes one or more of a CCLM model, an MMLM model, a CCCM model, and a GLM model.

[0103] Exemplarily, the second candidate list is a CCMerge list. It can be understood that in the CCMerge list, the second cross-component prediction models respectively adopted for intra-frame prediction of the first color component and the third color component of the adjacent position and / or non-adjacent position of the current block are recorded, and the second cross-component prediction models inherited from the adjacent position and / or non-adjacent position are stored in the list without duplication. The cross-component prediction model in the CCMerge list can be one or more models of CCLM, MMLM, CCCM and GLM. When the second cross-component prediction model is not enough to fill the CCMerge list, the default model is used to fill the models in the list to N groups. The default model can be, for example, a CCLM model with a specific slope, such as the slope α is {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8} in sequence, and β is obtained by the calculation method described in the CCLM paragraph; wherein,

[0104] The adjacent positions of the current block are shown in Figure 6. When obtaining the second cross-component prediction model of the adjacent positions of the current block, the second cross-component prediction models used by positions B1, A1, B0, A0, and B2 can be accessed in sequence. The encoder can also obtain the second cross-component prediction models used by the non-adjacent positions of the current block and add these models to the CCMerge list; wherein the non-adjacent positions of the current block can be one or more non-adjacent positions above, above left, above right, left, and / or below right of the current block.

[0105] In step 502, the first candidate list is determined based on the second candidate list;

[0106] It can be understood that the candidate cross-component prediction models in the second candidate list may be arranged according to the configured access order; wherein the access order refers to the order of accessing the adjacent positions and / or non-adjacent positions of the current block. For example, when obtaining the second cross-component prediction model of the adjacent position of the current block, the second cross-component prediction models used by the positions B1, A1, B0, A0, and B2 can be accessed in sequence.

[0107] Based on the obtained second candidate list, the candidate cross-component prediction models in the second candidate list are reordered, and the first candidate list is determined based on the reordered second candidate list. Here, "reordering" can also be understood as "sorting" or "re-sorting", etc. In short, the candidate cross-component prediction models in the second candidate list are reordered.

[0108] Specifically, in some embodiments, as shown in FIG7 , step 502 may be implemented through steps 5021 to 5023 as follows:

[0109] Step 5021, determining the prediction errors of the candidate cross-component prediction models in the second candidate list;

[0110] Step 5022: sort the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list;

[0111] Step 5023: Determine the first candidate list based on the sorted second candidate list.

[0112] in,

[0113] In step 5021, the prediction errors of the candidate cross-component prediction models in the second candidate list are determined.

[0114] It can be understood that different color components have corresponding candidate cross-component prediction models, so the prediction errors of the candidate cross-component prediction models of different color components need to be calculated respectively.

[0115] Exemplarily, in some embodiments, step 5021 can be implemented as follows: based on the candidate cross-component prediction model of the color component (the color component is the first color component or the third color component) in the second candidate list and the reconstructed value of the second color component of the template area of ​​the current block, intra-frame prediction is performed on the color component of the template area of ​​the current block to obtain a second intra-frame prediction value; and based on the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block, the prediction error of the candidate cross-component prediction model of the color component in the second candidate list is determined.

[0116] Exemplarily, in some embodiments, the template area of ​​the current block includes an upper adjacent template of the current block and / or a left adjacent template of the current block.

[0117] For example, the upper adjacent template is the upper adjacent row of the current block, and / or the left adjacent template is the left adjacent column of the current block.

[0118] It can be understood that the template area of ​​the current block includes the first samples for which the reconstruction of the second color component has not been completed and / or the first samples for which the reconstruction of the second color component has been completed.

[0119] In some embodiments, when there is a first sample in the template area of ​​the current block that has not completed reconstruction of the second color component, the reconstructed value of the second color component of the first sample is filled with the reconstructed value of a second sample adjacent to or non-adjacent to the first sample that has completed reconstruction of the second color component;

[0120] In some embodiments, when all samples in the template area of ​​the current block have not completed the reconstruction of the second color component, the candidate cross-component prediction models in the second candidate list are not reordered, but intra-frame prediction is performed based on the second candidate list. For example, a third cross-component prediction model for the first color component is selected from the second candidate list, and intra-frame prediction is performed on the first color component of the current block based on the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value; and a second residual value of the first color component of the current block is determined based on the third intra-frame prediction value and the sample value of the first color component of the current block; and a code stream is generated based on the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list.

[0121] In step 5022, the candidate cross-component prediction models in the second candidate list are sorted according to the prediction errors of the candidate cross-component prediction models in the second candidate list.

[0122] In an embodiment of the present application, when sorting, the candidate cross-component prediction models of different color components belonging to the same group can be sorted separately, or the candidate cross-component prediction model groups can be sorted in groups.

[0123] Exemplarily, in some embodiments, step 5022 may be implemented as follows: sorting the candidate cross-component prediction models for the first color component in the second candidate list in ascending order of prediction errors of the candidate cross-component prediction models for the first color component in the second candidate list; and / or

[0124] The candidate cross-component prediction models of the third color component in the second candidate list are sorted in ascending order of prediction errors of the candidate cross-component prediction models of the third color component in the second candidate list.

[0125] Exemplarily, in some other embodiments, step 5022 can also be implemented as follows: sort the candidate cross-component prediction model groups in the second candidate list in ascending order of the sum of the prediction error of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction error of the candidate cross-component prediction model of the third color component in the same group.

[0126] In the embodiment of the present application, there is no limitation on whether the second candidate list records part of the parameters or all the parameters of the candidate cross-component prediction model.

[0127] In some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, some parameters of the CCCM model are filtering parameters of the CCCM model; the remaining parameters of the CCCM model include the offset value of the color component (such as the offsetCb or offsetCr mentioned above) and the offset value of the second color component (such as the offsetLuma mentioned above); the method also includes: determining the offset value of the color component based on the reconstructed value of the color component of the adjacent blocks and / or non-adjacent blocks of the current block; determining the offset value of the second color component based on the reconstructed value of the second color component of the adjacent blocks and / or non-adjacent blocks of the current block.

[0128] Exemplarily, in some embodiments, the offset value of the color component is equal to the mean of one or more reconstructed values ​​of the color component of the adjacent blocks and / or non-adjacent blocks of the current block; the offset value of the second color component is equal to the mean of one or more reconstructed values ​​of the second color component of the adjacent blocks and / or non-adjacent blocks of the current block.

[0129] For example, offsetChroma (such as offsetCb or offsetCr) can be obtained by averaging one or more reconstructed values ​​in the reconstructed area of ​​the chroma components of the current block (such as the reconstructed values ​​of the chroma components above, to the upper left, to the left, to the lower left, and / or to the upper right of the current block). Similarly, offsetLuma is obtained for the luma block at the position corresponding to the current chroma position using the same method as chroma offsetChroma.

[0130] In some other embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; based on this, the method further includes: determining the remaining parameters of the candidate cross-component prediction model of the color component based on the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the adjacent blocks or non-adjacent blocks of the current block.

[0131] Exemplarily, in some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, some parameters of the candidate cross-component prediction model of the color component are the slope of the CCLM model, and the calculation method of the remaining parameters of the CCLM model (i.e., β) can refer to the above formula (3), which will not be repeated here.

[0132] For example, in some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include the slope of the first CCLM model, the slope of the second CCLM model, and the first threshold in the MMLM model; the calculation method of the remaining parameters (i.e., β) of the first CCLM model and the second CCLM model can refer to the above formula (3), which will not be repeated here.

[0133] Regarding the use of the MMLM model, in some embodiments, when the reconstructed value of the second color component of the to-be-predicted sample of the color component of the template area of ​​the current block is less than or equal to the first threshold, intra-frame prediction is performed on the color component of the to-be-predicted sample based on the first CCLM model and the reconstructed value of the second color component of the to-be-predicted sample;

[0134] When the reconstructed value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, intra-frame prediction is performed on the color component of the sample to be predicted according to the second CCLM model and the reconstructed value of the second color component of the sample to be predicted.

[0135] In the embodiment of the present application, there is no limitation on the rule for determining the prediction error, which can be

[0136] Exemplarily, in some embodiments, the prediction error of the candidate cross-component prediction model of the color component in the second candidate list is equal to the sum of absolute errors (SAD), the sum of absolute errors (SATD), the mean squared error (MSE) or the sum of squared errors (SSD) between the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0137] In step 5023, the first candidate list is determined based on the sorted second candidate list.

[0138] Further, in some embodiments, when the number of candidate cross-component prediction model groups in the second candidate list is equal to N groups, the first candidate list is the sorted second candidate list; and when the number of candidate cross-component prediction model groups in the second candidate list is greater than N groups, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

[0139] In an embodiment of the present application, for any coding unit, the encoder can use the first candidate list for intra-frame prediction; of course, the encoder can also determine whether to use the first candidate list for intra-frame prediction based on the size of the current block and / or the frame type to which the current block belongs.

[0140] Exemplarily, in some embodiments, the first candidate list is determined in at least one of the following cases (1) to (3):

[0141] (1) The size of the current block is smaller than a second threshold;

[0142] (2) The size of the current block is greater than a third threshold; wherein the second threshold is greater than the third threshold;

[0143] (3) The frame type to which the current block belongs is an intra-frame.

[0144] It can be understood that a video sequence is divided into intra-frame prediction frames and inter-frame prediction frames according to different encoding configurations. All prediction blocks in an intra-frame prediction frame are intra-frame prediction blocks, while blocks in an inter-frame prediction frame include both intra-frame prediction blocks and inter-frame prediction blocks. The intra-frame frame mentioned here refers to a frame in which all prediction blocks are intra-frame prediction blocks.

[0145] In some embodiments, the encoder may write a first identifier into the bitstream; wherein the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses a sorting method for intra-frame prediction. For example, if the first identifier is equal to 0, it means that the candidate cross-component prediction models are not sorted, that is, the first candidate list is not used for decoding. For another example, if the first identifier is equal to 1, it means that the candidate cross-component prediction models are sorted, that is, the first candidate list is used for decoding

[0146] Accordingly, at the decoding end, when parsing the bitstream, the decoder obtains the first identifier and determines whether to sort the candidate cross-component prediction models based on the first identifier. If the first identifier indicates that the candidate cross-component prediction models are to be sorted, the candidate cross-component prediction models are sorted to obtain a first candidate list, and then cross-component intra prediction is performed on the first color component of the current block based on the first candidate list.

[0147] In some embodiments, the encoder may also write a second identifier into the bitstream; wherein the second identifier is used to identify whether to use a sorting method based on a template region.

[0148] It can be understood that the second identifier is an overall control identifier, that is, the use of the template area-based sorting method not only includes the sorting of candidate cross-component prediction models, but also includes other scenarios that require the template area-based sorting method to achieve sorting.

[0149] Accordingly, at the decoding end, when parsing the bitstream, the decoder obtains the second identifier and determines whether to use the template region-based sorting method based on the second identifier. If the second identifier indicates to use the template region-based sorting method, the candidate cross-component prediction models are sorted to obtain a first candidate list, and then cross-component intra prediction is performed on the first color component of the current block based on the first candidate list.

[0150] The present application further provides a decoding method, which is applied to a decoder. FIG8 is a schematic diagram of an implementation flow of the decoding method provided in the present application embodiment. As shown in FIG8 , the method includes the following steps 801 to 805:

[0151] Step 801: Parse the bitstream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list;

[0152] In one possible implementation, the code stream carries an identifier indicating whether the CCMerge mode is used. If the identifier indicates that the CCMerge mode is used, the decoder executes steps 802 to 805 below; otherwise, the decoder uses other methods to determine the reconstructed value of the current block.

[0153] Step 802: Determine the first candidate list, where the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction error of the candidate cross-component prediction model or the sum of the prediction errors in the model group where the candidate cross-component prediction model is located.

[0154] In some embodiments, the first candidate list includes N groups of candidate cross-component prediction models, each group of candidate cross-component prediction models including a candidate cross-component prediction model for the first color component and a candidate cross-component prediction model for a third color component.

[0155] Exemplarily, in some embodiments, the first color component and the third color component are chrominance components, and the second color component is a luminance component.

[0156] Further, in some embodiments, the candidate cross-component prediction models of the first color component in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models of the first color component; and / or, the candidate cross-component prediction models of the third color component in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models of the third color component.

[0157] Further, in some other embodiments, the candidate cross-component prediction model groups in the first candidate list are arranged in ascending order according to the sum of the prediction error of the candidate cross-component prediction model of the first color component and the prediction error of the candidate cross-component prediction model of the third color component in the candidate cross-component prediction model group.

[0158] Furthermore, in some embodiments, the determination of the first candidate list may be achieved through steps 902 and 903 of the following embodiments.

[0159] It should be noted that in the embodiments of the present application, the method for determining the first candidate list in the decoding method is the same as the method for determining the first candidate list in the encoding method. Therefore, for technical details not disclosed in the decoding method embodiment, please refer to the description of the encoding method embodiment of the present application for understanding.

[0160] Step 803: Determine the first cross-component prediction model according to the index value of the first cross-component prediction model in the first candidate list and the first candidate list;

[0161] Step 804: Perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value;

[0162] Step 805 : Determine a reconstructed value of the first color component of the current block according to the first intra-frame prediction value and the first residual value.

[0163] The present application further provides a decoding method. FIG9 is a schematic diagram of an implementation flow of the decoding method provided in the present application. As shown in FIG9 , the method includes the following steps 901 to 906:

[0164] Step 901: Parse the bitstream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list;

[0165] Step 902: construct a second candidate list;

[0166] Among them, the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model used for intra-frame prediction of the first color component and / or the third color component at the adjacent position and / or non-adjacent position of the current block.

[0167] Exemplarily, in some embodiments, the first color component and the third color component are chrominance components, and the second color component is a luminance component.

[0168] In some embodiments, the second candidate list may be constructed as follows: obtaining a set of second cross-component prediction models used for performing intra prediction on adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes cross-component prediction models of the first color component and / or the third color component;

[0169] Deduplication is performed on the obtained one or more sets of second span component prediction models to obtain deduplicated second span component prediction models;

[0170] When the number of groups of the second cross-component prediction model after deduplication is less than N, the second cross-component prediction model after deduplication is used as a candidate cross-component prediction model in the second candidate list, and the candidate cross-component prediction model in the second candidate list is filled into N groups using a CCLM model with a specific slope;

[0171] When the number of groups of the second cross-component prediction model after deduplication is equal to N, the second cross-component prediction model after deduplication is used as a candidate cross-component prediction model in the second candidate list;

[0172] When the number of groups of the second cross-component prediction model after deduplication is greater than N, the second cross-component prediction model after deduplication is used as the candidate cross-component prediction model in the second candidate list.

[0173] In some embodiments, the second candidate list includes one or more of a CCLM model, an MMLM model, a CCCM model, and a GLM model.

[0174] Step 903: Determine the first candidate list according to the second candidate list.

[0175] Further, in some embodiments, the decoder may implement step 903 as follows: determining the prediction error of the candidate cross-component prediction model in the second candidate list; sorting the candidate cross-component prediction models in the second candidate list according to the prediction error of the candidate cross-component prediction model in the second candidate list; and determining the first candidate list based on the sorted second candidate list.

[0176] Furthermore, in some embodiments, determining the prediction error of the candidate cross-component prediction model of the color component in the second candidate list includes: performing intra-frame prediction on the color component of the template area of ​​the current block according to the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed value of the second color component of the template area of ​​the current block to obtain a second intra-frame prediction value; determining the prediction error of the candidate cross-component prediction model of the color component in the second candidate list according to the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0177] Exemplarily, in some embodiments, the template area of ​​the current block includes an upper adjacent template of the current block and / or a left adjacent template of the current block. For example, the upper adjacent template is an upper adjacent row of the current block, and / or the left adjacent template is a left adjacent column of the current block.

[0178] In some embodiments, if there is a first sample in the template area of ​​the current block where reconstruction of the second color component has not been completed, the reconstructed value of the second color component of the first sample is padded with the reconstructed value of a second sample adjacent or non-adjacent to the first sample where reconstruction of the second color component has been completed. If reconstruction of the second color component of all samples in the template area of ​​the current block has not been completed, no reordering technique is used, that is, the second candidate list is not sorted, but cross-component intra-frame prediction is performed based on the second candidate list. Accordingly, the bitstream carries the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list. In this case, the decoder parses the bitstream to obtain the second residual value and the index value of the third cross-component prediction model in the second candidate list. The third cross-component prediction model is determined based on the index value of the third cross-component prediction model in the second candidate list and the second candidate list. Intra-frame prediction is performed on the first color component of the current block based on the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value. The reconstructed value of the first color component of the current block is determined based on the third intra-frame prediction value and the second residual value.

[0179] Exemplarily, in some embodiments, the prediction error of the candidate cross-component prediction model of the color component in the second candidate list is equal to the SAD, SATD, MSE or SSD between the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0180] In some embodiments, the sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list includes: sorting the candidate cross-component prediction models of the first color component in the second candidate list in order from small to large according to the prediction errors of the candidate cross-component prediction models of the first color component in the second candidate list; and / or sorting the candidate cross-component prediction models of the third color component in the second candidate list in order from small to large according to the prediction errors of the candidate cross-component prediction models of the third color component in the second candidate list.

[0181] In some other embodiments, the sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list includes: sorting the candidate cross-component prediction model groups in the second candidate list in ascending order of the sum of the prediction errors of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction errors of the candidate cross-component prediction model of the third color component in the same group.

[0182] In some embodiments, when the group of candidate cross-component prediction models in the second candidate list is equal to N groups, the first candidate list is the sorted second candidate list; when the group of candidate cross-component prediction models in the second candidate list is greater than N groups, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

[0183] In some embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; in the case that the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, the partial parameters of the CCCM model are filtering parameters of the CCCM model; the remaining parameters of the CCCM model include the offset value of the color component and the offset value of the second color component; the method further includes: determining the offset value of the color component based on the reconstructed value of the color component of the adjacent blocks and / or non-adjacent blocks of the current block; determining the offset value of the second color component based on the reconstructed value of the second color component of the adjacent blocks and / or non-adjacent blocks of the current block.

[0184] In some other embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; the method further includes: determining the remaining parameters of the candidate cross-component prediction model of the color component based on the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the adjacent blocks or non-adjacent blocks of the current block.

[0185] Exemplarily, in some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, part of the parameters of the candidate cross-component prediction model of the color component is the slope of the CCLM model.

[0186] Exemplarily, in some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include the slope of the first CCLM model, the slope of the second CCLM model and the first threshold in the MMLM model; wherein,

[0187] When a reconstructed value of a second color component of the to-be-predicted sample of the color component of the template area of ​​the current block is less than or equal to the first threshold, performing intra-frame prediction on the color component of the to-be-predicted sample according to the first CCLM model and the reconstructed value of the second color component of the to-be-predicted sample;

[0188] When the reconstructed value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, intra-frame prediction is performed on the color component of the sample to be predicted according to the second CCLM model and the reconstructed value of the second color component of the sample to be predicted.

[0189] Step 904: Determine the first cross-component prediction model according to the index value of the first cross-component prediction model in the first candidate list and the first candidate list;

[0190] Step 905 , performing intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value;

[0191] Step 906: Determine a reconstructed value of the first color component of the current block according to the first intra-frame prediction value and the first residual value.

[0192] In some embodiments, the first candidate list is determined when the size of the current block is smaller than a second threshold and / or the size of the current block is larger than a third threshold; wherein the second threshold is larger than the third threshold.

[0193] In some embodiments, when the frame type to which the current block belongs is an intra frame, the first candidate list is determined.

[0194] In some embodiments, the method further includes: parsing the code stream to obtain a first identifier; wherein the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses a sorting method for intra-frame prediction.

[0195] In some embodiments, the method further includes: parsing the code stream to obtain a second identifier; wherein the second identifier is used to identify whether to use a sorting method based on a template region.

[0196] It should be noted that in the embodiments of the present application, the method for determining the first candidate list in the decoding method is the same as the method for determining the first candidate list in the encoding method. Therefore, for technical details not disclosed in the decoding method embodiment, please refer to the description of the encoding method embodiment of the present application for understanding.

[0197] It can be understood that there is a strong spatial correlation between adjacent parts or adjacent pixels within the image. Intra-frame prediction is a method of predicting the current block using the reconstructed samples / pixels around the current block as a reference. In order to remove the redundancy between different color channels, a cross-component intra-frame prediction mode is proposed. Its concept is to use the reconstructed luminance block to predict the chrominance component of the current block. When predicting, it is necessary to construct a linear or nonlinear relationship between luminance and chrominance based on the reconstructed luminance pixel value and the reconstructed chrominance pixel value. For example, CCLM, MMLM, CCCM, GLM or CCMerge lists can be used to realize cross-component prediction of the current block. Among them,

[0198] The introduction of CCLM is as follows:

[0199] As shown in the following equation (8), CCLM uses a simple linear relationship to predict the chrominance pixel value using the reconstructed luminance pixel value at the corresponding position, pred C (i,j)=α·rec L ′(i,j)+β (8);

[0200] In formula (1), pred C (i, j) represents the intra-frame prediction value of the chrominance component at the coordinate (i, j) in the current block, rec L ′(i, j) is the reconstructed value (i.e., the reconstructed luminance pixel value) of the luminance block at the relative position of the current block after downsampling. α and β are derived linear parameters, which are derived from the reconstructed chrominance pixel values ​​around the current block (the chrominance block shown in FIG10A ) and the reconstructed luminance pixel values ​​around the luminance block at the corresponding position (the luminance block shown in FIG10A ).

[0201] In ECM, the least squares method is used to derive α and β, and the calculation formulas are shown in the following equations (9) and (10):

[0202] Where I is the number of samples.

[0203] FIG10B is a schematic diagram of establishing a linear relationship between luminance samples (Y) and chrominance samples (C).

[0204] Since the linear parameters α and β of CCLM are derived, they do not need to be parsed from the code stream.

[0205] The introduction of MMLM is as follows:

[0206] MMLM is similar to CCLM, except that it allows two sets of linear models to be derived for a prediction block (i.e., the current block to be predicted). The choice of which of the two linear models is used for the prediction sample is controlled by a first threshold, Threshold, which is the average of the reconstructed pixel values ​​around the corresponding luminance block. MMLM is shown in Equation (11). Figure 10C shows an example of dividing samples into two groups based on a threshold and deriving two sets of linear models.

[0207] In the MMLM-based prediction, the linear model used at the current prediction point needs to be determined based on whether the downsampled brightness reconstruction value at the corresponding prediction position is greater than the Threshold.

[0208] Since the MMLM Threshold, α1, α2, β1, and β2 are derived, they do not need to be parsed from the bitstream.

[0209] The following is an introduction to CCCM:

[0210] Similar to the concept of the prediction method based on the CCLM model, the prediction method based on the CCCM is also a process of predicting the pixel value of the chrominance component by reconstructing the pixel value of the luminance component.

[0211] CCCM no longer derives simple α and β, but a set of convolution filter coefficients. CCCM also supports deriving two sets of convolution filter coefficients for a block. Similarly, which set of convolution filter coefficients to use is controlled by a second threshold.

[0212] The introduction of convolution filtering is as follows:

[0213] The convolution filter used in CCCM is a 7-tap filter consisting of a 5-tap cross filter, a nonlinear term P, and a bias term B. As shown in Figure 3, the input of the 5-tap cross filter consists of the center (Center, C) luma sample (the downsampled luma sample at the position corresponding to the current chroma prediction position), the above (Above / North, N) luma sample, the below (Below / South, S) luma sample, the left (Left / West, W) luma sample, and the right (Right / East, E) luma sample.

[0214] As shown in the following equation (12), the nonlinear term P is determined by the bit depth bitDepth of the luminance input sample C at the middle position and the pixel value of the current prediction block: P = (C × C + (1 < < (bitDepth - 1))) >> bitDepth (12);

[0215] For example, when the bit precision of the predicted block pixel value is 10 bits, P = (C × C + 512) >> 10;

[0216] The offset term B is set to (1<<(bitDepth-1)) in CCCM. For example, for content with a prediction block pixel precision of 10 bits, B=512.

[0217] As shown in the following equation (13), the CCCM-based prediction value predChromaVal is determined according to the adaptively acquired 7-tap filter coefficients {c0,…,c6} and the input samples: predChromaVal = c0C + c1N + c2S + c3E + c4W + c5P + c6B (13);

[0218] The following are instructions for obtaining the convolution filter coefficients:

[0219] The convolution filter coefficients are obtained by minimizing the mean square error between the total chrominance prediction value and the reconstructed value in the reconstructed area, as shown in Figure 4, which illustrates that the reconstructed area of ​​the current chrominance block is composed of the reconstructed pixel values ​​of 6 rows and 6 columns around the current chrominance block. When there is an unfinished reconstruction position in the reconstructed area, the value at that position is filled with the value of the completed reconstruction.

[0220] The calculation process of minimizing the mean square error is:

[0221] 3. Obtain the autocorrelation matrix of the luminance input sample and the cross-correlation vector of the luminance input sample and the chrominance output sample;

[0222] 4. The autocorrelation matrix is ​​decomposed by LDL, and the final filter coefficients are obtained by back-banding.

[0223] In the calculation of the autocorrelation matrix, since the values ​​of the luma input samples used are relatively large, a greater precision is required when calculating the convolution filter coefficients. Therefore, in CCCM, the corresponding offset values ​​offsetLuma, offsetCb, and offsetCr need to be subtracted from the input luma samples and the output chroma samples. The luma reconstruction value and chroma prediction value outside the upper left corner of the current block are used as offsets. Therefore, the CCCM input becomes as follows: C'=C–offsetLuma N'=N–offsetLuma S'=S–offsetLuma E'=E–offsetLuma W'=W–offsetLuma P'=nonLinear(C') B=midValue=1<<(bitDepth-1)

[0224] The chroma prediction value is calculated by the following formula (14), where offsetChroma is the offset of the Cb and Cr components respectively; predChromaVal=c0C'+c1N'+c2S'+c3E'+c4W'+c5P'+c6B+offsetChroma (14).

[0225] CCCM also supports two sets of filter coefficients for a block, similar to MMLM, for example, using a certain set of coefficients based on Threshold control.

[0226] Since the parameter c of CCCM 0,···, c6 and possibly Threshold and a second set of parameters are derived and therefore do not need to be parsed from the bitstream.

[0227] The introduction of GLM is as follows:

[0228] GLM is an intra-frame chroma cross-component prediction tool used in the YUV4:2:0 format. In the ECM reference software, GLM includes a two-parameter model and a three-parameter model.

[0229] Compared to CCLM, GLM uses the gradient values ​​of the luma reconstructed samples and the chroma reconstructed samples to derive a linear model. Specifically, for the two-parameter GLM, the chroma prediction value is calculated as follows, where G is the gradient value of the luma sample corresponding to the current position. The calculation method of α and β is the same as CCLM. C = α·G + β

[0230] For the three-parameter GLM, the chrominance prediction value is calculated by the gradient value of the luminance sample corresponding to the current position and the corresponding luminance sample. The calculation method of α0, α1 and α2 is the same as CCCM, β = (1 < < (bitDepth-1)). For example, for the content with 10-bit pixel precision of the prediction block, β = 512. C = α0·G + α1·L + α2·β

[0231] The gradient of the GLM is obtained by one of the four Sobel operators shown in FIG11 . The specific Sobel operator used to obtain the gradient value is determined by the flag bit parsed from the bitstream.

[0232] Since the GLM parameters are also exported, they do not need to be parsed from the bitstream.

[0233] The introduction of CCMerge is as follows:

[0234] CCMerge inherits the cross-component prediction model of the chrominance components of the adjacent or non-adjacent positions around the current block (i.e., the current block) and applies it to the prediction of the current block. In CCMerge, a CCMerge list of length N (N=6) (i.e., an example of the second candidate list) is constructed. The list contains non-repeated cross-component prediction models inherited from the surrounding blocks. These cross-component prediction models can be one or more models of CCLM, MMLM, CCCM, and GLM. When the surrounding models are not enough to fill the CCMerge list, the default model will be used to fill the remaining list. Among them, the adjacent positions of the current block are shown in Figure 6. When CCMerge obtains the cross-component prediction models of the surrounding adjacent positions, it visits the positions B1→A1→B0→A0→B2 in sequence.

[0235] CCMerge can also further obtain cross-component prediction models at non-adjacent positions. The concept of non-adjacent positions can also be used in inter-frame merge. Non-adjacent positions include some non-adjacent positions above, upper left, upper right, left, and lower left of the current block.

[0236] The default model includes a CCLM with a default slope. When the number of cross-component prediction models obtained from adjacent and non-adjacent positions is less than N, the CCLM with a default slope is used to fill the remaining list. The default slopes α are {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8}, and β is calculated as described above.

[0237] A block-level flag will be used by the codec to identify whether the CCMerge mode is selected. When CCMerge is selected, it is necessary to continue decoding to determine which model in the CCMerge list is selected. The model index is used to truncate the unary code for encoding and decoding.

[0238] In the list of length N constructed by CCMerge, each index can correspond to a set of cross-component prediction models in the CCMerge list. Each set of models contains a model for predicting the blue chrominance component Cb block and a model for predicting the red chrominance component Cr block. When the parsing index determines the selected model, the cross-component prediction models of Cb and Cr are determined at the same time.

[0239] In an embodiment of the present application, a method for reordering (also understood as sorting) the list constructed by CCMerge is provided. The cross-component prediction models of Cb and Cr in the list can be reordered separately, that is, the cross-component prediction models of Cb and Cr obtained by index after reordering may inherit blocks at different positions.

[0240] The Merge list reordering of Cb and Cr components is based on the cost of the predicted value and the reconstructed value using the cross-component prediction model in the list on the Cb template and the Cr template, respectively.

[0241] Exemplarily, the method for reordering the Cb component cross-component prediction model includes the following steps 1 to 3:

[0242] Step 1: Obtain candidate Cb cross-component prediction models for adjacent and non-adjacent positions. When the number of candidate Cb cross-component prediction models is less than N, use CCLM with a default slope to fill the number to N.

[0243] Step 2: Use each candidate Cb cross-component prediction model to obtain the model input from the Y component reconstruction template area and calculate the prediction value of the Cb template area; the schematic diagram of the template of the Cb and Cr components used for reordering is shown in Figure 12.

[0244] Step 3: Take the difference between the N groups of predicted values ​​and the reconstructed values ​​as a reference and sort the patterns with smaller difference values ​​in front.

[0245] The method of reordering the Cr component is the same as that of Cb, but the difference value of the Cr template area is used as the sorting basis.

[0246] In some embodiments, in step 1, when the number of candidate Cb cross-component prediction models at adjacent positions and non-adjacent positions exceeds N, more than N candidate Cb cross-component prediction models can also be obtained, and only the top N candidate Cb cross-component prediction models with the smallest prediction errors are retained in subsequent reordering.

[0247] In some embodiments, in step 2, when the Y component reconstruction template area used as the model input contains pixels that have not been reconstructed, the nearest pixel values ​​that have been reconstructed can be used to fill them. When all pixel values ​​have not been reconstructed, no reordering is required.

[0248] In some implementations, in step 3, the selected difference value can be SAD (the sum of absolute difference). When the template area of ​​Cb is a positive integer power of 2 such as 2, 4, 8, ..., SATD (the sum of transformed difference) can be used as the difference value.

[0249] In some embodiments, in step 3, in order to reduce complexity, the templates of Cb and Cr may use a reconstruction area of ​​1 row and 1 column.

[0250] In some embodiments, since the cross-component modes that the CCMerge list can inherit may include CCLM, MMLM, CCCM, and / or GLM, the CCMerge list may only inherit some parameters in these models.

[0251] For example, in CCLM, only the slope α can be inherited, while β can be adaptively calculated based on the current block.

[0252] For example, in MMLM, only the α and Threshold of the two models can be inherited, and the β of the two models can be adaptively calculated according to the current block.

[0253] For example, in CCCM, the filter parameters of CCCM can be inherited, and the luma offset Luma and chroma offset Chroma can be obtained according to the current block.

[0254] In some embodiments, the cross-component prediction models of Cb and Cr can also be sorted simultaneously, that is, each group of cross-component prediction models is sorted according to the sum of the difference values ​​(i.e., prediction errors) of each group of models on the Cb and Cr templates, which means that each group of models inherits from the block at the same position.

[0255] In some embodiments, whether the reordering technique can be used can be determined by whether the current frame is an intra-frame. When the current frame is an intra-frame, the reordering technique can be used.

[0256] In some embodiments, whether the reordering technology can be used can be determined by the size of the current block, for example, it can be used when the current block is smaller than NxM, and / or it can be used only when the current block is larger than PxQ, where N, M, P and Q are all positive integers.

[0257] In some embodiments, whether the reordering technique can be used can be controlled by a syntax element (ie, an example of the first flag), such as a syntax element at the block level, coding tree unit level, slice level, frame level, or sequence level.

[0258] In some embodiments, a template-based sorting flag (ie, an example of a second flag) is set to control whether the template-based sorting technology can be used. In this case, whether to reorder the CCMerge list can also be controlled by the overall flag bit.

[0259] In an embodiment of the present application, a candidate list (such as a CCMerge list) is constructed for the cross-component intra-frame prediction mode, and the list stores cross-component prediction models inherited from surrounding blocks or default cross-component prediction models. The models inherited in the CCMerge list may include one or more of CCLM, MMLM, CCCM and GLM models.

[0260] In an embodiment of the present application, the models in the candidate list are reordered, and the reordering is based on the difference between the predicted value and the reconstructed value of each model in the Cb and Cr template regions.

[0261] In an embodiment of the present application, a list greater than or equal to N may be constructed, and then only N groups of cross-component prediction models with smaller difference values ​​are retained during reordering.

[0262] In the embodiment of the present application, the models of Cb and Cr can be sorted separately or together.

[0263] In the embodiment of the present application, a template of Cb and Cr in one row and one column and SAD may be used as the difference value for sorting, thereby reducing computational complexity.

[0264] In an embodiment of the present application, when inheriting a cross-component prediction model, only part of the parameters of the model may be inherited while retaining part of the parameters for adaptive calculation based on the current block.

[0265] In an embodiment of the present application, the block size, frame type or identification bit can be used to control whether the reordering of the CCMerge list is allowed.

[0266] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps; or steps in different embodiments may be combined to form a new technical solution.

[0267] Based on the above embodiments, an embodiment of the present application provides an encoding device, which is applied to an encoder. FIG13 is a schematic structural diagram of the encoding device provided in an embodiment of the present application. As shown in FIG13 , the encoding device 13 includes:

[0268] A first determining module 131 is configured to determine a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong;

[0269] A selection module 132 configured to select a first cross-component prediction model for a first color component from the first candidate list;

[0270] A first prediction module 133 is configured to perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value;

[0271] a second determining module 134 configured to determine a first residual value of the first color component of the current block according to the first intra prediction value and a sample value of the first color component of the current block;

[0272] The encoding module 135 is configured to generate a bitstream according to the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

[0273] In some embodiments, the first candidate list includes N groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model for the first color component and a candidate cross-component prediction model for a third color component; wherein N is greater than 1.

[0274] In some embodiments, the candidate cross-component prediction models of the first color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the first color component.

[0275] In some embodiments, the candidate cross-component prediction models of the third color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the third color component.

[0276] In some embodiments, the candidate cross-component prediction model groups in the first candidate list are arranged in ascending order according to the sum of the prediction error of the candidate cross-component prediction model of the first color component and the prediction error of the candidate cross-component prediction model of the third color component in the candidate cross-component prediction model group.

[0277] In some embodiments, the first determination module 131 is configured to: construct a second candidate list; and determine the first candidate list based on the second candidate list; wherein the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model adopted for intra-frame prediction of the first color component and / or the third color component at adjacent positions and / or non-adjacent positions of the current block.

[0278] In some embodiments, the second candidate list includes one or more of a CCLM model, an MMLM model, a CCCM model, and a GLM model.

[0279] In some embodiments, the first determination module 131 is configured to: obtain a set of second cross-component prediction models used for intra-frame prediction of adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes a cross-component prediction model of the first color component and / or a cross-component prediction model of the third color component; when the number of groups of the deduplicated second cross-component prediction models is less than N, the deduplicated second cross-component prediction model is used as a candidate cross-component prediction model in the second candidate list, and the candidate cross-component prediction models in the second candidate list are filled to N groups using a CCLM model with a specific slope; when the number of groups of the deduplicated second cross-component prediction models is equal to N, the deduplicated second cross-component prediction model is used as a candidate cross-component prediction model in the second candidate list; when the number of groups of the deduplicated second cross-component prediction models is greater than N, the deduplicated second cross-component prediction model is used as a candidate cross-component prediction model in the second candidate list.

[0280] In some embodiments, the first determination module 131 is configured to: determine the prediction error of the candidate cross-component prediction model in the second candidate list; sort the candidate cross-component prediction models in the second candidate list according to the prediction error of the candidate cross-component prediction model in the second candidate list; and determine the first candidate list based on the sorted second candidate list.

[0281] In some embodiments, the first determination module 131 is configured to: perform intra-frame prediction on the color component of the template area of ​​the current block according to the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed value of the second color component of the template area of ​​the current block to obtain a second intra-frame prediction value; wherein the color component refers to the first color component or the third color component; determine the prediction error of the candidate cross-component prediction model of the color component in the second candidate list according to the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0282] In some embodiments, the prediction error of the candidate cross-component prediction model of the color component in the second candidate list is equal to the SAD, SATD, MSE or SSD between the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0283] In some embodiments, the template area of ​​the current block includes an upper adjacent template of the current block and / or a left adjacent template of the current block.

[0284] In some embodiments, the upper adjacent template is an upper adjacent row of the current block.

[0285] In some embodiments, the left-neighboring template is a left-neighboring column of the current block.

[0286] In some embodiments, in some embodiments, the first determination module 131 is further configured to: when there is a first sample in the template area of ​​the current block whose second color component reconstruction has not been completed, fill the reconstruction value of the second color component of the first sample with the reconstruction value of the second sample adjacent to or non-adjacent to the first sample whose second color component reconstruction has been completed.

[0287] In some embodiments, the selection module 132 is further configured to select a third cross-component prediction model of the first color component from the second candidate list when all samples in the template area of ​​the current block have not completed the reconstruction of the second color component; and the first prediction module 133 is further configured to perform intra-frame prediction on the first color component of the current block according to the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value; the second determination module 134 is further configured to determine the second residual value of the first color component of the current block according to the third intra-frame prediction value and the sample value of the first color component of the current block; the encoding module 135 is further configured to generate a code stream according to the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list.

[0288] In some embodiments, the first determination module 131 is configured to: sort the candidate cross-component prediction models of the first color component in the second candidate list in order of small to large prediction errors of the candidate cross-component prediction models of the first color component in the second candidate list; and / or sort the candidate cross-component prediction models of the third color component in the second candidate list in order of small to large prediction errors of the candidate cross-component prediction models of the third color component in the second candidate list.

[0289] In other embodiments, the first determination module 131 is configured to: sort the candidate cross-component prediction model groups in the second candidate list in order from small to large according to the sum of the prediction error of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction error of the candidate cross-component prediction model of the third color component in the same group.

[0290] In some embodiments, when the group of candidate cross-component prediction models in the second candidate list is equal to N groups, the first candidate list is the sorted second candidate list; when the group of candidate cross-component prediction models in the second candidate list is greater than N groups, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

[0291] In some embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; the first determination module 131 is also configured to: determine the remaining parameters of the candidate cross-component prediction model of the color component based on the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the adjacent blocks or non-adjacent blocks of the current block.

[0292] In some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, part of the parameters of the candidate cross-component prediction model of the color component is a slope of the CCLM model.

[0293] In some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include the slope of the first CCLM model, the slope of the second CCLM model and the first threshold in the MMLM model; wherein, the first prediction module 133 is configured to, when the reconstruction value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is less than or equal to the first threshold, perform intra-frame prediction on the color component of the sample to be predicted according to the first CCLM model and the reconstruction value of the second color component of the sample to be predicted; when the reconstruction value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, perform intra-frame prediction on the color component of the sample to be predicted according to the second CCLM model and the reconstruction value of the second color component of the sample to be predicted.

[0294] In some embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; in the case that the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, the partial parameters of the CCCM model are filtering parameters of the CCCM model; the remaining parameters of the CCCM model include the offset value of the color component and the offset value of the second color component; the first determination module 131 is also configured to: determine the offset value of the color component according to the reconstructed value of the color component of the adjacent blocks and / or non-adjacent blocks of the current block; and determine the offset value of the second color component according to the reconstructed value of the second color component of the adjacent blocks and / or non-adjacent blocks of the current block.

[0295] In some embodiments, the first determination module 131 is configured to determine the first candidate list when the size of the current block is smaller than a second threshold and / or the size of the current block is larger than a third threshold; wherein the second threshold is larger than the third threshold.

[0296] In some embodiments, the first determination module 131 is configured to determine the first candidate list when the frame type to which the current block belongs is an intra frame.

[0297] In some embodiments, the encoding module 135 is further configured to write a first identifier into the bitstream; wherein the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses the sorting method for intra-frame prediction.

[0298] In some embodiments, the encoding module 135 is further configured to write a second identifier into the bitstream; wherein the second identifier is used to identify whether to use a sorting method based on a template region.

[0299] In some embodiments, the first color component and the third color component are chrominance components, and the second color component is a luminance component.

[0300] The description of the above encoding device embodiment is similar to the description of the above encoding method embodiment, and has similar beneficial effects as the encoding method embodiment. For technical details not disclosed in the encoding device embodiment of this application, please refer to the description of the encoding method embodiment of this application for understanding.

[0301] The present application embodiment provides a decoding device, which is applied to a decoder. FIG14 is a schematic structural diagram of the decoding device provided in the present application embodiment. As shown in FIG14 , the decoding device 14 includes:

[0302] The decoding module 141 is configured to parse the code stream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list;

[0303] A third determining module 142 is configured to determine the first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong;

[0304] a fourth determining module 143 configured to determine the first cross-component prediction model according to an index value of the first cross-component prediction model in the first candidate list and the first candidate list;

[0305] a second prediction module 144 configured to perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value;

[0306] The fifth determining module 145 is configured to determine a reconstructed value of the first color component of the current block according to the first intra-frame prediction value and the first residual value.

[0307] In some embodiments, the third determination module 142 is configured to: construct a second candidate list; and determine the first candidate list based on the second candidate list; wherein the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model adopted for intra-frame prediction of the first color component and / or the third color component at adjacent positions and / or non-adjacent positions of the current block.

[0308] In some embodiments, the third determination module 142 is configured to: obtain a set of second cross-component prediction models used for intra-frame prediction of adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes cross-component prediction models of the first color component and / or the third color component; when the number of groups of the deduplicated second cross-component prediction models is less than N, the deduplicated second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list, and the candidate cross-component prediction models in the second candidate list are filled to N groups using a CCLM model with a specific slope; when the number of groups of the deduplicated second cross-component prediction models is equal to N, the deduplicated second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list; when the number of groups of the deduplicated second cross-component prediction models is greater than N, the deduplicated second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list.

[0309] In some embodiments, the third determination module 142 is configured to: determine the prediction error of the candidate cross-component prediction model in the second candidate list; sort the candidate cross-component prediction models in the second candidate list according to the prediction error of the candidate cross-component prediction model in the second candidate list; and determine the first candidate list based on the sorted second candidate list.

[0310] In some embodiments, the third determination module 142 is configured to: perform intra-frame prediction on the color component of the template area of ​​the current block according to the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed value of the second color component of the template area of ​​the current block to obtain a second intra-frame prediction value; wherein the color component refers to the first color component or the third color component; determine the prediction error of the candidate cross-component prediction model of the color component in the second candidate list according to the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

[0311] In some embodiments, the third determination module 142 is further configured to: when there is a first sample in the template area of ​​the current block that has not completed the reconstruction of the second color component, fill the reconstruction value of the second color component of the first sample with the reconstruction value of a second sample adjacent to or non-adjacent to the first sample that has completed the reconstruction of the second color component.

[0312] In some embodiments, when all samples in the template area of ​​the current block have not completed the reconstruction of the second color component, the code stream carries the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list; the decoding module 141 is further configured to parse the code stream to obtain the second residual value and the index value of the third cross-component prediction model in the second candidate list; the fourth determination module 143 is further configured to determine the third cross-component prediction model based on the index value of the third cross-component prediction model in the second candidate list and the second candidate list; the second prediction module 144 is further configured to perform intra-frame prediction on the first color component of the current block based on the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value; the fifth determination module 145 is further configured to determine the reconstructed value of the first color component of the current block based on the third intra-frame prediction value and the second residual value.

[0313] In some embodiments, the third determination module 142 is configured to: sort the candidate cross-component prediction models of the first color component in the second candidate list in order of small to large prediction errors of the candidate cross-component prediction models of the first color component in the second candidate list; and / or sort the candidate cross-component prediction models of the third color component in the second candidate list in order of small to large prediction errors of the candidate cross-component prediction models of the third color component in the second candidate list.

[0314] In other embodiments, the third determination module 142 is configured to sort the candidate cross-component prediction model groups in the second candidate list in ascending order of the sum of the prediction error of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction error of the candidate cross-component prediction model of the third color component in the same group.

[0315] In some embodiments, when the group of candidate cross-component prediction models in the second candidate list is equal to N groups, the first candidate list is the sorted second candidate list; when the group of candidate cross-component prediction models in the second candidate list is greater than N groups, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

[0316] In some embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; the third determination module 142 is further configured to: determine the remaining parameters of the candidate cross-component prediction model of the color component based on the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the adjacent blocks or non-adjacent blocks of the current block.

[0317] In some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, part of the parameters of the candidate cross-component prediction model of the color component is a slope of the CCLM model.

[0318] In some embodiments, when the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include the slope of the first CCLM model, the slope of the second CCLM model and the first threshold in the MMLM model; wherein, the second prediction module 144 is further configured to, when the reconstruction value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is less than or equal to the first threshold, perform intra-frame prediction on the color component of the sample to be predicted according to the first CCLM model and the reconstruction value of the second color component of the sample to be predicted; when the reconstruction value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, perform intra-frame prediction on the color component of the sample to be predicted according to the second CCLM model and the reconstruction value of the second color component of the sample to be predicted.

[0319] In some embodiments, the second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; in the case that the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, the partial parameters of the CCCM model are filtering parameters of the CCCM model; the remaining parameters of the CCCM model include the offset value of the color component and the offset value of the second color component; the third determination module 142 is further configured to: determine the offset value of the color component according to the reconstructed value of the color component of the adjacent blocks and / or non-adjacent blocks of the current block; determine the offset value of the second color component according to the reconstructed value of the second color component of the adjacent blocks and / or non-adjacent blocks of the current block.

[0320] In some embodiments, the third determination module 142 is configured to: determine the first candidate list when the size of the current block is smaller than a second threshold, and / or the size of the current block is larger than a third threshold; wherein the second threshold is larger than the third threshold.

[0321] In some embodiments, the third determination module 142 is configured to: determine the first candidate list when the frame type to which the current block belongs is an intra frame.

[0322] In some embodiments, the decoding module 141 is further configured to parse the code stream to obtain a first identifier; wherein, the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses the sorting method for intra-frame prediction.

[0323] In some embodiments, the decoding module 141 is further configured to parse the code stream to obtain a second identifier; wherein the second identifier is used to identify whether to use a sorting method based on a template region.

[0324] The description of the above decoding device embodiment is similar to the description of the above encoding / decoding method embodiment, and has similar beneficial effects as the encoding / decoding method embodiment. For technical details not disclosed in the decoding device embodiment of this application, please refer to the description of the encoding / decoding method embodiment of this application for understanding.

[0325] It should be noted that the division of modules in the encoding / decoding device described in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units. They may also be implemented in a combination of software and hardware.

[0326] It should be noted that, in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0327] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the encoding method or the decoding method as described in the embodiment of the present application is implemented.

[0328] An embodiment of the present application provides an encoder, as shown in FIG15 , the encoder 15 includes: a first communication interface 151, a first memory 152, and a first processor 153; each component is coupled together via a first bus system 154. It is understood that the first bus system 154 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 154 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in FIG15 , various buses are labeled as the first bus system 154. Among them,

[0329] The first communication interface 151 is used for receiving and sending signals during the process of sending and receiving information between other external network elements;

[0330] A first memory 152 is used to store computer programs that can be run on the first processor 153;

[0331] The first processor 153 is configured to execute the encoding method described in the embodiment of the present application when running the computer program.

[0332] It is understood that the first memory 152 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 152 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0333] The first processor 153 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 153. The above-mentioned first processor 153 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 152 , and the first processor 153 reads the information in the first memory 152 and completes the steps of the above method in combination with its hardware.

[0334] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0335] Optionally, as another embodiment, the first processor 153 is further configured to execute any of the aforementioned encoding method embodiments when running the computer program.

[0336] The present application provides a decoder, as shown in FIG16 , the decoder 16 includes: a second communication interface 161, a second memory 162, and a second processor 163; each component is coupled together via a second bus system 164. It is understood that the second bus system 164 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 164 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in FIG16 , various buses are labeled as the second bus system 164. Among them,

[0337] The second communication interface 161 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0338] The second memory 162 is used to store computer programs that can be run on the second processor 163;

[0339] The second processor 163 is configured to execute the decoding method described in the embodiment of the present application when running the computer program.

[0340] It can be understood that the hardware functions of the second memory 162 and the first memory 152 are similar, and the hardware functions of the second processor 163 and the first processor 153 are similar; they are not described in detail here.

[0341] The embodiment of the present application further provides a code stream, which is obtained by using the aforementioned encoding method.

[0342] An embodiment of the present application provides an electronic device, comprising: a processor adapted to execute a computer program; and a computer-readable storage medium storing the computer program, wherein when the computer program is executed by the processor, the encoding method and / or decoding method described in the embodiment of the present application are implemented. The electronic device can be any type of device capable of video encoding and / or video decoding, such as a mobile phone, tablet computer, laptop computer, personal computer, television, projection device, or monitoring device.

[0343] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0344] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, they will not be repeated here.

[0345] The term "and / or" in this article is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, object A and / or object B can mean: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0346] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0347] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.

[0348] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed across multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of this embodiment.

[0349] In addition, all functional modules in the embodiments of the present application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the above-mentioned integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0350] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0351] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, 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 for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0352] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0353] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0354] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0355] The above is merely an embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A coding method, the coding method being applied to an encoder, the method comprising: Determine a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong; Selecting a first cross-component prediction model for a first color component from the first candidate list, and performing intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and a reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; Determine a first residual value of the first color component of the current block according to the first intra-frame prediction value and a sample value of the first color component of the current block; Generate a bitstream according to the first residual value of the current block and the index value of the first cross-component prediction model in the first candidate list.

2. The method according to claim 1, wherein: The first candidate list includes N groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and a candidate cross-component prediction model of a third color component; wherein N is greater than 1.

3. The method according to claim 2, wherein: The candidate cross-component prediction models of the first color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the first color component.

4. The method according to claim 2 or 3, wherein: The candidate cross-component prediction models of the third color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the third color component.

5. The method according to claim 2, wherein: The candidate cross-component prediction model groups in the first candidate list are arranged in ascending order according to the sum of the prediction errors of the candidate cross-component prediction models of the first color component and the prediction errors of the candidate cross-component prediction models of the third color component in the candidate cross-component prediction model group.

6. The method according to claim 1, wherein: Constructing a second candidate list; and determining the first candidate list according to the second candidate list; Among them, the second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model of the first color component and / or a candidate cross-component prediction model of the third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model used for intra-frame prediction of the first color component and / or the third color component at an adjacent position and / or non-adjacent position of the current block.

7. The method according to claim 6, wherein: The second candidate list includes one or more of a CCLM model, an MMLM model, a CCCM model and a GLM model.

8. The method according to claim 6, wherein: Obtaining a set of second cross-component prediction models used for performing intra-frame prediction on adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes a cross-component prediction model of the first color component and / or a cross-component prediction model of the third color component; When the number of groups of the deduplicated second cross-component prediction model is less than N, the deduplicated second cross-component prediction model is used as the candidate cross-component prediction model in the second candidate list, and the candidate cross-component prediction models in the second candidate list are filled into N groups using a CCLM model with a specific slope.

9. The method according to claim 8, wherein: The method further comprises: When the number of groups of the removed second cross-component prediction models is equal to N, the removed second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list.

10. The method according to claim 8, wherein: The method further comprises: When the number of the removed second cross-component prediction models is greater than N, the removed second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list.

11. The method according to any one of claims 8 to 10, wherein: The determining the first candidate list according to the second candidate list includes: determining prediction errors of candidate cross-component prediction models in the second candidate list; sorting the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list; The first candidate list is determined according to the sorted second candidate list.

12. The method according to claim 11, wherein: Determining a prediction error of a candidate cross-component prediction model for a color component in the second candidate list comprises: According to the candidate cross-component prediction model of the color component in the second candidate list and the first candidate cross-component prediction model of the template area of ​​the current block reconstructed value of the second color component, performing intra-frame prediction on the color component of the template area of ​​the current block to obtain a second intra-frame prediction value; wherein the color component refers to the first color component or the third color component; Determine a prediction error of a candidate cross-component prediction model of the color component in the second candidate list according to the second intra prediction value and a reconstructed value of the color component of the template area of ​​the current block.

13. The method according to claim 12, wherein: The prediction error of the candidate cross-component prediction model of the color component in the second candidate list is equal to the SAD, SATD, MSE or SSD between the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

14. The method according to claim 12, wherein: The template area of ​​the current block includes an upper adjacent template of the current block and / or a left adjacent template of the current block.

15. The method according to claim 14, wherein: The upper adjacent template is the upper adjacent row of the current block.

16. The method according to claim 14 or 15, wherein: The left adjacent template is the left adjacent column of the current block.

17. The method according to claim 12, wherein: The method further comprises: When there is a first sample in the template area of ​​the current block whose second color component reconstruction has not been completed, the reconstruction value of the second color component of the first sample is filled with the reconstruction value of a second sample adjacent to or non-adjacent to the first sample whose second color component reconstruction has been completed.

18. The method according to claim 12, wherein: The method further comprises: In a case where all samples of the template area of ​​the current block have not completed reconstruction of the second color component, selecting a third cross-component prediction model of the first color component from the second candidate list, and performing intra-frame prediction on the first color component of the current block according to the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value; Determine a second residual value of the first color component of the current block according to the third intra-frame prediction value and the sample value of the first color component of the current block; Generate a bitstream according to the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list.

19. The method according to claim 11, wherein: The sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list comprises: sorting the candidate cross-component prediction models for the first color component in the second candidate list in ascending order of prediction errors of the candidate cross-component prediction models for the first color component in the second candidate list; and / or The candidate cross-component prediction models for the third color component in the second candidate list are sorted in order of prediction errors of the candidate cross-component prediction models for the third color component in the second candidate list from small to large.

20. The method according to claim 11, wherein: The sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list comprises: The candidate cross-component prediction model groups in the second candidate list are sorted in order from small to large based on the sum of the prediction errors of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction errors of the candidate cross-component prediction model of the third color component in the same group.

21. The method according to claim 19 or 20, wherein: When the number of candidate cross-component prediction model groups in the second candidate list is equal to N groups, the first candidate list is a sorted second candidate list; When the number of candidate cross-component prediction model groups in the second candidate list is greater than N, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

22. The method according to claim 12, wherein: The second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; the method further includes: The remaining parameters of the candidate cross-component prediction model of the color component are determined according to the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the neighboring blocks or non-neighboring blocks of the current block.

23. The method according to claim 22, wherein: When the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, part of the parameters of the candidate cross-component prediction model of the color component is the slope of the CCLM model.

24. The method according to claim 22, wherein: When the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include a slope of a first CCLM model, a slope of a second CCLM model and a first threshold in the MMLM model; wherein, The reconstructed value of the second color component of the to-be-predicted sample of the color component in the template area of ​​the current block is less than or equal to the When the first threshold is exceeded, performing intra-frame prediction on the color component of the sample to be predicted according to the first CCLM model and the reconstructed value of the second color component of the sample to be predicted; When the reconstructed value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, intra-frame prediction is performed on the color component of the sample to be predicted according to the second CCLM model and the reconstructed value of the second color component of the sample to be predicted.

25. The method of claim 12, wherein: The second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; When the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, some parameters of the CCCM model are filtering parameters of the CCCM model; The remaining parameters of the CCCM model include an offset value of the color component and an offset value of the second color component; the method further includes: Determine an offset value of the color component according to a reconstructed value of the color component of an adjacent block and / or a non-adjacent block of the current block; An offset value of the second color component is determined according to a reconstructed value of the second color component of an adjacent block and / or a non-adjacent block of the current block.

26. The method of claim 1, wherein: When the size of the current block is smaller than a second threshold and / or the size of the current block is larger than a third threshold, the first candidate list is determined; wherein the second threshold is larger than the third threshold.

27. The method of claim 1, wherein: In a case where the frame type to which the current block belongs is an intra frame, the first candidate list is determined.

28. The method of claim 1, wherein: The method further comprises: A first identifier is written into a bitstream; wherein the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses a sorting method for intra-frame prediction.

29. The method of claim 12, wherein: The method further comprises: A second identifier is written into the code stream; wherein the second identifier is used to identify whether to use a sorting method based on a template region.

30. The method of claim 2, wherein: The first color component and the third color component are chrominance components, and the second color component is a luminance component.

31. A decoding method, the decoding method being applied to a decoder, the method comprising: Parse the bitstream to obtain a first residual value of a first color component of the current block and an index value of a first cross-component prediction model in a first candidate list; Determine the first candidate list, where the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong; Determine the first cross-component prediction model according to the index value of the first cross-component prediction model in the first candidate list and the first candidate list; Performing intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; A reconstructed value of a first color component of the current block is determined according to the first intra-frame prediction value and the first residual value.

32. The method according to claim 31, wherein: The first candidate list includes N groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes a candidate cross-component prediction model for the first color component and a candidate cross-component prediction model for a third color component.

33. The method according to claim 32, wherein: The candidate cross-component prediction models of the first color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the first color component.

34. The method according to claim 32 or 33, wherein: The candidate cross-component prediction models of the third color component in the first candidate list are arranged in ascending order of prediction errors of the candidate cross-component prediction models of the third color component.

35. The method of claim 32, wherein: The candidate cross-component prediction model groups in the first candidate list are arranged in ascending order according to the sum of the prediction errors of the candidate cross-component prediction models of the first color component and the prediction errors of the candidate cross-component prediction models of the third color component in the candidate cross-component prediction model group.

36. The method of claim 31, wherein: Constructing a second candidate list; and determining the first candidate list according to the second candidate list; The second candidate list includes multiple groups of candidate cross-component prediction models, each group of candidate cross-component prediction models includes the first A candidate cross-component prediction model for a color component and / or a candidate cross-component prediction model for a third color component; the multiple groups of candidate cross-component prediction models include: a CCLM model with a specific slope, and / or a second cross-component prediction model used for intra-frame prediction of the first color component and / or the third color component at an adjacent position and / or a non-adjacent position of the current block.

37. The method of claim 36, wherein: The second candidate list includes one or more of a CCLM model, an MMLM model, a CCCM model and a GLM model.

38. The method of claim 36, wherein: Obtaining a set of second cross-component prediction models used for performing intra-frame prediction on adjacent positions and / or non-adjacent positions of the current block; wherein the set of second cross-component prediction models includes cross-component prediction models of the first color component and / or the third color component; When the number of groups of the deduplicated second cross-component prediction model is less than N, the deduplicated second cross-component prediction model is used as the candidate cross-component prediction model in the second candidate list, and the candidate cross-component prediction models in the second candidate list are filled into N groups using a CCLM model with a specific slope.

39. The method of claim 38, wherein: The method further comprises: When the number of groups of the removed second cross-component prediction models is equal to N, the removed second cross-component prediction models are used as candidate cross-component prediction models in the second candidate list.

40. The method of claim 38, wherein: The method further comprises: When the number of groups of the second cross-component prediction models after deduplication is greater than N, the second cross-component prediction models after deduplication are used as candidate cross-component prediction models in the second candidate list.

41. The method according to any one of claims 38 to 40, wherein: The determining the first candidate list according to the second candidate list includes: determining prediction errors of candidate cross-component prediction models in the second candidate list; sorting the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list; The first candidate list is determined according to the sorted second candidate list.

42. The method according to claim 41, wherein: Determining a prediction error of a candidate cross-component prediction model for a color component in the second candidate list comprises: According to the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed value of the second color component of the template area of ​​the current block, intra-prediction is performed on the color component of the template area of ​​the current block to obtain a second intra-prediction value; wherein the color component refers to the first color component or the third color component; Determine a prediction error of a candidate cross-component prediction model of the color component in the second candidate list according to the second intra prediction value and a reconstructed value of the color component of the template area of ​​the current block.

43. The method of claim 42, wherein: The prediction error of the candidate cross-component prediction model of the color component in the second candidate list is equal to the SAD, SATD, MSE or SSD between the second intra-frame prediction value and the reconstructed value of the color component of the template area of ​​the current block.

44. The method of claim 42, wherein: The template area of ​​the current block includes an upper adjacent template of the current block and / or a left adjacent template of the current block.

45. The method of claim 44, wherein: The upper adjacent template is the upper adjacent row of the current block.

46. ​​The method according to claim 44 or 45, wherein: The left adjacent template is the left adjacent column of the current block.

47. The method of claim 42, wherein: The method further comprises: When there is a first sample in the template area of ​​the current block whose second color component reconstruction has not been completed, the reconstruction value of the second color component of the first sample is filled with the reconstruction value of a second sample adjacent to or non-adjacent to the first sample whose second color component reconstruction has been completed.

48. The method of claim 42, wherein: In the case that all samples in the template area of ​​the current block have not completed the reconstruction of the second color component, the bitstream carries the second residual value of the current block and the index value of the third cross-component prediction model in the second candidate list; the method further includes: Parsing the bitstream to obtain the second residual value and an index value of the third cross-component prediction model in the second candidate list; Determine the third cross-component prediction model according to the index value of the third cross-component prediction model in the second candidate list and the second candidate list; Performing intra-frame prediction on the first color component of the current block according to the third cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a third intra-frame prediction value; A reconstructed value of a first color component of the current block is determined according to the third intra-frame prediction value and the second residual value.

49. The method of claim 41, wherein: The sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list comprises: sorting the candidate cross-component prediction models for the first color component in the second candidate list in ascending order of prediction errors of the candidate cross-component prediction models for the first color component in the second candidate list; and / or The candidate cross-component prediction models for the third color component in the second candidate list are sorted in order of prediction errors of the candidate cross-component prediction models for the third color component in the second candidate list from small to large.

50. The method of claim 41, wherein: The sorting of the candidate cross-component prediction models in the second candidate list according to the prediction errors of the candidate cross-component prediction models in the second candidate list comprises: The candidate cross-component prediction model groups in the second candidate list are sorted in order from small to large based on the sum of the prediction errors of the candidate cross-component prediction model of the first color component in the second candidate list and the prediction errors of the candidate cross-component prediction model of the third color component in the same group.

51. The method of claim 49 or 50, wherein: When the number of candidate cross-component prediction model groups in the second candidate list is equal to N groups, the first candidate list is a sorted second candidate list; When the number of candidate cross-component prediction model groups in the second candidate list is greater than N, the first N groups of candidate cross-component prediction models in the sorted second candidate list are retained to obtain the first candidate list.

52. The method of claim 42, wherein: The second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; the method further includes: The remaining parameters of the candidate cross-component prediction model of the color component are determined according to the partial parameters of the candidate cross-component prediction model of the color component in the second candidate list and the reconstructed values ​​of the neighboring blocks or non-neighboring blocks of the current block.

53. The method of claim 52, wherein: When the candidate cross-component prediction model of the color component in the second candidate list is a CCLM model, part of the parameters of the candidate cross-component prediction model of the color component is the slope of the CCLM model.

54. The method of claim 52, wherein: When the candidate cross-component prediction model of the color component in the second candidate list is an MMLM model, some parameters of the candidate cross-component prediction model of the color component include a slope of a first CCLM model, a slope of a second CCLM model and a first threshold in the MMLM model; wherein, When the reconstructed value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is less than or equal to the first threshold, performing intra-frame prediction on the color component of the sample to be predicted according to the first CCLM model and the reconstructed value of the second color component of the sample to be predicted; When the reconstructed value of the second color component of the sample to be predicted of the color component of the template area of ​​the current block is greater than the first threshold, intra-frame prediction is performed on the color component of the sample to be predicted according to the second CCLM model and the reconstructed value of the second color component of the sample to be predicted.

55. The method of claim 42, wherein: The second candidate list includes partial parameters of the candidate cross-component prediction model of the color component; When the candidate cross-component prediction model of the color component in the second candidate list is a CCCM model, some parameters of the CCCM model are filtering parameters of the CCCM model; The remaining parameters of the CCCM model include an offset value of the color component and an offset value of the second color component; the method further includes: Determine an offset value of the color component according to a reconstructed value of the color component of an adjacent block and / or a non-adjacent block of the current block; An offset value of the second color component is determined according to a reconstructed value of the second color component of an adjacent block and / or a non-adjacent block of the current block.

56. The method of claim 31, wherein: When the size of the current block is smaller than a second threshold and / or the size of the current block is larger than a third threshold, the first candidate list is determined; wherein the second threshold is larger than the third threshold.

57. The method of claim 31, wherein: In a case where the frame type to which the current block belongs is an intra frame, the first candidate list is determined.

58. The method of claim 31, wherein: The method further comprises: Parse the bitstream to obtain a first identifier; wherein the first identifier is used to identify whether the current block, the coding tree unit where the current block is located, the slice where the current block is located, the frame where the current block is located, or the sequence where the current block is located uses a sorting method for intra-frame prediction.

59. The method of claim 42, wherein: The method further comprises: Parse the code stream to obtain a second identifier; wherein the second identifier is used to identify whether to use a sorting method based on a template area.

60. The method of claim 32, wherein: The first color component and the third color component are chrominance components, and the second color component is a luminance component.

61. A coding device, applied to an encoder, the device comprising: A first determination module is configured to determine a first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong; A selection module configured to select a first cross-component prediction model for a first color component from the first candidate list; A first prediction module is configured to perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; A second determination module is configured to determine a first residual value of the first color component of the current block according to the first intra-frame prediction value and a sample value of the first color component of the current block; The encoding module is configured to generate a code stream according to a first residual value of the current block and an index value of the first cross-component prediction model in the first candidate list.

62. An encoder comprising a first memory and a first processor; wherein, The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 1 to 30 when running the computer program.

63. A code stream, wherein the code stream is obtained by using the encoding method according to any one of claims 1 to 30.

64. A decoding device, the device being applied to a decoder, the device comprising: A decoding module is configured to parse the bitstream to obtain a first residual value of a first color component of a current block and an index value of a first cross-component prediction model in a first candidate list; A third determination module is configured to determine the first candidate list, wherein the candidate cross-component prediction models in the first candidate list are arranged in ascending order according to the prediction errors of the candidate cross-component prediction models or the sum of the prediction errors in the model group to which the candidate cross-component prediction models belong; a fourth determination module, configured to determine the first cross-component prediction model according to an index value of the first cross-component prediction model in the first candidate list and the first candidate list; A second prediction module is configured to perform intra-frame prediction on the first color component of the current block according to the first cross-component prediction model and the reconstructed value of the second color component of the current block to obtain a first intra-frame prediction value; The fifth determination module is configured to determine a reconstructed value of a first color component of the current block according to the first intra-frame prediction value and the first residual value.

65. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 31 to 60 when running the computer program.

66. An electronic device comprising: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 30 is implemented, or when the computer program is executed by the processor, the method according to any one of claims 31 to 60 is implemented.

67. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, which implements the method according to any one of claims 1 to 30 when executed, or implements the method according to any one of claims 31 to 60 when executed.

Citation Information

Patent Citations

  • Coding video data using derived chroma mode

    CN110100436A

  • Initialization of counter-based intra prediction mode

    CN114270825A

  • Image encoding / decoding method and apparatus, and recording medium storing bitstream

    US20220086428A1

  • Colour component prediction method, encoder, decoder, and storage medium

    US20220116591A1

  • Adaptive construction of most probable modes candidate list for video data encoding and decoding

    WO2020056779A1