Encoding method, decoding method, encoder, decoder, and storage medium

By determining the candidate list and inter-component prediction model information in video encoding, the prediction accuracy of the second image component is improved by utilizing samples from the first image component. This solves the problem that the chroma prediction mode is not applicable in the prior art and improves encoding and decoding performance.

WO2026237029A1PCT designated stage Publication Date: 2026-11-19GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/095270
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

Existing chroma prediction models are not applicable to all samples in video coding, resulting in reduced prediction accuracy and affecting encoding and decoding performance.

Method used

By determining the candidate list for the current unit, and based on the samples of the first image component corresponding to the current unit, the prediction model information between components is determined in the candidate list, and then the prediction samples and reconstruction samples of the second image component are determined. The correlation between the first image component and the second image component is used to improve the prediction accuracy.

Benefits of technology

It improves the prediction accuracy of video encoding and decoding, and enhances encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025095270_19112026_PF_FP_ABST
    Figure CN2025095270_19112026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present application are an encoding method, a decoding method, an encoder, a decoder, and a storage medium. The encoding / decoding method comprises: an encoder / decoder determining a candidate list of a current unit; on the basis of a sample of a first image component corresponding to the current unit, determining cross-component prediction model information of the current unit from the candidate list; on the basis of the cross-component prediction model information of the current unit, determining a second prediction sample of a second image component of the current unit; and on the basis of the second prediction sample of the second image component of the current unit, determining a reconstructed sample of the second image component of the current unit.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding / decoding methods, encoders, decoders, and storage media Technical Field

[0001] This application relates to the field of video encoding and decoding technology, and in particular to an encoding and decoding method, encoder, decoder, and storage medium. Background Technology

[0002] In video coding standards, chroma prediction modes can include traditional chroma prediction modes and cross-component prediction (CCP) modes. For CCP modes, the prediction mode can be obtained from a CCP merge list.

[0003] However, the common methods for determining CCP patterns are not applicable to the prediction of all samples, which reduces the accuracy of prediction and affects encoding and decoding performance. Summary of the Invention

[0004] This application provides an encoding / decoding method, encoder, decoder, and storage medium, which can improve the accuracy of prediction and enhance encoding / decoding performance.

[0005] The technical solution of this application embodiment can be implemented as follows:

[0006] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:

[0007] Determine the candidate list for the current cell;

[0008] Based on the samples of the first image component corresponding to the current unit, determine the inter-component prediction model information of the current unit in the candidate list;

[0009] The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit;

[0010] Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined.

[0011] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:

[0012] Determine the candidate list for the current cell;

[0013] Based on the samples of the first image component corresponding to the current unit, determine the inter-component prediction model information of the current unit in the candidate list;

[0014] The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit;

[0015] Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined.

[0016] Thirdly, embodiments of this application provide an encoder, which includes a first determining unit, wherein:

[0017] The first determining unit is configured to: determine a candidate list for the current unit; determine inter-component prediction model information of the current unit from the candidate list based on the samples of the first image component corresponding to the current unit; determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine the reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0018] Fourthly, embodiments of this application provide an encoder, which includes a second determining unit, wherein:

[0019] The second determining unit is configured to: determine a candidate list for the current unit; determine inter-component prediction model information of the current unit from the candidate list based on the samples of the first image component corresponding to the current unit; determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine the reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0020] Fifthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,

[0021] A first memory for storing computer programs that can run on a first processor;

[0022] A first processor is configured to execute the encoding method described in the second aspect when running a computer program.

[0023] Sixthly, embodiments of this application provide a decoder, the encoder including a second memory and a second processor; wherein,

[0024] The second memory is used to store computer programs that can run on the second processor;

[0025] The second processor is used to execute the decoding method as described in the first aspect when running a computer program.

[0026] In a seventh aspect, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the decoding method as described in the first aspect or the encoding method as described in the second aspect.

[0027] Eighthly, embodiments of this application provide a computer-readable storage medium having a bitstream stored thereon, the bitstream being generated by performing the steps of the encoding method as described in the second aspect.

[0028] In a ninth aspect, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the decoding method as described in the first aspect or the encoding method as described in the second aspect.

[0029] This application provides an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines a candidate list for the current unit; based on samples of the first image component corresponding to the current unit, it determines inter-component prediction model information for the current unit from the candidate list; based on the inter-component prediction model information for the current unit, it determines a second prediction sample for the second image component of the current unit; and based on the second prediction sample for the second image component of the current unit, it determines a reconstructed sample for the second image component of the current unit. In other words, in this application's embodiments, the inter-component prediction model information used by the current unit can be determined from the candidate list of the current unit using samples of the first image component. That is, the inter-component prediction model information used in the cross-component prediction process of the second image component can be determined using samples of the first image component. Since the corresponding first and second image components have a stronger correlation, the finally determined inter-component prediction model information is better able to express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve prediction accuracy and enhance encoding / decoding performance. Attached Figure Description

[0030] Figure 1 is a schematic diagram of the decoding process of the InterCcpMerge method provided in the embodiments of this application;

[0031] Figure 2 is a schematic diagram of the method for determining CCP mode provided in an embodiment of this application;

[0032] Figure 3 is a schematic diagram of the implementation method of colorimetric prediction provided in the embodiments of this application;

[0033] Figure 4 is a schematic diagram of a video encoding and decoding network architecture provided in an embodiment of this application;

[0034] Figure 5 is a schematic block diagram of an encoder provided in an embodiment of this application;

[0035] Figure 6 is a schematic block diagram of a decoder provided in an embodiment of this application;

[0036] Figure 7 is a flowchart illustrating a decoding method provided in an embodiment of this application;

[0037] Figure 8 is a schematic diagram of the airspace candidate locations provided in an embodiment of this application;

[0038] Figure 9 is a schematic diagram of the temporal candidate positions provided in an embodiment of this application;

[0039] Figure 10 is a schematic diagram of the candidate positions in the time domain for shifting provided in an embodiment of this application;

[0040] Figure 11 is a schematic diagram of the adjacent block positions for selecting motion displacement provided in an embodiment of this application;

[0041] Figure 12 is a schematic diagram of the implementation of chromaticity prediction provided in the embodiments of this application;

[0042] Figure 13 is a schematic diagram of the positional relationship of downsampled brightness samples provided in an embodiment of this application;

[0043] Figure 14 is a schematic diagram of the positional relationship of the downsampled brightness samples provided in an embodiment of this application;

[0044] Figure 15 is a schematic diagram of the downsampling filter types provided in the embodiments of this application;

[0045] Figure 16 is a schematic diagram of the positional relationship of brightness samples after unsampling provided in an embodiment of this application;

[0046] Figure 17 is a schematic diagram of four Sobel operators provided in the embodiments of this application;

[0047] Figure 18 is a flowchart illustrating a decoding method provided in an embodiment of this application;

[0048] Figure 19 is a schematic diagram of the template types provided in the embodiments of this application;

[0049] Figure 20 is a schematic diagram of the template types provided in the embodiments of this application;

[0050] Figure 21 is a schematic diagram of the template types provided in the embodiments of this application;

[0051] Figure 22 is a schematic diagram of the template types provided in the embodiments of this application;

[0052] Figure 23 is a schematic diagram of the template types provided in the embodiments of this application;

[0053] Figure 24 is a schematic diagram of the template types provided in the embodiments of this application;

[0054] Figure 25 is a flowchart illustrating an encoding method provided in an embodiment of this application;

[0055] Figure 26 is a flowchart illustrating an encoding method provided in an embodiment of this application;

[0056] Figure 27 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application;

[0057] Figure 28 is a schematic diagram of the hardware structure of an encoder provided in an embodiment of this application;

[0058] Figure 29 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application;

[0059] Figure 30 is a schematic diagram of the hardware structure of a decoder provided in an embodiment of this application;

[0060] Figure 31 is a schematic diagram of the composition structure of an encoding and decoding system provided in an embodiment of this application. Detailed Implementation

[0061] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0063] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0064] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0065] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application will be explained. The nouns and terms used in the embodiments of this application shall be interpreted as follows:

[0066] H.266 / Versatile Video Coding (VVC);

[0067] Joint Video Experts Team (JVET);

[0068] Coding Unit (CU);

[0069] Coding Tree Unit (CTU);

[0070] Largest Coding Unit (LCU);

[0071] Prediction Unit (PU);

[0072] Transform Unit (TU);

[0073] Merge;

[0074] Block Vector (BV);

[0075] Motion Vector (MV);

[0076] Mean-square error (MSE);

[0077] Sum of Absolute Difference (SAD);

[0078] Sum of Absolute Transformed Difference (SATD)

[0079] Sequence Parameter Set (SPS);

[0080] Cross-component prediction (CCP);

[0081] Cross-component Linear Model (CCLM);

[0082] Multi-model CCLM (MMLM);

[0083] Convolutional Cross-Component Model (CCCM);

[0084] Gradient Linear Model (GLM);

[0085] Picture Order Count (POC);

[0086] Sum of Squared Differences (SSE);

[0087] Mean Absolute Difference (MAD);

[0088] Mean Absolute Error (MAE);

[0089] Rate Distortion Function (RDO).

[0090] It is understandable that common video codec standards employ a block-based hybrid coding framework. For example, each image, sub-image, or frame in a video is divided into square maximum coding units (MCUs) or coding tree units of the same size (e.g., 256×256, 128×128, 64×64, etc.). Each MCU or coding tree unit can be further divided into rectangular coding units according to rules. Coding units may also be divided into prediction units, transform units, etc. The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, inv.quantization, inv.transform, and in-loop filtering. The prediction module can include intra-prediction and inter-prediction, with inter-prediction including motion estimation and motion compensation. Because there is a strong correlation between adjacent samples in an image within a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent samples. Conversely, because there is a strong similarity between adjacent images in a video, inter-image prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0091] The basic workflow of a video codec is as follows: At the encoding end, an image is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. The original block of the current block is subtracted from the prediction block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. The quantization coefficient matrix is ​​entropy-encoded and output to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. On the other hand, the bitstream is parsed to obtain the quantization coefficient matrix. The quantization coefficient matrix is ​​inverse-quantized and inverse-transformed to obtain a residual block. The prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Loop filtering is performed on the reconstructed image based on the image or based on the blocks to obtain a decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. The decoded image can be used as a reference image for subsequent images in inter-frame prediction. The block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode information or parameter information determined at the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as that obtained by the decoding end. The decoded image obtained by the encoding end is usually also called the reconstructed image. During prediction, the current block can be divided into prediction units, and during transform, the current block can be divided into transform units. The division of prediction units and transform units can be different. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The embodiments of this application are applicable to the basic flow of a video codec under this block-based hybrid coding framework, but are not limited to this framework and flow.

[0092] In the embodiments of this application, the current unit can be the current coding unit (Current CU), the current prediction unit (Current PU), or the current transform unit (Current TU), etc., and can correspond to different concepts (CU, PU, ​​or TU) depending on the processing object in different processing steps. Due to the need for parallel processing, images can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning there is no data dependency between them. A "frame" is a commonly used term, generally understood as an image. In this document, "frame" can also be replaced with "image" or "slice," etc. Furthermore, the "sample" mentioned in this document can also be called a pixel, and a sample includes location information and value.

[0093] The following is a brief introduction to the technologies related to this application.

[0094] (1) Inter-Cross Component Prediction Merge (InterCcpMerge).

[0095] Inter-component prediction merging (InterCcpMerge) is a chroma coding technique based on the concept of inheritance. This mode allows the inheritance of CCP models including {CCLM, CCCM, GLM, InterCCCM} or other cross-component prediction models that may emerge in the future.

[0096] The prediction process of the InterCcpMerge technique is described in detail below.

[0097] The inputs to InterCcpMerge are: the luminance reconstruction value recSamplesY[x][y] corresponding to the current cell, and the first chromaticity prediction value (taking the chromaticity space composed of Y / Cb / Cr components as an example, for the Cb component it is predSamplesCb[x1][y1], and for the Cr component it is predSamplesCr[x1][y1]), where x = 0..nTbW-1, y = 0..nTbH-1, x1 = 0..nTbWC-1, and y1 = 0..nTbHC-1.

[0098] The output of InterCcpMerge is the third chromaticity prediction value of the current cell (taking the chromaticity space composed of Y / Cb / Cr components as an example, it is predSamplesCb′[x][y] for Cb components and predSamplesCr′[x][y] for Cr components), where x = 0..nTbWC-1 and y = 0..nTbHC-1.

[0099] As shown in Figure 1, the specific prediction process of the InterCcpMerge technology consists of four steps: S1, constructing a candidate list; S2, determining the CCP mode; S3, calculating the second chromaticity prediction value of the current cell; and S4, calculating the third chromaticity prediction value of the current cell.

[0100] When constructing the candidate list, InterCcpMerge contains 12 CCP model candidates. Besides adding the CCP model predicted by applying intra-frame CCCM to the current cell, it also includes, in sequence, spatially adjacent candidates, second-type shifted-temporal candidates, temporal candidates, spatially non-adjacent candidates, history-based CCP candidates, first-type shifted-temporal candidates, and the default CCP candidate, until the candidate list is full. During the addition of CCP candidates, redundancy checks are performed, and non-duplicate candidates are added to the candidate list.

[0101] When determining the CCP model, as shown in Figure 2, Input Data 1, Input Data 2, and Input Data 3 can be the reconstructed / predicted values ​​of the Y / Cb / Cr components in the adjacent regions of the current cell, or the reconstructed / predicted values ​​of the R / G / B components, the X / Y / Z components, or other representations in different color spaces. The CCP Model List is the InterCcpMerge candidate list obtained in step S1, and the final CCP model is selected through the selection module.

[0102] The embodiments in this application are all illustrated using a space composed of Y / Cb / Cr components as an example.

[0103] When calculating the second chromaticity prediction value of the current cell, as shown in Figure 3, the input data is the reconstructed value of the Y component corresponding to the current cell, and the CCP model is obtained in step S2. Output data 1 and output data 2 are the second prediction values ​​of the Cb / Cr components of the current cell.

[0104] When calculating the third chromaticity prediction value of the current cell, the second chromaticity prediction value (predCbVal for Cb component and predCrVal for Cr component) obtained in step S3 can be fused with the first chromaticity prediction value (predSamplesCb for Cb component and predSamplesCr for Cr component).

[0105] It should be noted that both the encoding and decoding ends need to build the same Inter CCP candidate list.

[0106] Currently, InterCcpMerge uses the adjacent reconstructed regions of the current cell as template regions to calculate the template cost and sort the candidate list. When the texture of the current frame content is complex, the similarity between the reference regions above and to the left of the current cell and the current cell is not high, resulting in low accuracy of the chroma prediction value of the current cell, thus affecting the video coding efficiency.

[0107] Based on this, embodiments of this application provide an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines a candidate list for the current unit; based on samples of the first image component corresponding to the current unit, it determines inter-component prediction model information for the current unit from the candidate list; based on the inter-component prediction model information for the current unit, it determines a second prediction sample for the second image component of the current unit; and based on the second prediction sample for the second image component of the current unit, it determines a reconstructed sample for the second image component of the current unit. In other words, in embodiments of this application, samples of the first image component corresponding to the current unit can be used to determine the inter-component prediction model information used by the current unit from the candidate list. That is, samples of the first image component can be used to determine the inter-component prediction model information used in the cross-component prediction process of the second image component. Since the corresponding first and second image components have a stronger correlation, the finally determined inter-component prediction model information is better able to express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve prediction accuracy and enhance encoding / decoding performance.

[0108] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0109] Figure 4 is a schematic diagram of a video encoding and decoding network architecture provided in an embodiment of this application. As shown in Figure 4, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01. The electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic devices can be various types of devices with video encoding and decoding capabilities. For example, the electronic devices may include mobile phones, tablets, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc. This embodiment of the application does not impose any limitations.

[0110] This application provides a network architecture for a video encoding / decoding system that includes decoding and encoding methods. The decoder or encoder in this application can be the aforementioned electronic device. That is, the electronic device in this application has video encoding / decoding capabilities and generally includes a video / image encoder (referred to as an encoder) and a video / image decoder (referred to as a decoder).

[0111] Figure 5 is a schematic block diagram of an encoder provided in an embodiment of this application. As shown in Figure 5, the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control and analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc. Among them, the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by partitioning it through a Coding Tree Unit (CTU). Then, the residual sample information obtained after intra-frame or inter-frame prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the sample domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide time prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 is used to perform the motion estimation based on the motion vectors determined by the motion estimation unit 105. The motion compensation is performed. After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109. In addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the sample domain, and remove the block artifacts by the filter control analysis unit 107 and the filtering unit 108. Then, the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-prediction mode and output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.

[0112] Figure 6 is a schematic block diagram of a decoder provided in an embodiment of this application. As shown in Figure 6, the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc. The decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding processing shown in Figure 5, the bitstream of the video signal is output. This bitstream is input into the decoder 200, first passing through the decoding unit 201 to obtain the decoded transform coefficients. The transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the sample domain. The intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses... The prediction information is used to generate a predictive block of the video block being decoded; the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.

[0113] It should be noted that the method in this application embodiment can be applied to an encoder, a decoder, or even to both encoders and decoders simultaneously, without any limitation.

[0114] It should also be noted that when the embodiments of this application are applied to the encoder 100, "current unit" can refer to the unit currently to be encoded in the video image (also known as "encoding unit"); when the embodiments of this application are applied to the decoder 200, "current unit" can refer to the unit currently to be decoded in the video image (also known as "decoding unit").

[0115] In one embodiment of this application, FIG7 is a schematic flowchart of a decoding method provided in this application embodiment. As shown in FIG7, the decoding method of the decoder may include the following steps:

[0116] Step 701: Determine the candidate list for the current unit.

[0117] In this embodiment, the method is applied to the decoder. Based on the structure of the decoder 200 shown in Figure 6, the decoding method of this embodiment can be applied to the prediction part. Specifically, it can be an optimization method for determining the CCP model based on the InterCcpMerge candidate list, thereby improving the accuracy of CCP prediction.

[0118] In embodiments of this application, the current unit may include any one of the following units: current CU, current PU, and current TU. For example, the current unit may be the current CU.

[0119] Wherein, CU is an encoding unit, which may include one or more PUs or one or more TUs, and this application does not make specific limitations.

[0120] For example, in some embodiments, the current unit is the current CU, which includes one or more CBs. For instance, the current CU includes one CB, or the current CU includes two CBs, or the current CU includes three CBs.

[0121] In embodiments of this application, the candidate list for the current unit, such as the InterCcpMerge candidate list for the current unit, can be specific to the current unit. For example, for one or more current blocks included in the current unit, the candidate list of the current CU can be used.

[0122] In the embodiments of this application, the candidate list of the current unit may include one or more candidate model information, that is, the candidate list of the current unit may include one or more candidate component prediction model information.

[0123] In the embodiments of this application, the candidate list of the current unit can be understood as the InterCcpMerge candidate list. The InterCcpMerge candidate list includes one or more candidate CCP models (CCP model candidates, i.e., candidate model information). For example, the InterCcpMerge candidate list contains 12 CCP model candidates.

[0124] In some embodiments, when determining the candidate list for the current cell, the InterCcpMerge candidate list contains 12 CCP model candidates. Besides adding the CCP model predicted by applying intra-frame CCCM to the current cell, the list also includes, in sequence, spatially adjacent candidates, second-type shifted temporal candidates, temporal candidates, spatially non-adjacent candidates, history-based CCP candidates, first-type shifted temporal candidates, and a default CCP candidate, until the candidate list is full. During the process of adding CCP candidates, redundancy checks are performed, and non-repeating candidates are added to the candidate list.

[0125] In some embodiments, the candidate positions are as follows:

[0126] 1) Candidates with adjacent and non-adjacent airspace.

[0127] As shown in Figure 8, the spatially adjacent candidate positions are numbered 1 to 5 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list. The spatially non-adjacent candidate positions are numbered 6 to 23 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list.

[0128] 2) Temporal Candidates

[0129] As shown in Figure 9, temporal candidates are derived from the co-location image, and the solid line blocks represent the co-location blocks of the current unit within the co-location image. Specifically, based on the co-location image index in the bitstream, the image corresponding to that index in the reference frame list is selected as the co-location image.

[0130] For example, taking Figure 2 as an example, the inclusion order of the time-domain candidates can be C01→C02→…→C0 10 If C0i is outside the image / slice boundary while C1i is inside the image / slice boundary, then C1i will be used instead of C0i, where 1≤i≤10. Otherwise, the next containing position will be selected.

[0131] 3) Shift-time domain candidates

[0132] As shown in Figure 10, the shifted temporal candidate is derived from the co-position image. The solid line block represents the co-position block on the co-position image after the current cell has undergone motion displacement. Therefore, the shifted temporal candidate position is the position after motion offset from the temporal candidate positions in Figure 4. Following the sequence C01→C02→…→C0 10 The available CCP candidates are searched sequentially. Based on the type of motion displacement, they are divided into first-class shift-time-domain candidates and second-class shift-time-domain candidates.

[0133] a) First type of shift-time domain candidate

[0134] As shown in Figure 11, the motion displacement of the first type of shift-time domain candidate is derived from the adjacent blocks of the current element. According to L0... B1 →L1 B1 →L0 A1 →L1 A1 →L0 B0 →L1 B0 →L0 A0 →L1 A0 →L0 B2 →L1 B2The available motion vectors are searched sequentially. Here, L0x is the forward motion vector, and L1x is the backward motion vector. The first motion vector using the co-located image as a reference image is determined as the motion displacement. If no such motion vector is found, no first-class shift temporal candidate is added.

[0135] b) Second type of shift-time domain candidate

[0136] The motion displacement of the second type of shift time-domain candidate is derived based on the motion vector of the current element.

[0137] 4) Historical CCP Candidates

[0138] Historical CCP candidate selection involves storing CCP mode information from previously encoded blocks in an HCCP list of maximum length 6, used to construct the InterCcpMerge candidate list. The HCCP list is continuously updated during the encoding process. Redundancy checks are performed on existing candidates; if a newly inserted candidate is duplicated, it is removed. Finally, the list is maintained at its maximum length of 6 according to a First-In-First-Out (FIFO) principle; if adding a new candidate results in a list with more than 6 candidates, the first candidate is removed. The HCCP list's lifespan is one CTU row; it is cleared before the first CTU of each CTU row is encoded.

[0139] 5) Default CCP candidate

[0140] If there are still empty positions in the candidate list after sequentially checking the spatially adjacent candidates, the second type of shifted time-domain candidates, time-domain candidates, spatially non-adjacent candidates, historical CCP candidates, and the first type of shifted time-domain candidates, then the default CCP candidate will be added to the candidate list until the candidate list is full.

[0141] If there are no CCP candidates of the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0142] If there is a CCP candidate with the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, the scaling parameter of the first CCP candidate using CCLM, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0143] Step 702: Based on the samples of the first image component corresponding to the current unit, determine the inter-component prediction model information of the current unit in the candidate list.

[0144] In the embodiments of this application, after determining the candidate list of the current unit, the inter-component prediction model information of the current unit can be further determined from the candidate list based on the samples of the first image component corresponding to the current unit.

[0145] In the embodiments of this application, the candidate list of the current unit can be understood as the InterCcpMerge candidate list, and the inter-component prediction model information of the current unit determined based on the candidate list of the current unit may include the CCP model used by the current unit.

[0146] In the embodiments of this application, the first image component and the second image component can be different image components (color components) of the current image, including but not limited to the first image component being a luminance component and the second image component being a chrominance component, or the first image component being a chrominance component and the second image component being a luminance component.

[0147] For example, in some embodiments, the first image component may be a luminance component, typically denoted by the symbol Y. The second image component may be a chrominance component, which may include a blue chrominance component (typically denoted by the symbols Cb or U) or a red chrominance component (typically denoted by the symbols Cr or V).

[0148] For example, in some embodiments, the first image component and the second image component can be represented in any color space, including but not limited to one or more of the following: CUY / Cb / Cr components, R / G / B components, X / Y / Z components, or other different color space representations. This application does not impose specific limitations.

[0149] In embodiments of this application, the current unit includes one or more image components (one or more color components).

[0150] For example, in some embodiments, in a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, a CU contains three CBs, namely one luminance CB and two chrominance CBs.

[0151] For example, in some embodiments, in a dual-tree partitioning scenario, i.e., when luminance and chrominance are partitioned separately, a CU contains one or two CBs, wherein a luminance CU contains one luminance CB and a chrominance CU contains two chrominance CBs.

[0152] In other words, in the embodiments of this application, a CU may include one or more image components, while a CB corresponds to only one color component.

[0153] In the embodiments of this application, the sample of the first image component corresponding to the current unit can be the sample of the first image component included in the current unit in a single-tree partitioning scenario, and the sample of the first image component of the co-located region corresponding to the current unit in a dual-tree partitioning scenario.

[0154] For example, in some embodiments, the first image component is a luminance component and the second image component is a chrominance component. In a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, the current unit includes samples of the luminance component and samples of the chrominance component.

[0155] For example, in some embodiments, the first image component is a luminance component and the second image component is a chrominance component. In a dual-tree partitioning scenario, i.e., when luminance and chrominance are partitioned separately, the current unit includes a sample of the chrominance component, and the sample of the luminance component corresponding to the current unit is the sample of the luminance component of the co-location region of the current unit.

[0156] In other words, in the embodiments of this application, the sample of the first image component corresponding to the current unit may include the sample of the first image component of the current unit when dividing by a single tree, or it may include the sample of the first image component of the co-located region corresponding to the current unit when dividing by a dual tree.

[0157] For example, in some embodiments, in a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, the current cell includes samples of the Y component, samples of the Cb component, and samples of the Cr component.

[0158] For example, in some embodiments, in a dual-tree partitioning scenario, i.e., where luminance and chrominance are partitioned separately, if the current cell is a chrominance cell, then the current cell includes samples of the Cb component and samples of the Cr component. If the current cell is a luminance cell, then the current cell includes samples of the Y component.

[0159] In the embodiments of this application, after constructing the candidate list of the current unit, the inter-component prediction model information of the current unit can be further determined from the candidate list of the current unit based on the samples of the first image component corresponding to the current unit. Specifically, determining the inter-component prediction model information of the current unit from the candidate list of the current unit based on the samples of the first image component corresponding to the current unit can be understood as using the current unit and / or its corresponding co-location region as the template region of the current unit to determine the template cost of the candidate model information in the candidate list of the current unit. Then, the candidate list of the current unit can be sorted using the determined template cost of the candidate model information, and / or, the inter-component prediction model information of the current unit can be determined from the candidate list using the determined template cost of the candidate model information.

[0160] In the embodiments of this application, in a single-tree partitioning scenario, the current unit can be used as the template region of the current unit to determine the template cost of the candidate model information. In a dual-tree partitioning scenario, the corresponding region of the current unit can be used as the template region of the current unit to determine the template cost of the candidate model information.

[0161] It should be noted that, in the embodiments of this application, the decoding method proposed in this application is illustrated by taking the first image component as the luminance component and the second image component as the chrominance component as an example.

[0162] In embodiments of this application, the samples of the first image component include predicted samples of the first image component and / or reconstructed samples of the first image component.

[0163] In some embodiments, the sample of the luminance block corresponding to the current chroma unit may include a luminance prediction sample (a prediction sample of the first image component) and a luminance reconstruction sample (a reconstruction sample of the first image component).

[0164] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the prediction sample of the first image component and the candidate model information in the candidate list; the inter-component prediction model information of the current unit is determined in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0165] In embodiments of this application, the chromaticity components include a first component and a second component. For example, the first component may be a Cr component and the second component may be a Cb component, or the first component may be a Cb component and the second component may be a Cr component; this application does not impose any specific limitations.

[0166] In embodiments of this application, the candidate model information in the candidate list includes first component candidate model information and second component candidate model information. For example, the candidate model information in the candidate list includes Cr component candidate model information and Cb component candidate model information.

[0167] In other words, in the embodiments of this application, the candidate model information may include different CCP models corresponding to different chromaticity components. Specifically, the Cr component candidate model information is used to predict the Cr component based on the Y component, and the Cb component candidate model information is used to predict the Cb component based on the Y component.

[0168] In embodiments of this application, the template prediction sample of the current unit determined based on the candidate model information in the candidate list may include: the first component template prediction sample of the current unit determined based on the first component candidate model information; and the second component template prediction sample of the current unit determined based on the second component candidate model information.

[0169] In embodiments of this application, the template prediction samples for the second image component of the current unit include template prediction samples for the first component and template prediction samples for the second component. For example, the template prediction samples for the second image component of the current unit include template prediction samples for the Cr component and template prediction samples for the Cb component.

[0170] For example, in some embodiments, assuming the first component is the Cr component, the Cr component template prediction sample of the second image component of the current unit is determined based on the reconstructed sample of the first image component and the Cr component candidate model information in the candidate list. Alternatively, the Cr component template prediction sample of the second image component of the current unit is determined based on the prediction sample of the first image component and the Cr component candidate model information in the candidate list.

[0171] For example, in some embodiments, assuming the second component is a Cb component, the Cb component template prediction sample of the second image component of the current unit is determined based on the reconstructed samples of the first image component and the Cb component candidate model information in the candidate list. Alternatively, the Cb component template prediction sample of the second image component of the current unit is determined based on the prediction samples of the first image component and the Cb component candidate model information in the candidate list.

[0172] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list of the current unit based on the sample of the first image component corresponding to the current unit, the current unit or the corresponding co-location region can be used as the template region of the current unit. Based on the prediction sample of the luminance component of the co-location region (i.e. the prediction sample of the luminance component corresponding to the current unit), one or more template prediction samples (chromaticity prediction values ​​corresponding to the candidate model information) of the chromaticity component of the current unit corresponding to one or more candidate model information can be determined through one or more candidate model information in the candidate list. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on the one or more template prediction samples of the chromaticity component corresponding to one or more candidate model information.

[0173] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the reconstructed samples of the first image component and the candidate model information in the candidate list; the inter-component prediction model information of the current unit is determined in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0174] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list of the current unit based on the samples of the first image component corresponding to the current unit, the current unit or the corresponding co-location region can be used as the template region of the current unit. Based on the reconstructed samples of the co-location region (i.e., the reconstructed samples of the luminance component corresponding to the current unit), one or more template prediction samples (chromaticity prediction values ​​corresponding to the candidate model information) of the chromaticity component of the current unit corresponding to one or more candidate model information can be determined through one or more candidate model information in the candidate list. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on the one or more template prediction samples of the chromaticity component corresponding to one or more candidate model information.

[0175] In embodiments of this application, the first prediction sample of the second image component of the current cell can be understood as the initial prediction sample of the chroma component of the current cell. For example, the first prediction sample of the second image component of the current cell may include the initial prediction value of the chroma component of the current cell obtained by inter-frame prediction or intra-frame block copying.

[0176] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the template cost of the candidate model information is determined based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit; and the inter-component prediction model information of the current unit is determined in the candidate list based on the template cost.

[0177] In the embodiments of this application, after determining one or more template prediction samples corresponding to one or more candidate model information for chromaticity components, the template cost corresponding to one or more candidate model information can be determined by combining the first prediction sample of the chromaticity component of the current unit. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on the template cost of the candidate model information.

[0178] In other words, in the embodiments of this application, when determining the template cost of the candidate model information of the candidate list of the current unit, the current unit or the corresponding co-location of the current unit can be used as the template region of the current unit. That is, the predicted sample and / or reconstructed sample of the luminance component corresponding to the current unit is used, combined with the first predicted sample of the chrominance component of the current unit, to determine the template cost corresponding to the candidate model information.

[0179] In the embodiments of this application, when determining the template cost corresponding to the candidate model information, the template cost can be calculated by using a cost function based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit.

[0180] In embodiments of this application, the chromaticity components include a first component and a second component. Accordingly, the first prediction sample of the current unit includes a first component prediction sample and a second component prediction sample. For example, the first prediction sample of the current unit includes a Cr component prediction sample and a Cb component prediction sample.

[0181] In the embodiments of this application, when determining the template cost of candidate model information based on the first prediction sample of the current unit and the template prediction sample of the current unit, the first component template cost of candidate model information is determined based on the first component prediction sample and the first component template prediction sample; the second component template cost of candidate model information is determined based on the second component prediction sample and the second component template prediction sample; and the template cost of candidate model information is determined based on the first component template cost and the second component template cost.

[0182] For example, in some embodiments, when determining the template cost of candidate model information, for different chromaticity components, such as Cr and Cb components, the corresponding chromaticity component cost values ​​can be calculated based on the candidate model information, and then the sum of the different chromaticity component cost values ​​can be used as the template cost of the candidate model information.

[0183] For example, in some embodiments, assuming the first component is the Cr component and the second component is the Cb component, the Cr component template cost of the candidate model information can be determined based on the Cr component prediction sample and the Cr component template prediction sample; at the same time, the Cb component template cost of the candidate model information can be determined based on the Cb component prediction sample and the Cb component template prediction sample; finally, the sum of the Cr component template cost and the Cb component template cost can be determined as the template cost of the candidate model information.

[0184] In the embodiments of this application, the cost function for template cost can be selected from various options, including but not limited to: sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), rate distortion function (RDO), and other evaluation criteria. Any evaluation criterion mentioned below can be selected from the above criteria.

[0185] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows:

[0186] Where Ti is the template chromaticity prediction value (template prediction sample) generated by performing CCP on the current luminance prediction block (prediction sample of luminance component), T is the first chromaticity prediction value (first prediction sample of chromaticity component) of the current cell, and M represents the number of samples in the current chromaticity block. c is used to indicate the chromaticity component. For example, c = 1 represents the chromaticity component is the Cr component, and c = 0 represents the chromaticity component is the Cb component.

[0187] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows: SAD(T i ) = SAD(T i ,0)+SAD(T i ,1) (3)

[0188] Wherein, Ti is a template chrominance prediction value (template prediction sample) generated by performing CCP on the current luminance prediction block (prediction sample of the luminance component), T is the first chrominance prediction value of the current unit (first prediction sample of the chrominance component), and M represents the number of samples in the current chrominance block. c is used to indicate the chrominance component, for example, c being 1 means the chrominance component is the Cr component, and c being 0 means the chrominance component is the Cb component.

[0189] Exemplarily, in some embodiments, after the construction of the candidate list is completed, based on the candidate list, the inter-component prediction model information of the current unit may be further determined from the candidate list according to the first prediction sample of the second image component and the prediction sample of the first image component of the current unit.

[0190] Exemplarily, in some embodiments, after the construction of the candidate list is completed, based on the candidate list, the inter-component prediction model information of the current unit may be further determined from the candidate list according to the first prediction sample of the second image component and the reconstructed sample of the first image component of the current unit.

[0191] In the embodiments of the present application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information with the minimum template cost in the candidate list may be determined as the inter-component prediction model information of the current unit.

[0192] That is to say, in the embodiments of the present application, after the template cost of the candidate model information is determined based on the samples of the first image component corresponding to the current unit, the candidate model information with the minimum template cost in the candidate list may be directly selected and determined as the inter-component prediction model information of the current unit.

[0193] Exemplarily, in some embodiments, taking the SAD evaluation criterion as an example, minSAD=candSAD[0]; optCand=cand[0]; for(i=1; i<numCand; i++){if(candSAD[i]<minSAD){minSAD=candSAD[i]; optCand=cand[i];}}. Wherein, numCand is the number of pieces of candidate model information in the candidate list.

[0194] For example, in some embodiments, the candidate model information with the smallest template cost is first initialized as the first item in the candidate list, and the smallest template cost is the smallest template cost corresponding to the first item in the candidate list; then, according to the order in which the candidate list was added, the template cost of the model information is checked sequentially to see if it is less than the smallest template cost: if it is less, the first item is updated to the current candidate (candidate model information) item, and the smallest template cost is the smallest template cost corresponding to the first item in the candidate list, and then the next candidate is checked until the candidate list is checked; otherwise, the next candidate is checked directly until the candidate list is checked.

[0195] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list can be sorted in ascending order of template cost to obtain a sorted candidate list, and then the first candidate model information in the sorted candidate list can be determined as the inter-component prediction model information of the current unit.

[0196] In other words, in the embodiments of this application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list can be directly sorted according to the template cost, and then the inter-component prediction model information of the current unit can be determined according to the sorted candidate list. For example, the first candidate model information in the sorted candidate list can be determined as the inter-component prediction model information of the current unit, or the Kth candidate model information in the sorted candidate list can be determined as the inter-component prediction model information of the current unit, where K is an integer greater than 0.

[0197] In the embodiments of this application, the bitstream is decoded to determine the first candidate index information of the current unit, wherein the first candidate index information of the current unit (e.g., ccpModeIndex) can be used to determine the inter-component prediction model information of the current unit.

[0198] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; the inter-component prediction model information of the current unit is determined in the sorted candidate list based on the first candidate index information of the current unit.

[0199] That is, in the embodiments of the present application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list may be sorted in ascending order of the template cost, and then the inter-component prediction model information of the current unit is determined according to the sorted candidate list. For example, the candidate model information indicated by the first candidate index information of the current unit in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0200] In some embodiments, assuming that the candidate list includes 12 pieces of candidate model information, the sorted candidate list includes 12 pieces of candidate model information. At this time, the value range of the first candidate index information of the current unit is 0-11, which is used to respectively indicate the 12 pieces of candidate model information in the sorted candidate list.

[0201] In the embodiments of the present application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of the template cost, and the sorted candidate list is determined based on the top N pieces of candidate model information in the sorted order, where N is an integer greater than 0; the inter-component prediction model information of the current unit is determined in the sorted candidate list based on the first candidate index information of the current unit.

[0202] That is, in the embodiments of the present application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list may be sorted in ascending order of the template cost, then the sorted candidate list is determined based on the top N pieces of candidate model information in the sorted order, and further the inter-component prediction model information of the current unit is determined according to the sorted candidate list. For example, the candidate model information indicated by the first candidate index information of the current unit in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0203] It can be understood that, in the embodiments of the present application, determining the sorted candidate list based on the top N pieces of candidate model information in the sorted order can reduce codeword consumption. For example, the length of the candidate list is numCandInList, and the length of the sorted candidate list determined based on the top N pieces of candidate model information in the sorted order is N, where N is less than numCandInList. At this time, the first candidate index information candIdx of the current unit can be obtained by binarization according to N. Compared with binarization according to numCandInList, the codeword consumption is reduced, and the encoding and decoding efficiency is improved.

[0204] In some embodiments, assuming the candidate list includes 12 candidate model information and N is 6, the sorted candidate list obtained after sorting and filtering includes 6 candidate model information. At this time, the value range of the first candidate index information of the current unit is 0-5, which is used to indicate the 6 candidate model information in the sorted candidate list respectively.

[0205] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; a template cost threshold is determined; an updated candidate list is determined based on the candidate model information in the sorted candidate list whose template cost is less than or equal to the template cost threshold; and the inter-component prediction model information of the current unit is determined in the updated candidate list based on the first candidate index information of the current unit.

[0206] In other words, in the embodiments of this application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list can be sorted in ascending order of template cost. For the sorted candidate list, the candidate model information with a template cost less than or equal to a determined template cost threshold is added to the updated candidate list, and then the inter-component prediction model information of the current unit is determined based on the updated candidate list. For example, the candidate model information indicated by the first candidate index information of the current unit in the updated candidate list is determined as the inter-component prediction model information of the current unit.

[0207] In the embodiments of this application, the template cost threshold can be used to filter candidate model information. However, the embodiments of this application do not specifically limit the method for determining the template cost threshold.

[0208] For example, in some embodiments, a pre-set value can be determined as the template cost threshold.

[0209] For example, in some embodiments, the template cost threshold can be determined based on the template cost. For instance, the average template cost corresponding to the candidate template information in the candidate list can be calculated, and the result of the average calculation can be determined as the template cost threshold.

[0210] For example, in some embodiments, a template cost threshold can be determined based on the template cost. For instance, a minimum template cost can be determined, and then the template cost threshold can be determined based on the minimum template cost and a pre-set scaling factor.

[0211] For example, in some embodiments, a template cost threshold can be determined based on the template cost. For instance, the maximum template cost can be determined, and then the template cost threshold can be determined based on the maximum template cost and a pre-set scaling factor.

[0212] Therefore, in the embodiments of this application, one or more candidate model information can be selected dynamically by comparing the template cost threshold with the template cost of the candidate model information, that is, it is not necessary to know how many candidate model information to select in advance.

[0213] For example, in some embodiments, the candidate list is sorted from smallest to largest according to the matching error SAD (template cost) to obtain the sorted candidate list; at the same time, the template cost threshold can be determined according to the minimum template cost: thresholdSAD = factor × candSAD[0]. Where factor is the scaling factor, the updated candidate list can be constructed as follows: selectedCand[0] = cand[0]; numSelectedCand = 1; for(i = 1; i <numCand;i++){if(candSAD[i]<=thresholdSAD){selectedCand[numSelectedCand]=cand[i];numSelectedCand++;}}。

[0214] Step 703: Determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit.

[0215] In the embodiments of this application, the second predicted sample of the second image component of the current unit can be understood as the compensated predicted value of the second image component of the current unit obtained by cross-component prediction through the inter-component prediction model information of the current unit.

[0216] For example, in some embodiments, the second predicted sample of the second image component of the current cell can be the predicted sample of the chromaticity component of the current cell obtained by the CCP model.

[0217] In the embodiments of this application, when determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit and the reconstructed sample of the first image component.

[0218] For example, in some embodiments, cross-component prediction can be performed using the CCP model (inter-component prediction model information of the current unit) based on the reconstructed value of the luminance block corresponding to the current chroma unit, to obtain the predicted value of the current chroma unit, that is, the second predicted sample of the second image component of the current unit.

[0219] In the embodiments of this application, the first image component is the luminance component, and the second image component is the chrominance component. When calculating the second chrominance prediction value (the second prediction sample of the second image component) of the current unit, as shown in Figure 12, the input data (InputData) is the reconstructed value of the Y component corresponding to the current unit, and the CCP Model is the inter-component prediction model information of the current unit obtained through step 702. The output data (OutputData1 / 2) is the second prediction value of the Cb / Cr component of the current unit, that is, the second prediction sample of the second image component.

[0220] In some embodiments, the candidate mode with the lowest template cost is selected as the CCP mode of the current cell, and the CCP mode is applied to the luminance reconstruction value corresponding to the current cell to obtain the second chromaticity prediction value predChromaVal. The CCP modes allowed to be included in the InterCcpMerge candidate list are {CCLM, CCCM, GLM, InterCCCM}, where the CCCM mode includes {CCCM, GLCCCM, MDFCCCM, NSCCCM}, and the GLM mode includes {GLM0123, GLM4567}.

[0221] For example, in some embodiments, the formula for calculating the CCP mode is as follows:

[0222] 1) CCLM

[0223] CCLM is a cross-component linear model, and its calculation formula is as follows: predChromaVal = a×lumaVal + β (4)

[0224] Where, lumaVal is the downsampled sample corresponding to the current cell. lumaVal is the downsampled brightness reconstruction sample of the current cell.

[0225] 2) CCCM

[0226] a) CCCM

[0227] CCCM is a CCP mode that uses a 7-tap convolutional filter. Its calculation formula is as follows: predChromaVal = c0C + c1N+ c2S + c3E+ c4W + c5P(C)+ c6B (5) P(C)=(C×C+midVal)>>bitDepth(6) B = 1<<(bitDepth-1) (7)

[0228] As shown in Figure 13, the input of the 7-tap filter includes 5 spatially close brightness reconstruction samples (after downsampling), 1 nonlinear term P, and 1 offset term B.

[0229] b)GLCCCM

[0230] GLCCCM is a gradient and position-based CCP mode that uses a 7-tap filter. Its calculation formula is as follows: predChromaVal= c0C + c1Gy + c2Gx + c3Y+ c4X + c5P + c6B (8)

[0231] Wherein, parameters Y and X are the vertical and horizontal positions of the center brightness reconstruction sample C, and Gy and Gx are the vertical gradient and horizontal gradient, respectively. The calculation formulas are: Gy = (2N + NW + NE) - (2S + SW + SE) (9) Gx = (2W + NW + SW) - (2E + NE + SE) (10)

[0232] The positional relationship of the downsampled brightness samples in GLCCCM is shown in Figure 14.

[0233] c)MDFCCCM

[0234] MDFCCCM is a CCP model that applies multiple downsampling filters, and it is divided into three types:

[0235] Model 1: predChromaVal=c0×H(C)+c1×G1(C)+c2×G2(C)+c3×G3(C)+c4×P(H(C))+c5×P(G1(C))+c6×P(G2(C))+c7×X+c8×Y+c9×B(11)

[0236] Model 2: predChromaVal=c0×H(C)+c1×H(W)+c2×H(E)+c3×G1(C)+c4×G1(W)+c5×G1(E)+c6×P(H(C))+c7×P(H(W))+c8×P(H(E))+c9×X+c10×B(12)

[0237] Model 3: predChromaVal=c0×H(C)+c1×H(NE)+c2×H(SW)+c3×G3(C)+c4×G3(NE)+c5×G3(SW)+c6×P(H(C))+c7×P(H(NE))+c8×P(H(SW))+c9×Y+c10×B(13)

[0238] As shown in Figure 14, {NW, N, NE, W, C, E, SW, S, SE} represents the positional relationship of the luminance samples. As shown in Figure 15, {H, G1, G2, G3, G4} represents the downsampling filter type in MDFCCCM.

[0239] d)NSCCCM

[0240] NSCCCM is a CCP mode that uses unsampled luminance samples, meaning that chrominance samples are directly predicted from the original reconstructed luminance samples. Its calculation formula is as follows:

[0241] The positional relationship between the chroma samples and the unsampled luminance samples is shown in Figure 16. The filter consists of a 6-tap spatial term, 4 nonlinear terms, and 1 bias term.

[0242] 2) GLM

[0243] GLM is a gradient-based linear CCP mode, as shown in Figure 17. Its gradient G can be calculated from the brightness reconstruction samples using four Sobel operators.

[0244] a)GLM0123

[0245] The calculation formula is as follows: predChromaVal = α*G+β (15)

[0246] b)GLM4567

[0247] The calculation formula is as follows: predChromaVal = α0*G+α1C+α1β (16)

[0248] Where C is the brightness reconstruction sample after downsampling.

[0249] 4) InterCCCM

[0250] The model used in InterCCCM technology is an 8-tap filter consisting of 6 spatial luminance samples L0 to L5, a nonlinear term P, and a bias term B. redChromaVal=c0L0+c1L1+c2L2+c3L3+c4L4+c5L5 +c6P((L0+L3+1)>>1)+c7B (17)

[0251] Similar to NSCCCM, unsampled brightness samples are used to reconstruct the samples, and the sample locations are shown in Figure 16.

[0252] Step 704: Based on the second predicted sample of the second image component of the current unit, determine the reconstructed sample of the second image component of the current unit.

[0253] In the embodiments of this application, after determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit can be further determined based on the second prediction sample of the second image component of the current unit.

[0254] In the embodiments of this application, when determining the second predicted sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit is determined based on the second predicted sample of the second image component of the current unit and the residual of the second image component of the current unit.

[0255] In some embodiments, after determining the second prediction sample of the second image component of the current unit through the inter-component prediction model information of the current unit, the second prediction sample of the second image component can be directly used as the final prediction sample of the second image component of the current unit. Then, the second image component of the current unit can be reconstructed by the second prediction sample of the second image component of the current unit and the residual of the second image component of the current unit, and the reconstructed sample of the second image component of the current unit can be determined.

[0256] In the embodiments of this application, when determining the second predicted sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit is determined based on the first weight of the first predicted sample of the second image component of the current unit, the second weight of the second predicted sample of the second image component of the current unit, the first predicted sample of the second image component of the current unit, the second predicted sample of the second image component of the current unit, and the residual of the second image component of the current unit.

[0257] In some embodiments, after determining the second prediction sample of the second image component of the current unit through the inter-component prediction model information of the current unit, the second prediction sample of the second image component and the first prediction sample of the second image component of the current unit can be fused to obtain the final prediction sample of the second image component of the current unit. Then, the second image component of the current unit can be reconstructed by the final prediction sample of the second image component of the current unit and the residual of the second image component of the current unit to determine the reconstructed sample of the second image component of the current unit.

[0258] In the embodiments of this application, when fusing the second predicted sample of the second image component of the current unit and the first predicted sample of the second image component of the current unit, a first weight corresponding to the first predicted sample of the second image component can be determined first, and a second weight corresponding to the second predicted sample of the second image component of the current unit can be determined at the same time. Then, the first weight and the second weight are used to fuse the first predicted sample of the second image component of the current unit and the second predicted sample of the second image component of the current unit.

[0259] In the embodiments of this application, the specific values ​​of the first weight and the second weight are not specifically limited, and the sum of the first weight and the second weight can be 1.

[0260] In embodiments of this application, when determining weights during the fusion process, a first weight and a second weight can be determined based on preset weight parameters. These preset weight parameters can be used to determine the first weight and / or the second weight. For example, based on a preset weight parameter of w, the second weight is determined to be w, and the first weight is determined to be 1-w.

[0261] For example, in some embodiments, during the process of generating a prediction sample (third chromaticity prediction value) of the second image component of the current unit, a third chromaticity prediction value (predSamplesCb′ for the Cb component and predCrVal for the Cr component) is generated by weighting the second chromaticity prediction value (i.e., the second prediction sample of the second image component, predSamplesCb for the Cb component and predSamplesCr for the Cr component) with the first chromaticity prediction value (i.e., the first prediction sample of the second image component, predSamplesCb for the Cb component and predSamplesCr′ for the Cr component) according to the following formula is performed, thereby generating the third chromaticity prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (18) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (19)

[0262] Where w is the weighting weight. For example, w is 0.75.

[0263] In the embodiments of this application, when determining the weights in the fusion process, the bitstream can be decoded to determine the weight index information of the current unit; based on the weight index information of the current unit and the candidate weight set of the current unit, the first weight and the second weight are determined.

[0264] For example, in some embodiments, the weighting weights can be predefined with an optional set of weights (candidate weight set), and then the weights in the fusion process can be determined based on the candidate weight set and weight index information used to determine the first weight and / or the second weight.

[0265] For example, in some embodiments, assuming the selected weight set is {0, 1 / N, 2 / N, ..., 1}, for example, when N is 4, the set is {0, 0.25, 0.5, 0.75, 1}. Then, indicated by wIdx (weight index information) in the bitstream, the encoder determines the optimal weight combination through RDO, and the decoder obtains the weighted weights by decoding the bitstream. For example, if w is determined to be 0.75 based on wIdx, then the first weight is determined to be 1-w, which equals 0.25, and the second weight is w, which equals 0.75.

[0266] In the embodiments of this application, when determining the weights in the fusion process, the residual value of the first sample is determined; wherein, the first sample is the first image component sample of the first predicted sample corresponding to the second image component of the current unit; the first weight and the second weight are determined based on the residual value of the first sample.

[0267] In some embodiments, the first weight and the second weight can also be adaptively determined based on the residual values ​​of the first sample. That is, for different second image component samples to be predicted in the current unit, the first weight and the second weight used can be different.

[0268] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the weighting weight is determined based on the residual value of the luminance sample (the first sample, i.e., the first image component sample corresponding to the first predicted sample of the second image component of the current unit) at the chrominance sample location. For example, the smaller the residual value of the first sample, the more accurate the chrominance sample prediction at the corresponding location is considered, and the larger the weighting weight (first weight) of the chrominance prediction value (the first predicted value of chrominance) is; the larger the residual value of the first sample, the less accurate the chrominance sample prediction at the corresponding location is considered, and the smaller the weighting weight (first weight) of the chrominance prediction value (the first predicted value of chrominance) is.

[0269] In embodiments of this application, the current unit may include one or more sub-units. For a sub-unit of the current unit, based on the sample of the first image component corresponding to the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list; based on the inter-component prediction model information of the sub-unit of the current unit, the second prediction sample of the second image component of the sub-unit of the current unit is determined; based on the second prediction sample of the second image component of the sub-unit of the current unit, the reconstructed sample of the second image component of the sub-unit of the current unit is determined.

[0270] In other words, in the embodiments of this application, one or more sub-units of the current unit share a candidate list, namely the candidate list of the current unit. However, for a sub-unit of the current unit, the inter-component prediction model information to be used can be adaptively selected from the candidate list. That is, the inter-component prediction model information used by different sub-units may be different.

[0271] Accordingly, in the embodiments of this application, cross-component prediction can be performed using inter-component prediction model information adapted to the sub-unit for different sub-units, which can obtain more ideal prediction results.

[0272] For example, in some embodiments, for the sub-units of the current unit, the sub-units of the current unit or the corresponding co-position sub-regions of the sub-units can be selected as the template region of the sub-units of the current unit. Then, the template cost is calculated for the candidate model information in the candidate list based on the template region. Then, the inter-component prediction model information of the sub-units of the current unit is determined according to the template cost of the candidate model information. Finally, the inter-component prediction model information is used to perform cross-component prediction on the sub-units of the current unit.

[0273] In embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the predicted sample of the first image component corresponding to the sub-unit and / or the reconstructed sample of the first image component corresponding to the sub-unit.

[0274] In some embodiments, the sample of the luminance subunit corresponding to the chroma subunit of the current unit may include a luminance prediction sample (prediction sample of the first image component) and a luminance reconstruction sample (reconstruction sample of the first image component).

[0275] In the embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the predicted sample of the first image component corresponding to the sub-unit. When determining the inter-component prediction model information of the sub-unit of the current unit in the candidate list based on the sample of the first image component corresponding to the sub-unit of the current unit, the template prediction sample of the second image component of the sub-unit of the current unit is determined based on the predicted sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list. Based on the first predicted sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list.

[0276] In the embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the reconstructed sample of the first image component corresponding to the sub-unit. When determining the inter-component prediction model information of the sub-unit of the current unit in the candidate list based on the sample of the first image component corresponding to the sub-unit of the current unit, the template prediction sample of the second image component of the sub-unit of the current unit is determined based on the reconstructed sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list.

[0277] In an embodiment of this application, Figure 18 is a flowchart illustrating a decoding method provided in an embodiment of this application. As shown in Figure 18, the encoding method of the encoder may further include the following steps:

[0278] Step 1801: Determine the candidate list for the current unit.

[0279] Step 1802: Based on the reconstructed samples of the first image component corresponding to the current unit and the candidate model information in the candidate list, determine the template prediction samples of the second image component of the current unit.

[0280] Step 1803: Determine the template cost of candidate model information based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit.

[0281] Step 1804: Determine the template prediction sample of the second image component of the current unit corresponding to the candidate model information with the minimum template cost in the candidate list as the second prediction sample of the second image component of the current unit.

[0282] Step 1805: Based on the second predicted sample of the second image component of the current unit, determine the reconstructed sample of the second image component of the current unit.

[0283] In embodiments of this application, the samples of the first image component include predicted samples of the first image component and / or reconstructed samples of the first image component.

[0284] In some embodiments, the sample of the luminance block corresponding to the current chroma unit may include a luminance prediction sample (a prediction sample of the first image component) and a luminance reconstruction sample (a reconstruction sample of the first image component).

[0285] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the reconstructed sample of the first image component and the candidate model information in the candidate list; the template cost of the candidate model information is determined based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0286] In the embodiments of this application, based on the reconstructed samples of the first image component, the template prediction sample of the second image component of the current unit is determined using the candidate model information in the candidate list, and the template cost of the candidate model information is calculated using the template prediction sample of the second image component of the current unit. Then, the candidate model information with the smallest template cost in the candidate list can be considered as the inter-component prediction model information of the current unit. At this time, the template prediction sample of the second image component of the current unit obtained through the candidate model information with the smallest template cost can be directly determined as the second prediction sample of the second image component of the current unit.

[0287] In other words, in the embodiments of this application, in the scenario where the template cost of candidate model information in the candidate list is determined based on the reconstructed samples of the first image component, the determination of the inter-component prediction model information of the current unit can be skipped. Instead, the candidate model information with the minimum template cost can be directly found. The template prediction sample of the second image component of the current unit obtained by applying the candidate model information with the minimum template cost to the reconstructed samples of the first image component is used as the second prediction sample of the second image component obtained by the current unit through cross-component prediction using the inter-component prediction model information.

[0288] In the embodiments of this application, the bitstream is decoded to determine the first syntax element identification information; when the value of the first syntax element identification information is a first value, the first syntax element identification information indicates that the inter-component prediction model information of the current unit is currently allowed or used by using samples of the first image component corresponding to the current unit; when the value of the first syntax element identification information is a second value, the first syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by using samples of the adjacent regions of the current unit.

[0289] In this embodiment, some instruction information in the form of syntax elements or flags can be written into the bitstream. In this way, by parsing the values ​​of the syntax elements in the bitstream, the relevant decoding information of the current unit can be determined, such as whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit.

[0290] In some embodiments, the first syntax element identification information in the parsed bitstream is used to indicate whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit.

[0291] In this embodiment of the application, if the value of the first syntax element identifier information is a first value, then the inter-component prediction model information of the current unit is determined by the samples of the first image component corresponding to the current unit; if the value of the first syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit by the samples of the adjacent regions of the current unit.

[0292] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to true and the second value can be set to false. This application does not impose any specific limitations.

[0293] In this embodiment, the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, which can be understood as selecting the current unit or the corresponding co-location of the current unit as the template region of the current unit to determine the template cost of the candidate model information; the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, which can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0294] In the embodiments of this application, the first syntax element identification information can be a syntax element of the SPS layer, PPS layer, ph layer or sh layer, used to indicate whether the scheme of determining the inter-component prediction model information of the current unit through the samples of the first image component corresponding to the current unit is enabled.

[0295] For example, in some embodiments, it is assumed that the first syntax element identification information is a syntax element of the SPS layer, that is, an identifier sps_seq_inter_ccp_merge_tmpl_type (first syntax element identification information) is added to the SPS layer to indicate the template type used for sorting / selection in the cross-component prediction merging mode. A syntax element sps_seq_inter_ccp_merge_tmpl_type of 0 indicates that the adjacent regions of the current cell are used as the template region, and a syntax element sps_seq_inter_ccp_merge_tmpl_type of 1 indicates that the brightness prediction / reconstruction block corresponding to the current cell is used as the template region. Alternatively, a syntax element sps_seq_inter_ccp_merge_tmpl_type of 1 indicates that the adjacent regions of the current cell are used as the template region, and a syntax element sps_seq_inter_ccp_merge_tmpl_type of 0 indicates that the brightness prediction / reconstruction block corresponding to the current cell is used as the template region.

[0296] In the embodiments of this application, the bitstream is decoded to determine the second syntax element identification information; when the value of the second syntax element identification information is a first value, the second syntax element identification information indicates that it is currently allowed or adopted to determine the inter-component prediction model information of the current unit through the prediction samples of the first image component corresponding to the current unit; when the value of the second syntax element identification information is a second value, the second syntax element identification information indicates that it is currently allowed or adopted to determine the inter-component prediction model information of the current unit through the reconstruction samples of the first image component corresponding to the current unit; when the value of the second syntax element identification information is a third value, the second syntax element identification information indicates that the inter-component prediction model information of the current unit is determined through the samples of the adjacent regions of the current unit.

[0297] In this embodiment, some syntax element-based indication information or flags can be written into the bitstream. By parsing the values ​​of these syntax elements in the bitstream, the relevant decoding information for the current unit can be determined. For example, whether the current image allows or uses samples from the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit, whether the prediction samples from the first image component are used to determine the inter-component prediction model information of the current unit, and / or whether the reconstructed samples from the first image component are used to determine the inter-component prediction model information of the current unit.

[0298] In some embodiments, the second syntax element identification information in the parsed bitstream is used to indicate whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit, and at the same time to indicate whether the current unit determines the inter-component prediction model information of the current unit through the prediction samples or reconstruction samples of the first image component.

[0299] In this embodiment, if the value of the second syntax element identifier is a first value, then the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component corresponding to the current unit; if the value of the second syntax element identifier is a second value, then the inter-component prediction model information of the current unit is determined by the reconstruction samples of the first image component corresponding to the current unit; if the value of the second syntax element identifier is a third value, then the current unit determines the inter-component prediction model information of the current unit by the samples of the adjacent regions of the current unit.

[0300] For example, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2. This application does not impose any specific limitations.

[0301] In the embodiments of this application, the second syntax element identification information can be a syntax element of the SPS layer, PPS layer, ph layer or sh layer, used to indicate whether the scheme of determining the inter-component prediction model information of the current unit through samples of the second image component corresponding to the current unit is enabled.

[0302] For example, in some embodiments, it is assumed that the second syntax element identification information is a syntax element of the SPS layer, that is, the identifier sps_seq_inter_ccp_merge_tmpl_type (second syntax element identification information) is added to the SPS layer to indicate the template type used for sorting / selection in the cross-component prediction merging mode. A value of 0 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the adjacent regions of the current cell are used as the template region; a value of 1 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the brightness prediction block corresponding to the current cell is used as the template region; and a value of 1 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the brightness reconstruction block corresponding to the current cell is used as the template region.

[0303] In the embodiments of this application, the bitstream is decoded to determine the third syntax element identification information; when the value of the third syntax element identification information is a first value, the third syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by the samples of the first image component; when the value of the third syntax element identification information is a second value, the third syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by the samples of the adjacent regions of the current unit.

[0304] In this embodiment, some instruction information in the form of syntax elements or flag bits can be written into the bitstream. In this way, by parsing the values ​​of the syntax elements in the bitstream, the relevant decoding information of the current unit can be determined, such as whether the current unit determines the inter-component prediction model information of the current unit through the samples of the first image component.

[0305] In some embodiments, the third syntax element identification information in the parsed bitstream is used to indicate whether the current unit determines the inter-component prediction model information of the current unit through samples of the first image component.

[0306] In this embodiment, if the value of the third syntax element identifier information is a first value, then the current unit determines the inter-component prediction model information of the current unit through samples of the first image component; if the value of the third syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit.

[0307] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to true and the second value can be set to false. This application does not impose any specific limitations.

[0308] In this embodiment, the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, which can be understood as selecting the current unit or the corresponding co-location of the current unit as the template region of the current unit to determine the template cost of the candidate model information; the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, which can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0309] In the embodiments of this application, the third syntax element identification information can be a syntax element of the CU layer.

[0310] In the embodiments of this application, the bitstream is decoded to determine the fourth syntax element identification information; when the value of the fourth syntax element identification information is a first value, the fourth syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component; when the value of the fourth syntax element identification information is a second value, the fourth syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by the reconstruction samples of the first image component; when the value of the fourth syntax element identification information is a third value, the fourth syntax element identification information indicates that the inter-component prediction model information of the current unit is determined by the samples of the adjacent regions of the current unit.

[0311] In this embodiment, some syntax element-based indication information or flags can be written into the bitstream. By parsing the values ​​of these syntax elements in the bitstream, the relevant decoding information of the current unit can be determined. For example, whether the current unit determines its inter-component prediction model information using samples from the first image component, whether it uses prediction samples from the first image component to determine its inter-component prediction model information, and / or whether it uses reconstructed samples from the first image component to determine its inter-component prediction model information.

[0312] In some embodiments, the fourth syntax element identification information in the parsed bitstream is used to indicate whether the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, and at the same time to indicate whether the current unit determines the inter-component prediction model information of the current unit through the prediction samples or the reconstructed samples of the first image component.

[0313] In this embodiment, if the fourth syntax element identifier information is a first value, then the current unit determines the inter-component prediction model information of the current unit through the prediction samples of the first image component; if the fourth syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit through the reconstruction samples of the first image component; if the fourth syntax element identifier information is a third value, then the current unit determines the inter-component prediction model information of the current unit through the samples of the adjacent regions of the current unit.

[0314] For example, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2. This application does not impose any specific limitations.

[0315] In the embodiments of this application, the fourth syntax element identification information can be a syntax element of the CU layer.

[0316] In the embodiments of this application, the current unit determines the inter-component prediction model information of the current unit through the predicted samples or reconstructed samples of the first image component. This can be understood as selecting the current unit and / or the corresponding co-location region of the current unit as the template region of the current unit to determine the template cost of the candidate model information. The current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit. This can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0317] In the embodiments of this application, if the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, that is, the current unit uses the adjacent regions of the current unit as the template regions of the current unit to determine the template cost of the candidate model information, then after the candidate list is constructed, it is necessary to calculate the template cost of each CCP candidate and reorder the candidate list in ascending order of template cost.

[0318] The template type is determined based on the availability of adjacent reference samples. If none of the adjacent reference samples of the current cell are available, the first CCP candidate in the candidate list or the CCP candidate at a specified position is selected as the final CCP pattern. Otherwise:

[0319] When the reference samples on the upper left, upper, and left sides are all available, the template shape is as shown in Figure 19.

[0320] When only the left reference sample is available, the template shape is as shown in Figure 20.

[0321] When only the upper reference sample is available, the template shape is as shown in Figure 21.

[0322] When only the left and upper left reference samples are available, the template shape is as shown in Figure 22.

[0323] When only the left and lower left reference samples are available, the template shape is as shown in Figure 23.

[0324] When only the top and upper right reference samples are available, the template shape is as shown in Figure 24.

[0325] There are several options for the cost function used to calculate the cost of the template area. For example, evaluation criteria such as Sum of Absolute Errors (SAD), Sum of Transformed Absolute Errors (SATD), Sum of Squared Differences (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Rate Distortion Function (RDO) can be selected. Each evaluation criterion mentioned below can be chosen from these criteria. Taking the SAD evaluation criterion as an example, the calculation formula is as follows:

[0326] Where Ti and T are the chromaticity prediction value of CCP performed in the adjacent template region of the current cell and the chromaticity reconstruction value of the adjacent template region of the current cell, respectively, and M represents the number of samples in the template region. c is used to indicate the chromaticity component; for example, c = 1 represents the chromaticity component as Cr, and c = 0 represents the chromaticity component as Cb.

[0327] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows: SAD(T i ) = SAD(T i ,0)+SAD(T i ,1) (3)

[0328] Where Ti and T are the chromaticity prediction value of CCP performed in the adjacent template region of the current cell and the chromaticity reconstruction value of the adjacent template region of the current cell, respectively, and M represents the number of samples in the template region. c is used to indicate the chromaticity component; for example, c = 1 represents the chromaticity component as Cr, and c = 0 represents the chromaticity component as Cb.

[0329] In the embodiments of this application, the pattern with the smallest template matching can be selected as the final CCP pattern to be used.

[0330] In embodiments of this application, the first candidate mode can be selected directly after sorting as the final CCP mode.

[0331] For example, in some embodiments, the minimum matching cost item is first initialized as the first item in the candidate list, and the minimum matching cost value is the cost value corresponding to the first item in the candidate list; then, according to the order in which the candidate list was added, the matching cost of the pattern is checked in turn to see if it is less than the minimum matching cost value: if it is less, the minimum matching cost item is updated to the current candidate item, and the minimum matching cost value is the matching cost value corresponding to the current candidate item, and then the next candidate item is checked until the candidate list is checked; otherwise, the next candidate item is checked directly until the candidate list is checked.

[0332] This application provides a decoding method that determines a candidate list for the current unit; determines inter-component prediction model information for the current unit from the candidate list based on samples of the first image component corresponding to the current unit; determines a second prediction sample for the second image component of the current unit based on the inter-component prediction model information; and determines a reconstructed sample for the second image component of the current unit based on the second prediction sample. In other words, in this application, the inter-component prediction model information used by the current unit can be determined from the candidate list of the current unit using samples of the first image component. That is, the inter-component prediction model information used in the cross-component prediction process of the second image component can be determined using samples of the first image component. Since the corresponding first and second image components have a stronger correlation, the finally determined inter-component prediction model information is better able to express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve prediction accuracy and enhance encoding / decoding performance.

[0333] In another embodiment of this application, FIG25 is a flowchart illustrating an encoding method provided in an embodiment of this application. As shown in FIG25, the encoding method of the encoder may include the following steps:

[0334] Step 2501: Determine the candidate list for the current unit.

[0335] In this embodiment, the method is applied to the encoder. Based on the structure of the encoder 100 shown in Figure 5, the encoding method of this embodiment can be applied to the prediction part. Specifically, it can be an optimization method for determining the CCP model based on the InterCcpMerge candidate list, thereby improving the accuracy of CCP prediction.

[0336] In embodiments of this application, the current unit may include any one of the following units: current CU, current PU, and current TU. For example, the current unit may be the current CU.

[0337] Wherein, CU is an encoding unit, which may include one or more PUs or one or more TUs, and this application does not make specific limitations.

[0338] For example, in some embodiments, the current unit is the current CU, which includes one or more CBs. For instance, the current CU includes one CB, or the current CU includes two CBs, or the current CU includes three CBs.

[0339] In embodiments of this application, the candidate list for the current unit, such as the InterCcpMerge candidate list for the current unit, can be specific to the current unit. For example, for one or more current blocks included in the current unit, the candidate list of the current CU can be used.

[0340] In the embodiments of this application, the candidate list of the current unit may include one or more candidate model information, that is, the candidate list of the current unit may include one or more candidate component prediction model information.

[0341] In the embodiments of this application, the candidate list of the current unit can be understood as the InterCcpMerge candidate list. The InterCcpMerge candidate list includes one or more candidate CCP models (CCP model candidates, i.e., candidate model information). For example, the InterCcpMerge candidate list contains 12 CCP model candidates.

[0342] In some embodiments, when determining the candidate list for the current cell, the InterCcpMerge candidate list contains 12 CCP model candidates. Besides adding the CCP model predicted by applying intra-frame CCCM to the current cell, the list also includes, in sequence, spatially adjacent candidates, second-type shifted temporal candidates, temporal candidates, spatially non-adjacent candidates, history-based CCP candidates, first-type shifted temporal candidates, and a default CCP candidate, until the candidate list is full. During the process of adding CCP candidates, redundancy checks are performed, and non-repeating candidates are added to the candidate list.

[0343] In some embodiments, the candidate positions are as follows:

[0344] 2) Spatial adjacent and non-adjacent candidates.

[0345] As shown in Figure 8, the spatially adjacent candidate positions are numbered 1 to 5 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list. The spatially non-adjacent candidate positions are numbered 6 to 23 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list.

[0346] 2) Temporal Candidates

[0347] As shown in Figure 9, temporal candidates are derived from the co-location image, and the solid line blocks represent the co-location blocks of the current unit within the co-location image. Specifically, based on the co-location image index in the bitstream, the image corresponding to that index in the reference frame list is selected as the co-location image.

[0348] For example, taking Figure 2 as an example, the inclusion order of the time-domain candidates can be C01→C02→…→C0 10 If C0i is outside the image / slice boundary while C1i is inside the image / slice boundary, then C1i will be used instead of C0i, where 1≤i≤10. Otherwise, the next containing position will be selected.

[0349] 3) Shift-time domain candidates

[0350] As shown in Figure 10, the shifted temporal candidate is derived from the co-position image. The solid line block represents the co-position block on the co-position image after the current cell has undergone motion displacement. Therefore, the shifted temporal candidate position is the position after motion offset from the temporal candidate positions in Figure 4. Following the sequence C01→C02→…→C0 10 The available CCP candidates are searched sequentially. Based on the type of motion displacement, they are divided into first-class shift-time-domain candidates and second-class shift-time-domain candidates.

[0351] a) First type of shift-time domain candidate

[0352] As shown in Figure 11, the motion displacement of the first type of shift-time domain candidate is derived from the adjacent blocks of the current element. According to L0... B1 →L1 B1 →L0 A1 →L1 A1 →L0 B0 →L1 B0 →L0 A0 →L1 A0 →L0 B2 →L1 B2 The available motion vectors are searched sequentially. Here, L0x is the forward motion vector, and L1x is the backward motion vector. The first motion vector using the co-located image as a reference image is determined as the motion displacement. If no such motion vector is found, no first-class shift temporal candidate is added.

[0353] b) Second type of shift-time domain candidate

[0354] The motion displacement of the second type of shift time-domain candidate is derived based on the motion vector of the current element.

[0355] 4) Historical CCP Candidates

[0356] Historical CCP candidate selection involves storing CCP mode information from previously encoded blocks in an HCCP list of maximum length 6, used to construct the InterCcpMerge candidate list. The HCCP list is continuously updated during the encoding process. Redundancy checks are performed on existing candidates; if a newly inserted candidate is duplicated, it is removed. Finally, the list is maintained at its maximum length of 6 according to a First-In-First-Out (FIFO) principle; if adding a new candidate results in a list with more than 6 candidates, the first candidate is removed. The HCCP list's lifespan is one CTU row; it is cleared before the first CTU of each CTU row is encoded.

[0357] 5) Default CCP candidate

[0358] If there are still empty positions in the candidate list after sequentially checking the spatially adjacent candidates, the second type of shifted time-domain candidates, time-domain candidates, spatially non-adjacent candidates, historical CCP candidates, and the first type of shifted time-domain candidates, then the default CCP candidate will be added to the candidate list until the candidate list is full.

[0359] If there are no CCP candidates of the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0360] If there is a CCP candidate with the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, the scaling parameter of the first CCP candidate using CCLM, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0361] Step 2502: Based on the samples of the first image component corresponding to the current unit, determine the inter-component prediction model information of the current unit in the candidate list.

[0362] In the embodiments of this application, after determining the candidate list of the current unit, the inter-component prediction model information of the current unit can be further determined from the candidate list based on the samples of the first image component corresponding to the current unit.

[0363] In the embodiments of this application, the candidate list of the current unit can be understood as the InterCcpMerge candidate list, and the inter-component prediction model information of the current unit determined based on the candidate list of the current unit may include the CCP model used by the current unit.

[0364] In the embodiments of this application, the first image component and the second image component can be different image components of the current image, including but not limited to the first image component being a luminance component and the second image component being a chrominance component, or the first image component being a chrominance component and the second image component being a luminance component.

[0365] For example, in some embodiments, the first image component may be a luminance component, typically denoted by the symbol Y. The second image component may be a chrominance component, which may include a blue chrominance component (typically denoted by the symbols Cb or U) or a red chrominance component (typically denoted by the symbols Cr or V).

[0366] For example, in some embodiments, the first image component and the second image component can be represented in any color space, including but not limited to one or more of the following: CUY / Cb / Cr components, R / G / B components, X / Y / Z components, or other different color space representations. This application does not impose specific limitations.

[0367] In embodiments of this application, the current unit includes one or more image components (one or more color components).

[0368] For example, in some embodiments, in a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, a CU contains three CBs, namely one luminance CB and two chrominance CBs.

[0369] For example, in some embodiments, in a dual-tree partitioning scenario, i.e., when luminance and chrominance are partitioned separately, a CU contains one or two CBs, wherein a luminance CU contains one luminance CB and a chrominance CU contains two chrominance CBs.

[0370] In other words, in the embodiments of this application, a CU may include one or more image components, while a CB corresponds to only one color component.

[0371] In the embodiments of this application, the sample of the first image component corresponding to the current unit can be the sample of the first image component included in the current unit in a single-tree partitioning scenario, and the sample of the first image component of the co-located region corresponding to the current unit in a dual-tree partitioning scenario.

[0372] For example, in some embodiments, the first image component is a luminance component and the second image component is a chrominance component. In a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, the current unit includes samples of the luminance component and samples of the chrominance component.

[0373] For example, in some embodiments, the first image component is a luminance component and the second image component is a chrominance component. In a dual-tree partitioning scenario, i.e., when luminance and chrominance are partitioned separately, the current unit includes a sample of the chrominance component, and the sample of the luminance component corresponding to the current unit is the sample of the luminance component of the co-location region of the current unit.

[0374] In other words, in the embodiments of this application, the sample of the first image component corresponding to the current unit may include the sample of the first image component of the current unit when dividing by a single tree, or it may include the sample of the first image component of the co-located region corresponding to the current unit when dividing by a dual tree.

[0375] For example, in some embodiments, in a single-tree partitioning scenario, i.e., when luminance and chrominance are partitioned together, the current cell includes samples of the Y component, samples of the Cb component, and samples of the Cr component.

[0376] For example, in some embodiments, in a dual-tree partitioning scenario, i.e., where luminance and chrominance are partitioned separately, if the current cell is a chrominance cell, then the current cell includes samples of the Cb component and samples of the Cr component. If the current cell is a luminance cell, then the current cell includes samples of the Y component.

[0377] In the embodiments of this application, after constructing the candidate list of the current unit, the inter-component prediction model information of the current unit can be further determined from the candidate list of the current unit based on the samples of the first image component corresponding to the current unit. Specifically, determining the inter-component prediction model information of the current unit from the candidate list of the current unit based on the samples of the first image component corresponding to the current unit can be understood as using the current unit and / or its corresponding co-location region as the template region of the current unit to determine the template cost of the candidate model information in the candidate list of the current unit. Then, the candidate list of the current unit can be sorted using the determined template cost of the candidate model information, and / or, the inter-component prediction model information of the current unit can be determined from the candidate list using the determined template cost of the candidate model information.

[0378] In the embodiments of this application, in a single-tree partitioning scenario, the current unit can be used as the template region of the current unit to determine the template cost of the candidate model information. In a dual-tree partitioning scenario, the corresponding region of the current unit can be used as the template region of the current unit to determine the template cost of the candidate model information.

[0379] For example, in some embodiments, the current unit is the chroma unit to be decoded, i.e., the current chroma unit, and the corresponding region of the current unit is the decoded luminance unit, i.e., the luminance unit corresponding to the current chroma unit.

[0380] It should be noted that, in the embodiments of this application, the decoding method proposed in this application is illustrated by taking the current unit as the chroma unit, the corresponding region of the current unit as the corresponding luminance unit, the first image component as the luminance component, and the second image component as the chroma component.

[0381] In embodiments of this application, the samples of the first image component include predicted samples of the first image component and / or reconstructed samples of the first image component.

[0382] In some embodiments, the sample of the luminance block corresponding to the current chroma unit may include a luminance prediction sample (a prediction sample of the first image component) and a luminance reconstruction sample (a reconstruction sample of the first image component).

[0383] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the prediction sample of the first image component and the candidate model information in the candidate list; the inter-component prediction model information of the current unit is determined in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0384] In embodiments of this application, the chromaticity components include a first component and a second component. For example, the first component may be a Cr component and the second component may be a Cb component, or the first component may be a Cb component and the second component may be a Cr component; this application does not impose any specific limitations.

[0385] In embodiments of this application, the candidate model information in the candidate list includes first component candidate model information and second component candidate model information. For example, the candidate model information in the candidate list includes Cr component candidate model information and Cb component candidate model information.

[0386] In other words, in the embodiments of this application, the candidate model information may include different CCP models corresponding to different chromaticity components. Specifically, the Cr component candidate model information is used to predict the Cr component based on the Y component, and the Cb component candidate model information is used to predict the Cb component based on the Y component.

[0387] In embodiments of this application, the template prediction sample of the current unit determined based on the candidate model information in the candidate list may include: the first component template prediction sample of the current unit determined based on the first component candidate model information; and the second component template prediction sample of the current unit determined based on the second component candidate model information.

[0388] In embodiments of this application, the template prediction samples for the second image component of the current unit include template prediction samples for the first component and template prediction samples for the second component. For example, the template prediction samples for the second image component of the current unit include template prediction samples for the Cr component and template prediction samples for the Cb component.

[0389] For example, in some embodiments, assuming the first component is the Cr component, the Cr component template prediction sample of the second image component of the current unit is determined based on the reconstructed sample of the first image component and the Cr component candidate model information in the candidate list. Alternatively, the Cr component template prediction sample of the second image component of the current unit is determined based on the prediction sample of the first image component and the Cr component candidate model information in the candidate list.

[0390] For example, in some embodiments, assuming the second component is a Cb component, the Cb component template prediction sample of the second image component of the current unit is determined based on the reconstructed samples of the first image component and the Cb component candidate model information in the candidate list. Alternatively, the Cb component template prediction sample of the second image component of the current unit is determined based on the prediction samples of the first image component and the Cb component candidate model information in the candidate list.

[0391] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list of the current unit based on the sample of the first image component corresponding to the current unit, the current unit or the corresponding co-location region can be used as the template region of the current unit. Based on the prediction sample of the co-location region (i.e. the prediction sample of the luminance component corresponding to the current unit), one or more template prediction samples (chromaticity prediction values ​​corresponding to the candidate model information) of the chromaticity component of the current unit corresponding to one or more candidate model information are determined through one or more candidate model information in the candidate list. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on one or more template prediction samples of the chromaticity component corresponding to one or more candidate model information.

[0392] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the reconstructed samples of the first image component and the candidate model information in the candidate list; the inter-component prediction model information of the current unit is determined in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0393] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list of the current unit based on the samples of the first image component corresponding to the current unit, the current unit or the corresponding co-location region can be used as the template region of the current unit. Based on the reconstructed samples of the co-location region (i.e., the reconstructed samples of the luminance component corresponding to the current unit), one or more template prediction samples (chromaticity prediction values ​​corresponding to the candidate model information) of the chromaticity component of the current unit corresponding to one or more candidate model information can be determined through one or more candidate model information in the candidate list. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on the one or more template prediction samples of the chromaticity component corresponding to one or more candidate model information.

[0394] In embodiments of this application, the first prediction sample of the second image component of the current cell can be understood as the initial prediction sample of the chroma component of the current cell. For example, the first prediction sample of the second image component of the current cell may include the initial prediction value of the chroma component of the current cell obtained by inter-frame prediction or intra-frame block copying.

[0395] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the template cost of the candidate model information is determined based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit; and the inter-component prediction model information of the current unit is determined in the candidate list based on the template cost.

[0396] In the embodiments of this application, after determining one or more template prediction samples corresponding to one or more candidate model information for chromaticity components, the template cost corresponding to one or more candidate model information can be determined by combining the first prediction sample of the chromaticity component of the current unit. Then, the inter-component prediction model information of the current unit can be determined in the candidate list based on the template cost of the candidate model information.

[0397] In other words, in the embodiments of this application, when determining the template cost of the candidate model information of the candidate list of the current unit, the current unit and / or the corresponding co-location region of the current unit can be used as the template region of the current unit. That is, the predicted sample and / or reconstructed sample of the luminance component corresponding to the current unit are used, combined with the first predicted sample of the chrominance component of the current unit, to determine the template cost corresponding to the candidate model information.

[0398] In the embodiments of this application, when determining the template cost corresponding to the candidate model information, the template cost can be calculated by using a cost function based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit.

[0399] In embodiments of this application, the chromaticity components include a first component and a second component. Accordingly, the first prediction sample of the current unit includes a first component prediction sample and a second component prediction sample. For example, the first prediction sample of the current unit includes a Cr component prediction sample and a Cb component prediction sample.

[0400] In the embodiments of this application, when determining the template cost of candidate model information based on the first prediction sample of the current unit and the template prediction sample of the current unit, the first component template cost of candidate model information is determined based on the first component prediction sample and the first component template prediction sample; the second component template cost of candidate model information is determined based on the second component prediction sample and the second component template prediction sample; and the template cost of candidate model information is determined based on the first component template cost and the second component template cost.

[0401] For example, in some embodiments, when determining the template cost of candidate model information, for different chromaticity components, such as Cr and Cb components, the corresponding chromaticity component cost values ​​can be calculated based on the candidate model information, and then the sum of the different chromaticity component cost values ​​can be used as the template cost of the candidate model information.

[0402] For example, in some embodiments, assuming the first component is the Cr component and the second component is the Cb component, the Cr component template cost of the candidate model information can be determined based on the Cr component prediction sample and the Cr component template prediction sample; at the same time, the Cb component template cost of the candidate model information can be determined based on the Cb component prediction sample and the Cb component template prediction sample; finally, the sum of the Cr component template cost and the Cb component template cost can be determined as the template cost of the candidate model information.

[0403] In the embodiments of this application, the cost function for template cost can be selected from various options, including but not limited to: sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), rate distortion function (RDO), and other evaluation criteria. Any evaluation criterion mentioned below can be selected from the above criteria.

[0404] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows:

[0405] Where Ti is the template chromaticity prediction value (template prediction sample) generated by performing CCP on the current luminance prediction block (prediction sample of luminance component), T is the first chromaticity prediction value (first prediction sample of chromaticity component) of the current cell, and M represents the number of samples in the current chromaticity block. c is used to indicate the chromaticity component. For example, c = 1 represents the chromaticity component is the Cr component, and c = 0 represents the chromaticity component is the Cb component.

[0406] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows: SAD(T i ) = SAD(T i ,0)+SAD(T i ,1) (3)

[0407] Where Ti is the template chromaticity prediction value (template prediction sample) generated by performing CCP on the current luminance prediction block (prediction sample of luminance component), T is the first chromaticity prediction value (first prediction sample of chromaticity component) of the current cell, and M represents the number of samples in the current chromaticity block. c is used to indicate the chromaticity component. For example, c = 1 represents the chromaticity component is the Cr component, and c = 0 represents the chromaticity component is the Cb component.

[0408] For example, in some embodiments, after the candidate list is constructed, based on the candidate list, and according to the first prediction sample of the second image component and the prediction sample of the first image component of the current unit, the inter-component prediction model information of the current unit can be further determined from the candidate list.

[0409] For example, in some embodiments, after the candidate list is constructed, based on the candidate list, the inter-component prediction model information of the current unit can be further determined from the candidate list according to the first predicted sample of the second image component of the current unit and the reconstructed sample of the first image component.

[0410] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information with the smallest template cost in the candidate list can be determined as the inter-component prediction model information of the current unit.

[0411] In other words, in the embodiments of this application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information with the smallest template cost in the candidate list can be directly selected as the inter-component prediction model information of the current unit.

[0412] Exemplarily, in some embodiments, taking the evaluation criterion of SAD as an example, minSAD=candSAD[0]; optCand=cand[0]; for(i=1; i<numCand; i++){if(candSAD[i]<minSAD){minSAD=candSAD[i]; optCand=cand[i];}}. Herein, numCand is the number of pieces of candidate model information in the candidate list.

[0413] Exemplarily, in some embodiments, the candidate model information with the minimum template cost is first initialized as the first item of the candidate list, and the minimum template cost is the minimum template cost corresponding to the first item of the candidate list; then, in the adding order of the candidate list, it is sequentially checked whether the template cost of the model information is less than the minimum template cost: if it is less, the first item is updated to the current candidate (candidate model information) item, the minimum template cost is updated to the minimum template cost corresponding to the first item of the candidate list, and then the next candidate item is continuously checked until all items in the candidate list are checked; otherwise, the next candidate item is directly continuously checked until all items in the candidate list are checked.

[0414] In the embodiments of the present application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list may be sorted in ascending order of the template cost to obtain a sorted candidate list, and then the first piece of candidate model information in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0415] That is to say, in the embodiments of the present application, after the template cost of the candidate model information is determined based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list may be directly sorted according to the template cost, and then the inter-component prediction model information of the current unit is determined according to the sorted candidate list. For example, the first piece of candidate model information in the sorted candidate list is determined as the inter-component prediction model information of the current unit, or the K-th piece of candidate model information in the sorted candidate list is determined as the inter-component prediction model information of the current unit, where K is an integer greater than 0.

[0416] In the embodiments of the present application, first candidate index information (for example, ccpModeIndex) of the current unit may be determined based on the inter-component prediction model information of the current unit; and the first candidate index information of the current unit is written into the bitstream.

[0417] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; the first generation value of the candidate model information in the sorted candidate list is determined based on the rate-distortion optimization algorithm; and the candidate model information with the smallest first generation value in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0418] In other words, in the embodiments of this application, after determining the template cost of the candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list can be sorted in ascending order of template cost. Then, the first-generation value of the candidate model information in the sorted candidate list can be determined according to the rate-distortion optimization algorithm (e.g., RDO). Finally, the inter-component prediction model information of the current unit can be determined based on the first-generation value. For example, the candidate model information with the smallest first-generation value in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0419] In some embodiments, assuming the candidate list includes 12 candidate model information, the sorted candidate list includes 12 candidate model information. In this case, the value range of the first candidate index information of the current unit is 0-11, which is used to indicate the 12 candidate model information in the sorted candidate list respectively.

[0420] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of template cost, and the sorted candidate list is determined based on the top N candidate model information; where N is an integer greater than 0; the first generation value of the candidate model information in the sorted candidate list is determined based on the rate-distortion optimization algorithm; and the candidate model information with the smallest first generation value in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0421] That is to say, in the embodiments of the present application, after the template cost of the candidate model information is determined based on the sample of the first image component corresponding to the current unit, the candidate model information in the candidate list may be sorted in ascending order of the template cost, then a sorted candidate list is determined based on the top N pieces of candidate model information in the sorted order, then the first generation value of the candidate model information in the sorted candidate list may be determined according to a rate-distortion optimization algorithm (for example, RDO), and finally the inter-component prediction model information of the current unit may be determined based on the first generation value. For example, the candidate model information with the smallest first generation value in the sorted candidate list is determined as the inter-component prediction model information of the current unit.

[0422] It can be understood that, in the embodiments of the present application, determining the sorted candidate list based on the top N pieces of candidate model information in the sorted order can reduce codeword consumption. For example, the length of the candidate list is numCandInList, and the length of the sorted candidate list determined based on the top N pieces of candidate model information in the sorted order is N, where N is less than numCandInList. At this time, the first candidate index information candIdx of the current unit can be obtained by binarization according to N, which reduces codeword consumption and improves encoding and decoding efficiency compared with binarization according to numCandInList.

[0423] In some embodiments, it is assumed that the candidate list includes 12 pieces of candidate model information and N is 6, then the sorted candidate list obtained after sorting and screening includes 6 pieces of candidate model information. At this time, the value range of the first candidate index information of the current unit is 0-5, which is used to respectively indicate the 6 pieces of candidate model information in the sorted candidate list.

[0424] In the embodiments of the present application, when determining the inter-component prediction model information of the current unit in the candidate list based on the template cost, the candidate model information in the candidate list is sorted in ascending order of the template cost to determine a sorted candidate list; a template cost threshold is determined; an updated candidate list is determined based on the candidate model information in the sorted candidate list whose template cost is less than or equal to the template cost threshold; the first generation value of the candidate model information in the updated candidate list is determined based on the rate-distortion optimization algorithm; and the candidate model information with the smallest first generation value in the updated candidate list is determined as the inter-component prediction model information of the current unit.

[0425] In other words, in the embodiments of this application, after determining the template cost of candidate model information based on the samples of the first image component corresponding to the current unit, the candidate model information in the candidate list can be sorted in ascending order of template cost. For the sorted candidate list, candidate model information with template cost less than or equal to the determined template cost threshold is added to the updated candidate list. Then, the first-generation value of the candidate model information in the updated candidate list can be determined according to a rate-distortion optimization algorithm (e.g., RDO). Finally, the inter-component prediction model information of the current unit can be determined based on the first-generation value. For example, the candidate model information with the smallest first-generation value in the updated candidate list is determined as the inter-component prediction model information of the current unit.

[0426] In the embodiments of this application, the template cost threshold can be used to filter candidate model information. However, the embodiments of this application do not specifically limit the method for determining the template cost threshold.

[0427] For example, in some embodiments, a pre-set value can be determined as the template cost threshold.

[0428] For example, in some embodiments, the template cost threshold can be determined based on the template cost. For instance, the average template cost corresponding to the candidate template information in the candidate list can be calculated, and the result of the average calculation can be determined as the template cost threshold.

[0429] For example, in some embodiments, a template cost threshold can be determined based on the template cost. For instance, a minimum template cost can be determined, and then the template cost threshold can be determined based on the minimum template cost and a pre-set scaling factor.

[0430] For example, in some embodiments, a template cost threshold can be determined based on the template cost. For instance, the maximum template cost can be determined, and then the template cost threshold can be determined based on the maximum template cost and a pre-set scaling factor.

[0431] Therefore, in the embodiments of this application, one or more candidate model information can be selected dynamically by comparing the template cost threshold with the template cost of the candidate model information, that is, it is not necessary to know how many candidate model information to select in advance.

[0432] For example, in some embodiments, the candidate list is sorted from smallest to largest according to the matching error SAD (template cost) to obtain the sorted candidate list; at the same time, the template cost threshold can be determined according to the minimum template cost: thresholdSAD = factor × candSAD[0]. Where factor is the scaling factor, the updated candidate list can be constructed as follows: selectedCand[0] = cand[0]; numSelectedCand = 1; for(i = 1; i <numCand;i++){if(candSAD[i]<=thresholdSAD){selectedCand[numSelectedCand]=cand[i];numSelectedCand++;}}。

[0433] Step 2503: Determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit.

[0434] In the embodiments of this application, the second predicted sample of the second image component of the current unit can be understood as the compensated predicted value of the second image component of the current unit obtained by cross-component prediction through the inter-component prediction model information of the current unit.

[0435] For example, in some embodiments, the second predicted sample of the second image component of the current cell can be the predicted sample of the chromaticity component of the current cell obtained by the CCP model.

[0436] In the embodiments of this application, when determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit and the reconstructed sample of the first image component.

[0437] For example, in some embodiments, cross-component prediction can be performed using the CCP model (inter-component prediction model information of the current unit) based on the reconstructed value of the luminance block corresponding to the current chroma unit, to obtain the predicted value of the current chroma unit, that is, the second predicted sample of the second image component of the current unit.

[0438] In the embodiments of this application, the first image component is the luminance component, and the second image component is the chrominance component. When calculating the second chrominance prediction value (the second prediction sample of the second image component) of the current unit, as shown in Figure 12, the input data (InputData) is the reconstructed value of the Y component corresponding to the current unit, and the CCP Model is the inter-component prediction model information of the current unit obtained through step 2502. The output data (OutputData1 / 2) is the second prediction value of the Cb / Cr component of the current unit, that is, the second prediction sample of the second image component.

[0439] In some embodiments, the candidate mode with the lowest template cost is selected as the CCP mode of the current cell, and the CCP mode is applied to the luminance reconstruction value corresponding to the current cell to obtain the second chromaticity prediction value predChromaVal. The CCP modes allowed to be included in the InterCcpMerge candidate list are {CCLM, CCCM, GLM, InterCCCM}, where the CCCM mode includes {CCCM, GLCCCM, MDFCCCM, NSCCCM}, and the GLM mode includes {GLM0123, GLM4567}.

[0440] For example, in some embodiments, the formula for calculating the CCP mode is as follows:

[0441] 1) CCLM

[0442] CCLM is a cross-component linear model, and its calculation formula is as follows: predChromaVal = a×lumaVal + β (4)

[0443] Where, lumaVal is the downsampled sample corresponding to the current cell. lumaVal is the downsampled brightness reconstruction sample of the current cell.

[0444] 2) CCCM

[0445] a) CCCM

[0446] CCCM is a CCP mode that uses a 7-tap convolutional filter. Its calculation formula is as follows: predChromaVal = c0C + c1N+ c2S + c3E+ c4W + c5P(C)+ c6B (5) P(C)=(C×C+midVal)>>bitDepth(6) B = 1<<(bitDepth-1) (7)

[0447] As shown in Figure 13, the input of the 7-tap filter includes 5 spatially close brightness reconstruction samples (after downsampling), 1 nonlinear term P, and 1 offset term B.

[0448] b)GLCCCM

[0449] GLCCCM is a gradient and position-based CCP mode that uses a 7-tap filter. Its calculation formula is as follows: predChromaVal= c0C + c1Gy + c2Gx + c3Y+ c4X + c5P + c6B (8)

[0450] Wherein, parameters Y and X are the vertical and horizontal positions of the center brightness reconstruction sample C, and Gy and Gx are the vertical gradient and horizontal gradient, respectively. The calculation formulas are: Gy = (2N + NW + NE) - (2S + SW + SE) (9) Gx = (2W + NW + SW) - (2E + NE + SE) (10)

[0451] The positional relationship of the downsampled brightness samples in GLCCCM is shown in Figure 14.

[0452] c)MDFCCCM

[0453] MDFCCCM is a CCP model that applies multiple downsampling filters, and it is divided into three types:

[0454] Model 1: predChromaVal=c0×H(C)+c1×G1(C)+c2×G2(C)+c3×G3(C)+c4×P(H(C))+c5×P(G1(C))+c6×P(G2(C))+c7×X+c8×Y+c9×B(11)

[0455] Model 2: predChromaVal=c0×H(C)+c1×H(W)+c2×H(E)+c3×G1(C)+c4×G1(W)+c5×G1(E)+c6×P(H(C))+c7×P(H(W))+c8×P(H(E))+c9×X+c10×B(12)

[0456] Model 3: predChromaVal=c0×H(C)+c1×H(NE)+c2×H(SW)+c3×G3(C)+c4×G3(NE)+c5×G3(SW)+c6×P(H(C))+c7×P(H(NE))+c8×P(H(SW))+c9×Y+c10×B(13)

[0457] As shown in Figure 14, {NW, N, NE, W, C, E, SW, S, SE} represents the positional relationship of the luminance samples. As shown in Figure 15, {H, G1, G2, G3, G4} represents the downsampling filter type in MDFCCCM.

[0458] d)NSCCCM

[0459] NSCCCM is a CCP mode that uses unsampled luminance samples, meaning that chrominance samples are directly predicted from the original reconstructed luminance samples. Its calculation formula is as follows:

[0460] The positional relationship between the chroma samples and the unsampled luminance samples is shown in Figure 16. The filter consists of a 6-tap spatial term, 4 nonlinear terms, and 1 bias term.

[0461] 2) GLM

[0462] GLM is a gradient-based linear CCP mode, as shown in Figure 17. Its gradient G can be calculated from the brightness reconstruction samples using four Sobel operators.

[0463] a)GLM0123

[0464] The calculation formula is as follows: predChromaVal = α*G+β (15)

[0465] b)GLM4567

[0466] The calculation formula is as follows: predChromaVal = α0*G+α1C+α1β (16)

[0467] Where C is the brightness reconstruction sample after downsampling.

[0468] 4) InterCCCM

[0469] The model used in InterCCCM technology is an 8-tap filter consisting of 6 spatial luminance samples L0 to L5, a nonlinear term P, and a bias term B. redChromaVal=c0L0+c1L1+c2L2+c3L3+c4L4+c5L5 +c6P((L0+L3+1)>>1)+c7B (17)

[0470] Similar to NSCCCM, unsampled brightness samples are used to reconstruct the samples, and the sample locations are shown in Figure 16.

[0471] Step 2504: Based on the second predicted sample of the second image component of the current unit, determine the reconstructed sample of the second image component of the current unit.

[0472] In the embodiments of this application, after determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit can be further determined based on the second prediction sample of the second image component of the current unit.

[0473] In the embodiments of this application, when determining the second predicted sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit is determined based on the second predicted sample of the second image component of the current unit and the residual of the second image component of the current unit.

[0474] In some embodiments, after determining the second prediction sample of the second image component of the current unit through the inter-component prediction model information of the current unit, the second prediction sample of the second image component can be directly used as the final prediction sample of the second image component of the current unit. Then, the second image component of the current unit can be reconstructed by the second prediction sample of the second image component of the current unit and the residual of the second image component of the current unit, and the reconstructed sample of the second image component of the current unit can be determined.

[0475] In the embodiments of this application, when determining the second predicted sample of the second image component of the current unit based on the inter-component prediction model information of the current unit, the reconstructed sample of the second image component of the current unit is determined based on the first weight of the first predicted sample of the second image component of the current unit, the second weight of the second predicted sample of the second image component of the current unit, the first predicted sample of the second image component of the current unit, the second predicted sample of the second image component of the current unit, and the residual of the second image component of the current unit.

[0476] In some embodiments, after determining the second prediction sample of the second image component of the current unit through the inter-component prediction model information of the current unit, the second prediction sample of the second image component and the first prediction sample of the second image component of the current unit can be fused to obtain the final prediction sample of the second image component of the current unit. Then, the second image component of the current unit can be reconstructed by the final prediction sample of the second image component of the current unit and the residual of the second image component of the current unit to determine the reconstructed sample of the second image component of the current unit.

[0477] In the embodiments of this application, when fusing the second predicted sample of the second image component of the current unit and the first predicted sample of the second image component of the current unit, a first weight corresponding to the first predicted sample of the second image component can be determined first, and a second weight corresponding to the second predicted sample of the second image component of the current unit can be determined at the same time. Then, the first weight and the second weight are used to fuse the first predicted sample of the second image component of the current unit and the second predicted sample of the second image component of the current unit.

[0478] In the embodiments of this application, the specific values ​​of the first weight and the second weight are not specifically limited, and the sum of the first weight and the second weight can be 1.

[0479] In embodiments of this application, when determining weights during the fusion process, a first weight and a second weight can be determined based on preset weight parameters. These preset weight parameters can be used to determine the first weight and / or the second weight. For example, based on a preset weight parameter of w, the second weight is determined to be w, and the first weight is determined to be 1-w.

[0480] For example, in some embodiments, during the process of generating a prediction sample (third chromaticity prediction value) of the second image component of the current unit, a third chromaticity prediction value (predSamplesCb′ for the Cb component and predCrVal for the Cr component) is generated by weighting the second chromaticity prediction value (i.e., the second prediction sample of the second image component, predSamplesCb for the Cb component and predSamplesCr for the Cr component) with the first chromaticity prediction value (i.e., the first prediction sample of the second image component, predSamplesCb for the Cb component and predSamplesCr′ for the Cr component) according to the following formula is performed, thereby generating the third chromaticity prediction value (predSamplesCb′ for the Cb component and predSamplesCr′ for the Cr component). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (18) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (19)

[0481] Where w is the weighting weight. For example, w is 0.75.

[0482] In the embodiments of this application, when determining the weights in the fusion process, a first weight and a second weight can be determined from the candidate weight set of the current unit; the weight index information of the current unit is determined based on the first weight and the second weight; and the weight index information of the current unit is written into the bitstream.

[0483] For example, in some embodiments, the weighting weights can be predefined with an optional set of weights (candidate weight set), and then the weights in the fusion process can be determined based on the candidate weight set and weight index information used to determine the first weight and / or the second weight.

[0484] For example, in some embodiments, assuming the selected weight set is {0, 1 / N, 2 / N, ..., 1}, for example, when N is 4, the set is {0, 0.25, 0.5, 0.75, 1}. The encoder determines the optimal weight combination through RDO. For example, if w is determined to be 0.75, then the first weight is determined to be 1-w, which equals 0.25, and the second weight is w, which equals 0.75. Then, wIdx (weight index information) indicates the weighted weight in the bitstream, and the decoder obtains the weighted weight by decoding the bitstream.

[0485] In the embodiments of this application, when determining the weights in the fusion process, the residual value of the first sample is determined; wherein, the first sample is the first image component sample of the first predicted sample corresponding to the second image component of the current unit; the first weight and the second weight are determined based on the residual value of the first sample.

[0486] In some embodiments, the first weight and the second weight can also be adaptively determined based on the residual values ​​of the first sample. That is, for different second image component samples to be predicted in the current unit, the first weight and the second weight used can be different.

[0487] For example, in some embodiments, assuming the first image component is a luminance component and the second image component is a chrominance component, the weighting weight is determined based on the residual value of the luminance sample (the first sample, i.e., the first image component sample corresponding to the first predicted sample of the second image component of the current unit) at the chrominance sample location. For example, the smaller the residual value of the first sample, the more accurate the chrominance sample prediction at the corresponding location is considered, and the larger the weighting weight (first weight) of the chrominance prediction value (the first predicted value of chrominance) is; the larger the residual value of the first sample, the less accurate the chrominance sample prediction at the corresponding location is considered, and the smaller the weighting weight (first weight) of the chrominance prediction value (the first predicted value of chrominance) is.

[0488] In embodiments of this application, the current unit may include one or more sub-units. For a sub-unit of the current unit, based on the sample of the first image component corresponding to the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list; based on the inter-component prediction model information of the sub-unit of the current unit, the second prediction sample of the second image component of the sub-unit of the current unit is determined; based on the second prediction sample of the second image component of the sub-unit of the current unit, the reconstructed sample of the second image component of the sub-unit of the current unit is determined.

[0489] In other words, in the embodiments of this application, one or more sub-units of the current unit share a candidate list, namely the candidate list of the current unit. However, for a sub-unit of the current unit, the inter-component prediction model information to be used can be adaptively selected from the candidate list. That is, the inter-component prediction model information used by different sub-units may be different.

[0490] Accordingly, in the embodiments of this application, cross-component prediction can be performed using inter-component prediction model information adapted to the sub-unit for different sub-units, which can obtain more ideal prediction results.

[0491] For example, in some embodiments, for the sub-units of the current unit, the sub-units of the current unit or the corresponding co-position sub-regions of the sub-units can be selected as the template region of the sub-units of the current unit. Then, the template cost is calculated for the candidate model information in the candidate list based on the template region. Then, the inter-component prediction model information of the sub-units of the current unit is determined according to the template cost of the candidate model information. Finally, the inter-component prediction model information is used to perform cross-component prediction on the sub-units of the current unit.

[0492] In embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the predicted sample of the first image component corresponding to the sub-unit and / or the reconstructed sample of the first image component corresponding to the sub-unit.

[0493] In some embodiments, the sample of the luminance subunit corresponding to the chroma subunit of the current unit may include a luminance prediction sample (prediction sample of the first image component) and a luminance reconstruction sample (reconstruction sample of the first image component).

[0494] In the embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the predicted sample of the first image component corresponding to the sub-unit. When determining the inter-component prediction model information of the sub-unit of the current unit in the candidate list based on the sample of the first image component corresponding to the sub-unit of the current unit, the template prediction sample of the second image component of the sub-unit of the current unit is determined based on the predicted sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list. Based on the first predicted sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list.

[0495] In the embodiments of this application, the sample of the first image component corresponding to the sub-unit includes the reconstructed sample of the first image component corresponding to the sub-unit. When determining the inter-component prediction model information of the sub-unit of the current unit in the candidate list based on the sample of the first image component corresponding to the sub-unit of the current unit, the template prediction sample of the second image component of the sub-unit of the current unit is determined based on the reconstructed sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list.

[0496] In an embodiment of this application, Figure 26 is a flowchart illustrating an encoding method provided in an embodiment of this application. As shown in Figure 26, the encoding method performed by the encoder may further include the following steps:

[0497] Step 2601: Determine the candidate list for the current unit.

[0498] Step 2602: Based on the reconstructed samples of the first image component corresponding to the current unit and the candidate model information in the candidate list, determine the template prediction samples of the second image component of the current unit.

[0499] Step 2603: Determine the template cost of candidate model information based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit.

[0500] Step 2604: Determine the template prediction sample of the second image component of the current unit corresponding to the candidate model information with the minimum template cost in the candidate list as the second prediction sample of the second image component of the current unit.

[0501] Step 2605: Based on the second predicted sample of the second image component of the current unit, determine the reconstructed sample of the second image component of the current unit.

[0502] In embodiments of this application, the samples of the first image component include predicted samples of the first image component and / or reconstructed samples of the first image component.

[0503] In some embodiments, the sample of the luminance block corresponding to the current chroma unit may include a luminance prediction sample (a prediction sample of the first image component) and a luminance reconstruction sample (a reconstruction sample of the first image component).

[0504] In the embodiments of this application, when determining the inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component, the template prediction sample of the second image component of the current unit is determined based on the reconstructed sample of the first image component and the candidate model information in the candidate list; the template cost of the candidate model information is determined based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit.

[0505] In the embodiments of this application, based on the reconstructed samples of the first image component, the template prediction sample of the second image component of the current unit is determined using the candidate model information in the candidate list, and the template cost of the candidate model information is calculated using the template prediction sample of the second image component of the current unit. Then, the candidate model information with the smallest template cost in the candidate list can be considered as the inter-component prediction model information of the current unit. At this time, the template prediction sample of the second image component of the current unit obtained through the candidate model information with the smallest template cost can be directly determined as the second prediction sample of the second image component of the current unit.

[0506] In other words, in the embodiments of this application, in the scenario where the template cost of candidate model information in the candidate list is determined based on the reconstructed samples of the first image component, the determination of the inter-component prediction model information of the current unit can be skipped. Instead, the candidate model information with the minimum template cost can be directly found. The template prediction sample of the second image component of the current unit obtained by applying the candidate model information with the minimum template cost to the reconstructed samples of the first image component is used as the second prediction sample of the second image component obtained by the current unit through cross-component prediction using the inter-component prediction model information.

[0507] In the embodiments of this application, when the inter-component prediction model information of the current unit is determined by samples of the first image component, a first prediction generation value is determined by a rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by samples of the adjacent regions of the current unit, a second prediction generation value is determined by a rate-distortion cost algorithm; a first syntax element identification information is determined based on the first prediction generation value and the second prediction generation value, and the first syntax element identification information is written into the bitstream; wherein, the first syntax element information is used to indicate whether the current image allows or uses the inter-component prediction model information of the current unit to be determined by samples of the first image component corresponding to the current unit.

[0508] In the embodiments of this application, when determining the first syntax element identification information based on the first prediction generation value and the second prediction generation value, if the first prediction generation value is less than the second prediction generation value, the value of the first syntax element identification information is determined to be a first value to indicate that the inter-component prediction model information of the current unit is currently allowed or used by using samples of the first image component corresponding to the current unit; if the first prediction generation value is greater than or equal to the second prediction generation value, the value of the first syntax element identification information is determined to be a second value to indicate that the inter-component prediction model information of the current unit is determined by using samples of the adjacent regions of the current unit.

[0509] In this embodiment, some instruction information in the form of syntax elements or flags can be written into the bitstream. In this way, by parsing the values ​​of the syntax elements in the bitstream, the relevant decoding information of the current unit can be determined, such as whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit.

[0510] In some embodiments, a first syntax element identification information is written into the bitstream; wherein, the first syntax element identification information is used to indicate whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit.

[0511] In this embodiment of the application, if the value of the first syntax element identifier information is a first value, then the inter-component prediction model information of the current unit is determined by the samples of the first image component corresponding to the current unit; if the value of the first syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit by the samples of the adjacent regions of the current unit.

[0512] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to true and the second value can be set to false. This application does not impose any specific limitations.

[0513] In this embodiment, the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, which can be understood as selecting the current unit and / or the corresponding co-location region of the current unit as the template region of the current unit to determine the template cost of the candidate model information; the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, which can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0514] In the embodiments of this application, the first syntax element identification information can be a syntax element of the SPS layer, PPS layer, ph layer or sh layer, used to indicate whether the scheme of determining the inter-component prediction model information of the current unit through the samples of the first image component corresponding to the current unit is enabled.

[0515] For example, in some embodiments, it is assumed that the first syntax element identification information is a syntax element of the SPS layer, that is, an identifier sps_seq_inter_ccp_merge_tmpl_type (first syntax element identification information) is added to the SPS layer to indicate the template type used for sorting / selection in the cross-component prediction merging mode. A syntax element sps_seq_inter_ccp_merge_tmpl_type of 0 indicates that the adjacent regions of the current cell are used as the template region, and a syntax element sps_seq_inter_ccp_merge_tmpl_type of 1 indicates that the brightness prediction / reconstruction block corresponding to the current cell is used as the template region. Alternatively, a syntax element sps_seq_inter_ccp_merge_tmpl_type of 1 indicates that the adjacent regions of the current cell are used as the template region, and a syntax element sps_seq_inter_ccp_merge_tmpl_type of 0 indicates that the brightness prediction / reconstruction block corresponding to the current cell is used as the template region.

[0516] In the embodiments of this application, when the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component, a first prediction generation value is determined by the rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by the reconstruction samples of the first image component, a second prediction generation value is determined by the rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by the samples of the adjacent regions of the current unit, a third prediction generation value is determined by the rate-distortion cost algorithm; a second syntax element identification information is determined based on the first prediction generation value, the second prediction generation value, and the third prediction generation value, and the second syntax element identification information is written into the bitstream; wherein, the second syntax element information is used to indicate whether the current image allows or uses the determination of the inter-component prediction model information of the current unit by the samples of the first image component corresponding to the current unit.

[0517] In the embodiments of this application, when determining the second syntax element identification information based on the first prediction generation value, the second prediction generation value, and the third prediction generation value, if the first prediction generation value is less than the second prediction generation value and the first prediction generation value is less than the third prediction generation value, the value of the second syntax element identification information is determined to be a first value to indicate that the inter-component prediction model information of the current unit is currently allowed or used by using the prediction samples of the first image component corresponding to the current unit; if the second prediction generation value is less than or equal to the first prediction generation value and the second prediction generation value is less than the third prediction generation value, the value of the second syntax element identification information is determined to be a second value to indicate that the inter-component prediction model information of the current unit is currently allowed or used by using the reconstruction samples of the first image component corresponding to the current unit; if the third prediction generation value is less than or equal to the first prediction generation value and the third prediction generation value is less than or equal to the second prediction generation value, the value of the first syntax element identification information is determined to be a third value to indicate that the inter-component prediction model information of the current unit is determined by using the samples of the adjacent regions of the current unit.

[0518] In this embodiment, some syntax element-based indication information or flags can be written into the bitstream. By parsing the values ​​of these syntax elements in the bitstream, the relevant decoding information for the current unit can be determined. For example, whether the current image allows or uses samples from the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit, whether the prediction samples from the first image component are used to determine the inter-component prediction model information of the current unit, and / or whether the reconstructed samples from the first image component are used to determine the inter-component prediction model information of the current unit.

[0519] In some embodiments, a second syntax element identification information is written into the bitstream; wherein, the second syntax element identification information is used to indicate whether the current image allows or uses samples of the first image component corresponding to the current unit to determine the inter-component prediction model information of the current unit, and is also used to indicate whether the current unit determines the inter-component prediction model information of the current unit through the prediction samples or reconstruction samples of the first image component.

[0520] In this embodiment, if the value of the second syntax element identifier is a first value, then the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component corresponding to the current unit; if the value of the second syntax element identifier is a second value, then the inter-component prediction model information of the current unit is determined by the reconstruction samples of the first image component corresponding to the current unit; if the value of the second syntax element identifier is a third value, then the current unit determines the inter-component prediction model information of the current unit by the samples of the adjacent regions of the current unit.

[0521] For example, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2. This application does not impose any specific limitations.

[0522] In the embodiments of this application, the second syntax element identification information can be a syntax element of the SPS layer, PPS layer, ph layer or sh layer, used to indicate whether the scheme of determining the inter-component prediction model information of the current unit through samples of the second image component corresponding to the current unit is enabled.

[0523] For example, in some embodiments, it is assumed that the second syntax element identification information is a syntax element of the SPS layer, that is, the identifier sps_seq_inter_ccp_merge_tmpl_type (second syntax element identification information) is added to the SPS layer to indicate the template type used for sorting / selection in the cross-component prediction merging mode. A value of 0 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the adjacent regions of the current cell are used as the template region; a value of 1 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the brightness prediction block corresponding to the current cell is used as the template region; and a value of 1 for the syntax element sps_seq_inter_ccp_merge_tmpl_type indicates that the brightness reconstruction block corresponding to the current cell is used as the template region.

[0524] In the embodiments of this application, when the inter-component prediction model information of the current unit is determined by the samples of the first image component, the first prediction generation value is determined by the rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by the samples of the adjacent regions of the current unit, the second prediction generation value is determined by the rate-distortion cost algorithm; the third syntax element identification information is determined based on the first prediction generation value and the second prediction generation value, and the third syntax element identification information is written into the bitstream.

[0525] In the embodiments of this application, when determining the third syntax element identification information based on the first prediction generation value and the second prediction generation value, if the first prediction generation value is less than the second prediction generation value, the value of the third syntax element identification information is determined to be a first value to indicate that the inter-component prediction model information of the current unit is determined through samples of the first image component; if the first prediction generation value is greater than or equal to the second prediction generation value, the value of the third syntax element identification information is determined to be a second value to indicate that the inter-component prediction model information of the current unit is determined through samples of the adjacent regions of the current unit.

[0526] In this embodiment, some instruction information in the form of syntax elements or flag bits can be written into the bitstream. In this way, by parsing the values ​​of the syntax elements in the bitstream, the relevant decoding information of the current unit can be determined, such as whether the current unit determines the inter-component prediction model information of the current unit through the samples of the first image component.

[0527] In some embodiments, a third syntax element identification information is written into the bitstream; wherein the third syntax element identification information is used to indicate whether the current unit determines the inter-component prediction model information of the current unit through samples of the first image component.

[0528] In this embodiment, if the value of the third syntax element identifier information is a first value, then the current unit determines the inter-component prediction model information of the current unit through samples of the first image component; if the value of the third syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit.

[0529] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to true and the second value can be set to false. This application does not impose any specific limitations.

[0530] In this embodiment, the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, which can be understood as selecting the current unit and / or the corresponding co-location region of the current unit as the template region of the current unit to determine the template cost of the candidate model information; the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, which can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0531] In the embodiments of this application, the third syntax element identification information can be a syntax element of the CU layer.

[0532] In the embodiments of this application, when the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component, a first prediction generation value is determined by the rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by the reconstruction samples of the first image component, a second prediction generation value is determined by the rate-distortion cost algorithm; when the inter-component prediction model information of the current unit is determined by the samples of the adjacent regions of the current unit, a third prediction generation value is determined by the rate-distortion cost algorithm; a fourth syntax element identification information is determined based on the first prediction generation value, the second prediction generation value, and the third prediction generation value, and the fourth syntax element identification information is written into the bitstream.

[0533] In the embodiments of this application, when determining the fourth syntax element identification information based on the first prediction generation value, the second prediction generation value, and the third prediction generation value, if the first prediction generation value is less than the second prediction generation value and the first prediction generation value is less than the third prediction generation value, the fourth syntax element identification information is determined to be a first value to indicate that the inter-component prediction model information of the current unit is determined through the prediction samples of the first image component; if the second prediction generation value is less than or equal to the first prediction generation value and the second prediction generation value is less than the third prediction generation value, the fourth syntax element identification information is determined to be a second value to indicate that the inter-component prediction model information of the current unit is determined through the reconstruction samples of the first image component; if the third prediction generation value is less than or equal to the first prediction generation value and the third prediction generation value is less than or equal to the second prediction generation value, the third syntax element identification information is determined to be a third value to indicate that the inter-component prediction model information of the current unit is determined through the samples of the adjacent regions of the current unit.

[0534] In this embodiment, some syntax element-based indication information or flags can be written into the bitstream. By parsing the values ​​of these syntax elements in the bitstream, the relevant decoding information of the current unit can be determined. For example, whether the current unit determines its inter-component prediction model information using samples from the first image component, whether it uses prediction samples from the first image component to determine its inter-component prediction model information, and / or whether it uses reconstructed samples from the first image component to determine its inter-component prediction model information.

[0535] In some embodiments, a fourth syntax element identification information is written into the bitstream; wherein, the fourth syntax element identification information is used to indicate whether the current unit determines the inter-component prediction model information of the current unit through samples of the first image component, and at the same time to indicate whether the current unit determines the inter-component prediction model information of the current unit through prediction samples or reconstruction samples of the first image component.

[0536] In this embodiment, if the fourth syntax element identifier information is a first value, then the current unit determines the inter-component prediction model information of the current unit through the prediction samples of the first image component; if the fourth syntax element identifier information is a second value, then the current unit determines the inter-component prediction model information of the current unit through the reconstruction samples of the first image component; if the fourth syntax element identifier information is a third value, then the current unit determines the inter-component prediction model information of the current unit through the samples of the adjacent regions of the current unit.

[0537] For example, the first value can be set to 0, the second value can be set to 1, and the third value can be set to 2. This application does not impose any specific limitations.

[0538] In the embodiments of this application, the fourth syntax element identification information can be a syntax element of the CU layer.

[0539] In the embodiments of this application, the current unit determines the inter-component prediction model information of the current unit through the predicted samples or reconstructed samples of the first image component. This can be understood as selecting the current unit and / or the corresponding co-location region of the current unit as the template region of the current unit to determine the template cost of the candidate model information. The current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit. This can be understood as selecting the adjacent regions of the current unit as the template region of the current unit to determine the template cost of the candidate model information.

[0540] In the embodiments of this application, if the current unit determines the inter-component prediction model information of the current unit through samples of the adjacent regions of the current unit, that is, the current unit uses the adjacent regions of the current unit as the template regions of the current unit to determine the template cost of the candidate model information, then after the candidate list is constructed, it is necessary to calculate the template cost of each CCP candidate and reorder the candidate list in ascending order of template cost.

[0541] The template type is determined based on the availability of adjacent reference samples. If none of the adjacent reference samples of the current cell are available, the first CCP candidate in the candidate list or the CCP candidate at a specified position is selected as the final CCP pattern. Otherwise:

[0542] When the reference samples on the upper left, upper, and left sides are all available, the template shape is as shown in Figure 19.

[0543] When only the left reference sample is available, the template shape is as shown in Figure 20.

[0544] When only the upper reference sample is available, the template shape is as shown in Figure 21.

[0545] When only the left and upper left reference samples are available, the template shape is as shown in Figure 22.

[0546] When only the left and lower left reference samples are available, the template shape is as shown in Figure 23.

[0547] When only the top and upper right reference samples are available, the template shape is as shown in Figure 24.

[0548] There are several options for the cost function used to calculate the cost of the template area. For example, evaluation criteria such as Sum of Absolute Errors (SAD), Sum of Transformed Absolute Errors (SATD), Sum of Squared Differences (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Rate Distortion Function (RDO) can be selected. Each evaluation criterion mentioned below can be chosen from these criteria. Taking the SAD evaluation criterion as an example, the calculation formula is as follows:

[0549] Where Ti and T are the chromaticity prediction value of CCP performed in the adjacent template region of the current cell and the chromaticity reconstruction value of the adjacent template region of the current cell, respectively, and M represents the number of samples in the template region. c is used to indicate the chromaticity component; for example, c = 1 represents the chromaticity component as Cr, and c = 0 represents the chromaticity component as Cb.

[0550] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows: SAD(Ti ) = SAD(T i ,0)+SAD(T i ,1) (3)

[0551] Where Ti and T are the chromaticity prediction value of CCP performed in the adjacent template region of the current cell and the chromaticity reconstruction value of the adjacent template region of the current cell, respectively, and M represents the number of samples in the template region. c is used to indicate the chromaticity component; for example, c = 1 represents the chromaticity component as Cr, and c = 0 represents the chromaticity component as Cb.

[0552] In the embodiments of this application, the pattern with the smallest template matching can be selected as the final CCP pattern to be used.

[0553] In embodiments of this application, the first candidate mode can be selected directly after sorting as the final CCP mode.

[0554] For example, in some embodiments, the minimum matching cost item is first initialized as the first item in the candidate list, and the minimum matching cost value is the cost value corresponding to the first item in the candidate list; then, according to the order in which the candidate list was added, the matching cost of the pattern is checked in turn to see if it is less than the minimum matching cost value: if it is less, the minimum matching cost item is updated to the current candidate item, and the minimum matching cost value is the matching cost value corresponding to the current candidate item, and then the next candidate item is checked until the candidate list is checked; otherwise, the next candidate item is checked directly until the candidate list is checked.

[0555] This application provides an encoding method that determines a candidate list for the current unit; determines inter-component prediction model information for the current unit from the candidate list based on samples of the first image component corresponding to the current unit; determines a second prediction sample for the second image component of the current unit based on the inter-component prediction model information; and determines a reconstructed sample for the second image component of the current unit based on the second prediction sample. In other words, in this application, the inter-component prediction model information used by the current unit can be determined from the candidate list of the current unit using samples of the first image component corresponding to the current unit. That is, the inter-component prediction model information used in the cross-component prediction process of the second image component can be determined using samples of the first image component. Since the corresponding first and second image components have a stronger correlation, the finally determined inter-component prediction model information is better able to express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve prediction accuracy and enhance encoding / decoding performance.

[0556] Based on the above embodiments, another embodiment of this application proposes an encoding and decoding method that uses the current luminance prediction block (the current cell or its corresponding co-location region) as a template region, which is more similar to the texture of the current cell. Therefore, the optimal CCP model determined in this way can better express the correlation between components, thus improving prediction accuracy.

[0557] Currently, InterCcpMerge uses the adjacent reconstructed regions of the current cell as template regions to calculate template costs and sort the candidate list. When the texture of the current frame content is complex, the similarity between the reference regions above and to the left of the current cell and the current cell is not high, resulting in low accuracy of the chroma prediction value of the current cell, thus affecting video coding efficiency. To solve this problem, the encoding and decoding method proposed in this application selects to perform template sorting on the current luma prediction block, rather than using the adjacent regions of the current cell.

[0558] The encoding and decoding method proposed in this application can be understood as an optimization of InterCcpMerge, or as an extension and update of InterCcpMerge, and can be called the InterCcpMerge-BlkSort scheme.

[0559] In InterCcpMerge-BlkSort, when calculating the template cost for each CCP candidate, the current brightness prediction block (i.e., the prediction sample of the first image component corresponding to the current cell) can be used as the template region.

[0560] In InterCcpMerge-BlkSort, when calculating the template cost for each CCP candidate, the current brightness reconstruction block (i.e., the reconstructed sample of the first image component corresponding to the current unit) can also be used as the template region.

[0561] The following section details the prediction process of the proposed encoding / decoding method, taking the first image component as the luminance component, the second image component as the chrominance component, and the prediction sample (current luminance prediction block) of the first image component corresponding to the current unit as an example.

[0562] The inputs to InterCcpMerge-BlkSort are: the predicted value predSamplesY[x][y] of the first image component (in the color space composed of Y / Cb / Cr components, for example, luminance) corresponding to the current cell, the reconstructed value recSamplesY[x][y] of the first image component (in the color space composed of Y / Cb / Cr components, for example, luminance), and the first predicted value of the second image component (in the color space composed of Y / Cb / Cr components, for example, chrominance). For the color space composed of Y / Cb / Cr components, it is predSamplesCb[x1][y1] for Cb components and predSamplesCr[x1][y1] for Cr components, where x = 0..nTbW-1, y = 0..nTbH-1, x1 = 0..nTbWC-1, y1 = 0..nTbHC-1.

[0563] The output of InterCcpMerge-BlkSort is the third predicted value of the second image component of the current cell (in the color space composed of Y / Cb / Cr components, for example, chromaticity), where x = 0..nTbWC-1 and y = 0..nTbHC-1.

[0564] The InterCcpMerge-BlkSort technique's prediction process consists of four steps: S1, constructing a candidate list; S2, reordering the candidate list; S3, calculating the second predicted value of the second image component (taking the color space composed of Y / Cb / Cr components as an example, chromaticity) of the current cell; and S4, calculating the third predicted value of the second image component (taking the color space composed of Y / Cb / Cr components as an example, chromaticity) of the current cell.

[0565] S1. Construct the candidate list

[0566] The InterCcpMerge candidate list contains 12 CCP model candidates. Besides adding the CCP model predicted by applying intra-frame CCCM to the current cell, it also includes, in sequence, spatially adjacent candidates, second-type shifted-temporal candidates, temporal candidates, spatially non-adjacent candidates, history-based CCP candidates, first-type shifted-temporal candidates, and default CCP candidates, until the candidate list is full. During the addition of CCP candidates, redundancy checks are performed, and non-duplicate candidates are added to the candidate list. The positions of each type of candidate are as follows:

[0567] 1) Adjacent and non-adjacent candidates in airspace

[0568] As shown in Figure 8, the spatially adjacent candidate positions are numbered 1 to 5 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list. The spatially non-adjacent candidate positions are numbered 6 to 23 and checked in numerical order. If a usable CCP candidate exists in the reconstructed coded block at the corresponding numbered position, it is added to the candidate list.

[0569] 2) Temporal Candidates

[0570] As shown in Figure 9, temporal candidates are derived from the co-location image, and the solid line blocks represent the co-location blocks of the current unit within the co-location image. Specifically, based on the co-location image index in the bitstream, the image corresponding to that index in the reference frame list is selected as the co-location image.

[0571] For example, taking Figure 2 as an example, the inclusion order of the time-domain candidates can be C01→C02→…→C0 10 If C0i is outside the image / slice boundary while C1i is inside the image / slice boundary, then C1i will be used instead of C0i, where 1≤i≤10. Otherwise, the next containing position will be selected.

[0572] 3) Shift-time domain candidates

[0573] As shown in Figure 10, the shifted temporal candidate is derived from the co-position image. The solid line block represents the co-position block on the co-position image after the current cell has undergone motion displacement. Therefore, the shifted temporal candidate position is the position after motion offset from the temporal candidate positions in Figure 4. Following the sequence C01→C02→…→C0 10 The available CCP candidates are searched sequentially. Based on the type of motion displacement, they are divided into first-class shift-time-domain candidates and second-class shift-time-domain candidates.

[0574] a) First type of shift-time domain candidate

[0575] As shown in Figure 11, the motion displacement of the first type of shift-time domain candidate is derived from the adjacent blocks of the current element. According to L0... B1 →L1 B1 →L0 A1 →L1 A1 →L0 B0 →L1 B0 →L0 A0 →L1 A0 →L0 B2 →L1 B2 The available motion vectors are searched sequentially. Here, L0x is the forward motion vector, and L1x is the backward motion vector. The first motion vector using the co-located image as a reference image is determined as the motion displacement. If no such motion vector is found, no first-class shift temporal candidate is added.

[0576] b) Second type of shift-time domain candidate

[0577] The motion displacement of the second type of shift time-domain candidate is derived based on the motion vector of the current element.

[0578] 4) Historical CCP Candidates

[0579] Historical CCP candidate selection involves storing CCP mode information from previously encoded blocks in an HCCP list of maximum length 6, used to construct the InterCcpMerge candidate list. The HCCP list is continuously updated during the encoding process. Redundancy checks are performed on existing candidates; if a newly inserted candidate is duplicated, it is removed. Finally, the list is maintained at its maximum length of 6 according to a First-In-First-Out (FIFO) principle; if adding a new candidate results in a list with more than 6 candidates, the first candidate is removed. The HCCP list's lifespan is one CTU row; it is cleared before the first CTU of each CTU row is encoded.

[0580] 5) Default CCP candidate

[0581] If there are still empty positions in the candidate list after sequentially checking the spatially adjacent candidates, the second type of shifted time-domain candidates, time-domain candidates, spatially non-adjacent candidates, historical CCP candidates, and the first type of shifted time-domain candidates, then the default CCP candidate will be added to the candidate list until the candidate list is full.

[0582] If there are no CCP candidates of the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0583] If there is a CCP candidate with the CCLM model in the current candidate list, the default CCP candidate type is CCLM, and the set of possible scaling parameters is {0, the scaling parameter of the first CCP candidate using CCLM, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8, -3 / 8, 4 / 8, -4 / 8, 5 / 8, -5 / 8, 6 / 8}.

[0584] S2. Determine the CCP pattern (the pattern with the lowest template matching cost in the candidate list).

[0585] As shown in Figure 2, Input Data 1, Input Data 2, and Input Data 3 (InputData1 / 2 / 3) can be the reconstructed / predicted values ​​of the Y / Cb / Cr components corresponding to the current element, or the reconstructed / predicted values ​​of the R / G / B components, X / Y / Z components, or other representations of different color spaces corresponding to the current element. The CCP Model List is the InterCcpMerge candidate list obtained in step S1. The final CCP model is selected via the Selection module, thus determining the inter-component prediction model information for the current element. The embodiments in this application all use the space composed of Y / Cb / Cr components as an example for illustration.

[0586] After the candidate list is constructed, each CCP candidate is applied to the luminance prediction value corresponding to the current cell. The calculated template chromaticity prediction value (predCbValTpl for Cb components and predCrValTpl for Cr components) and the first chromaticity prediction value of the current cell are used to determine the template cost through the cost function. The candidate list is then reordered in ascending order of template cost.

[0587] There are several options for the cost function used to calculate the cost of the template area. For example, evaluation criteria such as Sum of Absolute Errors (SAD), Sum of Transformed Absolute Errors (SATD), Sum of Squared Differences (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Rate Distortion Function (RDO) can be selected. Each evaluation criterion mentioned below can be chosen from these criteria. Taking the SAD evaluation criterion as an example, the calculation formula is as follows:

[0588] Among them, T i To execute the template chromaticity prediction value (template prediction sample) generated by CCP on the current luminance prediction block (prediction sample of luminance component), T is the first chromaticity prediction value (first prediction sample of chromaticity component) of the current cell, and M represents the number of samples in the current chromaticity block. c is used to indicate the chromaticity component. For example, c is 1, which means the chromaticity component is the Cr component, and c is 0, which means the chromaticity component is the Cb component.

[0589] For example, in some embodiments, taking the evaluation criteria of SAD as an example, the formula for calculating template cost is as follows: SAD(T i ) = SAD(T i ,0)+SAD(T i ,1) (3)

[0590] Where Ti is the template chromaticity prediction value (template prediction sample) generated by performing CCP on the current luminance prediction block (prediction sample of luminance component), T is the first chromaticity prediction value (first prediction sample of chromaticity component) of the current cell, and M represents the number of samples in the current chromaticity block. c is used to indicate the chromaticity component. For example, c = 1 represents the chromaticity component is the Cr component, and c = 0 represents the chromaticity component is the Cb component.

[0591] The pattern with the smallest template match is selected as the final CCP pattern.

[0592] Alternatively, you can sort the candidate modes and directly select the first one as the final CCP mode to use.

[0593] When determining the CCP mode, after the candidate list is constructed, each CCP candidate is applied to the brightness reconstruction value (reconstruction sample of the first image component) corresponding to the current cell. The calculated template chromaticity prediction value (predCbValTpl for Cb component and predCrValTpl for Cr component) and the first chromaticity prediction value of the current cell are used to determine the template cost through the cost function, and the candidate list is reordered in descending order of template cost.

[0594] When determining the CCP mode, after the candidate list is constructed, the template region is indicated by the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) as either the adjacent region of the current cell or the luminance prediction value corresponding to the current cell. The encoder determines the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) through RDO, and the decoder obtains the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) from the decoded bitstream.

[0595] When determining the CCP mode, after the candidate list is constructed, the template region is indicated by the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) as either the adjacent region of the current cell or the luminance reconstruction value corresponding to the current cell. The encoder determines the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) through RDO, and the decoder obtains the template index tmpIdx (or the template takes the current cell identifier tmpCurrFlag) from the decoded bitstream.

[0596] When determining the CCP mode, after reordering the candidate list, the encoder selects the final CCP model through RDO and transmits the corresponding index ccpModeIndex, while the decoder obtains ccpModeIndex through the decoded bitstream.

[0597] When determining the CCP mode, the reordering of the candidate list can be skipped. The encoder selects the final CCP model through RDO and transmits the corresponding index ccpModeIndex. The decoder obtains ccpModeIndex through the decoded bitstream.

[0598] When determining the CCP pattern, template derivation can be performed using all sampled values, a subset of sampled values, or processed sampled values.

[0599] In the case of using partial sampled values, partial sampled values ​​can be obtained by intermittently downsampling the template.

[0600] In the case of using the processed sampled values, the result can be obtained by downsampling and filtering the sampled template.

[0601] For example, in some embodiments, when using the luminance prediction block / reconstruction block and chrominance prediction block corresponding to the current unit to participate in the template cost calculation, in order to reduce the computational complexity, some sample points in the luminance prediction block / reconstruction block and chrominance prediction block corresponding to the current unit can be allowed to participate in the template cost calculation.

[0602] For example, in some embodiments, the sampling steps xStep and yStep in the horizontal (x-direction) and vertical (y-direction) directions are determined based on the size of the current cell. If the top-left coordinate of the current cell is (xPred, yPred), then the sample point at (xPred + xStep × n, yPred + yStep × m) will participate in the template cost calculation. Here, n = 0..nMax and m = 0..mMax, and xStep × nMax is less than the width of the current cell, and yStep × mMax is less than the height of the current cell.

[0603] For example, in some embodiments, in the current unit, when the luma block and chroma block sizes are inconsistent (in YUV420 or YUV422 format), the current luma block and chroma block are each directly downsampled to the target size, without needing to first downsample the luma block to the same size as the chroma block and then downsample it together with the chroma block. In this case, the downsampling process of the chroma block is the same as described above, while the step size of the luma downsampling is scaled accordingly based on the current chroma space format (YUV420, YUV422, YUV444, etc.).

[0604] S3. Calculate the second chromaticity prediction value of the current cell.

[0605] As shown in Figure 3, the input data is the reconstructed value of the Y component corresponding to the current cell, and the CCP model is obtained in step S2. Output data 1 and output data 2 (OutputData1 / 2) are the second predicted values ​​of the Cb / Cr components of the current cell.

[0606] The candidate mode with the lowest template cost is selected as the final CCP mode. This CCP mode is then applied to the luminance reconstruction value corresponding to the current cell to obtain the second chromaticity prediction value, predChromaVal. The InterCcpMerge candidate list allows the inclusion of CCP modes {CCLM, CCCM, GLM, InterCCCM}, where CCCM modes include {CCCM, GLCCCM, MDFCCCM, NSCCCM}, and GLM modes include {GLM0123, GLM4567}. The specific calculation formula for the CCP mode is as follows:

[0607] 1) CCLM

[0608] CCLM is a cross-component linear model, and its calculation formula is as follows: predChromaVal = a×lumaVal + β (4)

[0609] Where, lumaVal is the downsampled sample corresponding to the current cell. lumaVal is the downsampled brightness reconstruction sample of the current cell.

[0610] 2) CCCM

[0611] a) CCCM

[0612] CCCM is a CCP mode that uses a 7-tap convolutional filter. Its calculation formula is as follows: predChromaVal = c0C + c1N+ c2S + c3E+ c4W + c5P(C)+ c6B (5) P(C)=(C×C+midVal)>>bitDepth(6) B = 1<<(bitDepth-1) (7)

[0613] As shown in Figure 13, the input of the 7-tap filter includes 5 spatially close brightness reconstruction samples (after downsampling), 1 nonlinear term P, and 1 offset term B.

[0614] b)GLCCCM

[0615] GLCCCM is a gradient and position-based CCP mode that uses a 7-tap filter. Its calculation formula is as follows: predChromaVal= c0C + c1Gy + c2Gx + c3Y+ c4X + c5P + c6B (8)

[0616] Wherein, parameters Y and X are the vertical and horizontal positions of the center brightness reconstruction sample C, and Gy and Gx are the vertical gradient and horizontal gradient, respectively. The calculation formulas are: Gy = (2N + NW + NE) - (2S + SW + SE) (9) Gx = (2W + NW + SW) - (2E + NE + SE) (10)

[0617] The positional relationship of the downsampled brightness samples in GLCCCM is shown in Figure 14.

[0618] c)MDFCCCM

[0619] MDFCCCM is a CCP model that applies multiple downsampling filters, and it is divided into three types:

[0620] Model 1: predChromaVal=c0×H(C)+c1×G1(C)+c2×G2(C)+c3×G3(C)+c4×P(H(C))+c5×P(G1(C))+c6×P(G2(C))+c7×X+c8×Y+c9×B(11)

[0621] Model 2: predChromaVal=c0×H(C)+c1×H(W)+c2×H(E)+c3×G1(C)+c4×G1(W)+c5×G1(E)+c6×P(H(C))+c7×P(H(W))+c8×P(H(E))+c9×X+c10×B(12)

[0622] Model 3: predChromaVal=c0×H(C)+c1×H(NE)+c2×H(SW)+c3×G3(C)+c4×G3(NE)+c5×G3(SW)+c6×P(H(C))+c7×P(H(NE))+c8×P(H(SW))+c9×Y+c10×B(13)

[0623] As shown in Figure 14, {NW, N, NE, W, C, E, SW, S, SE} represents the positional relationship of the luminance samples. As shown in Figure 15, {H, G1, G2, G3, G4} represents the downsampling filter type in MDFCCCM.

[0624] d)NSCCCM

[0625] NSCCCM is a CCP mode that uses unsampled luminance samples, meaning that chrominance samples are directly predicted from the original reconstructed luminance samples. Its calculation formula is as follows:

[0626] The positional relationship between the chroma samples and the unsampled luminance samples is shown in Figure 16. The filter consists of a 6-tap spatial term, 4 nonlinear terms, and 1 bias term.

[0627] 2) GLM

[0628] GLM is a gradient-based linear CCP mode, as shown in Figure 17. Its gradient G can be calculated from the brightness reconstruction samples using four Sobel operators.

[0629] a)GLM0123

[0630] The calculation formula is as follows: predChromaVal = α*G+β (15)

[0631] b)GLM4567

[0632] The calculation formula is as follows: predChromaVal = α0*G+α1C+α1β (16)

[0633] Where C is the brightness reconstruction sample after downsampling.

[0634] 4) InterCCCM

[0635] The model used in InterCCCM technology is an 8-tap filter consisting of 6 spatial luminance samples L0 to L5, a nonlinear term P, and a bias term B. redChromaVal=c0L0+c1L1+c2L2+c3L3+c4L4+c5L5 +c6P((L0+L3+1)>>1)+c7B (17)

[0636] Similar to NSCCCM, unsampled brightness samples are used to reconstruct the samples, and the sample locations are shown in Figure 16.

[0637] When calculating the second chromaticity prediction value of the current cell, the CCP model can be applied to some sample points in the current luminance reconstruction block. Therefore, the second chromaticity prediction value is calculated only for the chromaticity samples corresponding to a portion of the luminance sample positions, and the subsequent third chromaticity prediction value is then calculated. The correspondence between luminance sample positions and chromaticity sample positions is shown in Table 1.

[0638] Table 1

[0639] Here, `sps_chroma_format_idc` is the identifier for the chroma sampling format (color sampling format), used to determine the chroma sampling format. `xChroma` and `yChoma` are the chroma sample positions, and `xLuma` and `yLuma` are the luma sample positions.

[0640] For example, in some embodiments, the sampling steps xStep and yStep in the horizontal (x-direction) and vertical (y-direction) directions are determined based on the current cell size. If the top-left coordinate of the current cell is (xReco, yReco), then the sample point at (xReco + xStep × n, yReco + yStep × m) will be subject to the CCP model. Here, n = 0..nMax and m = 0..mMax, and xStep × nMax is less than the width of the current cell, and yStep × mMax is less than the height of the current cell.

[0641] For example, in some embodiments, in the current unit, when the luma block and chroma block sizes are inconsistent (in YUV420 or YUV422 format), the current luma block and chroma block are each directly downsampled to the target size, without needing to first downsample the luma block to the same size as the chroma block and then downsample it together with the chroma block. In this case, the downsampling process of the chroma block is the same as described above, while the step size of the luma downsampling is scaled accordingly based on the current chroma space format (YUV420, YUV422, YUV444, etc.).

[0642] S4. Calculate the predicted third chromaticity value of the current cell.

[0643] The second chromaticity prediction value obtained in step S3 (predCbVal for Cb components and predCrVal for Cr components) is weighted with the first chromaticity prediction value (predSamplesCb for Cb components and predSamplesCr for Cr components) according to the following formula to generate a third chromaticity prediction value (predSamplesCb′ for Cb components and predSamplesCr′ for Cr components). predSamplesCb′=w×predCbVal+(1-w)×predSamplesCb (18) predSamplesCr′=w×predCrVal+(1-w)×predSamplesCr (19)

[0644] Where w is the weighting weight. For example, w is 0.75.

[0645] In the process of calculating the third chromaticity prediction value of the current cell, the third chromaticity prediction value can also be obtained directly from the second chromaticity prediction value without weighting it with the first chromaticity prediction value.

[0646] During the calculation of the third chromaticity prediction value of the current unit, when the second chromaticity prediction value is weighted with the first chromaticity prediction value, the weighting weight can be predefined by an optional weight set (for example, the set of w is {0, 1 / N, 2 / N, ..., 1}, for example, when N is 4, the set is {0, 0.25, 0.5, 0.75, 1}). Then, wIdx indicates the weighting weight in the bitstream. The encoder determines the optimal weight combination through RDO, and the decoder obtains the weighting weight by decoding the bitstream.

[0647] In some embodiments, when weighting the second chromaticity prediction value and the first chromaticity prediction value, the weighting weight is determined based on the residual value of the luminance sample corresponding to the first chromaticity prediction value. The smaller the residual, the more accurate the chromaticity sample prediction at the corresponding position is considered, and the greater the weighting weight of the first chromaticity prediction value.

[0648] In some embodiments, the CCP model is used to obtain the third chromaticity prediction value corresponding to the current unit, and then combined with the chromaticity residual of the current unit obtained by decoding to finally obtain the chromaticity reconstruction value of the current unit.

[0649] In some embodiments, a second chromaticity prediction value corresponding to the current unit is obtained by using the CCP model, and then combined with the first chromaticity prediction value of the current unit and the residual of the chromaticity of the current unit obtained by decoding, to finally obtain the chromaticity reconstruction value of the current unit.

[0650] In the embodiments of this application, the current luminance prediction block is used as a template region to generate a second chromaticity prediction value for the current unit, thus determining a CCP model. One possible implementation is the sub-unit InterCcpMerge-BlkSort.

[0651] In some embodiments, the sub-unit InterCcpMerge-BlkSort divides the current unit into one or more sub-units by block size. Each luminance prediction sub-unit (or reconstruction sub-unit) and the corresponding chrominance prediction sub-unit serve as a template for the sub-unit region. A CCP model is selected for the sub-unit, and the luminance reconstruction value applied to the sub-unit generates the second and third chrominance prediction values ​​for the sub-unit.

[0652] In some embodiments, the CCP model is used to obtain the corresponding second chromaticity prediction value for the sub-unit. Then, the first and second chromaticity prediction values ​​of the sub-unit are fused together. The fused chromaticity prediction value is the third chromaticity prediction value of the sub-unit. This value is then combined with the chromaticity residual of the sub-unit obtained by decoding to finally obtain the chromaticity reconstruction value of the sub-unit.

[0653] In some embodiments, the CCP model is used to obtain the second chromaticity prediction value of the corresponding sub-unit, which is then combined with the first chromaticity prediction value of the sub-unit and the chromaticity residual obtained by decoding to finally obtain the chromaticity reconstruction value of the sub-unit.

[0654] This application provides an encoding / decoding method that can use samples of the first image component corresponding to the current unit to determine the inter-component prediction model information used by the current unit in the candidate list of the current unit. That is, the samples of the first image component can be used to determine the inter-component prediction model information used in the cross-component prediction process of the second image component. Since the corresponding first image component and second image component have a stronger correlation, the finally determined inter-component prediction model information can better express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve the accuracy of prediction and improve the encoding / decoding performance.

[0655] Based on the above embodiments, in another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG27 is a schematic diagram of the composition structure of an encoder proposed in an embodiment of this application. As shown in FIG27, the encoder 100 may include a first determining part 1101, wherein:

[0656] The first determining part 1101 is configured to determine a candidate list for the current unit; determine inter-component prediction model information of the current unit in the candidate list based on the sample of the first image component corresponding to the current unit; determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine the reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0657] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0658] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0659] Therefore, this application provides a computer-readable storage medium applied to an encoder 100, the computer-readable storage medium storing a computer program that, when executed by a first processor, implements the method described in any of the foregoing embodiments.

[0660] Based on the composition of the encoder 100 described above and the computer-readable storage medium, Figure 28 is a schematic diagram of the specific hardware structure of an encoder proposed in an embodiment of this application. As shown in Figure 28, the encoder 100 may include: a first communication interface 1201, a first memory 1202, and a first processor 1203; the various components are coupled together through a first bus system 1204. It can be understood that the first bus system 1204 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 1204 in the figure.

[0661] The first communication interface 1201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0662] The first memory 1202 is used to store computer programs that can run on the first processor 1203;

[0663] The first processor 1203 is configured to, when running the computer program, perform the following: determine a candidate list for the current unit; determine inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component corresponding to the current unit; determine a second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine a reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0664] It is understood that the first memory 1202 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1202 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0665] The first processor 1203 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1203 or by instructions in software form. The first processor 1203 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1202. The first processor 1203 reads the information in the first memory 1202 and completes the steps of the above method in conjunction with its hardware.

[0666] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0667] Alternatively, as another embodiment, the first processor 1203 is further configured to execute the method described in any of the foregoing embodiments when running the computer program.

[0668] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG29 is a schematic diagram of the composition structure of a decoder proposed in an embodiment of this application. As shown in FIG29, the decoder 200 may include a second determining part 2101, wherein:

[0669] The second determining part 2101 is configured to determine a candidate list for the current unit; determine inter-component prediction model information of the current unit in the candidate list based on the sample of the first image component corresponding to the current unit; determine the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine the reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0670] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0671] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applied to the decoder 200. This computer-readable storage medium stores a computer program, which, when executed by a second processor, implements the method described in any of the foregoing embodiments.

[0672] Based on the composition of the decoder 200 and the computer-readable storage medium described above, Figure 30 is a schematic diagram of the specific hardware structure of a decoder proposed in an embodiment of this application. As shown in Figure 30, the decoder 200 may include: a second communication interface 2201, a second memory 2202, and a second processor 2203; the various components are coupled together through a second bus system 2204. It is understood that the second bus system 2204 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 2204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 2204 in the figure.

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

[0674] The second memory 2202 is used to store computer programs that can run on the second processor 2203;

[0675] The second processor 2203 is configured to, when running the computer program, perform the following: determine a candidate list for the current unit; determine inter-component prediction model information of the current unit in the candidate list based on the samples of the first image component corresponding to the current unit; determine a second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit; and determine a reconstructed sample of the second image component of the current unit based on the second prediction sample of the second image component of the current unit.

[0676] Alternatively, as another embodiment, the second processor 2203 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0677] It is understood that the second memory 2202 has similar hardware functions to the first memory 1202, and the second processor 2203 has similar hardware functions to the first processor 1203; details will not be elaborated here.

[0678] In another embodiment of this application, FIG31 is a schematic diagram of the composition structure of an encoding and decoding system proposed in an embodiment of this application. As shown in FIG31, the encoding and decoding system 300 may include an encoder 100 and a decoder 200.

[0679] In the embodiments of this application, the encoder 100 may be any one of the encoders described in the foregoing embodiments, and the decoder 200 may be any one of the decoders described in the foregoing embodiments.

[0680] Furthermore, this embodiment provides a computer-readable storage medium for storing a bitstream generated by any of the encoding methods in the foregoing embodiments.

[0681] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0682] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

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

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

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

[0686] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability

[0687] This application provides an encoding / decoding method, an encoder, a decoder, and a storage medium. The encoder / decoder determines a candidate list for the current unit; based on samples of the first image component corresponding to the current unit, it determines inter-component prediction model information for the current unit from the candidate list; based on the inter-component prediction model information for the current unit, it determines a second prediction sample for the second image component of the current unit; and based on the second prediction sample for the second image component of the current unit, it determines a reconstructed sample for the second image component of the current unit. In other words, in this application's embodiments, the inter-component prediction model information used by the current unit can be determined from the candidate list of the current unit using samples of the first image component. That is, the inter-component prediction model information used in the cross-component prediction process of the second image component can be determined using samples of the first image component. Since the corresponding first and second image components have a stronger correlation, the finally determined inter-component prediction model information is better able to express the inter-component correlation. Therefore, cross-component prediction using this inter-component prediction model information can improve prediction accuracy and enhance encoding / decoding performance.

Claims

A decoding method, applied to a decoder, the method comprising: Determine the candidate list for the current cell; Based on the samples of the first image component corresponding to the current unit, the inter-component prediction model information of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit; Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of claim 1, wherein, The samples of the first image component include predicted samples of the first image component. The step of determining the inter-component prediction model information of the current unit based on the samples of the first image component corresponding to the current unit in the candidate list includes: Based on the predicted sample of the first image component and the candidate model information in the candidate list, the template predicted sample of the second image component of the current unit is determined; Based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the inter-component prediction model information of the current unit is determined in the candidate list. The method of claim 1, wherein, The samples of the first image component include reconstructed samples of the first image component. The step of determining the inter-component prediction model information of the current unit based on the samples of the first image component corresponding to the current unit in the candidate list includes: Based on the reconstructed sample of the first image component and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined; Based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the inter-component prediction model information of the current unit is determined in the candidate list. The method according to claim 2 or 3, wherein The determination of inter-component prediction model information for the current unit based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit in the candidate list includes: Based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit, the template cost of the candidate model information is determined; Based on the template cost, the inter-component prediction model information of the current unit is determined in the candidate list. The method of claim 4, wherein, The candidate model information in the candidate list includes first component candidate model information and second component candidate model information; The template prediction samples for the second image component of the current unit include: The first component template prediction sample of the current unit determined based on the first component candidate model information; The second component template prediction sample of the current unit is determined based on the second component candidate model information. The method of claim 5, wherein, The first prediction sample of the current unit includes a first component prediction sample and a second component prediction sample; The step of determining the template cost of the candidate model information based on the first predicted sample of the current unit and the template predicted sample of the current unit includes: Based on the first component prediction sample and the first component template prediction sample, the first component template cost of the candidate model information is determined; Based on the second component prediction sample and the second component template prediction sample, the second component template cost of the candidate model information is determined; Based on the template cost of the first component and the template cost of the second component, the template cost of the candidate model information is determined. The method of any one of claims 4 to 6, wherein, The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information with the lowest template cost in the candidate list is determined as the inter-component prediction model information of the current unit. The method of any one of claims 4 to 6, wherein, The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; Based on the first candidate index information of the current unit, the inter-component prediction model information of the current unit is determined in the sorted candidate list. The method of any one of claims 4 to 6, wherein, The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost, and the sorted candidate list is determined based on the top N candidate model information; where N is an integer greater than 0. Based on the first candidate index information of the current unit, the inter-component prediction model information of the current unit is determined in the sorted candidate list. The method of any one of claims 4 to 6, wherein, The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; Determine the template cost threshold; Based on the candidate model information in the sorted candidate list, where the template cost is less than or equal to the template cost threshold, an updated candidate list is determined. Based on the first candidate index information of the current unit, the inter-component prediction model information of the current unit is determined in the updated candidate list. The method of any one of claims 8 to 10, wherein The method further includes: Decode the bitstream to determine the first candidate index information of the current unit. The method of any one of claims 1 to 11, wherein The step of determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit includes: Based on the inter-component prediction model information of the current unit and the reconstructed sample of the first image component, a second prediction sample of the second image component of the current unit is determined. The method of any one of claims 1 to 12, wherein Determining the reconstructed sample of the second image component of the current unit based on the second predicted sample of the second image component of the current unit includes: Based on the second predicted sample of the second image component of the current unit and the residual of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of any one of claims 1 to 12, wherein Determining the reconstructed sample of the second image component of the current unit based on the second predicted sample of the second image component of the current unit includes: Based on the first weight of the first predicted sample of the second image component of the current unit, the second weight of the second predicted sample of the second image component of the current unit, the first predicted sample of the second image component of the current unit, the second predicted sample of the second image component of the current unit, and the residual of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of claim 14, wherein, The method further includes: Decode the bitstream to determine the weight index information of the current unit; Based on the weight index information of the current unit and the candidate weight set of the current unit, the first weight and the second weight are determined. The method of claim 14, wherein, The method further includes: The first weight and the second weight are determined based on preset weight parameters. The method of claim 14, wherein, The method further includes: Determine the residual value of the first sample; wherein the first sample is the first image component sample corresponding to the first predicted sample of the second image component of the current unit; The first weight and the second weight are determined based on the residual value of the first sample. The method of any one of claims 1 to 17, wherein The method further includes: Based on the samples of the first image component corresponding to the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the sub-units of the current unit. Based on the second predicted sample of the second image component of the sub-unit of the current unit, the reconstructed sample of the second image component of the sub-unit of the current unit is determined. The method of claim 18, wherein, The samples of the first image component corresponding to the sub-unit include the predicted samples of the first image component corresponding to the sub-unit. The step of determining the inter-component prediction model information of the sub-units of the current unit based on the samples of the first image component corresponding to the sub-unit of the current unit in the candidate list includes: Based on the predicted sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list. The method of claim 18, wherein, The samples of the first image component corresponding to the sub-unit include the reconstructed samples of the first image component corresponding to the sub-unit. The step of determining the inter-component prediction model information of the sub-units of the current unit based on the samples of the first image component corresponding to the sub-unit of the current unit in the candidate list includes: Based on the reconstructed sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list. The method of any one of claims 1 to 22, wherein, The method further includes: Decode the bitstream to determine the first syntax element identifier information; When the value of the first syntax element identification information is a first value, the first syntax element identification information indicates that the inter-component prediction model information of the current unit is currently allowed or adopted by using samples of the first image component corresponding to the current unit. When the value of the first syntax element identification information is the second value, the first syntax element identification information indicates that the inter-component prediction model information of the current unit is currently allowed or adopted by determining the current unit through samples from the neighboring regions of the current unit. The method of any one of claims 1 to 22, wherein The method further includes: Decode the bitstream to determine the identification information of the second syntax element; When the value of the second syntax element identification information is the first value, the second syntax element identification information indicates that the inter-component prediction model information of the current unit is currently allowed or adopted by using the prediction samples of the first image component. When the value of the second syntax element identification information is the second value, the second syntax element identification information indicates that the inter-component prediction model information of the current unit is currently allowed or adopted by using the reconstruction samples of the first image component; When the value of the second syntax element identifier information is a third value, the second syntax element identifier information indicates that the inter-component prediction model information of the current unit is currently allowed or adopted by using samples from the neighboring regions of the current unit. An encoding method, applied to an encoder, the method comprising: Determine the candidate list for the current unit; Based on the samples of the first image component corresponding to the current unit, the inter-component prediction model information of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit; Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of claim 23, wherein, The samples of the first image component include predicted samples of the first image component. The step of determining the inter-component prediction model information of the current unit based on the samples of the first image component corresponding to the current unit in the candidate list includes: Based on the predicted sample of the first image component and the candidate model information in the candidate list, the template predicted sample of the second image component of the current unit is determined; Based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the inter-component prediction model information of the current unit is determined in the candidate list. The method of claim 23, wherein, The samples of the first image component include reconstructed samples of the first image component. The step of determining the inter-component prediction model information of the current unit based on the samples of the first image component corresponding to the current unit in the candidate list includes: Based on the reconstructed sample of the first image component and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined; Based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit, the inter-component prediction model information of the current unit is determined in the candidate list. The method of claim 24 or 25, wherein, The determination of inter-component prediction model information for the current unit based on the first prediction sample of the second image component of the current unit and the template prediction sample of the second image component of the current unit in the candidate list includes: Based on the first predicted sample of the second image component of the current unit and the template predicted sample of the second image component of the current unit, the template cost of the candidate model information is determined; Based on the template cost, the inter-component prediction model information of the current unit is determined in the candidate list. The method of claim 26, wherein, The candidate model information in the candidate list includes first component candidate model information and second component candidate model information; The template prediction samples for the second image component of the current unit include: The first component template prediction sample of the current unit determined based on the first component candidate model information; The second component template prediction sample of the current unit is determined based on the second component candidate model information. The method of claim 27, wherein, The first prediction sample of the current unit includes a first component prediction sample and a second component prediction sample; The step of determining the template cost of the candidate model information based on the first predicted sample of the current unit and the template predicted sample of the current unit includes: Based on the first component prediction sample and the first component template prediction sample, the first component template cost of the candidate model information is determined; Based on the second component prediction sample and the second component template prediction sample, the second component template cost of the candidate model information is determined; Based on the template cost of the first component and the template cost of the second component, the template cost of the candidate model information is determined. The method of any one of claims 26 to 28, wherein The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information with the lowest template cost in the candidate list is determined as the inter-component prediction model information of the current unit. The method of any one of claims 26 to 28, wherein The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; The first-generation value of candidate model information in the sorted candidate list is determined based on the rate-distortion optimization algorithm. The candidate model information with the lowest value in the first generation from the sorted candidate list is determined as the inter-component prediction model information of the current unit. The method of any one of claims 26 to 28, wherein The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost, and the sorted candidate list is determined based on the top N candidate model information; where N is an integer greater than 0. The first-generation value of candidate model information in the sorted candidate list is determined based on the rate-distortion optimization algorithm. The candidate model information with the lowest value in the first generation from the sorted candidate list is determined as the inter-component prediction model information of the current unit. The method of any one of claims 26 to 28, wherein The step of determining the inter-component prediction model information of the current unit in the candidate list based on the template cost includes: The candidate model information in the candidate list is sorted in ascending order of template cost to determine the sorted candidate list; Determine the template cost threshold; Based on the candidate model information in the sorted candidate list, where the template cost is less than or equal to the template cost threshold, an updated candidate list is determined. The first-generation value of candidate model information in the updated candidate list is determined based on the rate-distortion optimization algorithm. The candidate model information with the lowest value in the first generation from the updated candidate list is determined as the inter-component prediction model information of the current unit. The method according to claims 30 to 32, wherein The method further includes: Based on the inter-component prediction model information of the current unit, determine the first candidate index information of the current unit; Write the first candidate index information of the current unit into the code stream. The method of any one of claims 25 to 33, wherein The step of determining the second prediction sample of the second image component of the current unit based on the inter-component prediction model information of the current unit includes: Based on the inter-component prediction model information of the current unit and the reconstructed sample of the first image component, a second prediction sample of the second image component of the current unit is determined. The method of any one of claims 25 to 34, wherein Determining the reconstructed sample of the second image component of the current unit based on the second predicted sample of the second image component of the current unit includes: Based on the second predicted sample of the second image component of the current unit and the residual of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of any one of claims 25 to 34, wherein Determining the reconstructed sample of the second image component of the current unit based on the second predicted sample of the second image component of the current unit includes: Based on the first weight of the first predicted sample of the second image component of the current unit, the second weight of the second predicted sample of the second image component of the current unit, the first predicted sample of the second image component of the current unit, the second predicted sample of the second image component of the current unit, and the residual of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. The method of claim 36, wherein, The method further includes: In the candidate weight set of the current unit, determine the first weight and the second weight; The weight index information of the current unit is determined based on the first weight and the second weight; Write the weight index information of the current unit into the bitstream. The method of claim 36, wherein, The method further includes: The first weight and the second weight are determined based on preset weight parameters. The method of claim 36, wherein, The method further includes: Determine the residual value of the first sample; wherein the first sample is the first image component sample corresponding to the first predicted sample of the second image component of the current unit; The first weight and the second weight are determined based on the residual value of the first sample. The method of any one of claims 25 to 39, wherein The method further includes: Based on the samples of the first image component corresponding to the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the sub-units of the current unit. Based on the second predicted sample of the second image component of the sub-unit of the current unit, the reconstructed sample of the second image component of the sub-unit of the current unit is determined. The method of claim 40, wherein, The samples of the first image component corresponding to the sub-unit include the predicted samples of the first image component corresponding to the sub-unit. The step of determining the inter-component prediction model information of the sub-units of the current unit based on the samples of the first image component corresponding to the sub-unit of the current unit in the candidate list includes: Based on the predicted sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list. The method of claim 40, wherein, The samples of the first image component corresponding to the sub-unit include the reconstructed samples of the first image component corresponding to the sub-unit. The step of determining the inter-component prediction model information of the sub-units of the current unit based on the samples of the first image component corresponding to the sub-unit of the current unit in the candidate list includes: Based on the reconstructed sample of the first image component corresponding to the sub-unit and the candidate model information in the candidate list, the template prediction sample of the second image component of the current unit is determined. Based on the first prediction sample of the second image component of the sub-unit of the current unit and the template prediction sample of the second image component of the sub-unit of the current unit, the inter-component prediction model information of the sub-unit of the current unit is determined in the candidate list. The method of any one of claims 25 to 42, wherein, The method further includes: When the inter-component prediction model information of the current unit is determined by the sample of the first image component corresponding to the current unit, the first prediction cost is determined by the rate-distortion cost algorithm. When the inter-component prediction model information of the current unit is determined by samples from the neighboring regions of the current unit, the second prediction generation value is determined by the rate-distortion cost algorithm. Based on the first predicted generation value and the second predicted generation value, the first syntax element identification information is determined and written into the bitstream; wherein, the first syntax element information is used to indicate whether the current image allows or uses the inter-component prediction model information of the current unit to be determined by the samples of the first image component corresponding to the current unit. The method of any one of claims 25 to 42, wherein, The method further includes: When the inter-component prediction model information of the current unit is determined by the prediction samples of the first image component, the first prediction cost is determined by the rate-distortion cost algorithm. In the case that the inter-component prediction model information of the current unit is determined by the reconstructed samples of the first image component, the second prediction value is determined by the rate-distortion cost algorithm. When the inter-component prediction model information of the current unit is determined by samples from the neighboring regions of the current unit, the third prediction value is determined by the rate-distortion cost algorithm. Based on the first prediction generation value, the second prediction generation value, and the third prediction generation value, the second syntax element identification information is determined and written into the bitstream; wherein, the second syntax element information is used to indicate whether the current image allows or uses the inter-component prediction model information of the current unit to be determined by the samples of the first image component corresponding to the current unit. An encoder, the encoder comprising a first determining unit, wherein: The first determining unit is configured to determine the candidate list of the current unit; Based on the samples of the first image component corresponding to the current unit, the inter-component prediction model information of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit; Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. An encoder, the encoder comprising a first memory and a first processor, wherein: The first memory is used to store computer programs that can run on the first processor; The first processor is configured to perform the method as described in any one of claims 23 to 44 when running the computer program. A decoder, the decoder comprising a second determining unit, wherein: The second determining unit is configured to determine the candidate list of the current unit; Based on the samples of the first image component corresponding to the current unit, the inter-component prediction model information of the current unit is determined in the candidate list; The second prediction sample of the second image component of the current unit is determined based on the inter-component prediction model information of the current unit; Based on the second predicted sample of the second image component of the current unit, the reconstructed sample of the second image component of the current unit is determined. A decoder, the decoder comprising a second memory and a second processor, wherein: The second memory is used to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 1 to 22 when running the computer program. A computer-readable storage medium having stored thereon a computer program, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 22, or the method as described in any one of claims 23 to 44. A computer-readable storage medium having a code stream stored thereon, wherein, The bitstream is generated by performing the steps of the encoding method as described in any one of claims 23 to 44.