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

By constructing the mapping relationship between the luminance component and the chrominance component in H.266/VVC, the problem of inaccurate chrominance prediction is solved, and more efficient chrominance prediction and codec performance is achieved.

WO2025138232A1PCT designated stage expired Publication Date: 2025-07-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/143587
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the video encoding standard H.266/VVC, when the chromaticity prediction mode is DC mode in the intra-block copy mode, the chromaticity prediction is inaccurate and the encoding efficiency is lost.

Method used

By determining the prediction parameters of the current block, the first reference prediction parameter set is constructed, and the mapping relationship between the luminance component and the chrominance component is used to predict the chrominance component, making full use of the correlation between the reconstructed sample and the current block sample, improving the accuracy of the chrominance prediction and saving code rate.

Benefits of technology

It improves the accuracy of chromaticity prediction and encoding and decoding efficiency, reduces code rate consumption, and improves encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023143587_03072025_PF_FP_ABST
    Figure CN2023143587_03072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses an encoding method, a decoding method, a code stream, an encoder, a decoder, and a storage medium. The method comprises: determining prediction parameters of a current block; on the basis of the prediction parameters, determining a first reference prediction parameter set of the current block, wherein the first reference prediction parameter set comprises one or more first candidate reference prediction parameters; on the basis of the first reference prediction parameter set, determining a first color component reference sample value and a second color component reference sample value of the current block; on the basis of the first color component reference sample value and the second color component reference sample value, determining a mapping relationship between a first color component and a second color component; and on the basis of the mapping relationship and a first color component sample value of the current block, determining a predicted value of the second color component of the current block. In this way, the uniformity of chroma prediction can be improved, the accuracy of chroma prediction can also be improved, the code rate can be saved, and the encoding and decoding efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

[0001] The present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] As demand for video display quality increases, new video applications such as HD and UHD video have emerged. The Joint Video Exploration Team (JVET) of the ISO / IEC and ITU-T international standards organizations has developed the video coding standard H.266 / Versatile Video Coding (VVC). Intrablock copy (IBC) is a block-level coding mode provided by VVC for video sequences with specific screen content.

[0003] In the related art, for the direct mode (DM), if the luminance block uses the IBC mode, the obtained chrominance mode is the DC mode. At this time, the intra-frame prediction mode of the chrominance mode cannot be properly determined, resulting in inaccurate chrominance prediction of the current block and loss of coding efficiency.

[0004] Summary of the Invention

[0005] The present application provides a coding and decoding method, a code stream, an encoder, a decoder and a storage medium, which can not only improve the uniformity of chrominance prediction, but also improve the accuracy of chrominance prediction, save bit rate, and thus improve coding and decoding efficiency.

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

[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0008] Determine the prediction parameters of the current block;

[0009] Determine a first reference prediction parameter set for the current block according to the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters;

[0010] Determining a first color component reference sample value and a second color component reference sample value of a current block according to a first reference prediction parameter set;

[0011] Determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value;

[0012] A predicted value of a second color component of the current block is determined according to the mapping relationship and the sample value of the first color component of the current block.

[0013] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0014] Determine the prediction parameters of the current block;

[0015] Determine a first reference prediction parameter set for the current block according to the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters;

[0016] Determining a first color component reference sample value and a second color component reference sample value of a current block according to a first reference prediction parameter set;

[0017] Determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value;

[0018] A predicted value of a second color component of the current block is determined according to the mapping relationship and the sample value of the first color component of the current block.

[0019] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:

[0020] The residual value of the second color component of the current block, the value of the filter identification information, the mapping relationship index value, the value of the first syntax element and the value of the second syntax element; wherein the filter identification information is used to indicate the downsampling method of the current block, the first syntax element is used to indicate whether the current block uses the first prediction mode, and the second syntax element is used to indicate whether the current block is allowed to use the first prediction mode.

[0021] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determination unit and a first prediction unit, wherein:

[0022] The first determining unit is configured to determine a prediction parameter of the current block; and determine a first reference prediction parameter set of the current block based on the prediction parameter; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters;

[0023] The first determining unit is further configured to determine a first color component reference sample value and a second color component reference sample value of the current block according to the first reference prediction parameter set; and determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value;

[0024] The first prediction unit is configured to determine a predicted value of the second color component of the current block according to the mapping relationship and the sample value of the first color component of the current block.

[0025] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor, wherein:

[0026] a first memory for storing a computer program capable of running on the first processor;

[0027] The first processor is configured to execute the method according to the second aspect when running a computer program.

[0028] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second determination unit and a second prediction unit, wherein:

[0029] The second determining unit is configured to determine a prediction parameter of the current block; and determine a first reference prediction parameter set of the current block based on the prediction parameter; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters;

[0030] The second determining unit is further configured to determine a first color component reference sample value and a second color component reference sample value of the current block according to the first reference prediction parameter set; and determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value;

[0031] The second prediction unit is configured to determine a predicted value of the second color component of the current block according to the mapping relationship and the sample value of the first color component of the current block.

[0032] In a seventh aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor, wherein:

[0033] a second memory for storing a computer program capable of running on the second processor;

[0034] The second processor is configured to execute the method according to the first aspect when running a computer program.

[0035] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the method described in the first aspect or the method described in the second aspect.

[0036] The embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. Whether it is an encoding end or a decoding end, the prediction parameters of the current block are determined; based on the prediction parameters, a first reference prediction parameter set of the current block is determined; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters; based on the first reference prediction parameter set, a first color component reference sample value and a second color component reference sample value of the current block are determined; based on the first color component reference sample value and the second color component reference sample value, a mapping relationship between the first color component and the second color component reference sample value is determined; based on the mapping relationship and the first color component sample value of the current block, a prediction value of the second color component of the current block is determined. In this way, if the current block uses the BVG-LUT mode, then the first reference prediction parameter set for the chroma component can be determined, and based on the first reference prediction parameter set, the luminance component reference sample value and the chroma component reference sample value of the current block are determined, thereby establishing a mapping relationship between the luminance component and the chroma component, and then using the mapping relationship to predict the chroma component. In other words, the correlation between the reconstructed samples in the current image and the current block samples is fully utilized here to improve the uniformity of the chrominance prediction, thereby improving the accuracy of the chrominance prediction; and according to the established mapping relationship, pixel-level prediction can also be effectively performed, which can further save bit rate, improve encoding and decoding efficiency, and thus improve encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] FIG1 is a schematic diagram of a process for obtaining reconstruction samples based on the IBC mode;

[0038] FIG2 is a schematic diagram of the position distribution of adjacent blocks provided in an embodiment of the present application;

[0039] FIG3 is a first schematic diagram of the positional relationship between a luminance block and a chrominance block provided in an embodiment of the present application;

[0040] FIG4A is a schematic block diagram of an encoder provided in an embodiment of the present application;

[0041] FIG4B is a schematic block diagram of a decoder according to an embodiment of the present application;

[0042] FIG5 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;

[0043] FIG6 is a flowchart diagram 1 of a decoding method provided in an embodiment of the present application;

[0044] FIG7 is a second flow chart of a decoding method provided in an embodiment of the present application;

[0045] FIG8 is a third flow chart of a decoding method provided in an embodiment of the present application;

[0046] FIG9 is a second schematic diagram of the positional relationship between a luminance block and a chrominance block provided in an embodiment of the present application;

[0047] FIG10 is a third schematic diagram of the positional relationship between a luminance block and a chrominance block provided in an embodiment of the present application;

[0048] FIG11 is a fourth schematic diagram of the positional relationship between a luminance block and a chrominance block provided in an embodiment of the present application;

[0049] FIG12 is a schematic diagram showing a structure of whether an offset position does not cover a current block according to an embodiment of the present application;

[0050] FIG13 is a schematic diagram showing a structure of whether an offset position exceeds a preset available area according to an embodiment of the present application;

[0051] FIG14 is a schematic diagram of a template type provided in an embodiment of the present application;

[0052] FIG15 is a schematic diagram of motion compensation of a template provided in an embodiment of the present application;

[0053] FIG16 is a schematic diagram showing the positions of a co-located brightness region and a reference brightness region provided in an embodiment of the present application;

[0054] FIG17A is a first schematic diagram of downsampling provided in an embodiment of the present application;

[0055] FIG17B is a second schematic diagram of downsampling provided in an embodiment of the present application;

[0056] FIG17C is a third downsampling schematic diagram provided in an embodiment of the present application;

[0057] FIG17D is a fourth downsampling schematic diagram provided in an embodiment of the present application;

[0058] FIG17E is a fifth downsampling schematic diagram provided in an embodiment of the present application;

[0059] FIG17F is a sixth schematic diagram of downsampling provided in an embodiment of the present application;

[0060] FIG18 is a fourth flow chart of a decoding method provided in an embodiment of the present application;

[0061] FIG19 is a fifth flow chart of a decoding method provided in an embodiment of the present application;

[0062] FIG20 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application;

[0063] FIG21 is a second flow chart of an encoding method provided in an embodiment of the present application;

[0064] FIG22 is a schematic diagram of a detailed flow chart of an encoding method provided in an embodiment of the present application;

[0065] FIG23 is a schematic diagram of a chroma prediction process based on BV provided in an embodiment of the present application;

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

[0067] FIG25 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0068] FIG26 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0069] FIG27 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0070] FIG28 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

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

[0073] In the following description, reference is 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. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0074] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0075] Coding Block (CB);

[0076] Intra block copy (IBC);

[0077] Screen Content Coding (SCC);

[0078] Block Matching (BM);

[0079] Coding Unit (CU);

[0080] Block Vector (BV);

[0081] Motion Vector (MV);

[0082] Direct Block Vector (DBV);

[0083] Block Vector Guided LUT (BVG-LUT);

[0084] Advanced Motion Vector Prediction (IBC Advanced Motion Vector Prediction, AMVP);

[0085] Cross-Component Linear Model prediction (CCLM);

[0086] Merge Mode

[0087] Planar Mode;

[0088] Sum of Absolute Difference (SAD);

[0089] Sum of Absolute Transformed Difference (SATD);

[0090] Mean Squared Error (MSE);

[0091] Root Mean Square Error (RMSE);

[0092] Mean Absolute Error (MAE);

[0093] Mean Absolute Deviation (MAD);

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

[0095] VVC Test Model (VTM), a reference software testing platform for VVC.

[0096] It can be understood that in a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, a video image can be represented in either the YCbCr format or the YUV format.

[0097] It can also be understood that IBC is an extended tool of VVC for encoding video sequences of screen content types, which significantly improves the encoding efficiency of screen content sequences. Specifically, IBC is a block-level encoding mode. Similar to inter-frame technology, the encoding end performs motion search, specifically by finding the best block vector for the current coding block through block matching, which can also be called a motion vector. Among them, the block vector is a vector pointing from the current block to the reference block. The difference from inter-frame technology is that the best block vector of IBC is obtained by searching in the reconstructed area of ​​the image where the current block is located (that is, the current coded image), while the inter-frame motion vector is obtained by searching other reference images outside the current coded image (for example, the reference image of the current coded image in the time domain).

[0098] In H.266 / VVC, the specific process of obtaining the reconstruction value of the current block in the IBC mode may include: deriving a block vector, deriving a prediction sample using the block vector, deriving a residual sample, and deriving a reconstructed sample using the prediction sample and the residual sample.

[0099] In a specific implementation, the process of obtaining a reconstruction sample in the IBC mode, as shown in FIG1 , may include:

[0100] S101: Derive block vector.

[0101] For the luma component, the inputs include: the luma position (xCb, yCb), which specifies the luma sample of the top-left corner of the current block relative to the top-left luma sample of the current image; a variable cbWidth, which specifies the width of the current block in luma samples; and a variable cbHeight, which specifies the height of the current block in luma samples. The output includes: bvL (Block Vector for Luma Samples). It should be noted that the current block containing luma samples is also called the "luma block."

[0102] Here, the IBC mode is divided into IBC MERGE mode and IBC AMVP mode. When deriving bvL, it is necessary to establish an IBC block vector candidate list bvCandList. The following will describe the process of establishing the IBC MERGE list in detail. The process of establishing the IBC AMVP list is the same as that of the IBC MERGE list, but the maximum number of candidates can be different.

[0103] Step 1: When IsGt4by4 is equal to TRUE (the variable IsGt4by4 is TRUE when the width multiplied by the height of the luminance block is greater than 16), determine the availability of spatial blocks and block vector candidates of the adjacent coding unit based on the luminance block position (xCb, yCb), the width cbWidth and the height cbHeight of the luminance block, and set the availability flags availableFlagA1 and availableFlagB1 of the adjacent blocks and the block vectors bvA1 and bvB1 accordingly. The relative positions of the adjacent blocks A1 and B1 with respect to the current block are shown in Figure 2.

[0104] Step 2: When IsGt4by4 is equal to TRUE, the pseudo code for constructing the block vector candidate list bvCandList is as follows:

[0105] Step 3: The variable numCurrCand (the number of candidates currently obtained) is derived as follows:

[0106] If IsGt4by4 is equal to TRUE, numCurrCand is set equal to the number of candidates in bvCandList; otherwise numCurrCand is set to 0.

[0107] Step 4: When numCurrCand is less than MaxNumIbcMergeCand (the maximum number of candidates in MERGE mode) and NumHmvpIbcCand (the maximum number of candidates for the historical optimal block vector Hmvp in IBC mode) is greater than 0, use bvCandList and numCurrCand as input, and the modified bvCandList and numCurrCand as output to call the history-based IBC block vector candidate derivation process specified in the decoding specification.

[0108] Step 5: When numCurrCand is less than MaxNumIbcMergeCand, the following applies until numCurrCand equals MaxNumIbcMergeCand:

[0109] bvCandList[numCurrCand][0] is set equal to 0 (the horizontal component of BV);

[0110] bvCandList[numCurrCand][1] is set equal to 0 (the vertical component of BV);

[0111] numCurrCand increases by 1.

[0112] In this way, the block vector candidate list bvCandList is established, and the candidate index bvIdx is derived as follows. general_merge_flag indicates whether it is IBC MERGE mode:

[0113] bvIdx=general_merge_flag[xCb][yCb]? merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb]

[0114] In this way, the specific bvL can be obtained according to the index bvIdx and the block vector candidate list bvCandList:

[0115] bvL[0]=bvCandList[bvIdx][0];

[0116] bvL[1]=bvCandList[bvIdx][1].

[0117] For the IBC AMVP mode, the specific bvL can be obtained by indexing bvIdx and the block vector candidate list bvCandList as the predicted bvL. The real bvL also needs to be added with the block vector difference (BVD). The specific process is as follows:

[0118] Step 1: Get the horizontal and vertical components of BVD. Where MvdL0 is the forward motion vector difference, the horizontal component of BVD is represented by bvd[0], and the vertical component of BVD is represented by bvd[1], as follows:

[0119] bvd[0]=MvdL0[xCb][yCb][0];

[0120] bvd[1]=MvdL0[xCb][yCb][1].

[0121] Step 2: Round the predicted bvL obtained above. The right shift parameter AmvrShift is used for rounding, and the left shift parameter AmvrShift is used to increase the resolution. The details are as follows:

[0122] Offset=(AmvrShift==0)? 0:((1<<(AmvrShift-1))-1);

[0123] bvL[0]=Sign(bvL[0])*(((Abs(bvL[0])+offset)>>AmvrShift)< <AmvrShift);

[0124] bvL[1]=Sign(bvL[1])*(((Abs(bvL[1])+offset)>>AmvrShift)< <AmvrShift)。

[0125] Step 3: For the real bvL, its range needs to be controlled within -2 17 to 2 17 –1, the specific derivation process is as follows:

[0126] u[0]=(bvL[0]+bvd[0]+2 18 )%2 18 ;

[0127] bvL[0]=(u[0]>=2 17 )?(u[0]-2 18 ):u[0];

[0128] u[1]=(bvL[1]+bvd[1]+2 18 )%2 18 ;

[0129] bvL[1]=(u[1]>=2 17 )?(u[1]-2 18 ):u[1].

[0130] For the chroma component, if it is a dual-tree partition, the chroma component does not perform IBC; if it is a single-tree partition, the BV of the chroma component needs to be derived.

[0131] The input includes: luminance bvL (1 / 16 pixel accuracy). The output includes: chroma block vector (Block Vector Chroma, bvC) (1 / 32 pixel accuracy). The specific derivation process is as follows:

[0132] bvC[0]=((bvL[0]>>(3+SubWidthC))*32);

[0133] bvC[1]=((bvL[1]>>(3+SubHeightC))*32).

[0134] S102: Use the block vector to derive a prediction sample.

[0135] Here, the input includes: the luma position (xCb, yCb), which specifies the top left sample of the current block relative to the top left luma sample of the current image; a variable cbWidth, which specifies the width of the current block in luma samples; a variable cbHeight, which specifies the height of the current block in luma samples; a block vector BV; and a variable cIdx, which specifies the color component index of the current block. The output includes: an array of predicted samples predSamples.

[0136] For the prediction sample, the specific derivation process is as follows:

[0137] When cIdx is equal to 0, that is, the luminance component, for x = xCb ... xCb + cbWidth - 1 and y = yCb ... yCb + cbHeight - 1:

[0138] xVb=(x+(bv[0]>>4))&(IbcBufWidthY-1);

[0139] yVb=(y+(bv[1]>>4))&(CtbSizeY-1);

[0140] predSamples[x][y]=ibcVirBuf[0][xVb][yVb].

[0141] Among them, IbcBufWidthY is the width of the brightness pixel of the reconstruction buffer unit (Buffer) stored in IBC, CtbSizeY is the size of CTU (Coding Tree Unit), and ibcVirBuf is the reconstructed pixel stored in IBC.

[0142] When cIdx is not equal to 0, that is, the chrominance component, for x=xCb / SubWidthC...xCb / SubWidthC+cbWidth / SubWidthC-1 and y=yCb / SubHeightC...yCb / SubHeightC+cbHeight / SubHeightC-1:

[0143] xVb=(x+(bv[0]>>(3+SubWidthC)))&(IbcBufWidthC-1);

[0144] yVb=(y+(bv[1]>>(3+SubHeightC)))&((CtbSizeY / subHeightC)-1);

[0145] predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb].

[0146] Among them, the variables SubWidthC and SubHeightC depend on the color sampling format specified by sps_chroma_format_idc, and the specific corresponding relationship is shown in Table 1.

[0147] Table 1

[0148] S103: derive residual samples.

[0149] Decode the code stream and determine the residual samples of the current block.

[0150] S104: derive reconstructed samples using the predicted samples and the residual samples.

[0151] Determining reconstructed samples of the current block based on the predicted samples and residual samples of the current block. For example, calculating a sum of the predicted samples and the residual of the current block, and setting the reconstructed samples of the current block equal to the sum; wherein the calculating process includes limiting the sum to a preset value range, and the preset value range is determined according to the bit depth of the reconstructed samples.

[0152] In another specific implementation, the derivation process of the chroma prediction mode in H.266 / VVC includes the following inputs: the luma position (xCb, yCb), which specifies the upper left corner sample of the current block relative to the upper left corner luma sample of the current image; a variable cbWidth, which specifies the width of the current block in luma samples; a variable cbHeight, which specifies the height of the current block in luma samples; and a variable treeType, which specifies whether to use single tree partitioning or dual tree partitioning. The output includes: the chroma intra prediction mode IntraPredModeC[xCb][yCb] and the MIP chroma direct mode flag MipChromaDirectFlag[xCb][yCb].

[0153] If treeType is equal to SINGLE_TREE, that is, in the case of single tree partitioning, sps_chroma_format_idc is equal to 3, that is, YUV444 format (4:4:4 format), intra_chroma_pred_mode is equal to 4, and IntraMipFlag[xCb][yCb] is equal to 1, that is, the prediction mode corresponding to the same-position luminance center block is MIP mode, then:

[0154] ① The MIP chroma direct mode flag MipChromaDirectFlag[xCb][yCb] is set to 1, that is, the chroma uses the luminance MIP mode.

[0155] ② The chroma intra prediction mode IntraPredModeC[xCb][yCb] is set equal to IntraPredModeY[xCb][yCb].

[0156] otherwise:

[0157] ① The MIP chroma direct mode flag MipChromaDirectFlag[xCb][yCb] is set to equal to 0.

[0158] ②The corresponding luma intra prediction mode lumaIntraPredMode is derived as follows:

[0159] If IntraMipFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, lumaIntraPredMode is set equal to INTRA_PLANAR.

[0160] Otherwise, if CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC or MODE_PLT, then lumaIntraPredMode is set equal to INTRA_DC.

[0161] Note: The IntraTmp mode is newly introduced in ECM. If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA and it is IntraTmp mode, lumaIntraPredMode is set to be equal to INTRA_PLANAR.

[0162] Otherwise, lumaIntraPredMode is set equal to IntraPredModeY[xCb+cbWidth / 2][yCb+cbHeight / 2].

[0163] ③ The chroma intra prediction mode IntraPredModeC[xCb][yCb] is derived as follows:

[0164] If cu_act_enabled_flag[xCb][yCb] is equal to 1, the chroma intra prediction mode IntraPredModeC[xCb][yCb] is set equal to lumaIntraPredMode.

[0165] otherwise:

[0166] If BdpcmFlag[xCb][yCb][1] is equal to 1, then IntraPredModeC[xCb][yCb] is set equal to BdpcmDir[xCb][yCb][1]? INTRA_ANGULAR50:INTRA_ANGULAR18.

[0167] Otherwise, cu_act_enabled_flag[xCb][yCb] is equal to 0 and BdpcmFlag[xCb][yCb][1] is equal to 0, the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, and lumaIntraPredMode as specified in Table 2.

[0168] Table 2

[0169] When sps_chroma_format_idc is equal to 2, chroma intra prediction mode X in Table 2 can be used to derive chroma intra prediction mode Y. For details, see the mapping process specification of mode X to mode Y shown in Table 3. Then, chroma intra prediction mode X is set equal to chroma intra prediction mode Y.

[0170] Table 3

[0171] In another specific implementation, for the DM mode, the DM mode refers to directly using the brightness prediction mode information of the corresponding position:

[0172] When dual-tree partitioning is used for an I-frame, the luma and chroma components are allowed to use independent block partitioning structures, such as the Dual Tree mode in H.266 / VVC. In this case, the luma component at the corresponding position of the chroma coding block may contain multiple luma coding blocks, as shown in Figure 3. In H.266 / VVC, when the value of intra_chroma_pred_mode is equal to 4, it indicates that the current chroma block is decoded using DM mode.

[0173] The intra-frame prediction mode of the chrominance block is determined based on the intra-frame prediction mode of the luminance block at the center of the luminance region corresponding to the chrominance block. The determination method can be to directly use the intra-frame prediction mode of the luminance block or to further derive the intra-frame prediction mode.

[0174] In actual implementation, the intra-frame prediction mode of the chrominance block can be determined by using the center coordinates of the luminance region corresponding to the same position of the chrominance block as a reference point and the intra-frame prediction mode of the luminance block containing the reference point. The determination method can be to directly use the intra-frame prediction mode of the luminance block or to further derive the intra-frame prediction mode.

[0175] In addition, in the embodiments of the present application, the block mentioned here may be a CU, or a sub-block, or a transform block, etc., without any limitation thereto.

[0176] The specific description of the coding block position taken by the DM mode is as follows:

[0177] Get the position of the current chroma block, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), scale chromaPos according to the color sampling format shown in Table 4, and obtain the position of the same luminance area corresponding to the current chroma block lumaPos = (xCb, yCb).

[0178] Table 4

[0179] The luminance position (xCb, yCb) specifies the position of the upper left luminance sample of the luminance area corresponding to the current chrominance block relative to the upper left luminance sample of the current image; a variable cbWidth specifies the width of the current block in luminance samples; a variable cbHeight specifies the height of the current block in luminance samples.

[0180] The positional relationship between the current chroma block and the corresponding luma area is shown in Figure 3. The central luma pixel position of the luma area corresponding to the current chroma CU is described as follows, where xCenter represents the horizontal coordinate position, yCenter represents the vertical coordinate position, and the coding block containing the pixel position is the block at the center position of the luma block corresponding to the chroma block:

[0181] xCenter = xCb + cbWidth >> 1;

[0182] yCenter=yCb+cbHeight>>1.

[0183] In another specific implementation, for the decoding process of chroma prediction in H.266 / VVC, the syntax elements related to its decoding are shown in Table 5. In addition, for the value of the syntax element intra_chroma_pred_mode, its corresponding binary string (Bin string) is shown in Table 6; for different syntax elements (such as ccm_mode_flag, ccm_mode_idx, and intra_chroma_pred_mode, etc.), the encoding method used for each coded bit is shown in Table 7.

[0184] Table 5

[0185] Table 6

[0186] Table 7

[0187] Wherein, binIdx indicates the number of bits. If binIdx = 0, it indicates bit 0; if binIdx = 1, it indicates bit 1. In addition, bypass indicates bypass mode, and na indicates no processing.

[0188] In related art, under dual-tree partitioning, for DM mode, if the corresponding luma block is in IBC mode, the resulting chroma prediction mode is DC mode, which results in a loss of coding efficiency. This means that the correlation between the reconstructed samples in the current image and the samples in the current coding block is not utilized during the chroma prediction process, resulting in a loss of coding efficiency.

[0189] Based on this, an embodiment of the present application provides a coding and decoding method to determine the prediction parameters of the current block; determine a first reference prediction parameter set of the current block based on the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters; determine the first color component reference sample value and the second color component reference sample value of the current block based on the first reference prediction parameter set; determine the mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value; determine the prediction value of the second color component of the current block based on the mapping relationship and the first color component sample value of the current block.

[0190] In this way, if the current block uses the BVG-LUT mode, then the first reference prediction parameter set for the chrominance component can be determined, and based on the first reference prediction parameter set, the reference sample values ​​of the luminance component and the reference sample values ​​of the chrominance component of the current block can be determined, thereby establishing a mapping relationship between the luminance component and the chrominance component, and then using this mapping relationship to predict the chrominance component. In other words, here, the correlation between the reconstructed samples in the current image and the samples of the current block is fully utilized, the singleness of the chrominance prediction is improved, and thus the accuracy of the chrominance prediction can be improved; and based on the established mapping relationship, pixel-level prediction can also be effectively performed, thereby further saving bit rate, improving encoding and decoding efficiency, and thus improving encoding and decoding performance.

[0191] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0192] Referring to Figure 4A, which shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 4A, 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 analysis unit 107, a filtering unit 108, an encoding unit 109 and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained 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 on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured 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-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .

[0193] Refer to Figure 4B, which shows a schematic block diagram of the composition of a decoder provided by an embodiment of the present application. As shown in Figure 4B, 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 cache unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded and processed in Figure 4A, the code stream of the video signal is output; the code stream is input to the decoder 200, and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel 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 the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 is to determine the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and use The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0194] Furthermore, an embodiment of the present application also provides a network architecture of a codec system including an encoder and a decoder, wherein FIG5 shows a schematic diagram of a network architecture of a codec system provided by an embodiment of the present application. As shown in FIG5 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video codec functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., without any limitation here.

[0195] It should be noted that the decoder or encoder in the embodiment of the present application can be the above-mentioned electronic device. Among them, the encoder can also be called a "video encoder" or "image encoder", and the decoder can also be called a "video decoder" or "image decoder".

[0196] It should also be noted that the encoding and decoding method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 4A and the intra-frame prediction unit 203 shown in Figure 4B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application does not impose any limitation.

[0197] It should also be noted that, when applied to the intra-frame prediction unit 103, the "current block" specifically refers to the coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block" specifically refers to the decoding block currently to be intra-frame predicted.

[0198] In one embodiment of the present application, FIG6 is a flowchart of a decoding method provided by the embodiment of the present application. As shown in FIG6 , the method may include:

[0199] S601: Determine prediction parameters of the current block.

[0200] It should be noted that the decoding method in the embodiment of the present application is applied to a decoder. Furthermore, the decoding method may specifically refer to an intra-frame prediction method, more specifically, a block vector-based chrominance prediction method. A video image may be divided into multiple decoding blocks, each of which may include a first color component, a second color component, and a third color component. The current block in the embodiment of the present application refers to a decoding block in the video image for which chrominance prediction is currently being performed.

[0201] Here, if the current block predicts a first color component, and the first color component is a luminance component, then the current block may also be referred to as a luminance block; or, if the current block predicts a second color component, and the second color component is a chrominance component, then the current block may also be referred to as a chrominance block.

[0202] It should also be noted that, in the embodiment of the present application, the prediction parameter may be used to indicate whether the current block uses the first prediction mode. In some embodiments, the method may include: decoding a bitstream to determine the prediction parameter of the current block.

[0203] In an embodiment of the present application, if the value of the prediction parameter is the first value, it is determined that the current block uses the first prediction mode; if the value of the prediction parameter is the second value, it is determined that the current block does not use the first prediction mode.

[0204] In some embodiments, for the prediction parameters, the method may further include: decoding the code stream to determine the value of the first syntax element; and determining the prediction parameters of the current block according to the value of the first syntax element.

[0205] It should be noted that in the embodiment of the present application, the first syntax element can be represented by intra_bvglut_flag or bvglut_flag. The first syntax element can be used to indicate whether the current block uses the first prediction mode. Here, if the value of the first syntax element is the first value, it is determined that the current block uses the first prediction mode; if the value of the first syntax element is the second value, it is determined that the current block does not use the first prediction mode.

[0206] It should also be noted that, in the embodiment of the present application, determining the prediction parameter of the current block according to the value of the first syntax element may include: setting the value of the prediction parameter to be equal to the value of the first syntax element.

[0207] It should also be noted that in the embodiments of the present application, the first value and the second value are different. Specifically, 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 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true.

[0208] In a specific embodiment, the first value is set to 1 and the second value is set to 0. For example, if the value of the first syntax element is 1, it indicates that the prediction parameter indicates that the current block uses the first prediction mode, and the decoding method of the embodiment of the present application continues to be performed; otherwise, if the value of the first syntax element is 0, it indicates that the prediction parameter indicates that the current block does not use the first prediction mode, and other prediction modes in the related art (such as the PLANAR mode, CCLM mode, angular prediction mode, etc.) can be used for decoding.

[0209] S602 : Determine a first reference prediction parameter set for the current block according to the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters.

[0210] It should be noted that, in the embodiment of the present application, when the prediction parameter indicates that the current block uses the first prediction mode, a first reference prediction parameter set for the current block is determined. The first prediction mode may be a BVG-LUT mode. That is, for the current block, if the current block uses the BVG-LUT mode, the first reference prediction parameter set for the current block may be determined.

[0211] In some embodiments, determining a first reference prediction parameter set for a current block, as shown in FIG7 , may include:

[0212] S701, determining a first color component block of a current block.

[0213] S702: Determine a second reference prediction parameter set for the current block according to the first color component block.

[0214] S703: Determine a first reference prediction parameter set for the current block according to the second reference prediction parameter set.

[0215] It should be noted that, in the embodiment of the present application, the first reference prediction parameter set may include one or more first candidate reference prediction parameters, wherein the first candidate reference prediction parameters may be vector parameters based on the second color component.

[0216] It should also be noted that, in the embodiment of the present application, the second reference prediction parameter set may include one or more second candidate reference prediction parameters, wherein the second candidate reference prediction parameters may be vector parameters based on the first color component.

[0217] Exemplarily, the first color component may be a luminance component, and the second color component may be a chrominance component. Then, the first candidate reference prediction parameter may be a vector parameter based on the chrominance component, and the second candidate reference prediction parameter may be a vector parameter based on the luminance component.

[0218] In some embodiments, the vector parameter includes one of the following: a block vector parameter, a motion vector parameter. That is, whether the first reference prediction parameter set or the second reference prediction parameter set can be a parameter list applied to a BV, or a parameter list applied to an MV.

[0219] In a specific embodiment, taking BV as an example, the "first reference prediction parameter" here can be a block vector parameter based on the chrominance component, then the first reference prediction parameter set can be called a chrominance BVC candidate list; the "second reference prediction parameter" here can be a block vector parameter based on the luminance component, then the second reference prediction parameter set can be called a luminance BVL candidate list.

[0220] In some embodiments, determining the first color component block of the current block, as shown in FIG8 , the method may include:

[0221] S801, determining a first color component area at the same position as the current block.

[0222] S802: Determine a first candidate block at a first position based on multiple divided blocks of the first color component area.

[0223] S803 : Perform a position offset search in a preset search area at the first position to determine a plurality of second candidate blocks.

[0224] S804: Determine a first color component block of the current block according to the first candidate block and / or multiple second candidate blocks.

[0225] It should be noted that, in the embodiment of the present application, the first color component area at the same position of the current block is first determined; then, based on the multiple divided blocks of the first color component area, the first color component block of the current block is determined.

[0226] It should be noted that, in the embodiment of the present application, if the first color component is a luminance component, then the first color component region may also be referred to as a "co-located luminance region". For example, if the current block is a chrominance block, then the co-located luminance region may refer to the co-located luminance region corresponding to the current block. For the current block, the co-located first color component region may be divided into blocks, for example, using a binary tree structure, a ternary tree structure, a quadtree structure, etc., to obtain multiple blocks, each of which may be regarded as a CU, a sub-block, or a transform block, etc.; then, the first color component block of the current block is determined from these multiple divided blocks.

[0227] For example, in Figure 3, the area filled with diagonal lines represents the co-located luminance area corresponding to the chrominance component. Within this co-located luminance area, multiple blocks can be divided; the block at the center can be selected from these blocks as the corresponding luminance block of the current block. For example, the block filled with black in Figure 3 is the corresponding luminance block of the current block (the first color component block).

[0228] In a specific embodiment, for determining the first color component block of the current block, the method may include: determining a first candidate block at a first position from multiple divided blocks of the first color component area; and determining the first color component block of the current block based on the first candidate block at the first position.

[0229] In the embodiment of the present application, the first position may refer to any position of the first color component area. For example, the first position may be the center position, the upper left corner position, the lower right corner position, a specific position, etc. in the first color component area.

[0230] In the embodiments of the present application, the first candidate block may refer to a block at the first position. In a specific embodiment, the block at the center of the first color component region is selected as the first candidate block; and / or the block at the upper left corner of the first color component region is selected as the first candidate block; and / or the block at the lower right corner of the first color component region is selected as the first candidate block, and so on, without any limitation herein.

[0231] Further, in some embodiments, based on the first candidate block at the first position, the first color component block of the current block is determined. The method may include: performing a position offset search in a preset search area at the first position to determine multiple second candidate blocks; and determining the first color component block of the current block based on the first candidate block and / or multiple second candidate blocks.

[0232] In an embodiment of the present application, a position offset search is performed in a preset search area at the first position. Multiple positions may be searched in the upper left, upper, left, and other directions based on the first position. For example, the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), the left coordinate offset (xOffset, yOffset) = (-2, 0), etc. of the first position may be obtained. No limitation is made here.

[0233] In some embodiments, determining the first color component block of the current block may include: determining the position information of the current block; scaling the position information of the current block according to a preset sampling format to obtain the co-located area position information corresponding to the current block; determining the target position information based on the co-located area position information, and using the candidate block containing the target position information as the first color component block of the current block.

[0234] In some embodiments, determining the target position information based on the co-located area position information may include: calculating the center position based on the co-located area position information, and using the obtained center position information as the target position information; or, calculating the upper left corner position based on the co-located area position information, and using the obtained upper left position information as the target position information; or, calculating the lower right corner position based on the co-located area position information, and using the obtained lower left position information as the target position information.

[0235] In an embodiment of the present application, the preset sampling format may be a chroma sampling format (or color sampling format). For example, the mapping relationship between the position (x, y) of the current block and the position (xCb, yCb) of the co-located area is shown in Table 4.

[0236] In one possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0237] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance region corresponding to the current block (i.e., the entire diagonally filled region of the luminance component in Figure 3) is cbWidth, and the height is cbHeight; then the block at the center (the block at the center of the luminance region) is the luminance block containing the center coordinates (xCb+cbWidth>>1, yCb+cbHeight>>1), which is also the block filled with black in Figure 3. In Figure 3, the small white block represents the position of the center coordinates, which can be used to locate the position of the luminance block.

[0238] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2) of the center position of the same luminance region, the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0). The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+cbWidth>>1+xOffset, yCb+cbHeight>>1+yOffset).

[0239] In another possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0240] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (i.e., the entire diagonally filled area of ​​the luminance component in Figure 9) is cbWidth, and the height is cbHeight; then the block at the upper left corner (the upper left corner block of the luminance area) is the luminance block containing the upper left corner coordinates (xCb, yCb), which is also the block filled with black in Figure 9. In Figure 9, the small white block represents the position of the upper left corner coordinates, which can be used to locate the position of the luminance block.

[0241] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upper coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the upper left corner position of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+xOffset, yCb+yOffset).

[0242] In another possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0243] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (i.e., the entire diagonally filled area of ​​the luminance component in Figure 10) is cbWidth, and the height is cbHeight; then the block at the lower right corner (the lower right corner block of the luminance area) is the luminance block containing the lower right corner coordinates (xCb+cbWidth-1, yCb+cbHeight-1), which is also the block filled with black in Figure 10. In Figure 10, the small white block represents the position of the lower right corner coordinates, which can be used to locate the position of the luminance block.

[0244] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the lower right corner position of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb + cbWidth - 1 + xOffset, yCb + cbHeight - 1 + yOffset).

[0245] That is to say, in an embodiment of the present application, the first candidate block as the first color component block can be a block at any position among the multiple blocks shown in Figure 3. For example, the block at the center position in the co-located luminance area as shown in Figure 3 (a block filled with black), the block at the upper left corner position in the co-located luminance area as shown in Figure 9 (a block filled with black), the block at the lower right corner position in the co-located luminance area as shown in Figure 10 (a block filled with black), or even the block at the upper right corner position, the block at the lower left corner position, or even the block at the center position of the upper left area, etc., without any limitation here. Furthermore, based on the first candidate block, multiple positions can be searched to the upper left, above, and left to obtain multiple second candidate blocks. Then, based on the first candidate block and / or multiple second candidate blocks, the first color component block of the current block can be determined.

[0246] In some embodiments, the method may further include: determining at least one candidate block at a preset position from a plurality of divided blocks of the first color component area; and determining a first color component block of the current block based on the at least one candidate block.

[0247] In this embodiment of the present application, this at least one candidate block can be used as the first color component block of the current block. That is, the first color component block can be at least one candidate block obtained sequentially. For example, as shown in Figure 11, this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; it can be multiple different positions; nor is it limited to the five positions shown in Figure 11, and no limitation is imposed on these positions.

[0248] In another possible implementation, taking the block including five luminance pixel positions shown in FIG. 11 as an example, the positions may be acquired sequentially according to a preset order, which includes but is not limited to the following order: C->TL->TR->BL->BR.

[0249] For the detailed position derivation process of C, TL, TR, BL, and BR, the position of the current block is obtained, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the position of the same luminance area corresponding to the current block, lumaPos = (xCb, yCb).

[0250] Here, it is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image (i.e., the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block (i.e., the entire diagonal filled area of ​​the luminance component in Figure 11) is cbWidth, and the height is cbHeight.

[0251] The coordinates of the position of the brightness pixel C are (xCb+cbWidth / 2,yCb+cbHeight / 2);

[0252] The coordinates of the position of the luminance pixel TL are (xCb, yCb);

[0253] The coordinates of the position of the brightness pixel TR are (xCb+cbWidth-1, yCb);

[0254] The coordinates of the position of the brightness pixel BL are (xCb, yCb+cbHeight-1);

[0255] The coordinates of the position of the luminance pixel BR are (xCb+cbWidth-1, yCb+cbHeight-1).

[0256] Here, when searching for each position, multiple positions can also be searched to the upper left, above, and left of this position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset of this position (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0). The luminance block used in the luminance area is the luminance block that includes the coordinates of the position plus the position coordinates of the offset position.

[0257] Thus, for the current block, it is first necessary to determine the corresponding first color component block. For example, when the first color component is a luminance component, it is necessary to determine the corresponding luminance block of the current block. Specifically, the above-mentioned possible implementation methods can be used to determine one or more corresponding luminance blocks.

[0258] It is understood that after determining the first color component block, a second reference prediction parameter set for the current block can be constructed. In some embodiments, the method may include: determining one or more candidate vector parameters based on the first color component based on the first color component block; and determining the second reference prediction parameter set for the current block based on the one or more candidate vector parameters based on the first color component.

[0259] It should be noted that, in an embodiment of the present application, determining the second reference prediction parameter set of the current block based on one or more candidate vector parameters based on the first color component may include: adjusting the candidate vector parameters based on the first color component to determine the candidate vector parameters based on the second color component; when the candidate vector parameters based on the second color component meet the preset availability conditions, using the candidate vector parameters based on the first color component as the second candidate reference prediction parameters and adding them to the second reference prediction parameter set.

[0260] Here, taking the block vector parameter BV as an example, assuming that the current block is a chroma block and the first color component block is a luminance block, then the candidate vector parameter based on the first color component can be the BV of the luminance block, that is, BVL; the candidate vector parameter based on the second color component can be the BV of the chroma block, that is, BVC.

[0261] It should also be noted that in the embodiment of the present application, assuming that the candidate vector parameter based on the first color component is luminance BV = (BVLhor, BVLver), and the candidate vector parameter based on the second color component is chrominance BV = (BVChor, BVCver), then the corresponding chrominance BV can be determined by adjusting BVL (luminance BV).

[0262] In a specific embodiment, adjusting the candidate vector parameters based on the first color component and determining the candidate vector parameters based on the second color component may include: determining a preset sampling format for the current block; scaling the candidate vector parameters based on the first color component according to the preset sampling format, and determining the candidate vector parameters based on the second color component.

[0263] It should be noted that, in the embodiment of the present application, the above adjustment may include scaling according to a preset sampling format, wherein the preset sampling format may be a mapping relationship between the luminance BV and the scaled chrominance BV shown in Table 8.

[0264] Table 8

[0265] Here, the preset format may refer to a color sampling format, such as monochrome, 4:2:0, 4:2:2, or 4:4:4. The syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, specifically the chroma sampling format. Different color sampling formats have different corresponding scaling operations.

[0266] For example, if the value of sps_chroma_format_idc is 0, the color sampling format is determined to be monochrome, that is, there is no chroma BV parameter (BVC hor , BVC hor); If the value of sps_chroma_format_idc is 1, the color sampling format is determined to be 4:2:0. At this time, the mapping relationship between brightness BV and chroma BV is: BVC hor =BVL hor >>1, BVC hor =BVL ver >>1; If the value of sps_chroma_format_idc is 2, the color sampling format is determined to be 4:2:2. At this time, the mapping relationship between brightness BV and chroma BV is: BVC hor =BVL hor >>1, BVC hor =BVL ver ; If the value of sps_chroma_format_idc is 3, it means that the color sampling format is 4:4:4. At this time, the mapping relationship between brightness BV and chroma BV is: BVC hor =BVL hor , BVC hor =BVL ver .

[0267] Thus, based on Table 8, the candidate BVL can be scaled according to the color sampling format to obtain a scaled BVC; and then it is determined whether the scaled BVC meets the preset usability conditions. The scaled BVC meets the preset usability conditions, including but not limited to:

[0268] The offset position indicated by the scaled BVC does not exceed the image boundary;

[0269] The offset position indicated by the scaled BVC does not exceed the slice boundary;

[0270] The offset position indicated by the scaled BVC does not cover the current block;

[0271] The offset position indicated by the scaled BVC does not exceed the preset available area;

[0272] The offset position indicated by the scaled BVC has been reconstructed.

[0273] It should also be noted that in the embodiment of the present application, one or more candidate vector parameters based on the first color component (i.e., one or more candidate BVLs) are scaled based on the first color component block. If a candidate BVL is scaled based on the color sampling format shown in Table 8, and the scaled BVL meets the preset availability condition, then this candidate BVL can be used as a second candidate reference prediction parameter and added to the second reference prediction parameter set to construct the second reference prediction parameter set. The second reference prediction parameter set can include one or more second candidate reference prediction parameters.

[0274] It is also understood that after constructing the second reference prediction parameter set, the first reference prediction parameter set for the current block can be further determined. In some embodiments, the method may include: adjusting one or more second candidate reference prediction parameters in the second reference prediction parameter set to determine first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters; and determining the first reference prediction parameter set for the current block based on the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters.

[0275] It should be noted that in the embodiment of the present application, the number of first candidate reference prediction parameters and second candidate reference prediction parameters is the same. That is, for each second candidate reference prediction parameter, it can be adjusted to obtain one or more first candidate reference prediction parameters, and then a usable first candidate reference prediction parameter is determined from them. However, it should be noted that the number of first candidate reference prediction parameters and second candidate reference prediction parameters can also be different. In this case, each second candidate reference prediction parameter can determine more than one usable first candidate reference prediction parameter, and this is not limited here.

[0276] In some embodiments, one or more second candidate reference prediction parameters in the second reference prediction parameter set are adjusted to determine the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters. Here, taking one of the second candidate reference prediction parameters as an example, the method may include: adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set based on the second color component; and determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter based on the third reference prediction parameter set.

[0277] In the embodiment of the present application, for each second candidate reference prediction parameter, this method can be used to determine the corresponding first candidate reference prediction parameter to obtain a first reference prediction parameter set.

[0278] For example, assuming that the current block is a chroma block and the first color component block is a luma block, the first candidate reference prediction parameter may be a candidate BV for the chroma block, i.e., a candidate BVC; and the second candidate reference prediction parameter may be a candidate BV for the luma block, i.e., a candidate BVL. Adjusting the second candidate reference prediction parameter may determine one or more candidate vector parameters based on the second color component, i.e., one or more candidate BVCs. These candidate BVCs may be used to construct a third reference prediction parameter set.

[0279] It can be understood that in an embodiment of the present application, assuming that the second candidate reference prediction parameter is luminance BV = (BVLhor, BVLver), and the candidate vector parameter based on the second color component is chrominance BV = (BVChor, BVCver), then it is possible to choose to construct a chrominance BVC candidate list containing one or more candidate block vector parameters by adjusting BVL (luminance BV) or BVC (chrominance BV).

[0280] In one possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: scaling the second candidate reference prediction parameter according to a preset sampling format of the current block, determining a candidate vector parameter based on the second color component, and adding the candidate vector parameter based on the second color component to the third reference prediction parameter set.

[0281] It should be noted that, in the embodiment of the present application, the above adjustment may include scaling according to a preset sampling format. The preset sampling format may be a mapping relationship between the luma BV and the scaled chroma BV shown in Table 8. Here, the preset format may refer to a color sampling format, such as monochrome, 4:2:0, 4:2:2, 4:4:4, etc. In this way, scaling may be performed according to the color sampling format shown in Table 8, and the scaled BVC may be added as a candidate vector parameter to the third reference prediction parameter set.

[0282] In another possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: scaling the second candidate reference prediction parameter according to a preset sampling format of the current block to determine a first initial vector parameter based on the second color component; performing an offset calculation on the first initial vector parameter based on the second color component according to one or more offset values ​​to determine one or more candidate vector parameters based on the second color component, and adding the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

[0283] In another possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: performing offset calculation on the second candidate reference prediction parameter according to one or more offset values ​​to determine one or more second initial vector parameters based on the first color component; scaling one or more second initial vector parameters based on the first color component according to a preset sampling format of the current block to determine one or more candidate vector parameters based on the second color component, and adding the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

[0284] It should be noted that in the embodiment of the present application, the above-mentioned one or more offset values ​​can be any number of arbitrary numerical values, such as -1, +1, -2, +2, -3, +3, etc., and no limitation is made here.

[0285] That is, in the embodiment of the present application, after obtaining the BV of the corresponding luminance block, it can be recorded as BVL, and the chrominance BV obtained through BVL can be recorded as BVC. Then, by adjusting BVL or BVC, a chrominance BVC candidate containing one or more candidates can be constructed. The candidate construction method includes but is not limited to the following:

[0286] In one possible construction method, BVL can be adjusted to form four situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, the four situations are BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, BVL = (BVLhor, BVLver).

[0287] Or, when BVL is an even number, take BVL=(BVL hor, BVL ver )、BVL=(BVL hor +1, BVL ver )、BVL=(BVL hor, BVL ver +1), BVL=(BVL hor +1,BVL ver +1) Four situations.

[0288] Here, BVC[0]=BVL[0]*2 / SubWidthC, BVC[1]=BVL[1]*2 / SubHeightC. SubWidthC and SubHeightC can be determined according to the mapping relationship between sps_chroma_format_idc and the color sampling format in Table 1.

[0289] BVC is obtained by scaling BVL according to the above formula, so that when BVL is an odd number or an even number, four BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (ie, the third reference prediction parameter set).

[0290] In another possible construction method, BVL can be adjusted to form four cases, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor-1, BVLver), BVL = (BVLhor, BVLver-1), and BVL = (BVLhor-1, BVLver-1). Next, BVL is scaled according to the color sampling format in Table 8 to obtain BVC, so that when BVL is an odd number or an even number, four BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (ie, the third reference prediction parameter set).

[0291] It should be noted that, in this construction method, the operations under different circumstances of uniform parity and even numbers can also be calculated as follows: take four cases: BVL = (BVLhor-1, BVLver-1), BVL = (BVLhor+1, BVLver-1), BVL = (BVLho-1r, BVLver+1), and BVL = (BVLhor+1, BVLver+1).

[0292] In another possible construction method, BVL can be adjusted to form multiple situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, multiple situations such as BVL=(BVLhor, BVLver), BVL=(BVLhor+1, BVLver), BVL=(BVLhor, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver), BVL=(BVLhor, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-2, BVLver), and BVL=(BVLhor, BVLver-2) are taken, and a list is constructed in order for these candidates. When BVL is an even number, multiple cases are taken, such as BVL=(BVLhor, BVLver), BVL=(BVLhor-1, BVLver), BVL=(BVLhor, BVLver-1), BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor-3, BVLver), BVL=(BVLhor, BVLver-3), BVL=(BVLhor-3, BVLver-3), BVL=(BVLhor+2, BVLver), and BVL=(BVLhor, BVLver+2). Next, BVL is scaled according to the color sampling format in Table 8 to obtain BVC. In this way, when BVL is an odd number or an even number, multiple BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (i.e., the third reference prediction parameter set).

[0293] It should be noted that, in this construction method, the operations in different cases of uniform parity and even numbers can also be calculated as follows: take BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor+1, BVLver-1), BVL=(BVLhor-1, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver-1), BVL=(BVLhor-1, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-3, BVLver-1), BVL=(BVLhor-1, BVLver-3), etc.

[0294] In another possible construction method, the obtained BVC can also be adjusted to obtain nine candidates: that is, set BVC = (BVChor, BVCver), BVC = (BVChor-1, BVCver), BVC = (BVChor, BVCver-1), BVC = (BVChor-1, BVCver-1), BVC = (BVChor+1, BVCver), BVC = (BVChor, BVCver+1), BVC = (BVChor+1, BVCver+1), BVC = (BVChor-1, BVCver+1), BVC = (BVChor+1, BVCver-1), thus forming nine BVC candidates, which are added to the chroma BVC candidate list (that is, the third reference prediction parameter set).

[0295] In another possible construction method, the obtained BVC can also be adjusted to obtain multiple candidates: that is, set BVC=(BVChor, BVCver), BVC=(BVChor-1, BVCver), BVC=(BVChor, BVCver-1), BVC=(BVChor-1, BVCver-1), BVC=(BVChor+1, BVCver), BVC=(BVChor, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor+1, BVCver er-1), BVC=(BVChor-2, BVCver), BVC=(BVChor, BVCver-2), BVC=(BVChor-2, BVCver-2), BVC=(BVChor+2, BVCver), BVC=(BVChor, BVCver+2), BVC=(BVChor+2, BVCver+2), BVC=(BVChor-2, BVCver+2), BVC=(BVChor+2, BVCver-2), etc., thus forming a variety of BVC candidates, which are added to the chroma BVC candidate list (i.e., the third reference prediction parameter set).

[0296] It should also be noted that in the embodiments of this application, when the BVL is odd or even, since the BVL is a two-dimensional vector, this specifically refers to the fact that one of its components is odd or even. Furthermore, the "+1," "-1," "+2," "-2," "+3," and "-3" here all refer to integer pixel precision.

[0297] It is understood that in the embodiments of the present application, when determining the first candidate reference prediction parameter based on the third reference prediction parameter set, it is also necessary to determine whether the candidate vector parameters in the third reference prediction parameter set are available, that is, it is necessary to select one or more available candidate vector parameters from the third reference prediction parameter set. Therefore, in some embodiments, determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter based on the third reference prediction parameter set may include: determining whether the third reference prediction parameter set includes one or more candidate vector parameters that meet a preset availability condition; and when the third reference prediction parameter set includes one or more candidate vector parameters that meet the preset availability condition, determining the first candidate reference prediction parameter based on the one or more candidate vector parameters.

[0298] Specifically, in the embodiment of the present application, only when the candidate vector parameter meets the preset availability condition can the candidate vector parameter be determined as the first candidate reference prediction parameter.

[0299] In some embodiments, one or more candidate vector parameters meet preset availability conditions, including but not limited to:

[0300] The offset position indicated by the one or more candidate vector parameters does not exceed the image boundary;

[0301] The offset position indicated by the one or more candidate vector parameters does not exceed the slice boundary;

[0302] The offset position indicated by the one or more candidate vector parameters does not cover the current block;

[0303] The offset position indicated by one or more candidate vector parameters does not exceed a preset available area;

[0304] The offset position indicated by one or more candidate vector parameters has been reconstructed.

[0305] It should be noted that in this embodiment of the present application, assuming the current block position is (xCb, yCb), for the candidate vector parameters, BVC = (BVChor, BVCver), the corresponding offset position is found (xCb + BVChor, yCb + BVCver). Here, the offset position does not exceed the image boundary and can also be specifically described using data such as coordinate position information and the size parameters of the current block. For example, xCb + width + BVChor < = xCb or yCb + height + BVCver < = yCb.

[0306] It should also be noted that, in the embodiments of the present application, the preset availability condition may also consider whether the slice boundary is exceeded. For example, the offset position indicated by one or more candidate vector parameters does not exceed the slice boundary, or the offset position indicated by one or more candidate vector parameters does not exceed the tile boundary.

[0307] In the embodiment of the present application, only when all of the above conditions are met can it be determined that the candidate vector parameters meet the preset usability conditions, that is, the candidate vector parameters are usable. In a specific embodiment, taking one of the candidate vector parameters as an example, the candidate vector parameters meet the preset usability conditions, which at least include: the offset position indicated by the candidate vector parameter does not exceed the image boundary; the offset position indicated by the candidate vector parameter does not exceed the slice boundary; the offset position indicated by the candidate vector parameter does not overlap the current block; the offset position indicated by the candidate vector parameter does not exceed the preset usable area; and the offset position indicated by the candidate vector parameter has been reconstructed.

[0308] For example, Figure 12 shows a schematic diagram of a structure for determining whether an offset position does not cover the current block, provided by an embodiment of the present application. As shown in Figure 12, a block filled with black represents the current block, an area filled with diagonal lines represents an available area, and an unfilled area represents an unavailable area. For the current block, if the offset position indicated by the candidate block vector parameter is in an unavailable area, then the offset position covers the current block.

[0309] For example, FIG13 shows a schematic diagram of a structure of whether an offset position exceeds a preset available area provided by an embodiment of the present application. As shown in FIG13 , a block filled with black represents a current block, an area filled with oblique lines represents an available area, and the reference blocks in the available area have all been reconstructed. In an embodiment of the present application, taking into account the storage capacity of the Buffer, under normal circumstances, the reference blocks adjacent to the current block (m, n) can be specifically: reference block (m-2, n-2), reference block (m-1, n-2), reference block (m, n-2), reference block (m+1, n-2), reference block (m-2, n-1), reference block (m-1, n-1), reference block (m, n-1), reference block (m+1, n-1), reference block (m-2, n), reference block (m-1, n), etc. as preset available areas.

[0310] That is, when determining whether it is available, the position of the current block (xCb, yCb) can be obtained, the chroma BVC = (BVChor, BVCver), the corresponding offset position (xCb + BVChor, yCb + BVCver) can be found, and the following conditions, including but not limited to the following conditions (i.e., preset availability conditions), can be determined. If all of them are met, the chroma BV is available:

[0311] Whether the obtained offset position does not exceed the image boundary;

[0312] Whether the obtained offset position does not cover the current block, see Figure 12 for details;

[0313] xCb+width+BVChor<=xCb or yCb+height+BVCver<=yCb;

[0314] Whether the obtained offset position does not exceed the preset available area, see Figure 13 for details;

[0315] Whether the obtained offset position has been reconstructed.

[0316] It is also understood that in the embodiments of the present application, the methods for constructing the third reference prediction parameter set include, but are not limited to, the multiple situations described above. One of these methods may be used to construct the candidate list, or multiple methods may be used simultaneously to construct the list. That is, four BVC candidates are determined for each BVL to construct the third reference prediction parameter set. Then, for each BVL, one available BVC is determined for the four BVC candidates, namely, the first candidate reference prediction parameter corresponding to the BVL.

[0317] In some embodiments, a first candidate reference prediction parameter is determined based on one or more candidate vector parameters, including: if there is a candidate vector parameter in the third reference prediction parameter set that meets a preset availability condition, then the candidate vector parameter that meets the preset availability condition is determined as the first candidate reference prediction parameter; if there are multiple candidate vector parameters in the third reference prediction parameter set that meet the preset availability condition, then a decision is made on the multiple candidate vector parameters that meet the preset availability condition to determine the first candidate reference prediction parameter.

[0318] It should be noted that in the embodiments of the present application, if there are one or more candidate vector parameters that meet the preset availability conditions, then when determining the first candidate reference prediction parameter based on the one or more candidate vector parameters, one of the candidate vector parameters that meet the preset availability conditions can be directly determined as the first candidate reference prediction parameter. In other words, if only one BVC candidate in the constructed available BVC candidate list meets the preset availability conditions, then that BVC will be the final first candidate reference prediction parameter.

[0319] It should also be noted that, in the embodiment of the present application, if there are multiple candidate vector parameters that meet the preset availability conditions, then a decision can also be made on the multiple candidate vector parameters that meet the preset availability conditions. Specifically, the decision can be: determining a first template for the current block; determining first matching templates for each of the multiple candidate vector parameters based on the first template and the multiple candidate vector parameters; when the first template and the first matching template meet the preset existence conditions, calculating the matching error between the first template of the current block and the first matching template based on a preset error criterion to determine first generation values ​​for each of the multiple candidate vector parameters; determining a minimum cost value from the first generation values ​​of each of the multiple candidate vector parameters, and determining the candidate vector parameter corresponding to the minimum cost value as the first candidate reference prediction parameter.

[0320] That is, in the embodiment of the present application, for multiple candidate vector parameters that meet the preset availability conditions, after determining the first generation values ​​corresponding to the multiple candidate vector parameters, one or more candidate vector parameters can be determined from the multiple candidate vector parameters based on the first generation values. For example, if the constructed available BVC candidate list has multiple available BVC candidates, then it is necessary to make a decision on these available BVCs to obtain the final BV, and the decision-making method includes but is not limited to the decision-making method using a template.

[0321] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block. Accordingly, the type of the first template may include at least one of the following: an upper template, an upper right template, a left template, a lower left template, and an upper left template. Among them, the upper template is located in the upper decoded area adjacent to the current block, the upper right template is located in the upper right decoded area adjacent to the current block, the left template is located in the left decoded area adjacent to the current block, the lower left template is located in the lower left decoded area adjacent to the current block, and the upper left template is located in the upper left decoded area adjacent to the current block.

[0322] It should also be noted that in an embodiment of the present application, when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template position are available, including reconstructing chrominance information, based on the pixel availability of the adjacent areas of the current block. Figure 14 is a schematic diagram of the template type. As shown in Figure 14, based on the relative position relationship between the template and the current block, the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template. Among them, the sizes of different types of templates for different coding blocks can be fixed the same or different.

[0323] For example, the template size selects the same template size for the current block of any size. The following formula illustrates a setting condition for the template size, where nTbW and nTbH are the width and height of the current block, and iTempW and iTempH are the width and height of the template used:

[0324] Upper template:

[0325] Left template:

[0326] For example, you can select different template sizes based on the current block size. The following formula illustrates a template size setting condition, where nTbW and nTbH are the width and height of the current block, and iTempW and iTempH are the width and height of the template used:

[0327] Upper template:

[0328] Left template:

[0329] in,

[0330] For example, different template sizes can also be selected based on the number of pixels in the current block. The following formula illustrates a template size setting condition, where nTbW and nTbH are the width and height of the current block, nTbW×nTbH is the number of pixels in the current block, and iTempW and iTempH are the width and height of the template used:

[0331] Upper template:

[0332] Left template:

[0333] In some embodiments, when determining the first matching template based on multiple candidate vector parameters, taking the position of the current point as the starting point, the area indicated by the multiple candidate vector parameters, which has the same shape and contains the same number of sample values ​​as the first template, is determined as the first matching template.

[0334] For example, in an embodiment of the present application, when determining the first matching template, the first template of the current block is used to perform motion compensation on the multiple BVC candidates obtained (i.e., candidate block vector parameters that meet preset availability conditions) to obtain a template corresponding to the BV (the first matching template). Figure 15 is a schematic diagram of template motion compensation. As shown in Figure 15, if the BV (BVC candidate) is available, motion compensation is performed using the first template and the BV to obtain a template corresponding to the BV, i.e., the first matching template.

[0335] It can also be understood that in the embodiment of the present application, the preset error criterion may include but is not limited to any one of the absolute error sum SAD, transformed absolute error SATD, difference square sum SSE, mean absolute difference MAD, mean absolute error MAE, mean square error MSE, etc.

[0336] For example, in an embodiment of the present application, when performing cost calculation, that is, when determining the first-generation value, there are multiple options for the cost function for calculating the cost of the template area, that is, there are multiple options for the preset error criteria. For example, you can choose the evaluation criteria such as the sum of absolute deviations (SAD), the sum of transformed absolute deviations (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE). Any evaluation criterion mentioned in the following content can be selected from the above criteria. Taking the evaluation criterion of SAD as an example, the calculation formula is as follows:

[0337] Among them, predTempSizeW is the width of the template, predTempSizeH is the height of the template, predTemp[i][j] is the pixel point of the template at BV, and recTempC[i][j] is the pixel point of the current block template.

[0338] Furthermore, in some embodiments, the method may also include: when the first template and the first matching template do not satisfy the preset existence condition, determining the first candidate vector parameter in the third reference prediction parameter set that satisfies the preset availability condition as the first candidate reference prediction parameter; or, when the first template and the first matching template do not satisfy the preset existence condition, determining the candidate vector parameter at the second position in the third reference prediction parameter set that satisfies the preset availability condition as the first reference prediction parameter.

[0339] That is to say, if the first template and the first matching template meet the preset existence condition, the matching error between the first template and the first matching template of the current block can be calculated according to the preset error criterion to select the candidate vector parameter corresponding to the minimum cost value as the first candidate reference prediction parameter; if the first template and the first matching template do not meet the preset existence condition, the first candidate vector parameter that meets the preset availability condition in the third reference prediction parameter set or the candidate vector parameter at a specified position can be determined as the first candidate reference prediction parameter.

[0340] For example, depending on whether the first template and the first matching template meet the preset existence condition, there are the following situations for using the template when calculating the cost (i.e., the cost value):

[0341] The first type: the upper template and the left template of the current block both exist, and the upper template and the left template at the corresponding BV both exist. In this case, both the upper template and the left template are available.

[0342] The second method is: Both the upper and left templates of the current block exist, but only the upper template exists at the corresponding BV. In this case, there are two methods: Method 1: If the left template at the corresponding BV does not exist, it is directly ignored, that is, only the upper template is used for calculation. Method 2: If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead of the left template, that is, the upper and left templates are used for calculation.

[0343] The third method is: both the upper template and the left template of the current block exist, but only the left template exists at the corresponding BV. In this case, there are two methods: Method 1: If the upper template does not exist at the corresponding BV, it is directly not used, that is, only the left template is used for calculation. Method 2: If the upper template does not exist at the corresponding BV, the uppermost template height row inside the reference block is used instead of the upper template, that is, the upper and left templates are used for calculation.

[0344] The fourth scenario: Only the upper template exists in the current block. There are three possible approaches: Method 1: If the upper template at the corresponding BV does not exist, it is not used. The final BV selected is the first BVC in the BVC candidate list or the BVC at a specified position. Method 2: If the upper template at the corresponding BV does not exist, the uppermost template height row in the reference block is used instead. Method 3: If the upper template at the corresponding BV exists, it is used directly.

[0345] The fifth method: Only the left template exists in the current block. In this case, there are three methods: Method 1: If the left template at the corresponding BV does not exist, it is directly used. In this case, the final BV selected is the first BVC in the BVC candidate list or the BVC at a specified position. Method 2: If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead. Method 3: If the left template at the corresponding BV exists, it is directly used.

[0346] The sixth type: Neither the upper template nor the left template of the current block exists. At this time, the BV finally selected is the first BVC in the BVC candidate list or the BVC at a specified position.

[0347] For example, in an embodiment of the present application, when determining the first candidate reference prediction parameter based on the first cost value of each of the multiple candidate vector parameters, excluding the case where the cost cannot be calculated, the cost of each candidate in the candidate list of BVC is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort and other sorting methods. Any number of BVCs with the lowest cost are selected as the final selected BV (first candidate reference prediction parameter) to perform chromaticity prediction based on BV. It should also be noted that when performing cost value calculations on multiple candidate vector parameters, a cost can be calculated for each candidate vector parameter, and the candidate vector parameter with the lowest cost is always retained. In this case, a list is not required, and even sorting is not required.

[0348] In this way, after obtaining one or more first candidate reference prediction parameters, a first reference prediction parameter set can be constructed.

[0349] S603 : Determine a first color component reference sample value and a second color component reference sample value of the current block according to the first reference prediction parameter set.

[0350] It should be noted that in the embodiment of the present application, the "reference prediction parameters" here are parameters used to derive reference sample values ​​of the current block, and can specifically be vector parameters (such as BV or MV). These reference sample values ​​(Samples) can then be used to derive the mapping relationship between the first color component and the second color component.

[0351] It should also be noted that if all candidate vector parameters in the third reference prediction parameter set are unavailable, that is, all candidate block vector parameters in the third reference prediction parameter set do not meet the preset availability condition, then there are no available first candidate reference prediction parameters, and thus there is no first reference prediction parameter set. In this case, the method may further include: when all candidate vector parameters in the third reference prediction parameter set do not meet the preset availability condition, determining a first color component reconstructed sample and a second color component reconstructed sample at a third position of the current block; and determining a first color component reference sample value and a second color component reference sample value of the current block based on the first color component reconstructed sample and the second color component reconstructed sample at the third position.

[0352] That is to say, in an embodiment of the present application, the luminance pixels and chrominance pixels at a set position can also be obtained, and the set position includes but is not limited to an adjacent row and an adjacent column of the current block to obtain the first color component reference sample value and the second color component reference sample value of the current block.

[0353] In some embodiments, determining the first color component reference sample value and the second color component reference sample value of the current block according to the first reference prediction parameter set may include: determining the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters according to the first reference prediction parameter set; determining the first color component reconstructed sample and the second color component reconstructed sample at the third position of the current block; determining the first color component reference sample value and the second color component reference sample value of the current block according to the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters and the first color component reconstructed sample and the second color component reconstructed sample at the third position.

[0354] In an embodiment of the present application, determining, based on a first reference prediction parameter set, first color component reconstruction samples and second color component reconstruction samples indicated by one or more first candidate reference prediction parameters, may include: determining the position of a current block; scaling the position of the current block to determine the position of a first color component region at the same position of the current block; and scaling the first candidate reference prediction parameters to determine the scaled reference prediction parameters of the first color component region at the same position of the current block; determining a reference block of the first color component based on the position of the first color component region and the scaled reference prediction parameters, and determining the first color component reconstruction samples indicated by the first candidate reference prediction parameters based on the reference block of the first color component; determining a reference block of the second color component based on the position of the current block and the first candidate reference prediction parameters, and determining the second color component reconstruction samples indicated by the first candidate reference prediction parameters based on the reference block of the second color component.

[0355] In the embodiment of the present application, the position of the first color component area can be obtained by scaling the position of the current block according to a preset sampling format; the scaled reference prediction parameter of the first color component area can also be obtained by scaling the first candidate reference prediction parameter according to a preset sampling format. Here, the preset sampling format can be referred to in Table 4 above. It should be noted that the scaled reference prediction parameter can be obtained by amplifying the chroma BV; however, considering that the luma BV may suffer from precision loss, the luma BV obtained by amplifying the chroma BV is not necessarily equal to the original luma BV (the second candidate reference prediction parameter).

[0356] For example, the current block is a chroma block, and the first color component region at the same location is the co-located luma region. To obtain the first color component reference sample (luma reference sample), first obtain the position of the current block, that is, the position of the upper-left chroma sample of the current block relative to the upper-left chroma sample of the current image, chromaPos = (x, y). ChromaPos is then scaled according to the color sampling format shown in Table 4 to obtain the co-located luma region position corresponding to the current block, lumaPos = (xCb, yCb).

[0357] Exemplarily, obtain chroma BV = (BVChor, BVCver), scale the chroma BV according to the color sampling format shown in Table 4, and obtain the luminance BV = (BVYhor, BVYver) of the co-located luminance region corresponding to the current block. Obtain the position of the co-located luminance region corresponding to the current block lumaPos = (xCb, yCb), obtain luminance BV = (BVYhor, BVYver), and find the offset position (xCb + BVYhor, yCb + BVYver) corresponding to the co-located luminance region corresponding to the current block, as shown in Figure 16.

[0358] In a specific implementation, after obtaining the luma sample at the offset position, it may be downsampled to obtain a luma reference sample. In some embodiments, determining, based on the reference block of the first color component, the first color component reconstructed sample indicated by the first candidate reference prediction parameter may include: downsampling the reference block of the first color component to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter, so that the resolution of the first color component reconstructed sample is the same as the resolution of the second color component reconstructed sample.

[0359] It should be noted that, in an embodiment of the present application, downsampling the reference block of the first color component to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter may include: determining the downsampling method of the current block; downsampling the reference block of the first color component according to the downsampling method to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter.

[0360] It should also be noted that, in the embodiment of the present application, since the resolutions of the luminance samples and the chrominance samples are inconsistent, the luminance samples need to be downsampled so that the resolutions of the downsampled luminance samples and the chrominance samples are the same. Here, to determine the downsampling method of the current block, the following sampling methods can be used to compete or a certain sampling method can be used by default, but they include but are not limited to the following six sampling methods. For example, assuming that the luminance sample before downsampling is recBvBefDownLuma, the width of the storage buffer is iRecRefLumaStride, and the luminance sample after downsampling is recBvAftDownLuma, the luminance sample after downsampling at position (i, j) is:

[0361] Downsampling method 1 (as shown in FIG17A ):

[0362] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]*2

[0363] +recBvBefDownLuma[2*i+1]

[0364] +recBvBefDownLuma[2*i-1]

[0365] +recBvBefDownLuma[2*i+iRecRefLumaStride]*2

[0366] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]

[0367] +recBvBefDownLuma[2*i-1+iRecRefLumaStride]+4)>>3;

[0368] Downsampling method 2 (as shown in FIG17B ):

[0369] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0370] +recBvBefDownLuma[2*i+1]+1)>>1;

[0371] Downsampling method three (as shown in FIG17C ):

[0372] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0373] +recBvBefDownLuma[2*i+iRecRefLumaStride]+1)>>1;

[0374] Downsampling method 4 (as shown in FIG17D ):

[0375] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+iRecRefLumaStride]

[0376] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1;

[0377] Downsampling method five (as shown in FIG17E ):

[0378] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+1]

[0379] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1;

[0380] Downsampling method six (as shown in FIG17F ):

[0381] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0382] +recBvBefDownLuma[2*i+1]

[0383] +recBvBefDownLuma[2*i+iRecRefLumaStride]

[0384] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+2)>>2.

[0385] In some embodiments, determining the downsampling method of the current block may include: decoding a code stream to determine a value of filter identification information; and determining the downsampling method of the current block according to the value of the filter identification information.

[0386] In other words, the decoder can determine the value of the filter identification information by decoding the bitstream, and thus determine the downsampling method for the current block. The filter identification information can be represented by filter_idx, and the filter identification information can take values ​​such as 0, 1, 2, 3, 4, and 5. Thus, after determining the downsampling method for the current block, downsampling can be performed to obtain the downsampled luminance reference sample recBvAftDownLuma at the corresponding BV of the co-located luminance region of the current block.

[0387] Furthermore, for the chroma sample of the current block, first obtain the position of the current block (xCbC, yCbC), obtain the chroma BV = (BVChor, BVCver), find the corresponding offset position (xCbC+BVChor, yCbC+BVCver), that is, obtain the chroma reference sample recBvChroma at the BV corresponding to the current block.

[0388] In some embodiments, determining a first color component reconstructed sample and a second color component reconstructed sample at a third position of a current block may include: determining a first template of the current block; and determining the first color component reconstructed sample and the second color component reconstructed sample at the third position based on the first template.

[0389] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block. Accordingly, the type of the first template may include at least one of the following: an upper template, an upper right template, a left template, a lower left template, and an upper left template. Among them, the upper template is located in the upper decoded area adjacent to the current block, the upper right template is located in the upper right decoded area adjacent to the current block, the left template is located in the left decoded area adjacent to the current block, the lower left template is located in the lower left decoded area adjacent to the current block, and the upper left template is located in the upper left decoded area adjacent to the current block.

[0390] That is, for the first color component reference sample value and the second color component reference sample value of the current block, not only the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters, but also the first color component reconstructed sample and the second color component reconstructed sample at a third position (e.g., the first template area) of the current block are included. The third position represents an arbitrary set position of the current block, including but not limited to an adjacent row and an adjacent column of the current block.

[0391] In this way, a mapping relationship between luminance and chrominance can be constructed according to the luminance reference sample recBvAftDownLuma, the chrominance reference sample recBvChroma, and the reconstructed luminance sample and the reconstructed chrominance sample at the third position.

[0392] S604: Determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value.

[0393] It should be noted that, in one possible implementation, determining the mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value may include: determining a first lookup table based on the first color component reference sample value and the second color component reference sample value, wherein the first lookup table is used to record the value of the second color component corresponding to the first color component when the index keyword is the first color component.

[0394] It should also be noted that, in another possible implementation, determining the mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value may include: determining a first discrete model based on the first color component reference sample value and the second color component reference sample value, wherein the first discrete model is used to indicate the mapping relationship between the first color component and the second color component.

[0395] In other words, the mapping relationship here can be a lookup table (LUT). The index key in the LUT can be the first color component, and the value in the LUT can be the second color component, that is, value = LUT[key]. Alternatively, the mapping relationship can be a discrete model used to represent the mapping relationship between key and value.

[0396] Exemplarily, assuming that the luminance component is the key and the chrominance component is the value, each key-value pair in the mapping relationship can be established in the following ways including but not limited to: LUT[recBvAftDownLuma[i][j]] = recBvChroma[i][j] (8)

[0397] It should also be noted that in the embodiments of the present application, for the first color component parameter samples, they can also be limited within a preset sample range. In some embodiments, the method may further include: performing mapping processing on the first color component reference sample values to make the first color component reference sample values within the preset sample range.

[0398] In the embodiments of the present application, the preset sample range can be [0, (1 << bitdepth) - 1], where bitdepth represents the bit depth. Exemplarily, the preset sample range can be ranges such as [0, 255], [0, 511], etc., but there is no limitation. Among them, for multiple sample ranges, the rate-distortion cost method can be used to select one of them as the final preset sample range.

[0399] Exemplarily, taking a video with a bit depth greater than 8 bits as an example, assuming that the bit depth of the video is 10 bits, then the sample range is [0, 1023]. For the recBvAftDownLuma of the key value, it can be mapped to a preset sample range of [0, 255] or [0, 511].

[0400] Further, in some embodiments, the method may further include: when there are multiple second reference values that are different in the corresponding second color component reference values while the first reference values in the first color component reference values are the same, performing an overwriting process in sequence according to the sample order, and taking the last second reference value as the value having a mapping relationship with the first reference value.

[0401] Further, in some embodiments, the method may further include: when there are multiple second reference values that are different in the corresponding second color component reference values while the first reference values in the first color component reference values are the same, calculating the average value of the multiple second reference values, and taking the obtained average value as the value having a mapping relationship with the first reference value.

[0402] That is to say, in the embodiment of the present application, for different chromaticity values ​​with the same key value in the mapping relationship, the entries with the same key value can be overwritten in sequence according to the sample order, or operations such as averaging can be taken. In addition, in the mapping relationship, the initialization setting of LUT[] is -1, that is, an unavailable value. "Overwriting" mainly means that if there is the same key value later, the new value will be used for storage; however, it is not limited to this method, and all can also be stored and then the average value can be calculated as the value corresponding to the key.

[0403] It can be understood that in the embodiment of the present application, the first color component reference sample value and the second color component reference sample value used to construct the mapping relationship can also be obtained in other ways, which are exemplified below in combination with several implementation methods.

[0404] In another specific implementation, the luma samples are not downsampled, and the chroma samples may be upsampled to obtain chroma reference samples. In some embodiments, determining, based on the reference block of the second color component, the reconstructed samples of the second color component indicated by the first candidate reference prediction parameter may include: upsampling the reference block of the second color component to determine the reconstructed samples of the second color component indicated by the first candidate reference prediction parameter, such that the resolution of the reconstructed samples of the first color component is the same as the resolution of the reconstructed samples of the second color component.

[0405] That is, in the embodiment of the present application, after obtaining the reconstructed luma samples recBvBefDownLuma of the co-located luma area, no downsampling is performed. In this case, after obtaining the reconstructed chroma samples recBvChroma at the BV corresponding to the current block, upsampling is required, including but not limited to linear interpolation, to obtain reconstructed chroma samples recBvChromaUp of the same size as the reconstructed luma samples at the BV.

[0406] In this way, the reconstructed luminance sample recBvBefDownLuma at BV is used as the luminance reference sample, and the obtained up-sampled reconstructed chrominance sample recBvChromaUp is used as the chrominance reference sample; then the mapping relationship between luminance and chrominance is constructed based on the luminance reference sample and the chrominance reference sample.

[0407] Accordingly, in this embodiment of the present application, the predicted value of the second color component of the current block also needs to be downsampled. That is, if the reconstructed chroma samples of the current block are upsampled when constructing the mapping relationship, then the luminance-to-chroma prediction of the current block based on the mapping relationship needs to be downsampled to obtain the final chroma prediction value of the current block. The downsampling method includes but is not limited to average downsampling.

[0408] In yet another specific implementation, the method may further include: determining a first template of the current block; and determining a first color component reference sample value and a second color component reference sample value of the current block according to the first template.

[0409] In an embodiment of the present application, the first color component reference samples and the second color component reference samples used to establish the mapping relationship may also include the first color component reference samples and the second color component reference samples determined by the first template of the current block. Specifically, based on the first template of the current block, a first color component region template at the same location as the first template may be determined; then, based on the reconstructed samples in the first color component region template, the first color component reference samples may be determined; and based on the reconstructed samples in the first template, the second color component reference samples may be determined. The first template includes one or more reconstructed samples in an adjacent decoded region of the current block.

[0410] For example, based on the current chroma template of the current block, a chroma reference sample can be obtained; after determining the co-located luma region template of the current chroma template, a luma reference sample can be obtained based on the co-located luma region template. The luma reference samples and chroma reference samples obtained in the above embodiments are then combined to construct a mapping relationship between luma and chroma based on these luma reference samples and chroma reference samples.

[0411] S605 : Determine a predicted value of the second color component of the current block according to the mapping relationship and the sample value of the first color component of the current block.

[0412] It should be noted that, in the embodiment of the present application, determining the first color component sample value of the current block may include: determining reconstructed pixel samples of the first color component region at the same location in the current block; and determining the first color component sample value of the current block based on the reconstructed pixel samples of the first color component region. The reconstructed pixel samples of the first color component region may be directly used as the first color component sample value of the current block, or the reconstructed pixel samples of the first color component region may be filtered and the filtered reconstructed pixel samples may be used as the first color component sample value of the current block, without any limitation herein.

[0413] For example, in an embodiment of the present application, the filtering process is a downsampling process. Here, the reconstructed luminance sample recBefDownLuma at the position of the co-located luminance area lumaPos = (xCb, yCb) corresponding to the current block can be obtained, and the luminance sample is downsampled to obtain the downsampled reconstructed luminance sample recAftDownLuma, and the downsampled reconstructed luminance sample is used as the first color component sample value of the current block. In addition, if the luminance reference sample has been mapped to a sample range, then the downsampled reconstructed luminance sample also needs to be mapped to the same sample range here to obtain the first color component sample value of the current block.

[0414] In some embodiments, determining the predicted value of the second color component of the current block based on the mapping relationship and the first color component sample value of the current block may include: if a first color component value equal to the first color component sample value is found in the mapping relationship, then determining the value of the second color component corresponding to the first color component value as the predicted value of the second color component of the current block.

[0415] For example, in the embodiment of the present application, assuming that the predicted value of the current block is predSamples, then for predSamples[cIdx][x][y], the variable cIdx specifies the color component index of the current block, and the following prediction method can be used here:

[0416] With reference to the luminance value Yc at the same position, the chrominance prediction value is derived using the mapping relationship (discrete model) established in the above embodiment.

[0417] In some embodiments, for determining the predicted value of the second color component of the current block, the method may further include: if a first color component value equal to the first color component sample value is not found in the mapping relationship, then correcting the first color component sample value, determining the first color component correction value, and continuing to search in the mapping relationship whether there is a first color component value equal to the first color component correction value.

[0418] In a specific embodiment, correcting the first color component reconstructed value to determine the first color component corrected value may include performing an offset calculation on the first color component sample value according to one or more preset offset values ​​to determine the first color component corrected value.

[0419] In the embodiment of the present application, the offset values ​​can be +1, -1, +2, -2, +3, -3, etc., and there is no limitation on the number and specific values ​​of the offset values. In addition, for the correction processing of the reconstructed value of the first color component, these multiple offset values ​​can also be set in a certain order, for example, in the order of {+1, -1, +2, -2, +3, -3}.

[0420] Exemplarily, in an embodiment of the present application, for the mapping relationship established in the aforementioned embodiment, if Yc is not found in the input luminance set, the following processing methods are included but not limited to: Yc is corrected in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, and then a matching check is performed in the input luminance set based on the corrected Yc, and then the value corresponding to the corrected Yc is determined as the chrominance prediction value of the current block.

[0421] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: if a first color component value equal to the first color component correction value is not found in the mapping relationship, then an average value of the second color component reference sample value is calculated, and the obtained average value is determined as the predicted value of the second color component of the current block.

[0422] Exemplarily, in an embodiment of the present application, for the mapping relationship established in the aforementioned embodiment, if Yc is not found in the input luminance set, the following processing methods are included but not limited to: Yc is corrected in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}; if all of the above corrected Yc cannot be matched in the mapping relationship, the chroma prediction value can be set to the average value of the reconstructed chroma sample recBvChroma at the corresponding BV.

[0423] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: determining a first initial predicted value of the second color component of the current block based on the mapping relationship and the sample value of the first color component of the current block; performing a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

[0424] It should be noted that in the embodiment of the present application, a correction operation is performed on the first initial prediction value obtained according to the mapping relationship. The correction operation here may include a clip operation, a filtering operation, a weighted operation with the prediction value obtained by other prediction modes, etc., and there is no limitation on this.

[0425] In a specific embodiment, performing a correction operation on the first initial prediction value to determine the prediction value of the second color component of the current block may include: performing prediction processing on the second color component of the current block according to the first preset mode to determine the second initial prediction value of the second color component of the current block; and performing weighted calculation on the first initial prediction value and the second initial prediction value to determine the prediction value of the second color component of the current block. It should be noted that, in the embodiment of the present application, the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode and CCLM mode. That is, performing a correction operation on the first initial prediction value obtained according to the mapping relationship may include but is not limited to weighting with the CCLM-type mode or other prediction modes to obtain the chrominance prediction value of the current block.

[0426] In another specific embodiment, performing a correction operation on the first initial prediction value to determine the prediction value of the second color component of the current block may include: limiting the first initial prediction value within a preset numerical range, or it may also be called a "clip operation". It should be noted that, in the embodiment of the present application, the lower limit value of the preset numerical range is the minimum prediction value (min), and the upper limit value of the preset numerical range is the maximum prediction value (max). If the first initial prediction value is within the preset numerical range, then the first initial prediction value can be used as the chrominance prediction value of the current block; if the first initial prediction value is greater than max, then max can be used as the chrominance prediction value of the current block; if the first initial prediction value is less than min, then min can be used as the chrominance prediction value of the current block.

[0427] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: when the first reference prediction parameter set includes multiple first candidate reference prediction parameters, determining multiple third initial prediction values ​​of the second color component of the current block; performing weighted calculation on the multiple third initial prediction values ​​to determine the predicted value of the second color component of the current block.

[0428] It should be noted that in an embodiment of the present application, if the aforementioned embodiment determines multiple BVs (first candidate reference prediction parameters), then multiple third initial prediction values ​​can be obtained based on these multiple BVs; then these multiple third initial prediction values ​​are weighted, and the weighted prediction values ​​are used as the chrominance prediction values ​​of the current block; or, the weighted prediction values ​​can be further modified, including but not limited to weighting with CCLM-type modes or other prediction modes to obtain the chrominance prediction value of the current block.

[0429] In a specific embodiment, for determining the predicted value of the second color component of the current block, the method may also include: when the first reference prediction parameter set includes multiple first candidate reference prediction parameters, determining the first color component reconstruction samples and the second color component reconstruction samples indicated by each of the multiple first candidate reference prediction parameters; determining multiple mapping relationships between the first color component and the second color component based on the first color component reconstruction samples and the second color component reconstruction samples indicated by each of the multiple first candidate reference prediction parameters; determining multiple third initial prediction values ​​of the second color component of the current block based on the multiple mapping relationships; and performing weighted calculation on the multiple third initial prediction values ​​to determine the predicted value of the second color component of the current block.

[0430] It should be noted that in the embodiment of the present application, multiple blocks of the same luminance region are obtained, and the positions of the multiple blocks include but are not limited to the following positions, as shown in Figure 11. Multiple blocks can correspond to multiple luminance BVs, and these multiple luminance BVs respectively construct candidates for their own chrominance BVC candidate lists. The availability of the BVs in the candidate list is judged to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. For the multiple groups of BVs, multiple mapping tables LUTs between luminance and chrominance can be established. In this way, multiple initial chrominance prediction values ​​can be obtained based on these multiple mapping tables LUTs, and the chrominance prediction value of the current block can be obtained through weighted calculation.

[0431] In some embodiments, for determining the predicted value of the second color component of the current block, as shown in FIG18 , the method may include:

[0432] S1801 , when a first color component block of a current block includes multiple candidate blocks, determine a second reference prediction parameter set for the current block; wherein the second reference prediction parameter set includes multiple second candidate reference prediction parameters.

[0433] S1802 , determining a plurality of first candidate reference prediction parameters according to a plurality of second candidate reference prediction parameters; and determining a plurality of candidate mapping relationships between the first color component and the second color component based on the plurality of first candidate reference prediction parameters.

[0434] S1803: Decode the code stream and determine the mapping relationship index value.

[0435] S1804: Determine a target mapping relationship based on the mapping relationship index value and multiple candidate mapping relationships.

[0436] S1805 , determining a predicted value of a second color component of the current block according to the target mapping relationship and the sample value of the first color component of the current block.

[0437] It should be noted that, in an embodiment of the present application, multiple mapping tables LUT between luminance and chrominance can be established, and then the selected target mapping table LUT can be indicated using syntax elements. Exemplarily, multiple blocks of the same luminance area are obtained, and the positions of the multiple blocks include but are not limited to the following positions, as shown in FIG11 . Multiple blocks can correspond to multiple luminance BVs, and these multiple luminance BVs respectively construct candidates for their respective chrominance BVC candidate lists, and judge the availability of the BVs in the candidate list to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. The available chrominance BVCs of these multiple blocks can respectively establish a mapping table LUT; at the decoding end, the mapping relationship index value can be determined by decoding the corresponding syntax elements; then the target mapping relationship can be determined according to the mapping relationship index value, and then the chrominance prediction value of the current block can be determined. It should be noted that the number of mapping relationships established here can be set arbitrarily, for example, the number can be set to 4, but there is no limitation.

[0438] In some embodiments, for determining the predicted value of the second color component of the current block, as shown in FIG19 , the method may include:

[0439] S1901 , when a first color component block of a current block includes multiple candidate blocks, determine a second reference prediction parameter set for the current block; wherein the second reference prediction parameter set includes multiple second candidate reference prediction parameters.

[0440] S1902: Determine a plurality of first candidate reference prediction parameters according to a plurality of second candidate reference prediction parameters; and determine a plurality of candidate mapping relationships between the first color component and the second color component based on the plurality of first candidate reference prediction parameters.

[0441] S1903: Calculate matching errors for the multiple candidate mapping relationships based on a template matching method to determine the second generation value of each of the multiple candidate mapping relationships.

[0442] S1904: Determine a minimum cost value from the second generation values ​​of the plurality of candidate mapping relationships, and determine the candidate mapping relationship corresponding to the minimum cost value as the target mapping relationship.

[0443] S1905 , determining a predicted value of a second color component of the current block according to the target mapping relationship and the sample value of the first color component of the current block.

[0444] In a specific embodiment, matching errors are calculated for multiple candidate mapping relationships based on a template matching method to determine the second-generation values ​​of each of the multiple candidate mapping relationships, which may include: determining the first template of the current block; determining the reconstructed pixel sample values ​​of the first color component area template at the same position of the first template; determining the predicted values ​​of the second color components of the first template under multiple mapping relationships based on the multiple candidate mapping relationships and the reconstructed pixel sample values ​​of the first color component area template; performing cost calculation based on the reconstructed values ​​of the second color components of the first template and the predicted values ​​of the second color components of the first template under multiple mapping relationships to determine the second-generation values ​​of each of the multiple candidate mapping relationships.

[0445] It should be noted that in an embodiment of the present application, multiple mapping tables LUT between luminance and chrominance can be established, and then a template is used to select which mapping table LUT to use. Exemplarily, multiple blocks of the same luminance area are obtained, and the positions of the multiple blocks include but are not limited to the following positions, as shown in Figure 11. Multiple blocks can correspond to multiple luminance BVs, and these multiple luminance BVs respectively construct candidates for their respective chrominance BVC candidate lists, and judge the availability of the BVs in the candidate list to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. The available chrominance BVCs of these multiple blocks can respectively establish a mapping table LUT; the current block template is predicted using different mapping table LUTs, and the difference is calculated with the reconstructed value of the template to decide which mapping relationship to use, and then the mapping relationship finally decided is used to determine the chrominance prediction value of the current block. It should be noted that the number of mapping relationships established here can be set arbitrarily, for example, the number can be set to 4, but there is no limitation.

[0446] In a specific embodiment, the specific process of performing LUT prediction on the current block template is as follows:

[0447] Obtain the reconstructed luminance sample recBefDownLumaR of the co-located luminance area template lumaPos=(xCbR, yCbR) corresponding to the current block template, downsample the luminance sample to obtain the downsampled reconstructed luminance sample recAftDownLumaR, and perform mapping processing on the sample in the same sample range.

[0448] Assuming that the predicted value of the current block template is predSamplesR, for predSamplesR[cIdx][x][y], the variable cIdx specifies the color component index of the current block, and the prediction method is: refer to the luminance value Yc at the same position to derive the predicted value using the established mapping relationship. If Yc is not found in the input luminance set in the established mapping relationship, the following processing methods are included but not limited to: check in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}. If all the above values ​​cannot be matched in the mapping relationship, the chroma prediction value of the current block is set to the average value of the reconstructed chroma sample recBvChroma at the corresponding BV.

[0449] When calculating the cost of the current block template and the template prediction value of each LUT, the following situations exist for the use of the template:

[0450] The first type: Both the upper template and the left template of the current block exist. In this case, both the upper template and the left template are available.

[0451] The second type: Only the upper template exists in the current block, and only the upper template is available.

[0452] The third type: Only the left template exists in the current block, and only the left template is available.

[0453] The fourth type: Neither the upper template nor the left template of the current block exists. In this case, the LUT finally selected is the first LUT created or the LUT at a specified position.

[0454] For example, in the embodiment of the present application, assuming that the reconstruction value of the current block template is recSamplesR, there are multiple options for the cost function for calculating the template region cost, for example, the sum of absolute deviations (SAD), the sum of transformed absolute deviations (SATD), the sum of squared differences (SSE), the mean absolute deviation (MAD), the mean absolute error (MAE), the mean squared error (MSE), and other evaluation criteria can be selected. The evaluation criteria mentioned in the following content can be selected from the above criteria. Taking the evaluation criterion of SAD as an example, the calculation formula is as follows:

[0455] Among them, predTempSizeW is the width of the template, predTempSizeH is the height of the template, predSamplesR[i][j] is the predicted pixel point of the current block template after LUT, and recSamplesR[i][j] is the reconstructed pixel point of the current block template.

[0456] It should also be noted that in the embodiment of the present application, when selecting the final LUT using the current block template, except for cases where the cost cannot be calculated, the cost of each established LUT candidate is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. Among them, the LUT candidate with the lowest cost is selected as the final LUT used.

[0457] In some embodiments, after determining the predicted value of the second color component of the current block, the method may further include: decoding the code stream to determine the residual value of the second color component of the current block; and determining the reconstructed value of the second color component of the current block based on the residual value and the predicted value.

[0458] It should be noted that, in the embodiment of the present application, determining the reconstructed value of the second color component of the current block may include: performing an addition operation on the residual value and the predicted value to obtain the reconstructed value of the second color component of the current block.

[0459] In some embodiments, the method further includes: determining a first color component region at the same position of the current block; if the current block uses the DM mode and the first color component region is predicted based on the block vector, determining that the current block uses the first prediction mode.

[0460] It should be noted that in the embodiment of the present application, the first color component area at the same position of the current block is determined; if the current block uses the DM mode and the first color component area is predicted based on the block vector, it is determined that the current block uses the first prediction mode.

[0461] For example, in the embodiment of the present application, under dual-tree partitioning, in DM mode, if the corresponding luminance area has BV information, the current block is predicted using the first prediction mode (BVG-LUT mode). For example:

[0462] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, set intra_bvglut_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT.

[0463] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, if IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, set intra_bvglut_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT.

[0464] In the embodiment of the present application, the first syntax element can be used to indicate whether the current block uses the BVG-LUT mode. The first syntax element can be represented by intra_bvgplt_flag or bvgplt_flag. The chroma prediction mode is derived as follows:

[0465] The chroma intra prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode specified in the following table. These padding items other than the BVG-LUT mode are exemplary given corresponding values, and are not required to be filled in with this value. Among them, Table 9 shows an example of chroma prediction mode derivation. As shown in Table 9, 0 represents Planar mode, 1 represents DC mode, 18 represents horizontal mode, 50 represents vertical mode, and 81 to 83 represent CCLM mode.

[0466] Table 9

[0467] According to Table 9, in DM mode, if intra_bvglut_flag == 1, that is, the information obtained from the center block of the same luminance area contains BV, the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses the BVG-LUT mode.

[0468] In some embodiments, the method further includes: determining a value of a second syntax element; and when the second syntax element indicates that the current block allows the use of the first prediction mode, performing the step of determining prediction parameters of the current block.

[0469] It should be noted that in the embodiment of the present application, the second syntax element can be represented by BvglutEnabled. If the value of the second syntax element is the first value, the second syntax element indicates that the current block allows the use of the first prediction mode; if the value of the second syntax element is the second value, the second syntax element indicates that the current block does not allow the use of the first prediction mode.

[0470] It should also be noted that in the embodiment of the present application, the first value and the second value are different. The first value and the second value can be in parameter form or in numerical form. Specifically, both the first syntax element and the second syntax element can be parameters written in the profile or the value of a flag / identifier, and no limitation is made here.

[0471] 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 0 and the second value can be set to 1; or the first value can be set to true and the second value can be set to false; or the first value can be set to false and the second value can be set to true. In the embodiment of the present application, the first value can be set to 1 and the second value can be set to 0, but this is not limited to any aspect of the present invention.

[0472] Exemplarily, in an embodiment of the present application, if the syntax element sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, then BvglutEnabled is equal to 0. Otherwise, the variable ModeIncludeBv is set, and if the corresponding luminance block is not encoded in a mode with BV information, ModeIncludeBv is equal to 0; otherwise, ModeIncludeBv is equal to 1.

[0473] In one possible implementation, BvglutEnabled is equal to 1 if multiple of the following conditions are true at the same time (including but not limited to the following conditions):

[0474] ModeIncludeBv is equal to 1;

[0475] sh_slice_type is equal to I frame;

[0476] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0477] In another possible implementation, BvglutEnabled is equal to 1 if multiple of the following conditions are true at the same time (including but not limited to the following conditions):

[0478] ModeIncludeBv is equal to 1;

[0479] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0480] In yet another possible implementation, if multiple of the following conditions are true at the same time (including but not limited to the following conditions), then BvglutEnabled is equal to 1:

[0481] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0482] For each possible implementation, otherwise, BvglutEnabled is equal to 0. Here, if BvglutEnabled is equal to 0, then the value of the first syntax element can be inferred to be 0.

[0483] It should also be noted that in the embodiment of the present application, the prediction mode of the current block can also be determined at the encoding end based on the BVG-LUT mode competing with other modes. Among them, in the DM mode, in addition to the BVG-LUT mode, other modes can also compete. The final usage mode is determined according to the template cost. For example, instead of directly using the BV obtained by brightness, BV copy can be directly used, or the BVG-LUT mode defined in the embodiment of the present application can be used. After both modes are applied to the template of the current block, the one with the smaller template cost is selected as the prediction mode of the current block.

[0484] This embodiment provides a decoding method, which determines prediction parameters of a current block; determines a first reference prediction parameter set for the current block based on the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters; determines a first color component reference sample value and a second color component reference sample value of the current block based on the first reference prediction parameter set; determines a mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value; and determines a prediction value of the second color component of the current block based on the mapping relationship and the first color component sample value of the current block. In this way, if the current block uses the BVG-LUT mode, then a first reference prediction parameter set for applying the chroma component can be determined, and based on the first reference prediction parameter set, a luminance component reference sample value and a chroma component reference sample value of the current block can be determined, thereby establishing a mapping relationship between the luminance component and the chroma component, and then using this mapping relationship to predict the chroma component. In other words, the correlation between the reconstructed samples in the current image and the current block samples is fully utilized here to improve the uniformity of the chrominance prediction, thereby improving the accuracy of the chrominance prediction; and according to the established mapping relationship, pixel-level prediction can also be effectively performed, which can further save bit rate, improve encoding and decoding efficiency, and thus improve encoding and decoding performance.

[0485] In another embodiment of the present application, FIG20 is a flow chart of a coding method provided in an embodiment of the present application. As shown in FIG20 , the method may include:

[0486] S2001, determine the prediction parameters of the current block.

[0487] It should be noted that the encoding method in the embodiment of the present application is applied to an encoder. In addition, the encoding method may specifically refer to an intra-frame prediction method, more specifically, a block vector-based chrominance prediction method. A video image may be divided into a plurality of coding blocks, each of which may include a first color component, a second color component, and a third color component. The current block in the embodiment of the present application refers to a coding block in the video image that is currently to be subjected to chrominance prediction.

[0488] Here, if the current block predicts a first color component, and the first color component is a luminance component, then the current block may also be referred to as a luminance block; or, if the current block predicts a second color component, and the second color component is a chrominance component, then the current block may also be referred to as a chrominance block.

[0489] It should also be noted that, in embodiments of the present application, the prediction parameter may be used to indicate whether the current block uses the first prediction mode. In some embodiments, the method may include: determining a first-generation value when the current block uses the first prediction mode, and determining a second-generation value when the current block does not use the first prediction mode; and determining the prediction parameter based on the first-generation value and the second-generation value.

[0490] In a specific embodiment, determining the prediction parameter based on the first generation value and the second generation value may include: if the first generation value is less than the second generation value, determining the prediction parameter to indicate that the current block uses the first prediction mode; if the first generation value is greater than the second generation value, determining the prediction parameter to indicate that the current block does not use the first prediction mode.

[0491] In some embodiments, the method may further include: determining a value of the first syntax element according to the prediction parameter; encoding the value of the first syntax element, and writing the obtained coded bits into the bitstream.

[0492] It should be noted that, in an embodiment of the present application, determining the value of the first syntax element based on the prediction parameter may include: if the prediction parameter indicates that the current block uses the first prediction mode, determining the value of the first syntax element to be the first value; if the prediction parameter indicates that the current block does not use the first prediction mode, determining the value of the first syntax element to be the second value.

[0493] It should also be noted that in this embodiment of the present application, if the current block uses the first prediction mode, the value of the prediction parameter is determined to be the first value; if the current block does not use the first prediction mode, the value of the prediction parameter is determined to be the second value. Here, the method may also include: setting the value of the prediction parameter to be equal to the value of the first syntax element.

[0494] It should also be noted that, in the embodiment of the present application, the first syntax element can be represented by intra_bvglut_flag or bvglut_flag. The first syntax element can be used to indicate whether the current block uses the first prediction mode. Here, if the value of the first syntax element is the first value, it is determined that the current block uses the first prediction mode; if the value of the first syntax element is the second value, it is determined that the current block does not use the first prediction mode.

[0495] It is understood that in the embodiment of the present application, the first value is different from the second value. 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 0 and the second value can be set to 1; or the first value can be set to true and the second value can be set to false; or the first value can be set to false and the second value can be set to true.

[0496] In a specific embodiment, the first value is set to 1 and the second value is set to 0. For example, if the value of the first syntax element is 1, it indicates that the prediction parameter indicates that the current block uses the first prediction mode, and the encoding method of the embodiment of the present application continues to be performed; otherwise, if the value of the first syntax element is 0, it indicates that the prediction parameter indicates that the current block does not use the first prediction mode, and other prediction modes in the related art (such as the PLANAR mode, CCLM mode, angular prediction mode, etc.) can be used for encoding processing.

[0497] S2002 : Determine a first reference prediction parameter set for the current block according to the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters.

[0498] It should be noted that, in the embodiment of the present application, when the prediction parameter indicates that the current block uses the first prediction mode, a first reference prediction parameter set for the current block is determined. The first prediction mode may be a BVG-LUT mode. That is, for the current block, if the current block uses the BVG-LUT mode, the first reference prediction parameter set for the current block may be determined.

[0499] In some embodiments, determining a first reference prediction parameter set for a current block may include: determining a first color component block of the current block; determining a second reference prediction parameter set for the current block based on the first color component block; and determining a first reference prediction parameter set for the current block based on the second reference prediction parameter set.

[0500] It should be noted that, in the embodiment of the present application, the first reference prediction parameter set may include one or more first candidate reference prediction parameters, wherein the first candidate reference prediction parameters may be vector parameters based on the second color component.

[0501] It should also be noted that, in the embodiment of the present application, the second reference prediction parameter set may include one or more second candidate reference prediction parameters, wherein the second candidate reference prediction parameters may be vector parameters based on the first color component.

[0502] Exemplarily, the first color component may be a luminance component, and the second color component may be a chrominance component. Then, the first candidate reference prediction parameter may be a vector parameter based on the chrominance component, and the second candidate reference prediction parameter may be a vector parameter based on the luminance component.

[0503] In some embodiments, the vector parameter includes one of the following: a block vector parameter, a motion vector parameter. That is, whether the first reference prediction parameter set or the second reference prediction parameter set can be a parameter list applied to a BV, or a parameter list applied to an MV.

[0504] In a specific embodiment, taking BV as an example, the "first reference prediction parameter" here can be a block vector parameter based on the chrominance component, then the first reference prediction parameter set can be called a chrominance BVC candidate list; the "second reference prediction parameter" here can be a block vector parameter based on the luminance component, then the second reference prediction parameter set can be called a luminance BVL candidate list.

[0505] In some embodiments, determining the first color component block of the current block may include: determining a first color component region at the same location of the current block; and determining the first color component block of the current block based on multiple partitioned blocks of the first color component region.

[0506] It should be noted that, in the embodiment of the present application, if the first color component is a luminance component, then the first color component region may also be referred to as a "co-located luminance region". For example, if the current block is a chrominance block, then the co-located luminance region may refer to the co-located luminance region corresponding to the current block. For the current block, the co-located first color component region may be divided into blocks, for example, using a binary tree structure, a ternary tree structure, a quadtree structure, etc., to obtain multiple blocks, each of which may be regarded as a CU, a sub-block, or a transform block, etc.; then, the first color component block of the current block is determined from these multiple divided blocks.

[0507] For example, in Figure 3, the area filled with diagonal lines represents the co-located luminance area corresponding to the chrominance component. Within this co-located luminance area, multiple blocks can be divided; the block at the center can be selected from these blocks as the corresponding luminance block of the current block. For example, the block filled with black in Figure 3 is the corresponding luminance block of the current block (the first color component block).

[0508] In a specific embodiment, for determining the first color component block of the current block, the method may include: determining a first candidate block at a first position from multiple divided blocks; and determining the first color component block of the current block based on the first candidate block at the first position.

[0509] In the embodiment of the present application, the first position may refer to any position of the first color component area. For example, the first position may be the center position, the upper left corner position, the lower right corner position, a specific position, etc. in the first color component area.

[0510] In the embodiments of the present application, the first candidate block may refer to a block at the first position. In a specific embodiment, the block at the center of the first color component region is selected as the first candidate block; and / or the block at the upper left corner of the first color component region is selected as the first candidate block; and / or the block at the lower right corner of the first color component region is selected as the first candidate block, and so on, without any limitation herein.

[0511] Further, in some embodiments, based on the first candidate block at the first position, the first color component block of the current block is determined. The method may include: performing a position offset search in a preset search area at the first position to determine multiple second candidate blocks; and determining the first color component block of the current block based on the first candidate block and / or multiple second candidate blocks.

[0512] In an embodiment of the present application, a position offset search is performed in a preset search area at the first position. Multiple positions may be searched in the upper left, upper, left, and other directions based on the first position. For example, the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), the left coordinate offset (xOffset, yOffset) = (-2, 0), etc. of the first position may be obtained. No limitation is made here.

[0513] In some embodiments, determining the first color component block of the current block may include: determining the position information of the current block; scaling the position information of the current block according to a preset sampling format to obtain the co-located area position information corresponding to the current block; determining the target position information based on the co-located area position information, and using the candidate block containing the target position information as the first color component block of the current block.

[0514] In some embodiments, determining the target position information based on the co-located area position information may include: calculating the center position based on the co-located area position information, and using the obtained center position information as the target position information; or, calculating the upper left corner position based on the co-located area position information, and using the obtained upper left position information as the target position information; or, calculating the lower right corner position based on the co-located area position information, and using the obtained lower left position information as the target position information.

[0515] In an embodiment of the present application, the preset sampling format may be a chroma sampling format (or color sampling format). For example, the mapping relationship between the position (x, y) of the current block and the position (xCb, yCb) of the co-located area is shown in Table 4.

[0516] In one possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0517] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance region corresponding to the current block (i.e., the entire diagonally filled region of the luminance component in Figure 3) is cbWidth, and the height is cbHeight; then the block at the center (the block at the center of the luminance region) is the luminance block containing the center coordinates (xCb+cbWidth>>1, yCb+cbHeight>>1), which is also the block filled with black in Figure 3. In Figure 3, the small white block represents the position of the center coordinates, which can be used to locate the position of the luminance block.

[0518] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2) of the center position of the same luminance region, the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0). The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+cbWidth>>1+xOffset, yCb+cbHeight>>1+yOffset).

[0519] In another possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0520] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (i.e., the entire diagonally filled area of ​​the luminance component in Figure 9) is cbWidth, and the height is cbHeight; then the block at the upper left corner (the upper left corner block of the luminance area) is the luminance block containing the upper left corner coordinates (xCb, yCb), which is also the block filled with black in Figure 9. In Figure 9, the small white block represents the position of the upper left corner coordinates, which can be used to locate the position of the luminance block.

[0521] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upper coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the upper left corner position of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+xOffset, yCb+yOffset).

[0522] In another possible implementation, the position of the current block, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the co-located luminance area position lumaPos = (xCb, yCb) corresponding to the current block.

[0523] Here, assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (i.e., the entire diagonally filled area of ​​the luminance component in Figure 10) is cbWidth, and the height is cbHeight; then the block at the lower right corner (the lower right corner block of the luminance area) is the luminance block containing the lower right corner coordinates (xCb+cbWidth-1, yCb+cbHeight-1), which is also the block filled with black in Figure 10. In Figure 10, the small white block represents the position of the lower right corner coordinates, which can be used to locate the position of the luminance block.

[0524] Here, for multiple second candidate blocks, multiple positions can be searched to the upper left, above, and left of the luminance block position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the lower right corner position of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb + cbWidth - 1 + xOffset, yCb + cbHeight - 1 + yOffset).

[0525] That is to say, in an embodiment of the present application, the first candidate block as the first color component block can be a block at any position among the multiple blocks shown in Figure 3. For example, the block at the center position in the co-located luminance area as shown in Figure 3 (a block filled with black), the block at the upper left corner position in the co-located luminance area as shown in Figure 9 (a block filled with black), the block at the lower right corner position in the co-located luminance area as shown in Figure 10 (a block filled with black), or even the block at the upper right corner position, the block at the lower left corner position, or even the block at the center position of the upper left area, etc., without any limitation here. Furthermore, based on the first candidate block, multiple positions can be searched to the upper left, above, and left to obtain multiple second candidate blocks. Then, based on the first candidate block and / or multiple second candidate blocks, the first color component block of the current block can be determined.

[0526] In some embodiments, the method may further include: determining at least one candidate block at a preset position from a plurality of divided blocks of the first color component area; and determining a first color component block of the current block based on the at least one candidate block.

[0527] In this embodiment of the present application, this at least one candidate block can be used as the first color component block of the current block. That is, the first color component block can be at least one candidate block obtained sequentially. For example, as shown in Figure 11, this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; it can be multiple different positions; nor is it limited to the five positions shown in Figure 11, and no limitation is imposed on these positions.

[0528] In another possible implementation, taking the block including five luminance pixel positions shown in FIG. 11 as an example, the positions may be acquired sequentially according to a preset order, which includes but is not limited to the following order: C->TL->TR->BL->BR.

[0529] For the detailed position derivation process of C, TL, TR, BL, and BR, the position of the current block is obtained, that is, the position of the upper left chromaticity sample of the current block relative to the upper left chromaticity sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format shown in Table 4 to obtain the position of the same luminance area corresponding to the current block, lumaPos = (xCb, yCb).

[0530] Here, it is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current block relative to the luminance pixel in the upper left corner of the image (i.e., the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block (i.e., the entire diagonal filled area of ​​the luminance component in Figure 11) is cbWidth, and the height is cbHeight.

[0531] The coordinates of the position of the brightness pixel C are (xCb+cbWidth / 2,yCb+cbHeight / 2);

[0532] The coordinates of the position of the luminance pixel TL are (xCb, yCb);

[0533] The coordinates of the position of the brightness pixel TR are (xCb+cbWidth-1, yCb);

[0534] The coordinates of the position of the brightness pixel BL are (xCb, yCb+cbHeight-1);

[0535] The coordinates of the position of the luminance pixel BR are (xCb+cbWidth-1, yCb+cbHeight-1).

[0536] Here, when searching for each position, multiple positions can also be searched to the upper left, above, and left of this position, including but not limited to the following exemplary search positions: obtaining the upper left coordinate offset of this position (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0). The luminance block used in the luminance area is the luminance block that includes the coordinates of the position plus the position coordinates of the offset position.

[0537] Thus, for the current block, it is first necessary to determine the corresponding first color component block. For example, when the first color component is a luminance component, it is necessary to determine the corresponding luminance block of the current block. Specifically, the above-mentioned possible implementation methods can be used to determine one or more corresponding luminance blocks.

[0538] It is understood that after determining the first color component block, a second reference prediction parameter set for the current block can be constructed. In some embodiments, the method may include: determining one or more candidate vector parameters based on the first color component based on the first color component block; and determining the second reference prediction parameter set for the current block based on the one or more candidate vector parameters based on the first color component.

[0539] It should be noted that, in an embodiment of the present application, determining the second reference prediction parameter set of the current block based on one or more candidate vector parameters based on the first color component may include: adjusting the candidate vector parameters based on the first color component to determine the candidate vector parameters based on the second color component; when the candidate vector parameters based on the second color component meet the preset availability conditions, using the candidate vector parameters based on the first color component as the second candidate reference prediction parameters and adding them to the second reference prediction parameter set.

[0540] Here, taking the block vector parameter BV as an example, assuming that the current block is a chroma block and the first color component block is a luminance block, then the candidate vector parameter based on the first color component can be the BV of the luminance block, that is, BVL; the candidate vector parameter based on the second color component can be the BV of the chroma block, that is, BVC.

[0541] It should also be noted that in the embodiment of the present application, assuming that the candidate vector parameter based on the first color component is luminance BV = (BVLhor, BVLver), and the candidate vector parameter based on the second color component is chrominance BV = (BVChor, BVCver), then the corresponding chrominance BV can be determined by adjusting BVL (luminance BV).

[0542] In a specific embodiment, adjusting the candidate vector parameters based on the first color component and determining the candidate vector parameters based on the second color component may include: determining a preset sampling format for the current block; scaling the candidate vector parameters based on the first color component according to the preset sampling format, and determining the candidate vector parameters based on the second color component.

[0543] It should be noted that, in an embodiment of the present application, the above adjustment may include scaling according to a preset sampling format. The preset sampling format may be a mapping relationship between the luma BV and the scaled chroma BV shown in Table 8. Here, the preset format may refer to a color sampling format, such as monochrome, 4:2:0, 4:2:2, 4:4:4, etc. The syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, where the color sampling format is specifically the chroma sampling format. Here, different types of color sampling formats have different corresponding scaling operations.

[0544] For example, if the value of sps_chroma_format_idc is 0, the color sampling format is determined to be monochrome, that is, there is no chroma BV parameter (BVC hor , BVC hor); If the value of sps_chroma_format_idc is 1, the color sampling format is determined to be 4:2:0. At this time, the mapping relationship between brightness BV and chroma BV is: BVC hor =BVL hor >>1, BVC hor =BVL ver >>1; If the value of sps_chroma_format_idc is 2, the color sampling format is determined to be 4:2:2. At this time, the mapping relationship between the brightness BV and the chroma BV is: BVC hor =BVL hor >>1, BVC hor =BVL ver ; If the value of sps_chroma_format_idc is 3, it means that the color sampling format is 4:4:4. At this time, the mapping relationship between brightness BV and chroma BV is: BVC hor =BVL hor , BVC hor =BVL ver .

[0545] Thus, based on Table 8, the candidate BVL can be scaled according to the color sampling format to obtain a scaled BVC; and then it is determined whether the scaled BVC meets the preset usability conditions. The scaled BVC meets the preset usability conditions, including but not limited to:

[0546] The offset position indicated by the scaled BVC does not exceed the image boundary;

[0547] The offset position indicated by the scaled BVC does not exceed the slice boundary;

[0548] The offset position indicated by the scaled BVC does not cover the current block;

[0549] The offset position indicated by the scaled BVC does not exceed the preset available area;

[0550] The offset position indicated by the scaled BVC has been reconstructed.

[0551] It should also be noted that in the embodiment of the present application, one or more candidate vector parameters based on the first color component (i.e., one or more candidate BVLs) are scaled based on the first color component block. If a candidate BVL is scaled based on the color sampling format shown in Table 8, and the scaled BVL meets the preset availability condition, then this candidate BVL can be used as a second candidate reference prediction parameter and added to the second reference prediction parameter set to construct the second reference prediction parameter set. The second reference prediction parameter set can include one or more second candidate reference prediction parameters.

[0552] It is also understood that after constructing the second reference prediction parameter set, the first reference prediction parameter set for the current block can be further determined. In some embodiments, the method may include: adjusting one or more second candidate reference prediction parameters in the second reference prediction parameter set to determine first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters; and determining the first reference prediction parameter set for the current block based on the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters.

[0553] It should be noted that in the embodiment of the present application, the number of first candidate reference prediction parameters and second candidate reference prediction parameters is the same. That is, for each second candidate reference prediction parameter, it can be adjusted to obtain one or more first candidate reference prediction parameters, and then a usable first candidate reference prediction parameter is determined from them. However, it should be noted that the number of first candidate reference prediction parameters and second candidate reference prediction parameters can also be different. In this case, each second candidate reference prediction parameter can determine more than one usable first candidate reference prediction parameter, and this is not limited here.

[0554] In some embodiments, one or more second candidate reference prediction parameters in the second reference prediction parameter set are adjusted to determine the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters. Here, taking one of the second candidate reference prediction parameters as an example, the method may include: adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set based on the second color component; and determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter based on the third reference prediction parameter set.

[0555] In the embodiment of the present application, for each second candidate reference prediction parameter, this method can be used to determine the corresponding first candidate reference prediction parameter to obtain a first reference prediction parameter set.

[0556] For example, assuming that the current block is a chroma block and the first color component block is a luma block, the first candidate reference prediction parameter may be a candidate BV for the chroma block, i.e., a candidate BVC; and the second candidate reference prediction parameter may be a candidate BV for the luma block, i.e., a candidate BVL. Adjusting the second candidate reference prediction parameter may determine one or more candidate vector parameters based on the second color component, i.e., one or more candidate BVCs. These candidate BVCs may be used to construct a third reference prediction parameter set.

[0557] It can be understood that in an embodiment of the present application, assuming that the second candidate reference prediction parameter is luminance BV = (BVLhor, BVLver), and the candidate vector parameter based on the second color component is chrominance BV = (BVChor, BVCver), then it is possible to choose to construct a chrominance BVC candidate list containing one or more candidate block vector parameters by adjusting BVL (luminance BV) or BVC (chrominance BV).

[0558] In one possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: scaling the second candidate reference prediction parameter according to a preset sampling format of the current block, determining a candidate vector parameter based on the second color component, and adding the candidate vector parameter based on the second color component to the third reference prediction parameter set.

[0559] It should be noted that, in the embodiment of the present application, the above adjustment may include scaling according to a preset sampling format. The preset sampling format may be a mapping relationship between the luma BV and the scaled chroma BV shown in Table 8. Here, the preset format may refer to a color sampling format, such as monochrome, 4:2:0, 4:2:2, 4:4:4, etc. In this way, scaling may be performed according to the color sampling format shown in Table 8, and the scaled BVC may be added as a candidate vector parameter to the third reference prediction parameter set.

[0560] In another possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: scaling the second candidate reference prediction parameter according to a preset sampling format of the current block to determine a first initial vector parameter based on the second color component; performing an offset calculation on the first initial vector parameter based on the second color component according to one or more offset values ​​to determine one or more candidate vector parameters based on the second color component, and adding the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

[0561] In another possible implementation, adjusting the second candidate reference prediction parameter to determine a third reference prediction parameter set based on the second color component may include: performing offset calculation on the second candidate reference prediction parameter according to one or more offset values ​​to determine one or more second initial vector parameters based on the first color component; scaling one or more second initial vector parameters based on the first color component according to a preset sampling format of the current block to determine one or more candidate vector parameters based on the second color component, and adding the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

[0562] It should be noted that in the embodiment of the present application, the above-mentioned one or more offset values ​​can be any number of arbitrary numerical values, such as -1, +1, -2, +2, -3, +3, etc., and no limitation is made here.

[0563] That is, in the embodiment of the present application, after obtaining the BV of the corresponding luminance block, it can be recorded as BVL, and the chrominance BV obtained through BVL can be recorded as BVC. Then, by adjusting BVL or BVC, a chrominance BVC candidate containing one or more candidates can be constructed. The candidate construction method includes but is not limited to the following:

[0564] In one possible construction method, BVL can be adjusted to form four situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, the four situations are BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, BVL = (BVLhor, BVLver).

[0565] Or, when BVL is an even number, take BVL=(BVL hor, BVL ver )、BVL=(BVL hor +1, BVL ver )、BVL=(BVL hor, BVL ver +1), BVL=(BVL hor +1,BVL ver +1) Four situations.

[0566] Here, BVC[0]=BVL[0]*2 / SubWidthC, BVC[1]=BVL[1]*2 / SubHeightC. SubWidthC and SubHeightC can be determined according to the mapping relationship between sps_chroma_format_idc and the color sampling format in Table 1.

[0567] BVC is obtained by scaling BVL according to the above formula, so that when BVL is an odd number or an even number, four BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (ie, the third reference prediction parameter set).

[0568] In another possible construction method, BVL can be adjusted to form four cases, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor-1, BVLver), BVL = (BVLhor, BVLver-1), and BVL = (BVLhor-1, BVLver-1). Next, BVL is scaled according to the color sampling format in Table 8 to obtain BVC, so that when BVL is an odd number or an even number, four BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (ie, the third reference prediction parameter set).

[0569] It should be noted that, in this construction method, the operations under different circumstances of uniform parity and even numbers can also be calculated as follows: take four cases: BVL = (BVLhor-1, BVLver-1), BVL = (BVLhor+1, BVLver-1), BVL = (BVLho-1r, BVLver+1), and BVL = (BVLhor+1, BVLver+1).

[0570] In another possible construction method, BVL can be adjusted to form multiple situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, multiple situations such as BVL=(BVLhor, BVLver), BVL=(BVLhor+1, BVLver), BVL=(BVLhor, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver), BVL=(BVLhor, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-2, BVLver), and BVL=(BVLhor, BVLver-2) are taken, and a list is constructed in order for these candidates. When BVL is an even number, multiple cases are taken, such as BVL=(BVLhor, BVLver), BVL=(BVLhor-1, BVLver), BVL=(BVLhor, BVLver-1), BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor-3, BVLver), BVL=(BVLhor, BVLver-3), BVL=(BVLhor-3, BVLver-3), BVL=(BVLhor+2, BVLver), and BVL=(BVLhor, BVLver+2). Next, BVL is scaled according to the color sampling format in Table 8 to obtain BVC. In this way, when BVL is an odd number or an even number, multiple BVC candidates are formed, and these candidates are added to the chroma BVC candidate list (i.e., the third reference prediction parameter set).

[0571] It should be noted that, in this construction method, the operations in different cases of uniform parity and even numbers can also be calculated as follows: take BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor+1, BVLver-1), BVL=(BVLhor-1, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver-1), BVL=(BVLhor-1, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-3, BVLver-1), BVL=(BVLhor-1, BVLver-3), etc.

[0572] In another possible construction method, the obtained BVC can also be adjusted to obtain nine candidates: that is, set BVC = (BVChor, BVCver), BVC = (BVChor-1, BVCver), BVC = (BVChor, BVCver-1), BVC = (BVChor-1, BVCver-1), BVC = (BVChor+1, BVCver), BVC = (BVChor, BVCver+1), BVC = (BVChor+1, BVCver+1), BVC = (BVChor-1, BVCver+1), BVC = (BVChor+1, BVCver-1), thus forming nine BVC candidates, which are added to the chroma BVC candidate list (that is, the third reference prediction parameter set).

[0573] In another possible construction method, the obtained BVC can also be adjusted to obtain multiple candidates: that is, set BVC=(BVChor, BVCver), BVC=(BVChor-1, BVCver), BVC=(BVChor, BVCver-1), BVC=(BVChor-1, BVCver-1), BVC=(BVChor+1, BVCver), BVC=(BVChor, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor+1, BVCver er-1), BVC=(BVChor-2, BVCver), BVC=(BVChor, BVCver-2), BVC=(BVChor-2, BVCver-2), BVC=(BVChor+2, BVCver), BVC=(BVChor, BVCver+2), BVC=(BVChor+2, BVCver+2), BVC=(BVChor-2, BVCver+2), BVC=(BVChor+2, BVCver-2), etc., thus forming a variety of BVC candidates, which are added to the chroma BVC candidate list (i.e., the third reference prediction parameter set).

[0574] It should also be noted that in the embodiments of this application, when BVL is odd or even, since BVL is a two-dimensional vector, this specifically refers to whether one of its components is odd or even. In addition, the "+1", "-1", "+2", "-2", "+3", and "-3" here all refer to integer pixel precision.

[0575] It is understood that in the embodiments of the present application, when determining the first candidate reference prediction parameter based on the third reference prediction parameter set, it is also necessary to determine whether the candidate vector parameters in the third reference prediction parameter set are available, that is, it is necessary to select one or more available candidate vector parameters from the third reference prediction parameter set. Therefore, in some embodiments, determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter based on the third reference prediction parameter set may include: determining whether the third reference prediction parameter set includes one or more candidate vector parameters that meet a preset availability condition; and when the third reference prediction parameter set includes one or more candidate vector parameters that meet the preset availability condition, determining the first candidate reference prediction parameter based on the one or more candidate vector parameters.

[0576] Specifically, in the embodiment of the present application, only when the candidate vector parameter meets the preset availability condition can the candidate vector parameter be determined as the first candidate reference prediction parameter.

[0577] In some embodiments, one or more candidate vector parameters meet preset availability conditions, including but not limited to:

[0578] The offset position indicated by the one or more candidate vector parameters does not exceed the image boundary;

[0579] The offset position indicated by the one or more candidate vector parameters does not exceed the slice boundary;

[0580] The offset position indicated by the one or more candidate vector parameters does not cover the current block;

[0581] The offset position indicated by one or more candidate vector parameters does not exceed a preset available area;

[0582] The offset position indicated by one or more candidate vector parameters has been reconstructed.

[0583] It should be noted that in this embodiment of the present application, assuming the current block position is (xCb, yCb), for the candidate vector parameters, BVC = (BVChor, BVCver), the corresponding offset position is found (xCb + BVChor, yCb + BVCver). Here, the offset position does not exceed the image boundary and can also be specifically described using data such as coordinate position information and the size parameters of the current block. For example, xCb + width + BVChor < = xCb or yCb + height + BVCver < = yCb.

[0584] It should also be noted that, in the embodiments of the present application, the preset availability condition may also consider whether the slice boundary is exceeded. For example, the offset position indicated by one or more candidate vector parameters does not exceed the slice boundary, or the offset position indicated by one or more candidate vector parameters does not exceed the tile boundary.

[0585] In the embodiment of the present application, only when all of the above conditions are met can it be determined that the candidate vector parameters meet the preset usability conditions, that is, the candidate vector parameters are usable. In a specific embodiment, taking one of the candidate vector parameters as an example, the candidate vector parameters meet the preset usability conditions, which at least include: the offset position indicated by the candidate vector parameter does not exceed the image boundary; the offset position indicated by the candidate vector parameter does not exceed the slice boundary; the offset position indicated by the candidate vector parameter does not overlap the current block; the offset position indicated by the candidate vector parameter does not exceed the preset usable area; and the offset position indicated by the candidate vector parameter has been reconstructed.

[0586] For example, Figure 12 shows a schematic diagram of a structure for determining whether an offset position does not cover the current block, provided by an embodiment of the present application. As shown in Figure 12, a block filled with black represents the current block, an area filled with diagonal lines represents an available area, and an unfilled area represents an unavailable area. For the current block, if the offset position indicated by the candidate block vector parameter is in an unavailable area, then the offset position covers the current block.

[0587] For example, FIG13 shows a schematic diagram of a structure of whether an offset position exceeds a preset available area provided by an embodiment of the present application. As shown in FIG13 , a block filled with black represents a current block, an area filled with oblique lines represents an available area, and the reference blocks in the available area have all been reconstructed. In an embodiment of the present application, taking into account the storage capacity of the Buffer, under normal circumstances, the reference blocks adjacent to the current block (m, n) can be specifically: reference block (m-2, n-2), reference block (m-1, n-2), reference block (m, n-2), reference block (m+1, n-2), reference block (m-2, n-1), reference block (m-1, n-1), reference block (m, n-1), reference block (m+1, n-1), reference block (m-2, n), reference block (m-1, n), etc. as preset available areas.

[0588] That is, when determining whether it is available, the position of the current block (xCb, yCb) can be obtained, the chroma BVC = (BVChor, BVCver), the corresponding offset position (xCb + BVChor, yCb + BVCver) can be found, and the following conditions, including but not limited to the following conditions (i.e., preset availability conditions), can be determined. If all of them are met, the chroma BV is available:

[0589] Whether the obtained offset position does not exceed the image boundary;

[0590] Whether the obtained offset position does not cover the current block, see Figure 12 for details;

[0591] xCb+width+BVChor<=xCb or yCb+height+BVCver<=yCb;

[0592] Whether the obtained offset position does not exceed the preset available area, see Figure 13 for details;

[0593] Whether the obtained offset position has been reconstructed.

[0594] It is also understood that in the embodiments of the present application, the methods for constructing the third reference prediction parameter set include, but are not limited to, the multiple situations described above. One of these methods may be used to construct the candidate list, or multiple methods may be used simultaneously to construct the list. That is, four BVC candidates are determined for each BVL to construct the third reference prediction parameter set. Then, for each BVL, one available BVC is determined for the four BVC candidates, namely, the first candidate reference prediction parameter corresponding to the BVL.

[0595] In some embodiments, a first candidate reference prediction parameter is determined based on one or more candidate vector parameters, including: if there is a candidate vector parameter in the third reference prediction parameter set that meets a preset availability condition, then the candidate vector parameter that meets the preset availability condition is determined as the first candidate reference prediction parameter; if there are multiple candidate vector parameters in the third reference prediction parameter set that meet the preset availability condition, then a decision is made on the multiple candidate vector parameters that meet the preset availability condition to determine the first candidate reference prediction parameter.

[0596] It should be noted that in the embodiments of the present application, if there are one or more candidate vector parameters that meet the preset availability conditions, then when determining the first candidate reference prediction parameter based on the one or more candidate vector parameters, one of the candidate vector parameters that meet the preset availability conditions can be directly determined as the first candidate reference prediction parameter. In other words, if only one BVC candidate in the constructed available BVC candidate list meets the preset availability conditions, then that BVC will be the final first candidate reference prediction parameter.

[0597] It should also be noted that, in the embodiment of the present application, if there are multiple candidate vector parameters that meet the preset availability conditions, then a decision can also be made on the multiple candidate vector parameters that meet the preset availability conditions. Specifically, the decision can be: determining a first template for the current block; determining first matching templates for each of the multiple candidate vector parameters based on the first template and the multiple candidate vector parameters; when the first template and the first matching template meet the preset existence conditions, calculating the matching error between the first template of the current block and the first matching template based on a preset error criterion to determine first generation values ​​for each of the multiple candidate vector parameters; determining a minimum cost value from the first generation values ​​of each of the multiple candidate vector parameters, and determining the candidate vector parameter corresponding to the minimum cost value as the first candidate reference prediction parameter.

[0598] That is, in the embodiment of the present application, for multiple candidate vector parameters that meet the preset availability conditions, after determining the first generation values ​​corresponding to the multiple candidate vector parameters, one or more candidate vector parameters can be determined from the multiple candidate vector parameters based on the first generation values. For example, if the constructed available BVC candidate list has multiple available BVC candidates, then it is necessary to make a decision on these available BVCs to obtain the final BV, and the decision-making method includes but is not limited to the decision-making method using a template.

[0599] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block. Accordingly, the type of the first template may include at least one of the following: an upper template, an upper right template, a left template, a lower left template, and an upper left template. Among them, the upper template is located in the upper decoded area adjacent to the current block, the upper right template is located in the upper right decoded area adjacent to the current block, the left template is located in the left decoded area adjacent to the current block, the lower left template is located in the lower left decoded area adjacent to the current block, and the upper left template is located in the upper left decoded area adjacent to the current block.

[0600] It should also be noted that in an embodiment of the present application, when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template position are available, including reconstructing chrominance information, based on the pixel availability of the adjacent areas of the current block. Figure 14 is a schematic diagram of the template type. As shown in Figure 14, based on the relative position relationship between the template and the current block, the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template. Among them, the sizes of different types of templates for different coding blocks can be fixed the same or different.

[0601] For example, the template size selects the same template size for the current block of any size. The following formula illustrates a setting condition for the template size, where nTbW and nTbH are the width and height of the current block, and iTempW and iTempH are the width and height of the template used:

[0602] Upper template:

[0603] Left template:

[0604] For example, you can select different template sizes based on the current block size. The following formula illustrates a template size setting condition, where nTbW and nTbH are the width and height of the current block, and iTempW and iTempH are the width and height of the template used:

[0605] Upper template:

[0606] Left template:

[0607] in,

[0608] For example, different template sizes can also be selected based on the number of pixels in the current block. The following formula illustrates a template size setting condition, where nTbW and nTbH are the width and height of the current block, nTbW×nTbH is the number of pixels in the current block, and iTempW and iTempH are the width and height of the template used:

[0609] Upper template:

[0610] Left template:

[0611] In some embodiments, when determining the first matching template based on multiple candidate vector parameters, taking the position of the current point as the starting point, the area indicated by the multiple candidate vector parameters, which has the same shape and contains the same number of sample values ​​as the first template, is determined as the first matching template.

[0612] For example, in an embodiment of the present application, when determining the first matching template, the first template of the current block is used to perform motion compensation on the multiple BVC candidates obtained (i.e., candidate block vector parameters that meet preset availability conditions) to obtain a template corresponding to the BV (the first matching template). Figure 15 is a schematic diagram of template motion compensation. As shown in Figure 15, if the BV (BVC candidate) is available, motion compensation is performed using the first template and the BV to obtain a template corresponding to the BV, i.e., the first matching template.

[0613] It can also be understood that in the embodiment of the present application, the preset error criterion may include but is not limited to any one of the absolute error sum SAD, transformed absolute error SATD, difference square sum SSE, mean absolute difference MAD, mean absolute error MAE, mean square error MSE, etc.

[0614] For example, in an embodiment of the present application, when performing cost calculation, that is, when determining the first-generation value, there are multiple options for the cost function for calculating the cost of the template area, that is, there are multiple options for the preset error criteria. For example, you can choose the evaluation criteria such as the sum of absolute deviations (SAD), the sum of transformed absolute deviations (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE). Any evaluation criterion mentioned in the following content can be selected from the above criteria. Taking the evaluation criterion of SAD as an example, the calculation formula is as follows:

[0615] Among them, predTempSizeW is the width of the template, predTempSizeH is the height of the template, predTemp[i][j] is the pixel point of the template at BV, and recTempC[i][j] is the pixel point of the current block template.

[0616] Furthermore, in some embodiments, the method may also include: when the first template and the first matching template do not satisfy the preset existence condition, determining the first candidate vector parameter in the third reference prediction parameter set that satisfies the preset availability condition as the first candidate reference prediction parameter; or, when the first template and the first matching template do not satisfy the preset existence condition, determining the candidate vector parameter at the second position in the third reference prediction parameter set that satisfies the preset availability condition as the first reference prediction parameter.

[0617] That is to say, if the first template and the first matching template meet the preset existence condition, the matching error between the first template and the first matching template of the current block can be calculated according to the preset error criterion to select the candidate vector parameter corresponding to the minimum cost value as the first candidate reference prediction parameter; if the first template and the first matching template do not meet the preset existence condition, the first candidate vector parameter that meets the preset availability condition in the third reference prediction parameter set or the candidate vector parameter at a specified position can be determined as the first candidate reference prediction parameter.

[0618] For example, depending on whether the first template and the first matching template meet the preset existence condition, there are the following situations for using the template when calculating the cost (i.e., the cost value):

[0619] The first type: the upper template and the left template of the current block both exist, and the upper template and the left template at the corresponding BV both exist. In this case, both the upper template and the left template are available.

[0620] The second method is: Both the upper and left templates of the current block exist, but only the upper template exists at the corresponding BV. In this case, there are two methods: Method 1: If the left template at the corresponding BV does not exist, it is directly ignored, that is, only the upper template is used for calculation. Method 2: If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead of the left template, that is, the upper and left templates are used for calculation.

[0621] The third method is: both the upper template and the left template of the current block exist, but only the left template exists at the corresponding BV. In this case, there are two methods: Method 1: If the upper template does not exist at the corresponding BV, it is directly not used, that is, only the left template is used for calculation. Method 2: If the upper template does not exist at the corresponding BV, the uppermost template height row inside the reference block is used instead of the upper template, that is, the upper and left templates are used for calculation.

[0622] The fourth scenario: Only the upper template exists in the current block. There are three possible approaches: Method 1: If the upper template at the corresponding BV does not exist, it is not used. The final BV selected is the first BVC in the BVC candidate list or the BVC at a specified position. Method 2: If the upper template at the corresponding BV does not exist, the uppermost template height row in the reference block is used instead. Method 3: If the upper template at the corresponding BV exists, it is used directly.

[0623] The fifth method: Only the left template exists in the current block. In this case, there are three methods: Method 1: If the left template at the corresponding BV does not exist, it is directly used. In this case, the final BV selected is the first BVC in the BVC candidate list or the BVC at a specified position. Method 2: If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead. Method 3: If the left template at the corresponding BV exists, it is directly used.

[0624] The sixth type: Neither the upper template nor the left template of the current block exists. At this time, the BV finally selected is the first BVC in the BVC candidate list or the BVC at a specified position.

[0625] For example, in an embodiment of the present application, when determining the first candidate reference prediction parameter based on the first cost value of each of the multiple candidate vector parameters, excluding the case where the cost cannot be calculated, the cost of each candidate in the candidate list of BVC is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort and other sorting methods. Any number of BVCs with the lowest cost are selected as the final selected BV (first candidate reference prediction parameter) to perform chromaticity prediction based on BV. It should also be noted that when performing cost value calculations on multiple candidate vector parameters, a cost can be calculated for each candidate vector parameter, and the candidate vector parameter with the lowest cost is always retained. In this case, a list is not required, and even sorting is not required.

[0626] In this way, after obtaining one or more first candidate reference prediction parameters, a first reference prediction parameter set can be constructed.

[0627] S2003 : Determine a first color component reference sample value and a second color component reference sample value of the current block according to the first reference prediction parameter set.

[0628] It should be noted that in the embodiment of the present application, the "reference prediction parameters" here are parameters used to derive reference sample values ​​of the current block, and can specifically be vector parameters (such as BV or MV). These reference sample values ​​(Samples) can then be used to derive the mapping relationship between the first color component and the second color component.

[0629] It should also be noted that if all candidate vector parameters in the third reference prediction parameter set are unavailable, that is, all candidate block vector parameters in the third reference prediction parameter set do not meet the preset availability condition, then there are no available first candidate reference prediction parameters, and thus there is no first reference prediction parameter set. In this case, the method may further include: when all candidate vector parameters in the third reference prediction parameter set do not meet the preset availability condition, determining a first color component reconstructed sample and a second color component reconstructed sample at a third position of the current block; and determining a first color component reference sample value and a second color component reference sample value of the current block based on the first color component reconstructed sample and the second color component reconstructed sample at the third position.

[0630] That is to say, in an embodiment of the present application, the luminance pixels and chrominance pixels at a set position can also be obtained, and the set position includes but is not limited to an adjacent row and an adjacent column of the current block to obtain the first color component reference sample value and the second color component reference sample value of the current block.

[0631] In some embodiments, determining the first color component reference sample value and the second color component reference sample value of the current block according to the first reference prediction parameter set may include: determining the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters according to the first reference prediction parameter set; determining the first color component reconstructed sample and the second color component reconstructed sample at the third position of the current block; determining the first color component reference sample value and the second color component reference sample value of the current block according to the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters and the first color component reconstructed sample and the second color component reconstructed sample at the third position.

[0632] In an embodiment of the present application, determining, based on a first reference prediction parameter set, first color component reconstruction samples and second color component reconstruction samples indicated by one or more first candidate reference prediction parameters, may include: determining the position of a current block; scaling the position of the current block to determine the position of a first color component region at the same position of the current block; and scaling the first candidate reference prediction parameters to determine the scaled reference prediction parameters of the first color component region at the same position of the current block; determining a reference block of the first color component based on the position of the first color component region and the scaled reference prediction parameters, and determining the first color component reconstruction samples indicated by the first candidate reference prediction parameters based on the reference block of the first color component; determining a reference block of the second color component based on the position of the current block and the first candidate reference prediction parameters, and determining the second color component reconstruction samples indicated by the first candidate reference prediction parameters based on the reference block of the second color component.

[0633] In the embodiment of the present application, the position of the first color component area can be obtained by scaling the position of the current block according to a preset sampling format; the scaled reference prediction parameter of the first color component area can also be obtained by scaling the first candidate reference prediction parameter according to a preset sampling format. Here, the preset sampling format can be referred to in Table 4 above. It should be noted that the scaled reference prediction parameter can be obtained by amplifying the chroma BV; however, considering that the luma BV may suffer from precision loss, the luma BV obtained by amplifying the chroma BV is not necessarily equal to the original luma BV (the second candidate reference prediction parameter).

[0634] For example, the current block is a chroma block, and the first color component region at the same location is the co-located luma region. To obtain the first color component reference sample (luma reference sample), first obtain the position of the current block, that is, the position of the upper-left chroma sample of the current block relative to the upper-left chroma sample of the current image, chromaPos = (x, y). ChromaPos is then scaled according to the color sampling format shown in Table 4 to obtain the co-located luma region position corresponding to the current block, lumaPos = (xCb, yCb).

[0635] Exemplarily, obtain chroma BV = (BVChor, BVCver), scale the chroma BV according to the color sampling format shown in Table 4, and obtain the luminance BV = (BVYhor, BVYver) of the co-located luminance region corresponding to the current block. Obtain the position of the co-located luminance region corresponding to the current block lumaPos = (xCb, yCb), obtain luminance BV = (BVYhor, BVYver), and find the offset position (xCb + BVYhor, yCb + BVYver) corresponding to the co-located luminance region corresponding to the current block, as shown in Figure 16.

[0636] In a specific implementation, after obtaining the luma sample at the offset position, it may be downsampled to obtain a luma reference sample. In some embodiments, determining, based on the reference block of the first color component, the first color component reconstructed sample indicated by the first candidate reference prediction parameter may include: downsampling the reference block of the first color component to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter, so that the resolution of the first color component reconstructed sample is the same as the resolution of the second color component reconstructed sample.

[0637] It should be noted that, in an embodiment of the present application, downsampling the reference block of the first color component to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter may include: determining the downsampling method of the current block; downsampling the reference block of the first color component according to the downsampling method to determine the first color component reconstructed sample indicated by the first candidate reference prediction parameter.

[0638] In some embodiments, for determining the downsampling mode of the current block, as shown in FIG21 , the method may include:

[0639] S2101 , performing cost calculation on a plurality of candidate downsampling methods based on a preset competition method, and determining cost results corresponding to the plurality of candidate downsampling methods.

[0640] S2102 , selecting a minimum cost result from the cost results corresponding to the multiple candidate downsampling methods.

[0641] S2103: Determine the candidate downsampling method corresponding to the minimum cost result as the downsampling method of the current block.

[0642] It should be noted that in the embodiment of the present application, the preset competition mode may be a rate-distortion optimization (RDO) mode, such as a full RDO competition mode, a competition mode in which only one RDO selection is performed, a competition mode in which a variable number of RDO selections are performed, an RDO competition mode in which a set number of selections are performed, etc. These modes are described in detail below.

[0643] Exemplarily, the luminance reconstructed samples of the current block are downsampled to obtain downsampled luminance samples. The preset competition mode of the encoder includes but is not limited to the following modes:

[0644] ①Adopt full RDO competition method.

[0645] Different sampling methods correspond to different brightness downsampling reconstruction values. Each sampling method is predicted, transformed, quantized, and reconstructed to calculate distortion and bits, and then the optimal one is updated.

[0646] ② Only make one RDO selection.

[0647] Different sampling methods correspond to different brightness downsampling reconstruction values. Each sampling method is predicted, and the distortion between the predicted value and the original value is calculated, including but not limited to SAD, SATD, etc. A downsampling method with the smallest distortion is selected, and this downsampling method is predicted, transformed, quantized, and reconstructed to calculate the distortion and bits.

[0648] ③ Perform a variable number of RDO selections.

[0649] By default, prediction, transformation, quantization, and reconstruction are performed for downsampling method 1, calculating distortion and bits. For each downsampling method from 1 to 6, the distortion between the predicted value and the original value is calculated, including but not limited to SAD and SATD. The distortions for methods 2 to 6 are compared with the distortion for method 1. If scale * distortion (downsampling methods 2 to 6) < distortion (downsampling method 1), the corresponding RDO times are increased. The values ​​of scale include but are not limited to 1, 1.5, 1.15, 1.3, etc.

[0650] ④Select the RDO for the set number of times.

[0651] Use ② to perform an RDO, and perform RDO on the predicted value obtained by this sampling method and the intra-frame prediction mode at the position pointed to by BVL (including but not limited to the center luminance block), or perform RDO on the predicted value obtained by this sampling method and the chrominance predicted value at the position pointed to by BVC (including but not limited to the center luminance block). It should be noted that if weighted calculation is added, a weight_flag (indicating whether weighted) or weight_idx (indicating the sequence number of the weighted value options, such as 0, 1 / 4, 1 / 2, 3 / 4, 1, etc.) syntax element should be added to the bitstream accordingly.

[0652] It should also be noted that, in the embodiment of the present application, since the resolutions of the luminance samples and the chrominance samples are inconsistent, the luminance samples need to be downsampled so that the resolutions of the downsampled luminance samples and the chrominance samples are the same. Here, to determine the downsampling method of the current block, the following candidate sampling methods can be used to compete or a certain sampling method can be used by default, but they include but are not limited to the following six sampling methods. For example, assuming that the luminance sample before downsampling is recBvBefDownLuma, the width of the storage buffer is iRecRefLumaStride, and the luminance sample after downsampling is recBvAftDownLuma, the luminance sample after downsampling at position (i, j) is:

[0653] Downsampling method 1 (as shown in FIG17A ):

[0654] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]*2

[0655] +recBvBefDownLuma[2*i+1]

[0656] +recBvBefDownLuma[2*i-1]

[0657] +recBvBefDownLuma[2*i+iRecRefLumaStride]*2

[0658] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]

[0659] +recBvBefDownLuma[2*i-1+iRecRefLumaStride]+4)>>3;

[0660] Downsampling method 2 (as shown in FIG17B ):

[0661] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0662] +recBvBefDownLuma[2*i+1]+1)>>1;

[0663] Downsampling method three (as shown in FIG17C ):

[0664] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0665] +recBvBefDownLuma[2*i+iRecRefLumaStride]+1)>>1;

[0666] Downsampling method 4 (as shown in FIG17D ):

[0667] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+iRecRefLumaStride]

[0668] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1;

[0669] Downsampling method five (as shown in FIG17E ):

[0670] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+1]

[0671] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1;

[0672] Downsampling method six (as shown in FIG17F ):

[0673] recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]

[0674] +recBvBefDownLuma[2*i+1]

[0675] +recBvBefDownLuma[2*i+iRecRefLumaStride]

[0676] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+2)>>2.

[0677] In some embodiments, the method may further include: determining a value of the filter identification information; encoding the value of the filter identification information, and writing the obtained encoding bits into a bit stream.

[0678] That is to say, in the embodiment of the present application, the filter identification information is used to indicate the index number of the downsampling method of the current block among multiple candidate downsampling methods. This allows the decoding end to directly determine the downsampling method of the current block after determining the value of the filter identification information through the decoded code stream. The filter identification information can be represented by filter_idx, and the value of the filter identification information can be 0, 1, 2, 3, 4, 5, etc. In this way, after determining the downsampling method of the current block, the downsampled luminance reference sample recBvAftDownLuma at the corresponding BV of the co-located luminance area corresponding to the current block can be obtained through downsampling.

[0679] Furthermore, for the chroma sample of the current block, first obtain the position of the current block (xCbC, yCbC), obtain the chroma BV = (BVChor, BVCver), find the corresponding offset position (xCbC+BVChor, yCbC+BVCver), that is, obtain the chroma reference sample recBvChroma at the BV corresponding to the current block.

[0680] In some embodiments, determining a first color component reconstructed sample and a second color component reconstructed sample at a third position of a current block may include: determining a first template of the current block; and determining the first color component reconstructed sample and the second color component reconstructed sample at the third position based on the first template.

[0681] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block. Accordingly, the type of the first template may include at least one of the following: an upper template, an upper right template, a left template, a lower left template, and an upper left template. Among them, the upper template is located in the upper decoded area adjacent to the current block, the upper right template is located in the upper right decoded area adjacent to the current block, the left template is located in the left decoded area adjacent to the current block, the lower left template is located in the lower left decoded area adjacent to the current block, and the upper left template is located in the upper left decoded area adjacent to the current block.

[0682] That is, for the first color component reference sample value and the second color component reference sample value of the current block, not only the first color component reconstructed sample and the second color component reconstructed sample indicated by one or more first candidate reference prediction parameters, but also the first color component reconstructed sample and the second color component reconstructed sample at a third position (e.g., the first template area) of the current block are included. The third position represents an arbitrary set position of the current block, including but not limited to an adjacent row and an adjacent column of the current block.

[0683] In this way, a mapping relationship between luminance and chrominance can be constructed according to the luminance reference sample recBvAftDownLuma, the chrominance reference sample recBvChroma, and the reconstructed luminance sample and the reconstructed chrominance sample at the third position.

[0684] S2004: Determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value.

[0685] It should be noted that, in one possible implementation, determining the mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value may include: determining a first lookup table based on the first color component reference sample value and the second color component reference sample value, wherein the first lookup table is used to record the value of the second color component corresponding to the first color component when the index keyword is the first color component.

[0686] It should also be noted that, in another possible implementation manner, determining the mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value may include: determining a first discrete model according to the first color component reference sample value and the second color component reference sample value, where the first discrete model is used to indicate the mapping relationship between the first color component and the second color component.

[0687] That is to say, the mapping relationship here can be a Look Up Table (LUT). Among them, the index key (key) in the look-up table can be the first color component, and the value (value) of the look-up table can be the second color component, that is, value = LUT[key]. Or, the mapping relationship can also be a discrete model, which is used to characterize the mapping relationship between key and value.

[0688] Exemplarily, assuming that the luminance component is the key and the chrominance component is the value, then each key-value pair in the mapping relationship can be established in the following ways including but not limited to: LUT[recBvAftDownLuma[i][j]] = recBvChroma[i][j] (17)

[0689] It should also be noted that, in the embodiments of the present application, for the first color component parameter sample, it can also be limited within a preset sample range. In some embodiments, the method may further include: performing mapping processing on the first color component reference sample value to make the first color component reference sample value within the preset sample range.

[0690] In the embodiments of the present application, the preset sample range can be [0, (1 << bitdepth) - 1], where bitdepth represents the bit depth. Exemplarily, the preset sample range can be ranges such as [0, 255], [0, 511], etc., but there is no limitation. Among them, for multiple sample ranges, the rate-distortion cost method can be used to select one of them as the final preset sample range.

[0691] Exemplarily, taking a video with a bit depth greater than 8 bits as an example, assuming that the bit depth of the video is 10 bits, then the sample range is [0, 1023]. For the recBvAftDownLuma of the key value, it can be mapped to a preset sample range of [0, 255] or [0, 511].

[0692] Furthermore, in some embodiments, the method may also include: when the first reference sample values ​​in the first color component reference sample values ​​are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample values, overwriting processing is performed in sequence according to the sample order, and the last second reference sample value is used as the value having a mapping relationship with the first reference sample value.

[0693] Furthermore, in some embodiments, the method may also include: when the first reference sample values ​​in the first color component reference sample values ​​are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample values, calculating the average value of the multiple second reference sample values, and using the obtained average value as a value having a mapping relationship with the first reference sample value.

[0694] That is to say, in the embodiment of the present application, for different chromaticity values ​​with the same key value in the mapping relationship, the entries with the same key value can be overwritten in sequence according to the sample order, or operations such as average value can be taken. In addition, in the mapping relationship, the initialization setting of LUT[] is -1, that is, an unavailable value. "Overwriting" mainly means that if there is the same key value later, the new value will be used for storage; however, it is not limited to this method, and all can also be stored and then the average value can be calculated as the value corresponding to the key.

[0695] It can be understood that in the embodiment of the present application, the first color component reference sample value and the second color component reference sample value used to construct the mapping relationship can also be obtained in other ways, which are exemplified below in combination with several implementation methods.

[0696] In another specific implementation, the luma samples are not downsampled, and the chroma samples may be upsampled to obtain chroma reference samples. In some embodiments, determining, based on the reference block of the second color component, the reconstructed samples of the second color component indicated by the first candidate reference prediction parameter may include: upsampling the reference block of the second color component to determine the reconstructed samples of the second color component indicated by the first candidate reference prediction parameter, such that the resolution of the reconstructed samples of the first color component is the same as the resolution of the reconstructed samples of the second color component.

[0697] That is, in the embodiment of the present application, after obtaining the reconstructed luma samples recBvBefDownLuma of the co-located luma area, no downsampling is performed. In this case, after obtaining the reconstructed chroma samples recBvChroma at the BV corresponding to the current block, upsampling is required, including but not limited to linear interpolation, to obtain reconstructed chroma samples recBvChromaUp of the same size as the reconstructed luma samples at the BV.

[0698] In this way, the reconstructed luminance sample recBvBefDownLuma at BV is used as the luminance reference sample, and the obtained up-sampled reconstructed chrominance sample recBvChromaUp is used as the chrominance reference sample; then the mapping relationship between luminance and chrominance is constructed based on the luminance reference sample and the chrominance reference sample.

[0699] Accordingly, in this embodiment of the present application, the predicted value of the second color component of the current block also needs to be downsampled. That is, if the reconstructed chroma samples of the current block are upsampled when constructing the mapping relationship, then the luminance-to-chroma prediction of the current block based on the mapping relationship needs to be downsampled to obtain the final chroma prediction value of the current block. The downsampling method includes but is not limited to average downsampling.

[0700] In yet another specific implementation, the method may further include: determining a first template of the current block; and determining a first color component reference sample value and a second color component reference sample value of the current block according to the first template.

[0701] In an embodiment of the present application, the first color component reference samples and the second color component reference samples used to establish the mapping relationship may also include the first color component reference samples and the second color component reference samples determined by the first template of the current block. Specifically, based on the first template of the current block, a first color component region template at the same location as the first template may be determined; then, based on the reconstructed samples in the first color component region template, the first color component reference samples may be determined; and based on the reconstructed samples in the first template, the second color component reference samples may be determined. The first template includes one or more reconstructed samples in an adjacent decoded region of the current block.

[0702] For example, based on the current chroma template of the current block, a chroma reference sample can be obtained; after determining the co-located luma region template of the current chroma template, a luma reference sample can be obtained based on the co-located luma region template. The luma reference samples and chroma reference samples obtained in the above embodiments are then combined to construct a mapping relationship between luma and chroma based on these luma reference samples and chroma reference samples.

[0703] S2005 , determining a predicted value of a second color component of the current block according to the mapping relationship and the sample value of the first color component of the current block.

[0704] It should be noted that, in the embodiment of the present application, determining the first color component sample value of the current block may include: determining reconstructed pixel samples of the first color component region at the same location in the current block; and determining the first color component sample value of the current block based on the reconstructed pixel samples of the first color component region. The reconstructed pixel samples of the first color component region may be directly used as the first color component sample value of the current block, or the reconstructed pixel samples of the first color component region may be filtered and the filtered reconstructed pixel samples may be used as the first color component sample value of the current block, without any limitation herein.

[0705] For example, in an embodiment of the present application, the filtering process is a downsampling process. Here, the reconstructed luminance sample recBefDownLuma at the position of the co-located luminance area lumaPos = (xCb, yCb) corresponding to the current block can be obtained, and the luminance sample is downsampled to obtain the downsampled reconstructed luminance sample recAftDownLuma, and the downsampled reconstructed luminance sample is used as the first color component sample value of the current block. In addition, if the luminance reference sample has been mapped to a sample range, then the downsampled reconstructed luminance sample also needs to be mapped to the same sample range here to obtain the first color component sample value of the current block.

[0706] In some embodiments, determining the predicted value of the second color component of the current block based on the mapping relationship and the first color component sample value of the current block may include: if a first color component value equal to the first color component sample value is found in the mapping relationship, then determining the value of the second color component corresponding to the first color component value as the predicted value of the second color component of the current block.

[0707] For example, in the embodiment of the present application, assuming that the predicted value of the current block is predSamples, then for predSamples[cIdx][x][y], the variable cIdx specifies the color component index of the current block, and the following prediction method can be used here:

[0708] With reference to the luminance value Yc at the same position, the chrominance prediction value is derived using the mapping relationship (discrete model) established in the above embodiment.

[0709] In some embodiments, for determining the predicted value of the second color component of the current block, the method may further include: if a first color component value equal to the first color component sample value is not found in the mapping relationship, then correcting the first color component sample value, determining the first color component correction value, and continuing to search in the mapping relationship whether there is a first color component value equal to the first color component correction value.

[0710] In a specific embodiment, correcting the first color component reconstructed value to determine the first color component corrected value may include performing an offset calculation on the first color component sample value according to one or more preset offset values ​​to determine the first color component corrected value.

[0711] In the embodiment of the present application, the offset values ​​can be +1, -1, +2, -2, +3, -3, etc., and there is no limitation on the number and specific values ​​of the offset values. In addition, for the correction processing of the reconstructed value of the first color component, these multiple offset values ​​can also be set in a certain order, for example, in the order of {+1, -1, +2, -2, +3, -3}.

[0712] Exemplarily, in an embodiment of the present application, for the mapping relationship established in the aforementioned embodiment, if Yc is not found in the input luminance set, the following processing methods are included but not limited to: Yc is corrected in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, and then a matching check is performed in the input luminance set based on the corrected Yc, and then the value corresponding to the corrected Yc is determined as the chrominance prediction value of the current block.

[0713] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: if a first color component value equal to the first color component correction value is not found in the mapping relationship, then an average value of the second color component reference sample value is calculated, and the obtained average value is determined as the predicted value of the second color component of the current block.

[0714] Exemplarily, in an embodiment of the present application, for the mapping relationship established in the aforementioned embodiment, if Yc is not found in the input luminance set, the following processing methods are included but not limited to: Yc is corrected in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}; if all of the above corrected Yc cannot be matched in the mapping relationship, the chroma prediction value can be set to the average value of the reconstructed chroma sample recBvChroma at the corresponding BV.

[0715] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: determining a first initial predicted value of the second color component of the current block based on the mapping relationship and the sample value of the first color component of the current block; performing a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

[0716] It should be noted that in the embodiment of the present application, a correction operation is performed on the first initial prediction value obtained according to the mapping relationship. The correction operation here may include a clip operation, a filtering operation, a weighted operation with the prediction value obtained by other prediction modes, etc., and there is no limitation on this.

[0717] In a specific embodiment, performing a correction operation on the first initial prediction value to determine the prediction value of the second color component of the current block may include: performing prediction processing on the second color component of the current block according to the first preset mode to determine the second initial prediction value of the second color component of the current block; and performing weighted calculation on the first initial prediction value and the second initial prediction value to determine the prediction value of the second color component of the current block. It should be noted that, in the embodiment of the present application, the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode and CCLM mode. That is, performing a correction operation on the first initial prediction value obtained according to the mapping relationship may include but is not limited to weighting with the CCLM-type mode or other prediction modes to obtain the chrominance prediction value of the current block.

[0718] In another specific embodiment, performing a correction operation on the first initial prediction value to determine the prediction value of the second color component of the current block may include: limiting the first initial prediction value within a preset numerical range, or it may also be called a "clip operation". It should be noted that, in the embodiment of the present application, the lower limit value of the preset numerical range is the minimum prediction value (min), and the upper limit value of the preset numerical range is the maximum prediction value (max). If the first initial prediction value is within the preset numerical range, then the first initial prediction value can be used as the chrominance prediction value of the current block; if the first initial prediction value is greater than max, then max can be used as the chrominance prediction value of the current block; if the first initial prediction value is less than min, then min can be used as the chrominance prediction value of the current block.

[0719] In some embodiments, for determining the predicted value of the second color component of the current block, the method also includes: when the first reference prediction parameter set includes multiple first candidate reference prediction parameters, determining multiple third initial prediction values ​​of the second color component of the current block; performing weighted calculation on the multiple third initial prediction values ​​to determine the predicted value of the second color component of the current block.

[0720] It should be noted that in an embodiment of the present application, if the aforementioned embodiment determines multiple BVs (first candidate reference prediction parameters), then multiple third initial prediction values ​​can be obtained based on these multiple BVs; then these multiple third initial prediction values ​​are weighted, and the weighted prediction values ​​are used as the chrominance prediction values ​​of the current block; or, the weighted prediction values ​​can be further modified, including but not limited to weighting with CCLM-type modes or other prediction modes to obtain the chrominance prediction value of the current block.

[0721] In a specific embodiment, for determining the predicted value of the second color component of the current block, the method may also include: when the first reference prediction parameter set includes multiple first candidate reference prediction parameters, determining the first color component reconstruction samples and the second color component reconstruction samples indicated by each of the multiple first candidate reference prediction parameters; determining multiple mapping relationships between the first color component and the second color component based on the first color component reconstruction samples and the second color component reconstruction samples indicated by each of the multiple first candidate reference prediction parameters; determining multiple third initial prediction values ​​of the second color component of the current block based on the multiple mapping relationships; and performing weighted calculation on the multiple third initial prediction values ​​to determine the predicted value of the second color component of the current block.

[0722] It should be noted that in the embodiment of the present application, multiple blocks of the same luminance region are obtained, and the positions of the multiple blocks include but are not limited to the following positions, as shown in Figure 11. Multiple blocks can correspond to multiple luminance BVs, and these multiple luminance BVs respectively construct candidates for their own chrominance BVC candidate lists. The availability of the BVs in the candidate list is judged to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. For the multiple groups of BVs, multiple mapping tables LUTs between luminance and chrominance can be established. In this way, multiple initial chrominance prediction values ​​can be obtained based on these multiple mapping tables LUTs, and the chrominance prediction value of the current block can be obtained through weighted calculation.

[0723] In some embodiments, for determining the predicted value of the second color component of the current block, the method may include: when the first color component block of the current block includes multiple candidate blocks, determining a second reference prediction parameter set for the current block; wherein the second reference prediction parameter set includes multiple second candidate reference prediction parameters; determining multiple first candidate reference prediction parameters based on the multiple second candidate reference prediction parameters; and determining multiple candidate mapping relationships between the first color component and the second color component based on the multiple first candidate reference prediction parameters; determining a target mapping relationship from the multiple candidate mapping relationships; and determining the predicted value of the second color component of the current block based on the target mapping relationship and the first color component sample value of the current block.

[0724] In a specific embodiment, determining a target mapping relationship from multiple candidate mapping relationships may include: performing cost calculations on multiple candidate mapping relationships respectively to determine the cost results corresponding to each of the multiple candidate mapping relationships; determining the minimum cost result from the cost results corresponding to each of the multiple candidate mapping relationships, and determining the candidate mapping relationship corresponding to the minimum cost result as the target mapping relationship.

[0725] It should be noted that in the embodiment of the present application, the distortion value method can be used to determine the cost result, specifically the rate-distortion cost method can be used to determine the cost result; however, it can also be the size of SAD, the size of MSE, the size of SSE or other criteria for judging the cost, which is not specifically limited here.

[0726] Furthermore, in some embodiments, the method further includes: determining a mapping relationship index value, wherein the mapping relationship index value is used to indicate an index number of a target mapping relationship among a plurality of candidate mapping relationships; encoding the mapping relationship index value, and writing the obtained encoded bits into a bitstream.

[0727] It should also be noted that in an embodiment of the present application, the mapping relationship index value can be determined and written into the code stream based on the index number of the candidate mapping relationship corresponding to the minimum cost result in multiple candidate mapping relationships, so that the decoding end can determine the corresponding target mapping relationship based on the mapping relationship index value obtained by decoding.

[0728] That is to say, in an embodiment of the present application, a plurality of mapping tables LUT between luminance and chrominance can be established, and then the selected target mapping table LUT can be indicated using syntax elements. Exemplarily, a plurality of blocks of the same luminance area are obtained, and the positions of the plurality of blocks include but are not limited to the following positions, as shown in FIG11 . The plurality of blocks can correspond to a plurality of luminance BVs, and the plurality of luminance BVs respectively construct candidates for their respective chrominance BVC candidate lists, and judge the availability of the BVs in the candidate list to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. The respective available chrominance BVCs of the plurality of blocks can respectively establish a mapping table LUT; at the decoding end, the mapping relationship index value can be determined by decoding the corresponding syntax elements; then the target mapping relationship can be determined according to the mapping relationship index value, and then the chrominance prediction value of the current block can be determined. It should be noted that the number of mapping relationships established here can be set arbitrarily, for example, the number can be set to 4, but there is no limitation.

[0729] In some embodiments, for determining the predicted value of the second color component of the current block, the method may include: when the first color component block of the current block includes multiple candidate blocks, determining a second reference prediction parameter set for the current block; wherein the second reference prediction parameter set includes multiple second candidate reference prediction parameters; determining multiple first candidate reference prediction parameters based on the multiple second candidate reference prediction parameters; and determining multiple candidate mapping relationships between the first color component and the second color component based on the multiple first candidate reference prediction parameters; performing matching error calculation on the multiple candidate mapping relationships based on the template matching method to determine the second generation values ​​of each of the multiple candidate mapping relationships; determining the minimum cost value from the second generation values ​​of each of the multiple candidate mapping relationships, and determining the candidate mapping relationship corresponding to the minimum cost value as the target mapping relationship; determining the predicted value of the second color component of the current block based on the target mapping relationship and the first color component sample value of the current block.

[0730] In a specific embodiment, matching errors are calculated for multiple candidate mapping relationships based on a template matching method to determine the second-generation values ​​of each of the multiple candidate mapping relationships, which may include: determining the first template of the current block; determining the reconstructed pixel sample values ​​of the first color component area template at the same position of the first template; determining the predicted values ​​of the second color components of the first template under multiple mapping relationships based on the multiple candidate mapping relationships and the reconstructed pixel sample values ​​of the first color component area template; performing cost calculation based on the reconstructed values ​​of the second color components of the first template and the predicted values ​​of the second color components of the first template under multiple mapping relationships to determine the second-generation values ​​of each of the multiple candidate mapping relationships.

[0731] It should be noted that in an embodiment of the present application, multiple mapping tables LUT between luminance and chrominance can be established, and then a template is used to select which mapping table LUT to use. Exemplarily, multiple blocks of the same luminance area are obtained, and the positions of the multiple blocks include but are not limited to the following positions, as shown in Figure 11. Multiple blocks can correspond to multiple luminance BVs, and these multiple luminance BVs respectively construct candidates for their respective chrominance BVC candidate lists, and judge the availability of the BVs in the candidate list to decide one BV or multiple BVs or to decide multiple groups of BVs through clustering. The available chrominance BVCs of these multiple blocks can respectively establish a mapping table LUT; the current block template is predicted using different mapping table LUTs, and the difference is calculated with the reconstructed value of the template to decide which mapping relationship to use, and then the mapping relationship finally decided is used to determine the chrominance prediction value of the current block. It should be noted that the number of mapping relationships established here can be set arbitrarily, for example, the number can be set to 4, but there is no limitation.

[0732] In a specific embodiment, the specific process of performing LUT prediction on the current block template is as follows:

[0733] Obtain the reconstructed luminance sample recBef DownLumaR of the co-located luminance area template lumaPos = (xCbR, yCbR) corresponding to the current block template, downsample the luminance sample to obtain the downsampled reconstructed luminance sample recAftDownLumaR, and perform mapping processing on the sample in the same sample range.

[0734] Assuming that the predicted value of the current block template is predSamplesR, for predSamplesR[cIdx][x][y], the variable cIdx specifies the color component index of the current block, and the prediction method is: refer to the luminance value Yc at the same position to derive the predicted value using the established mapping relationship. If Yc is not found in the input luminance set in the established mapping relationship, the following processing methods are included but not limited to: check in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}. If all the above values ​​cannot be matched in the mapping relationship, the chroma prediction value of the current block is set to the average value of the reconstructed chroma sample recBvChroma at the corresponding BV.

[0735] When calculating the cost of the current block template and the template prediction value of each LUT, the following situations exist for the use of the template:

[0736] The first type: Both the upper template and the left template of the current block exist. In this case, both the upper template and the left template are available.

[0737] The second type: Only the upper template exists in the current block, and only the upper template is available.

[0738] The third type: Only the left template exists in the current block, and only the left template is available.

[0739] The fourth type: Neither the upper template nor the left template of the current block exists. In this case, the LUT finally selected is the first LUT created or the LUT at a specified position.

[0740] For example, in the embodiment of the present application, assuming that the reconstruction value of the current block template is recSamplesR, there are multiple options for the cost function for calculating the template region cost, for example, the sum of absolute deviations (SAD), the sum of transformed absolute deviations (SATD), the sum of squared differences (SSE), the mean absolute deviation (MAD), the mean absolute error (MAE), the mean squared error (MSE), and other evaluation criteria can be selected. The evaluation criteria mentioned in the following content can be selected from the above criteria. Taking the evaluation criterion of SAD as an example, the calculation formula is as follows:

[0741] Among them, predTempSizeW is the width of the template, predTempSizeH is the height of the template, predSamplesR[i][j] is the predicted pixel point of the current block template after LUT, and recSamplesR[i][j] is the reconstructed pixel point of the current block template.

[0742] It should also be noted that in the embodiment of the present application, when selecting the final LUT using the current block template, except for cases where the cost cannot be calculated, the cost of each established LUT candidate is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. Among them, the LUT candidate with the lowest cost is selected as the final LUT used.

[0743] S2006 , determining a residual value of the second color component of the current block according to the predicted value of the second color component of the current block.

[0744] It should be noted that in the embodiment of the present application, an initial value of the second color component of the current block is determined; and a residual value of the second color component of the current block is determined based on the initial value and the predicted value. Specifically, the residual value of the second color component of the current block can be obtained by subtracting the initial value from the predicted value.

[0745] In some embodiments, the method further includes encoding the residual value of the second color component of the current block and writing the resulting encoded bits into a bitstream, so that a subsequent decoding end can recover a reconstructed value of the second color component of the current block based on the residual value and the predicted value.

[0746] In some embodiments, determining the prediction parameters of the current block may include: determining a prediction mode of the current block; and determining the prediction parameters of the current block according to the prediction mode of the current block.

[0747] It should be noted that, in an embodiment of the present application, determining the prediction mode of the current block may include: determining multiple candidate modes for the current block; wherein the multiple candidate modes include a first prediction mode and other prediction modes other than the first prediction mode; performing cost calculations on the multiple candidate modes based on a preset cost method, and determining the cost results corresponding to each of the multiple candidate modes; determining the minimum cost result from the cost results corresponding to each of the multiple candidate modes, and determining the candidate mode corresponding to the minimum cost result as the prediction mode of the current block; wherein the preset cost method includes at least one of the following: a rate-distortion cost method and a template matching method.

[0748] It should also be noted that, in the embodiment of the present application, for the prediction mode of the current block, the BVG-LUT mode and other modes can be used simultaneously at the encoding end. Among them, in the DM mode, in addition to the BVG-LUT mode, other modes can also compete. The final use mode is determined according to the template cost. For example, instead of directly using the BV obtained by brightness, BV copy can be directly used, or the BVG-LUT mode defined in the embodiment of the present application can be used. After both modes are applied to the template of the current block, the one with the smaller template cost is selected as the prediction mode of the current block.

[0749] In some embodiments, the method further includes: determining a first color component region at the same position of the current block; if the current block uses the DM mode and the first color component region is predicted based on the block vector, determining that the current block uses the first prediction mode.

[0750] It should be noted that in the embodiment of the present application, the first color component area at the same position of the current block is determined; if the current block uses the DM mode and the first color component area is predicted based on the block vector, it is determined that the current block uses the first prediction mode.

[0751] For example, in the embodiment of the present application, under dual-tree partitioning, in DM mode, if the corresponding luminance area has BV information, the current block is predicted using the first prediction mode (BVG-LUT mode). For example:

[0752] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, set intra_bvglut_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT.

[0753] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, if IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, set intra_bvglut_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT.

[0754] In the embodiment of the present application, the first syntax element can be used to indicate whether the current block uses the BVG-LUT mode. The first syntax element can be represented by intra_bvgplt_flag or bvgplt_flag. The chroma prediction mode is derived as follows:

[0755] The chroma intra prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode specified in the following table. These padding items other than the BVG-LUT mode are exemplary given corresponding values, and are not required to be filled in with this value. Among them, Table 9 shows an example of chroma prediction mode derivation. As shown in Table 9, 0 represents Planar mode, 1 represents DC mode, 18 represents horizontal mode, 50 represents vertical mode, and 81 to 83 represent CCLM mode.

[0756] According to Table 9, in DM mode, if intra_bvglut_flag == 1, that is, the information obtained from the center block of the same luminance area contains BV, the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses the BVG-LUT mode.

[0757] In some embodiments, the method further includes: determining a value of a second syntax element; and when the second syntax element indicates that the current block allows the use of the first prediction mode, performing the step of determining prediction parameters of the current block.

[0758] In some embodiments, the method further includes: determining a value of a second syntax element; wherein the second syntax element is used to indicate whether the current block allows the use of the first prediction mode; encoding the value of the second syntax element, and writing the obtained coded bits into the bitstream.

[0759] It should be noted that in the embodiment of the present application, the second syntax element can be represented by BvglutEnabled. If the value of the second syntax element is the first value, the second syntax element indicates that the current block allows the use of the first prediction mode; if the value of the second syntax element is the second value, the second syntax element indicates that the current block does not allow the use of the first prediction mode.

[0760] It should also be noted that in the embodiment of the present application, the first value and the second value are different. The first value and the second value can be in parameter form or in numerical form. Specifically, both the first syntax element and the second syntax element can be parameters written in the profile or the value of a flag / identifier, and no limitation is made here.

[0761] 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 0 and the second value can be set to 1; or the first value can be set to true and the second value can be set to false; or the first value can be set to false and the second value can be set to true. In the embodiment of the present application, the first value can be set to 1 and the second value can be set to 0, but this is not limited to any aspect of the present invention.

[0762] Exemplarily, in an embodiment of the present application, if the syntax element sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, then BvglutEnabled is equal to 0. Otherwise, the variable ModeIncludeBv is set, and if the corresponding luminance block is not encoded in a mode with BV information, ModeIncludeBv is equal to 0; otherwise, ModeIncludeBv is equal to 1.

[0763] In one possible implementation, BvglutEnabled is equal to 1 if multiple of the following conditions are true at the same time (including but not limited to the following conditions):

[0764] ModeIncludeBv is equal to 1;

[0765] sh_slice_type is equal to I frame;

[0766] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0767] In another possible implementation, BvglutEnabled is equal to 1 if multiple of the following conditions are true at the same time (including but not limited to the following conditions):

[0768] ModeIncludeBv is equal to 1;

[0769] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0770] In yet another possible implementation, if multiple of the following conditions are true at the same time (including but not limited to the following conditions), then BvglutEnabled is equal to 1:

[0771] CtbLog2SizeC is less than or equal to MaxChromaIbcSize; wherein MaxChromaIbcSize may be determined according to the chroma CTU size or a preset value.

[0772] For each possible implementation, otherwise, BvglutEnabled is equal to 0. Here, if BvglutEnabled is equal to 0, then the value of the first syntax element can be inferred to be 0.

[0773] Furthermore, an embodiment of the present application also provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein the information to be encoded includes at least one of the following: the residual value of the second color component of the current block, the value of the filter identification information, the mapping relationship index value, the value of the first syntax element and the value of the second syntax element.

[0774] In an embodiment of the present application, the filter identification information is used to indicate the downsampling method of the current block, the first syntax element is used to indicate whether the current block uses the first prediction mode, and the second syntax element is used to indicate whether the current block is allowed to use the first prediction mode.

[0775] This embodiment provides a coding method, which determines prediction parameters of a current block; determines a first reference prediction parameter set for the current block based on the prediction parameters; wherein the first reference prediction parameter set includes one or more first candidate reference prediction parameters; determines a first color component reference sample value and a second color component reference sample value of the current block based on the first reference prediction parameter set; determines a mapping relationship between the first color component and the second color component based on the first color component reference sample value and the second color component reference sample value; and determines a prediction value of the second color component of the current block based on the mapping relationship and the first color component sample value of the current block. In this way, if the current block uses the BVG-LUT mode, then a first reference prediction parameter set for applying the chroma component can be determined, and based on the first reference prediction parameter set, a luminance component reference sample value and a chroma component reference sample value of the current block can be determined, thereby establishing a mapping relationship between the luminance component and the chroma component, and then using this mapping relationship to predict the chroma component. In other words, the correlation between the reconstructed samples in the current image and the current block samples is fully utilized here to improve the uniformity of the chrominance prediction, thereby improving the accuracy of the chrominance prediction; and according to the established mapping relationship, pixel-level prediction can also be effectively performed, which can further save bit rate, improve encoding and decoding efficiency, and thus improve encoding and decoding performance.

[0776] In another embodiment of the present application, based on the encoding and decoding method described in the above embodiment, the embodiment of the present application adds a new prediction mode BVG-LUT mode (i.e., Scheme 1). In the process of Scheme 1, from the decoding side, the decoding code stream determines the prediction parameters of the current block. When the prediction parameters indicate that the current block uses the BVG LUT mode, the BV of the corresponding luminance block is obtained, the luminance BV (BVL) is adjusted and applied to the chrominance, and a candidate list of chrominance BV (BVC) is constructed. Then, it is determined whether the BVC candidates in the candidate list of chrominance BVC are available: if available, enter the decision link; if not available, the BVC can be adjusted to available and then enter the decision link or discarded, and then the reconstructed luminance samples and reconstructed chrominance samples at the set position of the current block are directly used to construct the mapping relationship between the luminance component and the chrominance component, and then perform BV-based chrominance prediction.

[0777] For example, see FIG22 for a detailed flow diagram of an encoding method provided in an embodiment of the present application. As shown in FIG22 , the detailed flow may include:

[0778] S2201: Determine whether the BVG-LUT mode is applied to the current block.

[0779] S2202: Obtain the corresponding luminance block.

[0780] S2203: Construct a brightness BVL candidate list.

[0781] S2204: Construct a chroma BVC candidate list.

[0782] S2205: Determine whether the candidate BV is available.

[0783] S2206: If the candidate BV is available, determine the final chroma BV.

[0784] S2207: Perform chroma prediction based on the chroma BV.

[0785] S2208: Use other prediction modes to perform chrominance prediction.

[0786] It should be noted that in the embodiment of the present application, for step S2201, if the judgment result is no, that is, the BVG-LUT mode is not applied to the current block, then step S2208 is executed; if the judgment result is yes, that is, the BVG-LUT mode is applied to the current block, then steps S2202 to S2207 are executed. In addition, for step S2205, if the judgment result is no, it is directly discarded and then step S2207 is executed; if the judgment result is yes, step S2206 is executed to make a BV decision, and then step S2207 is executed.

[0787] In a specific embodiment, the encoding method of the embodiment of the present application may specifically include:

[0788] S1: Obtain the corresponding luminance block (specifically, obtain the reference luminance block corresponding to the chrominance component of the current block).

[0789] Methods of obtaining include but are not limited to:

[0790] (Method 1) Get the center position block of the same brightness area, as shown in Figure 3:

[0791] Get the position of the current chroma block, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), scale chromaPos according to the chroma sampling format shown in Table 4, and obtain the position of the same luminance area corresponding to the current chroma block lumaPos = (xCb, yCb).

[0792] Assume that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight.

[0793] The center position block of the luminance area is the luminance block containing the position coordinates (xCb+cbWidth>>1, yCb+cbHeight>>1); multiple positions can be searched to the upper left, above, and left of this luminance block, including but not limited to the following search positions:

[0794] Get the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upper coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the center position block of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+cbWidth>>1+xOffset, yCb+cbHeight>>1+yOffset);

[0795] (Method 2) Get the block in the upper left corner of the same brightness area, as shown in Figure 9:

[0796] Get the position of the current chroma block, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), scale chromaPos according to the chroma sampling format shown in Table 4, and obtain the position of the same luminance area corresponding to the current chroma block lumaPos = (xCb, yCb).

[0797] Assume that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight.

[0798] The upper left corner block of the luminance region is the luminance block containing the position coordinates (xCb, yCb); multiple positions can be searched to the upper left, above, and left of this luminance block, including but not limited to the following search positions:

[0799] Get the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upper coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the upper left corner block of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb+xOffset, yCb+yOffset).

[0800] (Method 3) Get the block at the lower right corner of the same brightness area, as shown in Figure 10:

[0801] Get the position of the current chroma block, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y). Scale chromaPos according to the chroma sampling format shown in Table 4 to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb).

[0802] Assume that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight.

[0803] The upper left corner block of the luminance area is the luminance block containing the position coordinates (xCb+cbWidth-1, yCb+cbHeight-1); multiple positions can be searched to the upper left, above, and left of this luminance block, including but not limited to the following search positions:

[0804] Get the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upper coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of the lower right corner block of the same luminance region. The luminance block used in the luminance region is the luminance block containing the position coordinates (xCb + cbWidth - 1 + xOffset, yCb + cbHeight - 1 + yOffset);

[0805] (Method 4) In the block shown in FIG11 containing five brightness pixel positions (including but not limited to five positions, which can be multiple different positions), the positions are acquired sequentially. The order of sequential acquisition includes but is not limited to the following order: C->TL->TR->BL->BR.

[0806] Detailed position derivation process for C, TL, TR, BL, and BR:

[0807] Get the position of the current chroma block, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), scale chromaPos according to the chroma sampling format shown in Table 4, and obtain the position of the same luminance area corresponding to the current chroma block lumaPos = (xCb, yCb).

[0808] The position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image (that is, the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight.

[0809] The coordinates of the position of the brightness pixel C are (xCb+cbWidth / 2,yCb+cbHeight / 2);

[0810] The coordinates of the position of the luminance pixel TL are (xCb, yCb);

[0811] The coordinates of the position of the brightness pixel TR are (xCb+cbWidth-1, yCb);

[0812] The coordinates of the position of the brightness pixel BL are (xCb, yCb+cbHeight-1);

[0813] The coordinates of the position of the luminance pixel BR are (xCb+cbWidth-1, yCb+cbHeight-1).

[0814] When searching for each position, multiple positions can be searched to the upper left, above, and left of this position, including but not limited to the following example search positions: obtaining the upper left coordinate offset (xOffset, yOffset) = (-2, -2), the upward coordinate offset (xOffset, yOffset) = (0, -2), and the left coordinate offset (xOffset, yOffset) = (-2, 0) of this position. The luminance block used in the luminance area is the luminance block that includes the coordinates of the position plus the position coordinates of the offset position.

[0815] S2: Build a brightness BVL candidate list.

[0816] According to the luminance block obtained in S1, the BVL information encoded in the mode with BV information is scaled, that is, the chrominance BV information BVC is obtained using the method of S3, and then the availability judgment of step S4 is performed. If available, this BVL information is added to the BVL list.

[0817] S3: Build a chroma BVC candidate list.

[0818] For the BVL candidate list obtained by S2, assume that the brightness BV in the list is (BVL hor ,BVL ver ), chroma BV=(BVC hor ,BVC ver ), constructing a chroma BVC candidate list containing one or more candidates by adjusting the BVL or BVC. The construction method is described below. You can use one of the methods to construct the candidate list, or you can use multiple methods simultaneously to construct the list.

[0819] Method 1: Scale the BVC according to the chroma sampling format shown in Table 8, and add the scaled BVC to the chroma BVC candidate list.

[0820] Method 2: After obtaining the BV of the corresponding luminance block, record it as BVL, and the chrominance BV obtained through BVL is recorded as BVC. By adjusting BVL or BVC, a chrominance BVC candidate containing one or more candidates is constructed.

[0821] The candidate construction methods include but are not limited to the following:

[0822] Construction method 1: Adjust BVL to form four situations, and then adjust BVC.

[0823] When BVL is an odd number, take BVL=(BVL hor, BVL ver )、BVL=(BVL hor +1, BVL ver )、BVL=(BVL hor, BVL ver +1), BVL=(BVL hor +1,BVL ver +1) Four situations.

[0824] When BVL is an even number, take BVL=(BVL hor, BVL ver ).

[0825] or:

[0826] When BVL is an even number, take BVL=(BVL hor,BVL ver )、BVL=(BVL hor +1, BVL ver )、BVL=(BVL hor, BVL ver +1), BVL=(BVL hor +1,BVL ver +1) Four situations.

[0827] Here, BVC[0]=BVL[0]*2 / SubWidthC; BVC[1]=BVL[1]*2 / SubHeightC. SubWidthC and SubHeightC are determined according to the correspondence between sps_chroma_format_idc and the chroma format sampling structure in Table 1.

[0828] The BVC is obtained by scaling the BVL according to the above formula. When the BVL is odd or even, four BVC...

Claims

1. A decoding method, applied to a decoder, the method comprising: Determine the prediction parameters of the current block; Determine a first set of reference prediction parameters for the current block according to the prediction parameters; wherein, the first set of reference prediction parameters includes one or more first candidate reference prediction parameters; Determine a first color component reference sample value and a second color component reference sample value of the current block according to the first set of reference prediction parameters; Determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value; Determine a predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block.

2. The method according to claim 1, wherein, The determining the prediction parameters of the current block includes: Decode the bitstream to determine the value of a first syntax element; Determine the prediction parameters of the current block according to the value of the first syntax element.

3. The method according to claim 1, wherein, The determining the first set of reference prediction parameters for the current block according to the prediction parameters includes: When the prediction parameters indicate that the current block uses a first prediction mode, determine the first set of reference prediction parameters for the current block.

4. The method according to claim 1, wherein, The determining the first set of reference prediction parameters for the current block includes: Determine a first color component block of the current block; Determine a second set of reference prediction parameters for the current block according to the first color component block; wherein, the second set of reference prediction parameters includes one or more second candidate reference prediction parameters; Determine the first set of reference prediction parameters for the current block according to the second set of reference prediction parameters.

5. The method according to claim 4, wherein, The first candidate reference prediction parameter is a vector parameter based on the second color component, and the second candidate reference prediction parameter is a vector parameter based on the first color component.

6. The method according to claim 5, wherein The vector parameter includes one of the following: a block vector parameter, a motion vector parameter.

7. The method according to claim 4, wherein The determining the first color component block of the current block includes: Determine a first color component region at the same position of the current block; Determine the first color component block of the current block based on multiple divided blocks of the first color component region.

8. The method according to claim 7, wherein The determining the first color component block of the current block based on multiple divided blocks of the first color component region includes: Determine a first candidate block at a first position from the multiple divided blocks; Determine the first color component block of the current block according to the first candidate block at the first position.

9. The method according to claim 8, wherein The determining the first color component block of the current block according to the first candidate block at the first position includes: Perform a position offset search in a preset search region at the first position to determine multiple second candidate blocks; Determine the first color component block of the current block according to the first candidate block and / or the multiple second candidate blocks.

10. The method according to claim 4, wherein, The determining the second set of reference prediction parameters for the current block according to the first color component block includes: Determine one or more candidate vector parameters based on the first color component according to the first color component block; Determine the second set of reference prediction parameters for the current block according to the one or more candidate vector parameters based on the first color component.

11. The method according to claim 10, wherein, Determining the second reference prediction parameter set of the current block according to the one or more candidate vector parameters based on the first color component includes: Adjusting the candidate vector parameters based on the first color component to determine candidate vector parameters based on the second color component; When the candidate vector parameters based on the second color component meet the preset available conditions, using the candidate vector parameters based on the first color component as the second candidate reference prediction parameters and adding them to the second reference prediction parameter set.

12. The method according to claim 11, wherein, The adjusting the candidate vector parameters based on the first color component to determine candidate vector parameters based on the second color component includes: Determining the preset sampling format of the current block; Scaling the candidate vector parameters based on the first color component according to the preset sampling format to determine the candidate vector parameters based on the second color component.

13. The method according to claim 4, wherein, Determining the first reference prediction parameter set of the current block according to the second reference prediction parameter set includes: Adjusting one or more second candidate reference prediction parameters in the second reference prediction parameter set to determine the first candidate reference prediction parameters corresponding to the one or more second candidate reference prediction parameters; Determining the first reference prediction parameter set of the current block according to the first candidate reference prediction parameters corresponding to the one or more second candidate reference prediction parameters.

14. The method according to claim 13, wherein, The adjusting one or more second candidate reference prediction parameters in the second reference prediction parameter set to determine the first candidate reference prediction parameters corresponding to the one or more second candidate reference prediction parameters includes: Adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set based on the second color component; Determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter according to the third reference prediction parameter set.

15. The method according to claim 14, wherein, The adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set based on the second color component includes: Scaling the second candidate reference prediction parameters according to the preset sampling format of the current block to determine candidate vector parameters based on the second color component, and adding the candidate vector parameters based on the second color component to the third reference prediction parameter set.

16. The method according to claim 14, wherein, The adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set based on the second color component includes: Scaling the second candidate reference prediction parameters according to the preset sampling format of the current block to determine a first initial vector parameter based on the second color component; Performing an offset calculation on the first initial vector parameter based on the second color component according to one or more offset values to determine one or more candidate vector parameters based on the second color component, and adding the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

17. The method according to claim 14, wherein, The adjusting the second candidate reference prediction parameters to determine a third reference prediction parameter set of the second color component includes: Offset calculation is performed on the second candidate reference prediction parameter according to one or more offset values to determine one or more second initial vector parameters based on the first color component; According to the preset sampling format of the current block, scale the one or more second initial vector parameters based on the first color component to determine one or more candidate vector parameters based on the second color component, and add the one or more candidate vector parameters based on the second color component to the third reference prediction parameter set.

18. The method according to claim 14, wherein, The determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter according to the third reference prediction parameter set includes: When there are one or more candidate vector parameters in the third reference prediction parameter set that meet the preset available conditions, determine the first candidate reference prediction parameter according to the one or more candidate vector parameters.

19. The method according to claim 18, wherein The one or more candidate vector parameters meeting the preset available conditions at least include: The offset position indicated by the one or more candidate vector parameters does not exceed the image boundary; The offset position indicated by the one or more candidate vector parameters does not exceed the slice boundary; The offset position indicated by the one or more candidate vector parameters does not cover the current block; The offset position indicated by the one or more candidate vector parameters does not exceed the preset available area; The offset position indicated by the one or more candidate vector parameters has been reconstructed.

20. The method according to claim 18, wherein, The determining the first candidate reference prediction parameter according to the one or more candidate vector parameters includes: If there is one candidate vector parameter in the third reference prediction parameter set that meets the preset available conditions, determine the one candidate vector parameter that meets the preset available conditions as the first candidate reference prediction parameter; If there are multiple candidate vector parameters in the third reference prediction parameter set that meet the preset available conditions, make a decision on the multiple candidate vector parameters that meet the preset available conditions to determine the first candidate reference prediction parameter.

21. The method according to claim 20, wherein, The making a decision on the multiple candidate vector parameters that meet the preset available conditions to determine the first candidate reference prediction parameter includes: Determine the first template of the current block; According to the first template and the multiple candidate vector parameters, determine the first matching template of each of the multiple candidate vector parameters; When the first template and the first matching template meet the preset existence conditions, calculate the matching error between the first template of the current block and the first matching template according to the preset error criterion to determine the first generation value of each of the multiple candidate vector parameters; Determine the minimum first generation value from the first generation values of each of the multiple candidate vector parameters, and use the candidate vector parameter corresponding to the minimum first generation value as the first candidate reference prediction parameter.

22. The method according to claim 21, wherein, The method further includes: When the first template and the first matching template do not meet the preset existence conditions, determine the first candidate vector parameter that meets the preset available conditions in the third reference prediction parameter set as the first candidate reference prediction parameter; or, When the first template and the first matching template do not meet the preset existence condition, the candidate vector parameter at the second position in the third reference prediction parameter set that meets the preset available condition is determined as the first reference prediction parameter.

23. The method according to claim 14, wherein The method further includes: When all candidate vector parameters in the third reference prediction parameter set do not meet the preset available condition, determining the first color component reconstruction sample and the second color component reconstruction sample at the third position of the current block; Based on the first color component reconstruction sample and the second color component reconstruction sample at the third position, determining the first color component reference sample value and the second color component reference sample value of the current block.

24. The method according to claim 1, wherein The determining the first color component reference sample value and the second color component reference sample value of the current block according to the first reference prediction parameter set includes: Based on the first reference prediction parameter set, determining the first color component reconstruction sample and the second color component reconstruction sample indicated by each of the one or more first candidate reference prediction parameters; Determining the first color component reconstruction sample and the second color component reconstruction sample at the third position of the current block; Based on the first color component reconstruction sample and the second color component reconstruction sample indicated by each of the one or more first candidate reference prediction parameters and the first color component reconstruction sample and the second color component reconstruction sample at the third position, determining the first color component reference sample value and the second color component reference sample value of the current block.

25. The method according to claim 24, wherein, The determining the first color component reconstruction sample and the second color component reconstruction sample indicated by each of the one or more first candidate reference prediction parameters according to the first reference prediction parameter set includes: Determining the position of the current block; Scaling the position of the current block to determine the position of the first color component region at the same position of the current block; and scaling the first candidate reference prediction parameter to determine the scaled reference prediction parameter of the first color component region at the same position of the current block; Based on the position of the first color component region and the scaled reference prediction parameter, determining the reference block of the first color component, and determining the first color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the first color component; Based on the position of the current block and the first candidate reference prediction parameter, determining the reference block of the second color component, and determining the second color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the second color component.

26. The method according to claim 25, wherein, The determining the first color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the first color component includes: Performing downsampling processing on the reference block of the first color component to determine the first color component reconstruction sample indicated by the first candidate reference prediction parameter, so that the resolution of the first color component reconstruction sample is the same as the resolution of the second color component reconstruction sample.

27. The method according to claim 25, wherein, The determining the second color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the second color component includes: Upsample the reference block of the second color component to determine the reconstructed samples of the second color component indicated by the first candidate reference prediction parameter, so that the resolution of the reconstructed samples of the first color component is the same as that of the reconstructed samples of the second color component; Correspondingly, the method further includes: downsampling the predicted value of the second color component of the current block.

28. The method according to claim 26, wherein, The downsampling the reference block of the first color component to determine the reconstructed samples of the first color component indicated by the first candidate reference prediction parameter includes: Determining the downsampling method of the current block; Downsampling the reference block of the first color component according to the downsampling method to determine the reconstructed samples of the first color component indicated by the first candidate reference prediction parameter.

29. The method according to claim 28, wherein, The determining the downsampling method of the current block includes: Decoding the bitstream to determine the value of the filtering identification information; Determining the downsampling method of the current block according to the value of the filtering identification information.

30. The method according to claim 24, wherein, The determining the reconstructed samples of the first color component and the second color component at the third position of the current block includes: Determining the first template of the current block; Determining the reconstructed samples of the first color component and the second color component at the third position according to the first template.

31. The method according to claim 21 or 30, wherein, The type of the first template includes at least one of the following: upper template, upper right template, left template, lower left template, and upper left template; Wherein, the upper template is located in the decoded area adjacent to the upper side of the current block, the upper right template is located in the upper right Decoded area of the adjacent side, the left template is located in the decoded area adjacent to the left side of the current block, the lower left template is located in the decoded area adjacent to the lower left side of the current block, and the upper left template is located in the decoded area adjacent to the upper left side of the current block.

32. The method according to any one of claims 1 to 31, wherein, The determining the mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value includes: Determining a first look-up table according to the first color component reference sample value and the second color component reference sample value, wherein the first look-up table is used to record the values of the second color component corresponding to the index keyword being the first color component.

33. The method according to any one of claims 1 to 31, wherein, The determining the mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value includes: Determining a first discrete model according to the first color component reference sample value and the second color component reference sample value, wherein the first discrete model is used to indicate the mapping relationship between the first color component and the second color component.

34. The method according to claim 32 or 33, wherein, The method further includes: Performing a mapping process on the first color component reference sample value so that the first color component reference sample value is within a preset sample range.

35. The method according to claim 32 or 33, wherein The method further includes: When there are multiple second reference sample values that are different corresponding to the same first reference sample value in the first color component reference sample values, performing an overwriting process in sequence according to the sample order, and using the last second reference sample value as the value having a mapping relationship with the first reference sample value.

36. The method according to claim 32 or 33, wherein, The method further includes: When the first reference sample value in the first color component reference sample values is the same and corresponds to a plurality of different second reference sample values in the second color component reference sample values, calculate the average value of the plurality of second reference sample values, and use the obtained average value as the value having a mapping relationship with the first reference sample value.

37. The method according to claim 1, wherein, The method further includes: Determine the reconstructed pixel samples of the first color component region at the same position of the current block; Based on the reconstructed pixel samples of the first color component region, determine the first color component sample value of the current block.

38. The method according to claim 1, wherein The determining the predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block includes: If a first color component value equal to the first color component sample value is found in the mapping relationship, determine the value of the second color component corresponding to the first color component value as the predicted value of the second color component of the current block.

39. The method according to claim 38, wherein The method further includes: If a first color component value equal to the first color component sample value is not found in the mapping relationship, perform a correction process on the first color component sample value to determine a first color component correction value, and continue to check whether there is a first color component value equal to the first color component correction value in the mapping relationship.

40. The method according to claim 39, wherein, The performing a correction process on the first color component reconstruction value to determine a first color component correction value includes: Perform an offset calculation on the first color component sample value according to one or more preset offset values to determine the first color component correction value.

41. The method according to claim 39, wherein, The method further includes: If a first color component value equal to the first color component correction value is not found in the mapping relationship, calculate the average value of the second color component reference sample values, and determine the obtained average value as the predicted value of the second color component of the current block.

42. The method according to claim 1, wherein, The determining the predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block includes: Determine a first initial predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block; Perform a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

43. The method according to claim 42, wherein, The performing a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block includes: Perform a prediction process on the second color component of the current block according to a first preset mode to determine a second initial predicted value of the second color component of the current block; wherein the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode, and CCLM mode; Perform a weighted calculation on the first initial predicted value and the second initial predicted value to determine the predicted value of the second color component of the current block.

44. The method according to claim 1, wherein, The method further includes: Decode the bitstream to determine the residual value of the second color component of the current block; Determine the reconstructed value of the second color component of the current block according to the residual value and the predicted value.

45. The method according to claim 1, wherein, The method further includes: When the first reference prediction parameter set includes a plurality of first candidate reference prediction parameters, determining first color component reconstruction samples and second color component reconstruction samples indicated by the plurality of first candidate reference prediction parameters respectively; Determining a plurality of mapping relationships between a first color component and a second color component according to the first color component reconstruction samples and the second color component reconstruction samples indicated by the plurality of first candidate reference prediction parameters respectively; Determining a plurality of third initial prediction values of the second color component of the current block according to the plurality of mapping relationships; Performing weighted calculation on the plurality of third initial prediction values to determine a prediction value of the second color component of the current block.

46. The method according to claim 1, wherein The method further includes: When the first color component block of the current block includes a plurality of candidate blocks, determining a second reference prediction parameter set of the current block; wherein, the second reference prediction parameter set includes a plurality of second candidate reference prediction parameters; Determining a plurality of first candidate reference prediction parameters according to the plurality of second candidate reference prediction parameters; Determining a plurality of candidate mapping relationships between a first color component and a second color component based on the plurality of first candidate reference prediction parameters; Decoding a bitstream to determine a mapping relationship index value; Determining a target mapping relationship according to the mapping relationship index value and the plurality of candidate mapping relationships; Determining a prediction value of the second color component of the current block according to the target mapping relationship and the first color component sample value of the current block.

47. The method according to claim 1, wherein, The method further includes: When the first color component block of the current block includes a plurality of candidate blocks, determining a second reference prediction parameter set of the current block; wherein, the second reference prediction parameter set includes a plurality of second candidate reference prediction parameters; Determining a plurality of first candidate reference prediction parameters according to the plurality of second candidate reference prediction parameters; Determining a plurality of candidate mapping relationships between a first color component and a second color component based on the plurality of first candidate reference prediction parameters; Calculating matching errors for the plurality of candidate mapping relationships based on a template matching method to determine second-generation values of the plurality of candidate mapping relationships respectively; Determining a minimum generation value from the second-generation values of the plurality of candidate mapping relationships respectively, and determining the candidate mapping relationship corresponding to the minimum generation value as the target mapping relationship; Determining a prediction value of the second color component of the current block according to the target mapping relationship and the first color component sample value of the current block.

48. The method according to claim 47, wherein, The calculating matching errors for the plurality of candidate mapping relationships based on a template matching method to determine second-generation values of the plurality of candidate mapping relationships respectively includes: Determining a first template of the current block; Determining reconstructed pixel sample values of a first color component region template at the same position of the first template; Determining prediction values of the second color component of the first template under the plurality of mapping relationships according to the plurality of candidate mapping relationships and the reconstructed pixel sample values of the first color component region template; Cost calculation is performed between the reconstructed value of the second color component according to the first template and the predicted values of the second color components of the first template under the multiple mapping relationships, and the second-generation values of the multiple candidate mapping relationships are determined.

49. The method according to claim 1, wherein The method further includes: Determine the first color component region at the same position of the current block; If the current block uses the DM mode and the first color component region is predicted based on a block vector, determine that the current block uses the first prediction mode.

50. The method according to any one of claims 1 to 49, wherein, The method further includes: Determine the value of a second syntax element; When the second syntax element indicates that the current block is allowed to use the first prediction mode, perform the step of determining the prediction parameters of the current block.

51. An encoding method, applied to an encoder, the method includes: Determine the prediction parameters of the current block; According to the prediction parameters, determine the first reference prediction parameter set of the current block; wherein, the first reference prediction parameter set includes one or more first candidate reference prediction parameters; According to the first reference prediction parameter set, determine the first color component reference sample value and the second color component reference sample value of the current block; According to the mapping relationship between the first color component and the second color component, and the first color component sample value of the current block, determine the predicted value of the second color component of the current block. The determining the first reference prediction parameter set of the current block according to the prediction parameters includes:

52. The method according to claim 51, wherein, When the prediction parameters indicate that the current block uses the first prediction mode, determine the first reference prediction parameter set of the current block. The determining the prediction parameters of the current block includes:

53. The method according to claim 52, wherein, Determine the first-generation value of the current block using the first prediction mode, and determine the second-generation value of the current block not using the first prediction mode; According to the first-generation value and the second-generation value, determine the prediction parameters. The determining the prediction parameters according to the first-generation value and the second-generation value includes:

54. The method according to claim 53, wherein, If the first-generation value is less than the second-generation value, determine that the prediction parameters indicate that the current block uses the first prediction mode; If the first-generation value is greater than the second-generation value, determine that the prediction parameters indicate that the current block does not use the first prediction mode. The method further includes:

55. The method according to claim 54, wherein, According to the prediction parameters, determine the value of a first syntax element; Perform encoding processing on the value of the first syntax element, and write the obtained encoded bits into the code stream. The determining the value of the first syntax element according to the prediction parameters includes:

56. The method according to claim 55, wherein, If the prediction parameters indicate that the current block uses the first prediction mode, determine that the value of the first syntax element is a first value; If the prediction parameters indicate that the current block does not use the first prediction mode, determine that the value of the first syntax element is a second value. The determining the first reference prediction parameter set of the current block includes:

57. The method according to claim 51, wherein, Determine the first color component block of the current block; ​ Determine a second set of reference prediction parameters for the current block according to the first color component block; wherein the second set of reference prediction parameters includes one or more second candidate reference prediction parameters; Determine a first set of reference prediction parameters for the current block according to the second set of reference prediction parameters.

58. The method according to claim 57, wherein, The first candidate reference prediction parameter is a vector parameter based on the second color component, and the second candidate reference prediction parameter is a vector parameter based on the first color component.

59. The method according to claim 58, wherein, The vector parameter includes one of the following: a block vector parameter, a motion vector parameter.

60. The method according to claim 57, wherein, The determining the first color component block of the current block includes: Determine a first color component region at the same position of the current block; Determine the first color component block of the current block based on multiple divided blocks of the first color component region.

61. The method according to claim 60, wherein, The determining the first color component block of the current block based on multiple divided blocks of the first color component region includes: Determine a first candidate block at a first position from the multiple divided blocks; Determine the first color component block of the current block according to the first candidate block at the first position.

62. The method according to claim 61, wherein, The determining the first color component block of the current block according to the first candidate block at the first position includes: Perform a position offset search in a preset search region at the first position to determine multiple second candidate blocks; Determine the first color component block of the current block according to the first candidate block and / or the multiple second candidate blocks.

63. The method according to claim 57, wherein, The determining the second set of reference prediction parameters for the current block according to the first color component block includes: Determine one or more candidate vector parameters based on the first color component according to the first color component block; Determine the second set of reference prediction parameters for the current block according to the one or more candidate vector parameters based on the first color component.

64. The method according to claim 63, wherein, The determining the second set of reference prediction parameters for the current block according to the one or more candidate vector parameters based on the first color component includes: Adjust the candidate vector parameters based on the first color component to determine candidate vector parameters based on the second color component; When the candidate vector parameters based on the second color component meet a preset available condition, use the candidate vector parameters based on the first color component as the second candidate reference prediction parameters and add them to the second set of reference prediction parameters.

65. The method according to claim 64, wherein, The adjusting the candidate vector parameters based on the first color component to determine candidate vector parameters based on the second color component includes: Determine a preset sampling format of the current block; Scale the candidate vector parameters based on the first color component according to the preset sampling format to determine the candidate vector parameters based on the second color component.

66. The method according to claim 57, wherein, The determining the first set of reference prediction parameters for the current block according to the second set of reference prediction parameters includes: Adjust one or more second candidate reference prediction parameters in the second set of reference prediction parameters to determine the first candidate reference prediction parameters corresponding to the one or more second candidate reference prediction parameters respectively; Determine a first set of reference prediction parameters for the current block according to the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters.

67. The method according to claim 66, wherein, Adjusting one or more second candidate reference prediction parameters in the second set of reference prediction parameters to determine the first candidate reference prediction parameters corresponding to each of the one or more second candidate reference prediction parameters includes: Adjust the second candidate reference prediction parameters to determine a third set of reference prediction parameters based on the second color component; Determine the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter according to the third set of reference prediction parameters.

68. The method according to claim 67, wherein, Adjusting the second candidate reference prediction parameters to determine a third set of reference prediction parameters based on the second color component includes: Scale the second candidate reference prediction parameters according to the preset sampling format of the current block to determine candidate vector parameters based on the second color component, and add the candidate vector parameters based on the second color component to the third set of reference prediction parameters.

69. The method according to claim 67, wherein, Adjusting the second candidate reference prediction parameters to determine a third set of reference prediction parameters based on the second color component includes: Scale the second candidate reference prediction parameters according to the preset sampling format of the current block to determine a first initial vector parameter based on the second color component; Perform an offset calculation on the first initial vector parameter based on the second color component according to one or more offset values to determine one or more candidate vector parameters based on the second color component, and add the one or more candidate vector parameters based on the second color component to the third set of reference prediction parameters.

70. The method according to claim 67, wherein, Adjusting the second candidate reference prediction parameters to determine a third set of reference prediction parameters for the second color component includes: Perform an offset calculation on the second candidate reference prediction parameters according to one or more offset values to determine one or more second initial vector parameters based on the first color component; Scale the one or more second initial vector parameters based on the first color component according to the preset sampling format of the current block to determine one or more candidate vector parameters based on the second color component, and add the one or more candidate vector parameters based on the second color component to the third set of reference prediction parameters.

71. The method according to claim 67, wherein, Determining the first candidate reference prediction parameter corresponding to the second candidate reference prediction parameter according to the third set of reference prediction parameters includes: When there are one or more candidate vector parameters in the third set of reference prediction parameters that meet the preset available conditions, determine the first candidate reference prediction parameter according to the one or more candidate vector parameters.

72. The method according to claim 71, wherein, The one or more candidate vector parameters meeting the preset available conditions at least include: The offset positions indicated by the one or more candidate vector parameters do not exceed the image boundary; The offset positions indicated by the one or more candidate vector parameters do not exceed the slice boundary; The offset positions indicated by the one or more candidate vector parameters do not cover the current block; The offset positions indicated by the one or more candidate vector parameters do not exceed the preset available area; The offset positions indicated by the one or more candidate vector parameters have been reconstructed.

73. The method according to claim 71, wherein, Determining the first candidate reference prediction parameter according to the one or more candidate vector parameters includes: If there is one candidate vector parameter in the third reference prediction parameter set that meets the preset availability condition, determining the one candidate vector parameter that meets the preset availability condition as the first candidate reference prediction parameter; If there are multiple candidate vector parameters in the third reference prediction parameter set that meet the preset availability condition, making a decision on the multiple candidate vector parameters that meet the preset availability condition to determine the first candidate reference prediction parameter.

74. The method according to claim 73, wherein, Making a decision on the multiple candidate vector parameters that meet the preset availability condition to determine the first candidate reference prediction parameter includes: Determining the first template of the current block; According to the first template and the multiple candidate vector parameters, determining the respective first matching templates of the multiple candidate vector parameters; When the first template and the first matching template meet the preset existence condition, calculating the matching error between the first template of the current block and the first matching template according to a preset error criterion to determine the respective first-generation values of the multiple candidate vector parameters; Determining the minimum first-generation value from the respective first-generation values of the multiple candidate vector parameters, and Determining the candidate vector parameter corresponding to the minimum first-generation value as the first candidate reference prediction parameter.

75. The method according to claim 74, wherein, The method further includes: When the first template and the first matching template do not meet the preset existence condition, determining the first candidate vector parameter at the first position in the third reference prediction parameter set that meets the preset availability condition as the first candidate reference prediction parameter; or, When the first template and the first matching template do not meet the preset existence condition, determining the candidate vector parameter at the second position in the third reference prediction parameter set that meets the preset availability condition as the first reference prediction parameter.

76. The method according to claim 67, wherein, The method further includes: When all candidate vector parameters in the third reference prediction parameter set do not meet the preset availability condition, determining the first color component reconstruction sample and the second color component reconstruction sample at the third position of the current block; According to the first color component reconstruction sample and the second color component reconstruction sample at the third position, determining the first color component reference sample value and the second color component reference sample value of the current block.

77. The method according to claim 51, wherein, Determining the first color component reference sample value and the second color component reference sample value of the current block according to the first reference prediction parameter set includes: According to the first reference prediction parameter set, determining the first color component reconstruction sample and the second color component reconstruction sample indicated by each of the one or more first candidate reference prediction parameters; Determining the first color component reconstruction sample and the second color component reconstruction sample at the third position of the current block; Determine the first color component reference sample value and the second color component reference sample value of the current block according to the first color component reconstruction samples and the second color component reconstruction samples respectively indicated by the one or more first candidate reference prediction parameters, and the first color component reconstruction samples and the second color component reconstruction samples at the third position.

78. The method according to claim 77, wherein, The determining the first color component reconstruction samples and the second color component reconstruction samples respectively indicated by the one or more first candidate reference prediction parameters according to the first reference prediction parameter set includes: Determine the position of the current block; Scale the position of the current block to determine the position of the first color component region at the same position as the current block; and scale the first candidate reference prediction parameter to determine the scaled reference prediction parameter of the first color component region at the same position as the current block; Determine the reference block of the first color component according to the position of the first color component region and the scaled reference prediction parameter, and determine the first color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the first color component; Determine the reference block of the second color component according to the position of the current block and the first candidate reference prediction parameter, and determine the second color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the second color component.

79. The method according to claim 78, wherein The determining the first color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the first color component includes: Perform downsampling on the reference block of the first color component to determine the first color component reconstruction sample indicated by the first candidate reference prediction parameter, so that the resolution of the first color component reconstruction sample is the same as the resolution of the second color component reconstruction sample.

80. The method according to claim 78, wherein, The determining the second color component reconstruction sample indicated by the first candidate reference prediction parameter according to the reference block of the second color component includes: Perform upsampling on the reference block of the second color component to determine the second color component reconstruction sample indicated by the first candidate reference prediction parameter, so that the resolution of the first color component reconstruction sample is the same as the resolution of the second color component reconstruction sample; Correspondingly, the method further includes: performing downsampling on the predicted value of the second color component of the current block.

81. The method according to claim 79, wherein, The performing downsampling on the reference block of the first color component to determine the first color component reconstruction sample indicated by the first candidate reference prediction parameter includes: Determine the downsampling method of the current block; Perform downsampling on the reference block of the first color component according to the downsampling method to determine the first color component reconstruction sample indicated by the first candidate reference prediction parameter.

82. The method according to claim 81, wherein, The determining the downsampling method of the current block includes: Calculate the cost of multiple candidate downsampling methods based on a preset competition method to determine the cost results respectively corresponding to the multiple candidate downsampling methods; Select the minimum cost result from the cost results respectively corresponding to the multiple candidate downsampling methods; Determine the candidate downsampling method corresponding to the minimum cost result as the downsampling method of the current block.

83. The method according to claim 82, wherein The preset competition method is a rate-distortion optimization method.

84. The method according to claim 82, wherein, The method further includes: Determining a value of filtering identification information, where the filtering identification information is used to indicate an index number of a downsampling method of the current block among the multiple candidate downsampling methods; Performing encoding processing on the value of the filtering identification information, and writing the obtained encoded bits into a bitstream.

85. The method according to claim 77, wherein, The determining the first color component reconstruction sample and the second color component reconstruction sample at a third position of the current block includes: Determining a first template of the current block; Determining the first color component reconstruction sample and the second color component reconstruction sample at the third position according to the first template.

86. The method according to claim 74 or 85, wherein, The type of the first template includes at least one of the following: an upper template, an upper-right template, a left template, a lower-left template, and an upper-left template; Wherein, the upper template is located in a decoded area adjacent to the upper side of the current block, the upper-right template is located in a decoded area adjacent to the upper-right side of the current block, the left template is located in a decoded area adjacent to the left side of the current block, the lower-left template is located in a decoded area adjacent to the lower-left side of the current block, and the upper-left template is located in a decoded area adjacent to the upper-left side of the current block.

87. The method according to any one of claims 51 to 86, wherein, The determining a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value includes: Determining a first look-up table according to the first color component reference sample value and the second color component reference sample value, where the first look-up table is used to record a value of the second color component corresponding to an index keyword being the first color component.

88. The method according to any one of claims 51 to 86, wherein, The determining a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value includes: Determining a first discrete model according to the first color component reference sample value and the second color component reference sample value, where the first discrete model is used to indicate a mapping relationship between the first color component and the second color component.

89. The method according to claim 87 or 88, wherein, The method further includes: Performing mapping processing on the first color component reference sample value so that the first color component reference sample value is within a preset sample range.

90. The method according to claim 87 or 88, wherein, The method further includes: When a first reference sample value in the first color component reference sample values is the same and corresponds to multiple second reference sample values that are different in the second color component reference sample values, performing covering processing in sequence according to the sample order, and using the last second reference sample value as a value having a mapping relationship with the first reference sample value.

91. The method according to claim 87 or 88, wherein, The method further includes: When a first reference sample value in the first color component reference sample values is the same and corresponds to multiple second reference sample values that are different in the second color component reference sample values, calculating an average value of the multiple second reference sample values, and using the obtained average value as a value having a mapping relationship with the first reference sample value.

92. The method according to claim 51, wherein, The method further includes: Determining a reconstructed pixel sample of a first color component region at the same position of the current block; Determining a first color component sample value of the current block based on the reconstructed pixel sample of the first color component region.

93. The method according to claim 51, wherein Determining a predicted value of a second color component of the current block according to the mapping relationship and a first color component sample value of the current block includes: If a first color component value equal to the first color component sample value is found in the mapping relationship, determining a value of the second color component corresponding to the first color component value as the predicted value of the second color component of the current block.

94. The method according to claim 93, wherein, The method further includes: If a first color component value equal to the first color component sample value is not found in the mapping relationship, performing a correction process on the first color component sample value to determine a first color component correction value, and continuing to search in the mapping relationship for a first color component value equal to the first color component correction value.

95. The method according to claim 94, wherein, Performing a correction process on the first color component reconstruction value to determine a first color component correction value includes: Performing an offset calculation on the first color component sample value according to one or more preset offset values to determine the first color component correction value.

96. The method according to claim 94, wherein, The method further includes: If a first color component value equal to the first color component correction value is not found in the mapping relationship, calculating an average value of the second color component reference sample values, and determining the obtained average value as the predicted value of the second color component of the current block.

97. The method according to claim 51, wherein, Determining a predicted value of a second color component of the current block according to the mapping relationship and a first color component sample value of the current block includes: Determining a first initial predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block; Performing a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

98. The method according to claim 97, wherein Performing a correction operation on the first initial predicted value to determine the predicted value of the second color component of the current block includes: Performing a prediction process on the second color component of the current block according to a first preset mode to determine a second initial predicted value of the second color component of the current block; wherein the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode, and CCLM mode; Performing a weighted calculation on the first initial predicted value and the second initial predicted value to determine the predicted value of the second color component of the current block.

99. The method according to claim 51, wherein The method further includes: Determining an initial value of the second color component of the current block; Determining a residual value of the second color component of the current block according to the initial value and the predicted value; Performing an encoding process on the residual value of the second color component of the current block, and writing the obtained encoded bits into a bitstream.

100. The method according to claim 51, wherein, The method further includes: When the first reference prediction parameter set includes a plurality of first candidate reference prediction parameters, determining first color component reconstruction samples and second color component reconstruction samples indicated by the plurality of first candidate reference prediction parameters respectively; Determining a plurality of mapping relationships between the first color component and the second color component according to the first color component reconstruction samples and the second color component reconstruction samples indicated by the plurality of first candidate reference prediction parameters respectively; Determine a plurality of third initial prediction values of the second color component of the current block according to the plurality of mapping relationships; Perform weighted calculation on the plurality of third initial prediction values to determine the prediction value of the second color component of the current block.

101. The method according to claim 51, wherein, The method further includes: When the first color component block of the current block includes a plurality of candidate blocks, determine a second reference prediction parameter set of the current block; wherein the second reference prediction parameter set includes a plurality of second candidate reference prediction parameters; Determine a plurality of first candidate reference prediction parameters according to the plurality of second candidate reference prediction parameters; Based on the plurality of first candidate reference prediction parameters, determine a plurality of candidate mapping relationships between the first color component and the second color component; Determine a target mapping relationship from the plurality of candidate mapping relationships; Determine the prediction value of the second color component of the current block according to the target mapping relationship and the sample value of the first color component of the current block.

102. The method according to claim 101, wherein The determining a target mapping relationship from the plurality of candidate mapping relationships includes: Perform cost calculation on each of the plurality of candidate mapping relationships to determine the cost result corresponding to each of the plurality of candidate mapping relationships; Determine the minimum cost result from the cost results corresponding to the plurality of candidate mapping relationships, and determine the candidate mapping relationship corresponding to the minimum cost result as the target mapping relationship.

103. The method according to claim 101, wherein The method further includes: Determine a mapping relationship index value, where the mapping relationship index value is used to indicate the index number of the target mapping relationship in the plurality of candidate mapping relationships; Perform encoding processing on the mapping relationship index value, and write the obtained encoded bits into the code stream.

104. The method according to claim 51, wherein, The method further includes: When the first color component block of the current block includes a plurality of candidate blocks, determine a second reference prediction parameter set of the current block; wherein the second reference prediction parameter set includes a plurality of second candidate reference prediction parameters; Determine a plurality of first candidate reference prediction parameters according to the plurality of second candidate reference prediction parameters; Based on the plurality of first candidate reference prediction parameters, determine a plurality of candidate mapping relationships between the first color component and the second color component; Calculate the matching error of the plurality of candidate mapping relationships based on a template matching method to determine the second-generation value of each of the plurality of candidate mapping relationships; Determine the minimum second-generation value from the second-generation values of the plurality of candidate mapping relationships, and determine the candidate mapping relationship corresponding to the minimum second-generation value as the target mapping relationship; Determine the prediction value of the second color component of the current block according to the target mapping relationship and the sample value of the first color component of the current block.

105. The method according to claim 104, wherein, The calculating the matching error of the plurality of candidate mapping relationships based on a template matching method to determine the second-generation value of each of the plurality of candidate mapping relationships includes: Determine the first template of the current block; Determine the reconstructed pixel sample value of the first color component region template at the same position of the first template; According to the plurality of candidate mapping relationships and the reconstructed pixel sample value of the first color component region template, determine the prediction value of the second color component of the first template under each of the plurality of mapping relationships; Cost calculation is performed on the reconstructed value of the second color component according to the first template and the predicted values of the second color components of the first template under the multiple mapping relationships, and the second-generation values of the multiple candidate mapping relationships are determined.

106. The method according to claim 51, wherein The determining the prediction parameters of the current block includes: Determining the prediction mode of the current block; According to the prediction mode of the current block, determining the prediction parameters of the current block.

107. The method according to claim 106, wherein, The determining the prediction mode of the current block includes: Determining multiple candidate modes of the current block; wherein, the multiple candidate modes include a first prediction mode and other prediction modes other than the first prediction mode; Performing cost calculation on the multiple candidate modes based on a preset cost method, and determining the cost results corresponding to the multiple candidate modes; Determining the minimum cost result from the cost results corresponding to the multiple candidate modes, and determining the candidate mode corresponding to the minimum cost result as the prediction mode of the current block; Wherein, the preset cost method includes at least one of the following: rate-distortion cost method and template matching method.

108. The method according to claim 51, wherein The method further includes: Determining the first color component region at the same position of the current block; If the current block uses the DM mode and the first color component region is predicted based on the block vector, determining that the current block uses the first prediction mode.

109. The method according to any one of claims 51 to 108, wherein, The method further includes: Determining the value of a second syntax element; wherein, the second syntax element is used to indicate whether the current block is allowed to use the first prediction mode; Performing encoding processing on the value of the second syntax element, and writing the obtained encoded bits into the code stream.

110. A bitstream, wherein, The code stream is generated by performing bit encoding on the information to be encoded; wherein, the information to be encoded includes at least one of the following: The residual value of the second color component of the current block, the value of the filtering identification information, the mapping relationship index value, the value of the first syntax element, and the value of the second syntax element; Wherein, the filtering identification information is used to indicate the downsampling method of the current block, the first syntax element is used to indicate whether the current block uses the first prediction mode, and the second syntax element is used to indicate whether the current block is allowed to use the first prediction mode.

111. An encoder, comprising a first determination unit and a first prediction unit, wherein: The first determination unit is configured to determine the prediction parameters of the current block; And according to the prediction parameters, determining a first set of reference prediction parameters of the current block; wherein, the first set of reference prediction parameters includes one or more first candidate reference prediction parameters; The first determination unit is further configured to determine the first color component reference sample value and the second color component reference sample value of the current block according to the first set of reference prediction parameters; and determine the mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value; The first prediction unit is configured to determine the predicted value of the second color component of the current block according to the mapping relationship and the first color component sample value of the current block.

112. An encoder, comprising a first memory and a first processor, wherein: The first memory is configured to store a computer program that can run on the first processor; The first processor is configured to execute the method according to any one of claims 51 to 109 when running the computer program.

113. A decoder, comprising a second determination unit and a second prediction unit, wherein: The second determination unit is configured to determine prediction parameters of a current block; and determine a first set of reference prediction parameters of the current block according to the prediction parameters; wherein the first set of reference prediction parameters includes one or more first candidate reference prediction parameters; The second determination unit is further configured to determine a first color component reference sample value and a second color component reference sample value of the current block according to the first set of reference prediction parameters; and determine a mapping relationship between the first color component and the second color component according to the first color component reference sample value and the second color component reference sample value; The second prediction unit is configured to determine a predicted value of the second color component of the current block according to the mapping relationship and a first color component sample value of the current block.

114. A decoder, the decoder comprising a second memory and a second processor, wherein: The second memory is configured to store a computer program that can run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 50 when running the computer program.

115. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 50 or the method according to any one of claims 51 to 109 is implemented.

Citation Information

Patent Citations

  • Image encoding / decoding method and apparatus

    CN101352046A

  • Intra block copy-based encoding / decoding method, device, and bitstream storage medium

    US20220256189A1

  • Method and device for processing colour information in an image

    WO2012175646A1