Encoding / decoding methods, bitstreams, encoders, decoders, and storage media

By determining block vector parameters and establishing mapping relationships between color components, the method improves color difference prediction accuracy and efficiency in video encoding and decoding, addressing inaccuracies in the H.266/VVC standard's IBC mode.

JP2026523172APending Publication Date: 2026-07-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025574241
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-07-04
Publication Date
2026-07-13

AI Technical Summary

Technical Problem

In video encoding and decoding, particularly with the H.266/Versatile Video Coding (VVC) standard, the color difference prediction in Intra-block copy (IBC) mode becomes inaccurate due to unreasonable color difference prediction mode settings, leading to inefficiencies in encoding and decoding processes.

Method used

Determine the first block vector parameter of the current block, establish a mapping relationship between color components based on reference samples, and use this relationship to predict the color difference component, thereby improving prediction accuracy and efficiency.

Benefits of technology

Enhances color difference prediction accuracy and reduces bitrate by utilizing mapping relationships between luminance and chrominance components, leading to improved encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026523172000001_ABST
    Figure 2026523172000001_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium, the method comprising the steps of: determining a first block vector parameter of the current block; determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter; establishing a mapping relationship between the first and second color components based on the first and second color component reference samples; and determining a 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. This improves the accuracy of color difference prediction, saves bitrate, and also improves encoding / decoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the video encoding and decoding technology, and more particularly to encoding and decoding methods, bitstreams, encoders, decoders, and storage media. [Background technology]

[0002] As people's demands for higher video display quality increase, new video application formats such as high-definition and ultra-high-definition video are constantly emerging. The Joint Video Exploration Team (JVET) of the International Organization for Standardization (ISO / IEC) and the ITU-T developed the video coding standard H.266 / Versatile Video Coding (VVC). Within this standard, Intra-block copy (IBC) is a block-level coding mode provided by VVC for screen content type video sequences.

[0003] In related technologies, with regard to Direct Mode (DM), when using IBC mode for luminance blocks, if the color difference prediction mode setting is unreasonable, the color difference prediction of the current block becomes inaccurate, impairing encoding efficiency. [Overview of the Initiative]

[0004] This application provides an encoding / decoding method, bitstream, encoder, decoder, and storage medium that can improve the accuracy of color difference prediction, further save bitrate, and thereby improve encoding / decoding efficiency.

[0005] The technical solution of this application can be realized as follows.

[0006] In a first aspect, an embodiment of the present application provides a decoding method applicable to a decoder, the method being: The steps are to determine the first block vector parameter of the current block, The steps include determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter, and establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample, The process includes the step of determining a predicted value for 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.

[0007] In a second aspect, an embodiment of the present application provides an encoding method applicable to an encoder, the method being: The steps are to determine the first block vector parameter of the current block, The steps include determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter, and establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample, The process includes the step of determining a predicted value for 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.

[0008] In a third aspect, an embodiment of the present application provides a bitstream, which is generated by bit encoding based on encoding pending information, and the encoding pending information is The value includes at least one of the following: a value of a first syntax element flag information, a value of a second syntax element flag information, and a mapping relation index value, wherein the first syntax element flag information is used to indicate whether or not to use the target prediction mode for the second color component of the current block, and the second syntax element flag information is used to indicate whether or not to allow the use of the target prediction mode for the second color component of the current block.

[0009] In a fourth aspect, an embodiment of the present application provides an encoder comprising a first determination unit, a first establishment unit, and a first prediction unit. The first decision unit is configured to determine the first block vector parameter of the current block, The first establishment unit is configured to determine a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameters, and to establish a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample. The first prediction unit is configured to determine a predicted value for 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.

[0010] In a fifth aspect, an embodiment of the present application provides an encoder comprising a first memory and a first processor, The first memory is used to store computer programs that can be executed on the first processor. The first processor is used to perform the method described in the second embodiment when executing a computer program.

[0011] In a sixth aspect, an embodiment of the present application provides a decoder comprising a second determination unit, a second establishment unit, and a second prediction unit, The second decision unit is configured to determine the first block vector parameter of the current block, The second establishment unit is configured to determine a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameters, and to establish a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample. The second prediction unit is configured to determine a predicted value for 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.

[0012] In a seventh aspect, an embodiment of the present application provides a decoder comprising a second memory and a second processor, The second memory is used to store computer programs that can be executed on the second processor. The second processor is used to perform the method described in the first embodiment when executing a computer program.

[0013] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium that stores a computer program, and the computer program, when executed, implements the method described in the first aspect or the method described in the second aspect.

[0014] Embodiments of the present invention provide an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. On either the encoding or decoding side, first, a first block vector parameter of the current block is determined; then, based on the first block vector parameter, a first color component reference sample and a second color component reference sample corresponding to the current block are determined; a mapping relationship between the first and second color components is established based on the first and second color component reference samples; and further, a predicted value for the second color component of the current block is determined based on the mapping relationship and the first color component sample value of the current block. In this way, when a luminance block corresponding to the current block is predicted based on the block vector, a first block vector parameter to be applied to the chrominance component can be determined based on the block vector parameter of the luminance block; a mapping relationship between the luminance component and the chrominance component is established based on the luminance component reference sample and the chrominance component reference sample located at the position of the first block vector parameter; and then, the chrominance component is predicted using this mapping relationship. In other words, the encoding and decoding method proposed in the embodiment of this application improves the problem of uniformity in color difference prediction, makes full use of related information of luminance blocks at the same location, and can improve the accuracy of color difference prediction. At the same time, it can effectively perform pixel-level prediction based on established mapping relationships, thereby further saving bitrate, improving encoding and decoding efficiency, and thereby improving encoding and decoding performance. [Brief explanation of the drawing]

[0015] [Figure 1] This is a schematic flowchart for obtaining reconstituted samples based on IBC mode. [Figure 2] This is a schematic diagram of the positional distribution of adjacent blocks provided in the embodiment of the present application. [Figure 3] This is a schematic diagram 1 showing the positional relationship between the luminance block and the color difference block provided in the embodiment of the present invention. [Figure 4A] This is a schematic block diagram of the encoder configuration provided in the embodiment of the present invention. [Figure 4B]This is a schematic block diagram of the decoder configuration provided in the embodiment of the present invention. [Figure 5] This is a schematic diagram of the network architecture of the encoding / decoding system provided by the embodiment of the present invention. [Figure 6] This is a schematic flowchart of the decoding method provided by the embodiment of the present application. [Figure 7] This is a schematic diagram 2 showing the positional relationship between the luminance block and the color difference block provided in the embodiment of the present invention. [Figure 8] Figure 3 shows a schematic diagram of the positional relationship between the luminance block and the color difference block provided in the embodiment of the present invention. [Figure 9] Figure 4 shows a schematic diagram of the positional relationship between the luminance block and the color difference block provided in the embodiment of the present invention. [Figure 10] This is a schematic diagram showing whether the offset position provided by the embodiment of the present application currently does not cover the block. [Figure 11] This is a schematic diagram of the structure showing whether the offset position provided by the embodiment of the present application exceeds a predetermined usable area. [Figure 12] This is a schematic diagram of the structure for determining the optimal color difference BV parameter provided by the embodiment of the present application. [Figure 13] This is a schematic diagram showing the current color difference block and the corresponding luminance region at the same location provided in the embodiment of the present application. [Figure 14] This is a schematic diagram of the luminance region at the same position and the corresponding offset position provided by the embodiment of the present application. [Figure 15] This is a schematic diagram of the type of template provided in the embodiment of the present application. [Figure 16] This is a schematic diagram illustrating the motion compensation of the template provided in the embodiment of the present application. [Figure 17] This is a schematic diagram showing the positions of the luminance region and the reference luminance region at the same location provided by the embodiment of the present application. [Figure 18] This is a schematic diagram of downsampling provided by the embodiment of the present application. [Figure 19] Figure 5 shows a schematic diagram of the positional relationship between the luminance block and the color difference block provided in the embodiment of the present invention. [Figure 20] This is a schematic flowchart of the encoding method provided by the embodiment of the present application. [Figure 21] This is a schematic diagram 1 of the detailed flow of the encoding method provided in the embodiment of the present invention. [Figure 22] This is a schematic diagram 2 of the detailed flow of the encoding method provided in the embodiment of the present invention. [Figure 23] This is a schematic diagram of the color difference prediction flow based on BV provided in the embodiment of the present application. [Figure 24] This is a schematic diagram of the configuration structure of the encoder provided in the embodiment of the present invention. [Figure 25] This is a schematic diagram of the specific hardware configuration of the encoder provided in the embodiment of the present invention. [Figure 26] This is a schematic diagram of the decoder configuration provided by the embodiment of the present invention. [Figure 27] This is a schematic diagram of the specific hardware configuration of the decoder provided in the embodiment of the present invention. [Figure 28] This is a schematic diagram of the configuration structure of the encoding / decoding system provided by the embodiment of the present invention. [Modes for carrying out the invention]

[0016] To enable a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of these embodiments will be described in detail below, accompanied by drawings. The attached drawings are for illustrative purposes only and do not limit the embodiments of this application.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as that commonly understood by those skilled in the art of this application. The terms used herein are for illustrative purposes only and are not intended to limit this application.

[0018] In the following description, “several embodiments” refers to a subset of all possible embodiments. However, “several embodiments” can be the same or different subsets of all possible embodiments and can be combined with each other as long as they do not contradict each other. Furthermore, the terms “first / second / third” relating to the embodiments of this application are used solely to distinguish similar subjects and do not represent a specific order of subjects. “First / second / third” should be understood to mean that, under permissible circumstances, a specific order or sequence can be swapped so that the embodiments of this application described herein can be carried out in an order other than that illustrated or described herein.

[0019] Before providing a more detailed description of the embodiments of this application, we will first explain the nouns and terms used in relation to the embodiments. The nouns and terms used in relation to the embodiments of this application will apply to the following interpretations.

[0020] Coding block (CB).

[0021] Intra-block copy (IBC).

[0022] Screen Content Coding (SCC).

[0023] Block matching (BM).

[0024] Coding Unit (CU).

[0025] Block vector (BV).

[0026] Motion vector (MV).

[0027] Direct Block Vector (DBV).

[0028] BV Guide Palette (Block Vector Guided-PLT, BVG-PLT).

[0029] IBC Advanced Motion Vector Prediction (AMVP).

[0030] Cross-Component Linear Model prediction (CCLM).

[0031] Merge Mode.

[0032] Planar Mode.

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

[0034] The VVC reference software test platform (VVC Test Model, VTM).

[0035] Understandably, in video images, encoded blocks are generally represented using a first color component, a second color component, and a third color component. Here, these three color components are one luminance component, one blue component, and one red component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue component by the symbol Cb or U, and the red component by the symbol Cr or V. In this way, video images can be represented in YCbCr format or YUV format.

[0036] Furthermore, IBC is a tool extended by VVC for encoding screen content type video sequences, significantly improving the encoding efficiency of screen content sequences. Specifically, IBC is a block-level encoding mode, and like interframe techniques, the encoding side performs motion search, specifically by block matching to find the optimal block vector (also called a motion vector) for each encoded block. Here, the block vector is a vector that points from the current block to a reference block. The difference from interframe techniques is that the optimal block vector in IBC is obtained by searching in the reconstruction domain of the frame where the current block is located (i.e., the currently encoded frame), whereas the motion vector between frames is obtained by searching in the adjacent reference frame in the time domain of the currently encoded frame.

[0037] In H.266 / VVC, the specific process for acquiring the reconstructed pixels of the current block in IBC mode may include deriving the block vector, deriving the predicted sample using the block vector, deriving the residual sample, and deriving the reconstructed sample using the predicted and residual samples.

[0038] In a specific implementation method, the process for acquiring a reconstituted sample in IBC mode includes the following steps, as shown in Figure 1.

[0039] In S101, we derive the block vector.

[0040] For the luminance component, the input includes a luminance position (xCb, yCb) specifying the relative position of the top-left corner sample of the current block to the top-left corner luminance sample of the current image, a variable cbWidth specifying the width of the current block in the luminance sample, and a variable cbHeight specifying the height of the current block in the luminance sample. The output is a luminance block vector (Block Vector Luma, bvL). It should be noted that the current block containing the luminance sample is also called the "luminance block".

[0041] Here, the IBC mode is divided into IBC MERGE mode and IBC AMVP mode. When deriving bvL, it is necessary to construct an IBC block vector candidate list bvCandList in both cases. The process of constructing the IBC MERGE list is described in detail below. The process of constructing the IBC AMVP list is the same as that of the IBC MERGE list, but the maximum number of candidates for each is not the same.

[0042] In step 1, when IsGt4by4 is TRUE (the variable IsGt4by4 is TRUE if the width × height of the luminance block is greater than 16), the process for deriving spatial block vector candidates from adjacent coding units as defined in the decoding specification is called, taking the luminance block position (xCb, yCb), the width cbWidth and height cbHeight of the luminance block as input, and the output is the availability flag availableFlag A1, availableFlag B1, and block vectors bvA1 and bvB1. Here, the relative positions of the adjacent block where A1 and B1 are located and the current block are as shown in Figure 2.

[0043] In step 2, when IsGt4by4 is TRUE, the dummy code for constructing the block vector candidate list bvCandList is as follows:

[0044] i=0 if(availableFlagA1) bvCandList[i++]=bvA1 if(availableFlagB1) bvCandList[i++]=bvB1 In Step 3, the derivation process for the variable numCurrCand (the number of candidates already obtained) is as follows:

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

[0046] In step 4, if numCurrCand is less than MaxNumIbcMergeCand (maximum number of candidates in MERGE mode) and NumHmvpIbcCand (maximum number of candidates for the historically optimal block vector Hmvp in IBC mode) is greater than 0, the derivation process for historically based IBC block vector candidates as defined in the decoding specification is invoked, with bvCandList and numCurrCand as inputs and the modified bvCandList and numCurrCand as outputs.

[0047] In step 5, if numCurrCand is less than MaxNumIbcMergeCand, continue until numCurrCand is equal to MaxNumIbcMergeCand. Set bvCandList[numCurrCand][0] to equal to 0 (horizontal component of BV), Set bvCandList[numCurrCand][1] to equal to 0 (vertical component of BV), The process is executed in which numCurrCand is incremented by 1.

[0048] In this way, the block vector candidate list bvCandList is completed, and the candidate index bvIdx is derived by bvIdx=general_merge_flag[xCb][yCb] ? merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb], where general_merge_flag indicates whether it is IBC MERGE mode.

[0049] In this way, based on the index bvIdx and the block vector candidate list bvCandList, a specific bvL can be obtained, that is, bvL[0]=bvCandList[bvIdx][0]; The value of bvL can be obtained using bvL[1]=bvCandList[bvIdx][1].

[0050] In IBC AMVP mode, the specific bvL is obtained as a predicted bvL using the index bvIdx and the block vector candidate list bvCandList, and the true bvL requires the addition of the block vector difference (BVD). The specific process is as follows:

[0051] In step 1, we obtain the horizontal and vertical components of the BVD. Here, MvdL0 is the difference of the forward motion vector, the horizontal component of the BVD is represented by bvd[0], and the vertical component of the BVD is represented by bvd[1]. Specifically, this is as follows:

[0052] bvd[0]=MvdL0[xCb][yCb][0]; bvd[1]=MvdL0[xCb][yCb][1].

[0053] In Step 2, rounding is performed on the predicted bvL obtained above. Here, the right shift parameter AmvrShift is used for rounding, and the left shift parameter AmvrShift is used to improve the resolution. Specifically, it is as follows:

[0054] Offset=(AmvrShift==0)?0: ((1<<(AmvrShift-1))-1); bvL[0]=Sign(bvL[0])*(((Abs(bvL[0])+offset)>>AmvrShift)< <AmvrShift); bvL[1]=Sign(bvL[1])*(((Abs(bvL[1])+offset)>>AmvrShift)< <AmvrShift)。

[0055] In step 3, for the true bvL, its range is -2 17 From 2 17 It needs to be controlled within the range of -1, and the specific derivation process is as follows.

[0056] u[0]=(bvL[0]+bvd[0]+2 18 )%2 18 ; bvL[0]=(u[0]>=2 17 )? (u[0]-2 18 ): u[0]; u[1]=(bvL[1]+bvd[1]+2 18 )%2 18 ; bvL[1]=(u[1]>=2 17 )? (u[1]-2 18 ): u[1];

[0057] For the chrominance components, if it is dual-tree splitting, IBC is not performed on the chrominance components. If it is single-tree splitting, it is necessary to derive the BV of the chrominance components.

[0058] Here, the input includes the bvL of luminance (1 / 16 pixel precision). The output includes the chroma block vector (bvC) (1 / 32 pixel precision). The specific derivation process is as follows.

[0059] bvC[0]=((bvL[0]>>(3+SubWidthC))*32); bvC[1]=((bvL[1]>>(3+SubHeightC))*32);

[0060] In S102, predictive samples are derived using the block vector.

[0061] ​​​​​The specific derivation process for the prediction samples is as follows:

[0063] When cIdx is equal to 0, i.e., it is the luminance component, then in x = xCb ... xCb + cbWidth - 1 and y = yCb ... yCb + cbHeight - 1, xVb=(x+(bv[0]>>4))&(IbcBufWidthY-1); yVb=(y+(bv[1]>>4))&(CtbSizeY-1); The following process is executed: predSamples[x][y]=ibcVirBuf[0][xVb][yVb].

[0064] Here, IbcBufWidthY is the width of the luminance pixels of the reconstructed buffer unit (Buffer) stored in the IBC, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconstructed pixel stored in the IBC.

[0065] If cIdx is not equal to 0, i.e., if it is a color difference component, then in x = xCb / SubWidthC ... xCb / SubWidthC + cbWidth / SubWidthC-1 and y = yCb / SubHeightC ... yCb / SubHeightC + cbHeight / SubHeightC-1, xVb=(x+(bv[0]>>5))&(IbcBufWidthC-1); yVb=(y+(bv[1]>>5))&((CtbSizeY / subHeightC)-1); The process predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb] is executed.

[0066] Here, the variables SubWidthC and SubHeightC depend specifically on the color sampling format specified by sps_chroma_format_idc, and the specific correspondence is shown in Table 1.

[0067] [Table 1]

[0068] In S103, the residual sample is derived.

[0069] For residual samples, the residual decoding process defined in the decoding specification can be invoked.

[0070] In S104, the reconstructed sample is derived using the predicted sample and the residual sample.

[0071] For a reconstructed sample (i.e., a reconstructed pixel value), the image reconstruction process for a specified color component defined in the decoding specification can be invoked.

[0072] In another specific implementation, the process for deriving the color difference prediction mode in H.266 / VVC includes, as inputs, a luminance position (xCb, yCb) specifying the relative position of the top-left corner sample of the current block to the top-left corner luminance sample of the current image, a variable cbWidth specifying the width of the current block in the luminance sample, a variable cbHeight specifying the height of the current block in the luminance sample, and a variable treeType specifying whether to use single-tree or dual-tree splitting. The output includes the color difference intra-prediction mode IntraPredModeC[xCb][yCb] and the MIP color difference direct mode flag MipChromaDirect Flag[xCb][yCb].

[0073] If treeType is equal to SINGLE_TREE, i.e., it is a single-tree partition, sps_chroma_format_idc is equal to 3, i.e., it is the YUV444 format (4:4:4 format), intra_chroma_pred_mode is equal to 4, and IntraMipFlag[xCb][yCb] is equal to 1, i.e., the prediction mode of the corresponding luminance center block at the same position is MIP mode, (1) Set the MIP ChromaDirectFlag[xCb][yCb] to equal 1, i.e., use the MIP mode for chrominance.

[0074] (2) The color difference intra prediction mode IntraPredModeC[xCb][yCb] is set to equal IntraPredModeY[xCb][yCb].

[0075] Otherwise, (1) Set the MIP color difference direct mode flag MipChromaDirectFlag[xCb][yCb] to equal to 0.

[0076] (2) The corresponding luminance intra-prediction mode lumaIntraPredMode is derived as follows, namely, If IntraMipFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, lumaIntraPredMode is set to INTRA_PLANAR.

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

[0078] Note: In ECM, a new IntraTmp mode has been introduced. If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA and is in IntraTmp mode, lumaIntraPredMode is set to equal to INTRA_PLANAR.

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

[0080] (3) The color difference intra-prediction mode IntraPredModeC[xCb][yCb] is derived as follows.

[0081] If cu_act_enabled_flag[xCb][yCb] is equal to 1, the color difference intra-prediction mode IntraPredModeC[xCb][yCb] is set to equal to lumaIntraPredMode.

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

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

[0084] [Table 2]

[0085] If sps_chroma_format_idc is equal to 2, the chroma difference intra-prediction mode Y can be derived using the chroma difference intra-prediction mode X in Table 2, specifically referring to the specification of the mode X to mode Y mapping process shown in Table 3, and then setting the chroma difference intra-prediction mode X to be equal to the chroma difference intra-prediction mode Y.

[0086] [Table 3]

[0087] In another specific implementation manner, for the DM mode, the DM mode refers to directly using the luminance prediction mode information at the corresponding position.

[0088] When using dual-tree splitting for I-frames, it is allowed to use an independent block splitting structure for the luminance component and the chrominance components. For example, it is the Dual Tree mode in H.266 / VVC. At this time, the luminance component at the corresponding position of the chrominance coding block may include multiple luminance coding blocks. As shown in FIG. 3, in H.266 / VVC, when the value of intra_chroma_pred_mode is equal to 4, it indicates decoding in the DM mode for the current chrominance block.

[0089] Based on the intra prediction mode of the luminance block at the center position of the luminance region at the same position corresponding to the chrominance block, determine the intra prediction mode of the chrominance block. As a determination method, the intra prediction mode of the luminance block can be directly used, or the further derived intra prediction mode can be used.

[0090] In actual implementation, taking the coordinates of the center position of the luminance region at the same position corresponding to the chrominance block as a reference point, the intra prediction mode of the chrominance block can be determined by the intra prediction mode of the luminance block including the reference point. As a determination method, the intra prediction mode of the luminance block can be directly used, or the further derived intra prediction mode can be used.

[0091] Also, in the embodiments of the present application, the block mentioned here can be a CU, a sub-block, a transform block, etc., without specific limitation thereto.

[0092] Here, obtaining the coding block position in the DM mode is specifically described as follows.

[0093] The current position of the color difference block, i.e., the relative position of the upper-left corner color difference sample of the current color difference block to the upper-left corner color difference sample of the current image, chromaPos=(x,y), is obtained. chromaPos is then scaled based on the color sampling format shown in Table 4 to obtain lumaPos=(xCb,yCb), which is the position of the luminance region at the same location corresponding to the current color difference block.

[0094] [Table 4]

[0095] The luminance position (xCb, yCb) specifies the relative position of the top-left corner luminance sample of the luminance region corresponding to the current color difference block, relative to the top-left corner luminance sample of the current image. The variable cbWidth specifies the width of the current block in the luminance sample. The variable cbHeight specifies the height of the current block in the luminance sample.

[0096] The current positional relationship between the color difference block and the corresponding luminance region is as shown in Figure 3. The central luminance pixel position of the luminance region corresponding to the current color difference CU is described as follows, where xCenter represents the horizontal coordinate position and yCenter represents the vertical coordinate position. The encoded block containing this pixel position is the block at the central position of the luminance block corresponding to the color difference block.

[0097] xCenter=xCb+cbWidth>>1; yCenter = yCb + cbHeight >> 1.

[0098] In yet another specific implementation, the syntax elements related to the decoding process of color difference prediction in H.266 / VVC are shown in Table 5. The corresponding binary strings for the values ​​of the syntax element intra_chroma_pred_mode are shown in Table 6. For different syntax elements (e.g., cclm_mode_flag, cclm_mode_idx, and intra_chroma_pred_mode), the encoding schemes used for each encoded bit are specifically shown in Table 7.

[0099] [Table 5]

[0100] [Table 6]

[0101] [Table 7]

[0102] Here, binIdx represents the number of bits, where binIdx=0 represents the 0th bit and binIdx=1 represents the 1st bit. Also, bypass represents bypass mode, and na represents not being processed.

[0103] In related technologies, in dual-tree partitioning, for DM mode, if the corresponding luminance block is in IBC mode, the acquired color difference prediction mode is DC mode, which compromises encoding efficiency. For example, if color difference prediction is performed using a fixed DC mode, not only will all predicted pixels have the same value, but it will also become impossible to represent the content of the color difference texture features of the current block. Furthermore, in color difference prediction, information from luminance blocks at the same position in IBC mode is not used, and there is no prediction algorithm for block duplication like IBC, making it impossible to effectively compress video sequences such as screen content. Simply put, in the current color difference prediction process, the color difference prediction mode is insufficient, resulting in inaccurate color difference prediction of the current block and a loss of encoding efficiency.

[0104] Based on this, embodiments of the present application provide an encoding / decoding method. The first block vector parameter of the current block is determined, the first color component reference sample and the second color component reference sample corresponding to the current block are determined based on the first block vector parameter, a mapping relationship between the first color component and the second color component is established based on the first color component reference sample and the second color component reference sample, and the predicted value of the second color component of the current block is determined based on the mapping relationship and the first color component sample value of the current block.

[0105] In this way, when the luminance block at the same position corresponding to the current block is predicted based on the block vector, the first block vector parameter applied to the chrominance component can be determined based on the block vector parameter of the luminance block, and a mapping relationship between the luminance component and the chrominance component is established based on the luminance component reference sample and the chrominance component reference sample at the position of the first block vector parameter. Then, the prediction of the chrominance component is performed using the mapping relationship. That is, the encoding / decoding method proposed in the embodiments of the present application can improve the problem of the uniqueness of chrominance prediction, make full use of the relevant information of the luminance block at the same position, and improve the accuracy of chrominance prediction. At the same time, based on the established mapping relationship, pixel-level prediction can also be effectively performed, thereby further saving the bit rate, improving the encoding / decoding efficiency, and thereby improving the encoding / decoding performance.

[0106] Hereinafter, each embodiment of the present application will be described in detail in combination with the drawings.

[0107] Referring to Figure 4A, a schematic block diagram of the encoder configuration provided by the embodiment of the present application is shown. As shown in Figure 4A, the encoder (specifically, the "video encoder") 100 may include a transformation / quantization unit 101, an intra-estimation unit 102, an intra-prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transformation / inverse quantization unit 106, a filter control analysis unit 107, a filter unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc. Here, the filter unit 108 can implement a deblocking filter and a sample adaptive offset (SAO) filter, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, video coding blocks are obtained by dividing it into coding tree units (CTUs). Subsequently, the residual pixel information obtained after intra or inter-prediction is transformed into the video coding block by the transformation / quantization unit 101. This involves transforming the residual information from the pixel region to the transformation region and quantizing the resulting transformation coefficients to further reduce the bitrate. The intra-estimation unit 102 and the intra-prediction unit 103 are used to perform intra-prediction on the video coding block. More specifically, the intra-estimation unit 102 and the intra-prediction unit 103 are used to determine the intra-prediction mode used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-prediction coding on one or more blocks within one or more reference frames for the received video coding block and to provide time prediction information. The motion estimation performed by the motion estimation unit 105 is a process that generates motion vectors that can estimate the motion of the video encoded block, and then the motion compensation unit 104 performs motion compensation based on the motion vectors determined by the motion estimation unit 105.After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also transmits the calculated and determined motion vector data to the encoding unit 109. Furthermore, the inverse transform / inverse quantization unit 106 is used to reconstruct the video coding block, reconstructing the residual block in the pixel region. The reconstructed residual block is then deblocked of block noise artifacts by the filter control analysis unit 107 and the filter unit 108, and subsequently, the reconstructed residual block is added to a prediction block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The encoding unit 109 is used to encode various coding parameters and post-quantization transformation coefficients. In the CABAC-based coding algorithm, the context content is based on adjacent coding blocks and can be used to encode information indicating the determined intra-prediction mode, outputting a bitstream of the video signal. The decoding image buffer unit 110 is then used to store the reconstructed video coding block and is used for prediction reference. As video image encoding progresses, new reconstructed video encoding blocks are constantly generated, and all of these reconstructed video encoding blocks are stored in the decoded image buffer unit 110.

[0108] Referring to Figure 4B, a schematic diagram of the configuration block of the decoder provided in the embodiment of the present invention is shown. As shown in Figure 4B, the decoder (specifically the "video decoder") 200 includes a decoding unit 201, an inverse transform / inverse quantization unit 202, an intra-prediction unit 203, a motion compensation unit 204, a filter unit 205, and a decoded image buffer unit 206, etc. Here, the decoding unit 201 can perform header information decoding and CABAC decoding, and the filter unit 205 can perform deblocking filtering and SAO filtering. The input video signal undergoes the encoding process shown in Figure 4A and outputs a bitstream of the video signal. This bitstream is input to the decoder 200 and first passes through the decoding unit 201 to obtain the decoded conversion coefficients. These conversion coefficients are processed by the inverse transform / inverse quantization unit 202 to generate residual blocks in the pixel region. The intra-prediction unit 203 can be used to generate prediction data for the currently decoded video block based on the determined intra-prediction mode and the data of previously decoded blocks of the current frame or image. The motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other relevant syntax elements, and uses this prediction information to generate a prediction block for the video decoding block being decoded. The decoded video block is formed by summing the residual block from the inverse transform / inverse quantization unit 202 with the corresponding prediction block generated by the intra-prediction unit 203 or the motion compensation unit 204. The decoded video signal can be filtered by the filter unit 205 to remove block noise artifacts and improve video quality. The decoded video block is then stored in the decoded image buffer unit 206. The decoded image buffer unit 206 stores a reference image for subsequent intra-prediction or motion compensation and is also used for outputting the video signal, i.e., obtaining the restored original video signal.

[0109] Furthermore, embodiments of the present application further provide a network architecture for an encoding / decoding system including an encoder and a decoder. Here, Figure 5 shows a schematic diagram of the network architecture for an encoding / decoding system provided by embodiments of the present application. As shown in Figure 5, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, the electronic devices 13 to 1N being able to perform video interaction via the communication network 01. The electronic devices may be various types of devices having video encoding / decoding capabilities in the course of implementation, for example, the electronic devices may include smartphones, tablet computers, personal computers, personal digital assistants, navigation devices, digital telephones, video phones, televisions, sensing devices, servers, etc., but embodiments of the present application are not specifically limited thereto. Here, the decoder or encoder described in embodiments of the present application may be the electronic devices described above.

[0110] It should be noted that the method of the embodiment of the present application is primarily applied to the intra-prediction unit 103 shown in Figure 4A and the intra-prediction unit 203 shown in Figure 4B. That is, the embodiment of the present application can be applied to both encoders and decoders, and can even be applied to both encoders and decoders simultaneously, but the embodiment of the present application is not specifically limited to these.

[0111] Furthermore, it should be noted that when "current block" is applied to the intra-prediction unit 103, it specifically refers to the coded block currently being predicted intra-, and when applied to the intra-prediction unit 203, it specifically refers to the decoded block currently being predicted intra-.

[0112] In one embodiment of the present application, with reference to Figure 6, a schematic flowchart of the decoding method provided by the embodiment of the present application is shown. As shown in Figure 6, the method may include the following:

[0113] In S601, the first block vector parameter of the current block is determined.

[0114] It should be explained that the decoding method of the embodiment of this application is applied to a decoder. Furthermore, this decoding method specifically refers to an intra prediction method, and more specifically, a color difference prediction method based on block vectors. Here, a video image can be divided into multiple decoding blocks, and each decoding block may contain a first color component, a second color component, and a third color component, and the current block in the embodiment of this application refers to the decoding block in the video image that is currently the target of color difference prediction.

[0115] Here, if the current block predicts the first color component and the first color component is the luminance component, the current block is also called the luminance block. Alternatively, if the current block predicts the second color component and the second color component is the color difference component, the current block is also called the color difference block.

[0116] It should be explained that, in dual-tree partitioning, for DM mode, if the prediction mode of luminance blocks at the same location satisfies the first condition, the embodiment of the present invention can derive a first block vector parameter applied to the color difference based on the block vector parameter of the luminance blocks at the same location, thereby improving coding efficiency.

[0117] In some embodiments, determining the first block vector parameter of the current block may include the steps of determining the first color component block of the current block, determining the second block vector parameter of the first color component block if the prediction mode of the first color component block satisfies a first condition, and determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block.

[0118] Understandably, in the embodiments of the present application, determining the first color component block of the current block may include the steps of determining the first color component region at the same position in the current block, and determining the first color component block of the current block from among a plurality of blocks separated from the first color component region.

[0119] It should be explained that in the embodiments of this application, if the first color component is the luminance component, the first color component region may also be called the "luminance region at the same position." For example, if the current block is a color difference block, the luminance region at the same position can refer to the luminance region at the same position corresponding to the current block. Block partitioning can be performed on the first color component region at the same position of the current block, and multiple blocks can be obtained by performing block partitioning using, for example, a binary tree structure, a ternary tree structure, or a quadrutree structure. Each block can be considered as a CU, a subblock, or a transformation block, and then the first color component block of the current block is determined from among these multiple blocks.

[0120] For example, in Figure 3, the shaded area represents the luminance region at the same position corresponding to the color difference component. Within this luminance region at the same position, multiple blocks may be divided. From these blocks, the central block can be selected as the corresponding luminance block for the current block. For example, in Figure 3, the black-filled block is the corresponding luminance block (first color component block) for the current block.

[0121] Furthermore, in some embodiments, determining the first color component block of the current block from among multiple blocks separated from the first color component region may include selecting a target block from among multiple blocks separated from the first color component region and making the target block the first color component block of the current block.

[0122] Here, the target block can be a block at any position. In one specific embodiment, the block at the center of the first color component region is selected as the target block. Alternatively, the block at the upper left corner of the first color component region is selected as the target block. Alternatively, the block at the lower right corner of the first color component region is selected as the target block.

[0123] Furthermore, in some embodiments, determining the first color component block of the current block may include the steps of: determining the position information of the current block; scaling the position information of the current block based on a predetermined sampling format to obtain position information for the same position region corresponding to the current block; and determining target position information based on the position information for the same position region, and designating the target block containing the target position information as the first color component block of the current block.

[0124] Furthermore, in some embodiments, determining target position information based on position information of the same location region may include performing a center position calculation based on the position information of the same location region and using the obtained center position information as the target position information, or performing an upper-left corner position calculation based on the position information of the same location region and using the obtained upper-left corner position information as the target position information, or performing a lower-right corner position calculation based on the position information of the same location region and using the obtained lower-right corner position information as the target position information.

[0125] In the embodiments of the present invention, the predetermined sampling format may be a color difference sampling format (or color sampling format). For example, the mapping relationship between the current block position (x,y) and the same positional region position (xCb,yCb) is shown in Table 4.

[0126] In one possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0127] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper left corner of the current block relative to the upper left corner luminance pixel of the image. Assume that the width of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 3) is cbWidth and the height is cbHeight. In this case, the block at the center position (luminance region center position block) is a luminance block that includes the center position information (xCb + cbWidth >> 1, yCb + cbHeight >> 1), which is the block that is filled in black in Figure 3.

[0128] In another possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0129] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper-left corner of the current block relative to the upper-left corner luminance pixel of the image, and let cbWidth and cbHeight be the width and height of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 7). In that case, the block at the upper-left corner position (the upper-left corner block of the luminance region) is a luminance block containing the position coordinates (xCb, yCb), which is the block filled in black in Figure 7.

[0130] In yet another possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0131] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper left corner of the current block relative to the upper left corner luminance pixel of the image. Assume that the width of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 8) is cbWidth and the height is cbHeight. In this case, the block at the lower right corner (lower right corner block of the luminance region) is a luminance block containing the position coordinates (xCb + cbWidth - 1, yCb + cbHeight - 1), which is the block that is filled in black in Figure 8.

[0132] In other words, in the embodiment of the present invention, the target block as the first color component block can be any block at any position among the multiple blocks shown in Figure 3. For example, it could be the block at the center of the luminance region at the same position shown in Figure 3 (the block filled in black), the block at the upper left corner of the luminance region at the same position shown in Figure 7 (the block filled in black), the block at the lower right corner of the luminance region at the same position shown in Figure 8 (the block filled in black), and further, the block at the upper right corner, the block at the lower left corner, and the block at the center of the upper left region of the luminance region at the same position, but there is no specific limitation to these here.

[0133] Furthermore, in some embodiments, determining the first color component block of the current block from among a plurality of blocks separated from the first color component region may include the steps of determining at least one candidate block at a predetermined position from among a plurality of blocks separated from the first color component region, and determining the first color component block of the current block based on the at least one candidate block.

[0134] In a particular embodiment, determining the first color component block of the current block based on at least one candidate block may include making at least one candidate block the first color component block of the current block.

[0135] In another specific embodiment, determining the first color component block of the current block based on at least one candidate block may include determining a target candidate block that satisfies predetermined judgment conditions from among at least one candidate block, and setting the target candidate block as the first color component block of the current block.

[0136] It should be explained that in the embodiment of the present application, determining whether a candidate block satisfies a predetermined judgment condition may include sequentially acquiring at least one candidate block in a predetermined order, performing a mode determination, and if it is determined that the predicted mode of the first candidate block satisfies the first condition, then the first candidate block may be made the first color component block of the current block.

[0137] Furthermore, in the embodiment of the present application, determining whether a candidate block satisfies predetermined judgment conditions may include the steps of: determining the first block vector parameter of the first candidate block if it is determined that the prediction mode of the first candidate block satisfies the first condition; determining whether the first block vector parameter of the first candidate block satisfies the availability condition; setting the first candidate block as the first color component block of the current block if the first block vector parameter of the first candidate block satisfies the availability condition; and continuing the mode determination of the next candidate block until a target candidate block is determined in which the prediction mode satisfies the first condition and the corresponding first block vector parameter satisfies the availability condition, and setting the target candidate block as the first color component block of the current block if the first block vector parameter of the first candidate block does not satisfy the availability condition.

[0138] In the embodiments of the present application, the first color component block can also be determined by performing a mode determination on at least one candidate block at a predetermined position. For example, as shown in Figure 9, there are five luminance pixel positions CU here, specifically C, TL, TR, BL, and BR. However, the embodiments of the present application are not limited to five positions, and may include multiple different positions. Furthermore, they are not limited to the five positions shown in Figure 9, and none of these are specific limitations.

[0139] In yet another possible implementation, taking the block containing the five luminance pixel positions shown in Figure 9 as an example, the blocks can be acquired sequentially in a predetermined order until it can be determined that the acquired block is to be predictively coded in a mode that has BV information, that is, until the block of the first luminance pixel position that is to be predictively coded in a mode that has BV information is found. The predetermined order of sequential acquisition includes, but is not limited to, the order C→TL→TR→BL→BR.

[0140] For the detailed position derivation process of C, TL, TR, BL, and BR, the position of the current block, i.e., the position of the upper-left corner chromatic difference sample of the current block relative to the upper-left corner chromatic difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chromatic difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0141] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper left corner of the current block relative to the upper left corner luminance pixel of the image (i.e., the position of the luminance pixel TL), and let cbWidth and cbHeight be the width and height of the luminance region at the same position corresponding to the current color difference coding block (i.e., the entire region filled with diagonal lines for the luminance component in Figure 9).

[0142] The coordinates of the position of luminance pixel C are (xCb+cbWidth / 2, yCb+cbHeight / 2).

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

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

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

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

[0147] In this way, for the current block, it is first necessary to determine the corresponding first color component block. For example, if the first color component is the luminance component, then it is necessary to determine the corresponding luminance block for the current block.

[0148] Furthermore, in embodiments of the present application, the method may be understood to further include the steps of determining whether to use a target prediction mode for the current block when the first color component block is predicted based on a block vector, and determining, when using a target prediction mode for the current block, that the prediction mode for the first color component block satisfies a first condition.

[0149] It should be explained that in the embodiment of the present application, the target prediction mode is a prediction mode based on BV guidance, which can be expressed here as BVG-PLT mode or BVG-LUT mode.

[0150] Furthermore, in the embodiment of the present application, when the corresponding luminance block of the current block is decoded in a mode having BV information, and the target prediction mode is applied to the current block, it can be determined that the prediction mode of the corresponding luminance block satisfies the first condition. In this case, the BV of the corresponding luminance block can be obtained, and the first block vector parameter of the current block can be determined based on the BV of the corresponding luminance block. Here, the mode using BV information includes, but is not limited to, the IBC mode or the IntraTMP mode.

[0151] Furthermore, it should be explained that in the embodiment of this application, the number of first color component blocks can be arbitrary; that is, the first color component block of the current block is not limited to one block, but may consist of multiple blocks. Accordingly, when deciding whether or not to make a prediction based on the block vector, it is necessary to make a decision for each first color component block, and only the first color component blocks that satisfy the prediction based on the block vector are used to determine the first block vector parameter of the subsequent current block.

[0152] Furthermore, in the embodiments of the present application, if the first color component block is not predicted based on the block vector, that is, if the first color component block is not processed in a mode that has BV information, it is possible to choose not to analyze the first syntax element flag information. Here, the first syntax element flag information is used to indicate whether or not to use the target prediction mode for the second color component of the current block.

[0153] In a specific implementation method, when determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block, the second block vector parameter of the first color component block can be directly selected as the first block vector parameter of the current block.

[0154] In another specific implementation, when determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block, it is also possible to construct a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter. The first block vector parameter of the current block is then determined based on the list of candidate block vector parameters.

[0155] In other words, in the embodiment of the present application, the second block vector parameter of the first color component block can be directly used as the first block vector parameter of the current block, or a candidate list of block vector parameters for the second color component can be constructed using the second block vector parameter, and then the first block vector parameter of the current block can be determined based on the candidate list of block vector parameters.

[0156] In some embodiments, constructing a candidate list of block vector parameters for the second color component of the current block based on a second block vector parameter may include the steps of adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block, and adding the candidate block vector parameter to the block vector parameter candidate list.

[0157] In other words, in the embodiment of the present application, the second block vector parameter of the first color component block can be directly set as the first block vector parameter of the current block. Alternatively, the second block vector parameter of the first color component block can be adjusted to determine a candidate block vector parameter for the second color component, and then this candidate block vector parameter can be set as the first block vector parameter of the current block. Alternatively, a candidate list of block vector parameters for the second color component can be constructed based on the candidate block vector parameter, and then the first block vector parameter of the current block can be determined based on this candidate list of block vector parameters.

[0158] Here, assuming that the current block is a chrominance block and the first color component block is a luminance block, the first block vector parameter can be the BV of the chrominance block, i.e., BVC, and the second block vector parameter can be the BV of the luminance block, i.e., BVL.

[0159] Understandably, in the embodiment of the present application, the second block vector parameter is luminance BV = (BVL hor BVL ver ) and the first block vector parameter is chrominance BV = (BVC hor ,BVC ver Assuming that ), we can choose to construct a list of candidate chrominance BVCs containing one or more candidate block vector parameters by adjusting the BVL (luminance BV) or BVC (chrominance BV).

[0160] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of determining a predetermined sampling format for the current block, and scaling the second block vector parameter based on the predetermined sampling format to determine a candidate block vector parameter for the second color component of the current block.

[0161] It should be explained that in the embodiments of the present application, the above-mentioned adjustment may include a scaling process based on a predetermined sampling format. Here, the predetermined sampling format may be a mapping relationship between the luminance BV parameter and the scaled chrominance BV parameter shown in Table 8.

[0162] [Table 8]

[0163] Here, the syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, which in this case is specifically a color difference sampling format. Here, different types of color sampling formats result in different corresponding scaling operations.

[0164] For example, if the value of sps_chroma_format_idc is 0, the color sampling format is determined to be monochrome, i.e., the color difference BV parameter (BVC) hor ,BVC hor ) does not exist. If the value of sps_chroma_format_idc is 1, the color sampling format is determined to be 4:2:0, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter at this time is BVC hor =BVL hor >>1, BVC hor =BVL ver >>1. When the value of sps_chroma_format_idc is 2, the color sampling format is determined to be 4:2:2, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter at this time is BVC hor =BVL hor >>1, BVC hor =BVL ver Therefore, if the value of sps_chroma_format_idc is 3, it indicates that the color sampling format is 4:4:4, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter in this case is BVC. hor =BVL hor BVC hor =BVL ver That is the case.

[0165] Thus, based on Table 8, you can choose to perform scaling according to the color sampling format and add the scaled BVC to the color difference BVC candidate list (block vector parameter candidate list) as a candidate block vector parameter.

[0166] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of: determining a predetermined sampling format for the current block; scaling the second block vector parameter based on the predetermined sampling format to determine a first initial block vector parameter for the second color component of the current block; and performing an offset calculation on the first initial block vector parameter based on one or more offset values ​​to determine a candidate block vector parameter for the second color component of the current block.

[0167] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of: determining one or more second initial block vector parameters by performing an offset calculation on the second block vector parameter based on one or more offset values; and determining a predetermined sampling format for the current block, scaling one or more second initial block vector parameters based on the predetermined sampling format, and determining a candidate block vector parameter for the second color component of the current block.

[0168] It should be explained that in the embodiments of this application, the one or more offset values ​​can be any number of arbitrary numbers, such as -1, +1, -2, +2, -3, +3, etc., but no specific limitations are imposed here.

[0169] In other words, in the embodiments of the present invention, after obtaining the BV of the corresponding luminance block, it is denoted as BVL, and the chrominance BV obtained by the BVL is denoted as BVC. Subsequently, by adjusting the BVL or BVC, one or more chrominance BVC candidates can be constructed. That is, based on Table 8, scaling can be performed according to the color sampling format, and the scaled BVL or BVC can be selected to be added to the chrominance BVC candidate list as a candidate block vector parameter.

[0170] For example, in the embodiment of the present application, four cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver We take four cases: +1). If BVL is even, then BVL = (BVL hor BVL ver Next, we take the BVL based on the color sampling format using Table 8 to obtain the BVC. In this way, if the BVL is odd, four BVC candidate block vector parameters are formed and these candidate block vector parameters are added to the chrominance BVC candidate list.

[0171] For example, in the embodiment of the present application, four cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL verWe take four cases: +1). If BVL is even, then BVL = (BVL hor BVL ver ), BVL=(BVL hor -1, BVL ver ), BVL=(BVL hor BVL ver -1), BVL=(BVL hor -1, BVL ver We take the four cases in -1). Next, we use Table 8 to scale the BVL based on the color sampling format to obtain the BVC. In this way, if the BVL is odd or even, four BVC candidates are formed in either case, and these candidates are added to the color difference BVC candidate list.

[0172] For example, in the embodiment of the present application, the operation in odd and even situations can be unified by the following calculation, that is, directly BVL = (BVL hor -1, BVL ver -1), BVL=(BVL hor +1, BVL ver -1), BVL=(BVLho-1r,BVL ver +1), BVL=(BVL hor +1, BVL ver We take the four cases of +1).

[0173] For example, in the embodiment of the present application, multiple cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver +1), BVL=(BVL hor +3, BVL ver ), BVL=(BVL hor BVL ver +3), BVL=(BVL hor +3, BVL ver+3), BVL = (BVL hor -2, BVL ver ), BVL = (BVL hor , BVL ver -2), etc., taking multiple cases and constructing a list of these candidates in order. If BVL is even, BVL = (BVL hor , BVL ver ), BVL = (BVL hor -1, BVL ver ), BVL = (BVL hor , BVL ver -1), BVL = (BVL hor -1, BVL ver -1), BVL = (BVL hor -3, BVL ver ), BVL = (BVL hor , BVL ver -3), BVL = (BVL hor -3, BVL ver -3), BVL = (BVL hor +2, BVL ver ), BVL = (BVL hor , BVL ver +2), etc., taking multiple cases. Next, using Table 8, scale BVL based on the color sampling format to obtain BVC. In this way, whether BVL is odd or even, multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0174] As an example, in the embodiments of the present application, the operations in different situations of odd and even numbers can also be unified by the following calculations. That is, directly BVL = (BVL hor -1, BVL ver -1), BVL = (BVL hor +1, BVL ver -1), BVL = (BVL hor -1, BVL<00001​​​​​​​​​​​​+3), BVL=(BVL hor +3, BVL ver +3), BVL=(BVL hor -3, BVL ver -1), BVL=(BVL hor -1, BVL ver -3) and so on.

[0175] For example, in the embodiment of the present application, nine candidates can be obtained by adjusting the obtained BVC. That is, BVC = (BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVC hor ,BVC ver +1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver Set it to -1), and in this way nine BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0176] For example, in the embodiment of the present application, multiple candidates can be obtained by adjusting the obtained BVC. That is, BVC = (BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVC hor ,BVC ver+1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver -1), BVC=(BVC hor -2, BVC ver ), BVC=(BVC hor ,BVC ver -2), BVC=(BVC hor -2, BVC ver -2), BVC=(BVC hor +2, BVC ver ), BVC=(BVC hor ,BVC ver +2), BVC=(BVC hor +2, BVC ver +2), BVC=(BVC hor -2, BVC ver +2), BVC=(BVC hor +2, BVC ver Set it as -2), and in this way multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0177] It should be explained that in the embodiments of this application, the situation where BVL is odd or even refers specifically to the case where one of its components is odd or even, since BVL is a two-dimensional vector. Also, "+1", "-1", "+2", "-2", "+3", and "-3" here all refer to integer pixel precision.

[0178] Furthermore, in some embodiments, when determining a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter of the first color component block, the optimal block vector parameter can first be determined based on the second block vector parameter. Next, a scaling process is performed on the optimal block vector parameter based on a predetermined sampling format to determine the candidate block vector parameter for the second color component. This allows for the determination of a list of candidate block vector parameters based on the candidate block vector parameter.

[0179] For example, in the embodiment of the present invention, in single-tree interpretation and IBC mode under single-tree splitting, the luminance BV (denoted as BVL) is determined by RDO to find the optimal BVL (optimal block vector parameter), and then the optimal block vector parameter is scaled based on a predetermined sampling format to obtain the chrominance BV (denoted as BVC). Here, the scaling process for the optimal block vector parameter can be performed using Table 8 above, and the optimal block vector parameter can be adjusted by combining any of the above adjustment or scaling methods, and the corresponding candidate block vector parameter can be obtained to construct a block vector parameter candidate list.

[0180] Furthermore, in some embodiments, when determining a candidate list of block vector parameters for the second color component of the current block based on the second block vector parameter of the first color component block, it is possible to first determine the optimal block vector parameter corresponding to the first color component block. Then, based on the optimal block vector parameter, a candidate list of block vector parameters for the second color component of the current block is determined.

[0181] For example, in the embodiment of this application, the optimal block vector parameter (denoted as BVL) for the corresponding luminance block can be found by detailed search using a template. Subsequently, a list of candidate block vector parameters is constructed based on the optimal block vector parameter by combining the arbitrary list construction methods described above.

[0182] Furthermore, it is understandable that in the embodiments of this application, when determining the first block vector parameter of the current block based on the block vector parameter candidate list, it is also necessary to determine whether the candidate block vector parameter is available, that is, it is necessary to select one or more available candidate block vector parameters from the block vector parameter candidate list. Therefore, in some embodiments, determining the first block vector parameter of the current block based on the block vector parameter candidate list is, The method may include the steps of: determining whether there is one or more candidate block vector parameters in the block vector parameter candidate list that satisfy the first availability condition; and, if there is one or more candidate block vector parameters in the block vector parameter candidate list that satisfy the first availability condition, determining the first block vector parameter of the current block based on one or more candidate block vector parameters.

[0183] Specifically, in the embodiment of the present invention, the candidate block vector parameter can be determined as the first block vector parameter of the current block only if the candidate block vector parameter satisfies the first availability condition.

[0184] In some embodiments, one or more candidate block vector parameters satisfy the first availability condition. The offset position indicated by one or more candidate block vector parameters does not extend beyond the image boundary. The offset position indicated by one or more candidate block vector parameters does not extend beyond the slice boundary. The offset position indicated by one or more candidate block vector parameters does not currently cover the block. The offset position indicated by one or more candidate block vector parameters does not exceed a predetermined usable area. This includes, but is not limited to, that the offset positions indicated in one or more candidate block vector parameters have already been reconstructed.

[0185] It should be explained that in the embodiment of this application, the current block position is assumed to be (xCb, yCb), and for each candidate block vector parameter, BVC = (BVChor, BVCver), and in this case, the corresponding offset position (xCb + BVChor, yCb + BVCver) is found. Here, the fact that the offset position does not cross the image boundary can also be specifically described using data such as coordinate position information and the size parameter of the current block. For example, xCb + width + BVC hor <= xCb or yCb + height + BVCver <= yCb.

[0186] Furthermore, in the embodiments of the present application, the first availability condition may also consider whether or not it crosses a slice boundary. For example, whether the offset position indicated by one or more candidate block vector parameters crosses a slice boundary, or whether the offset position indicated by one or more candidate block vector parameters crosses a tile boundary.

[0187] It should be understood that, in the embodiments of the present application, a candidate block vector parameter can be determined to satisfy the first availability condition, that is, to be available, only if all of the above conditions are met. In a particular embodiment, taking any candidate block vector parameter as an example, the candidate block vector parameter satisfying the first availability condition includes at least the following: the offset position indicated in the candidate block vector parameter does not exceed the image boundary; the offset position indicated in the candidate block vector parameter does not exceed the slice boundary; the offset position indicated in the candidate block vector parameter does not currently cover a block; the offset position indicated in the candidate block vector parameter does not exceed a predetermined available area; and the offset position indicated in the candidate block vector parameter has already been reconstructed.

[0188] As an example, Figure 10 shows a schematic diagram of the structure in which the offset position provided by the embodiment of the present application does not cover the current block. As shown in Figure 10, the black-filled block represents the current block, the shaded area represents the available area, and the unfilled area represents the unavailable area. For the current block, if the offset position indicated in the candidate block vector parameter is in the unavailable area, a situation occurs where the offset position covers the current block.

[0189] As an example, Figure 11 shows a schematic diagram of the structure to determine whether the offset position provided by the embodiment of the present application exceeds a predetermined usable area. As shown in Figure 11, the black-filled blocks represent the current block, the shaded areas represent the usable area, and all reference blocks within the usable area have already been reconfigured. In the embodiment of the present application, considering the memory capacity of the buffer, the predetermined usable area can typically be the reference blocks adjacent to the current block (m,n), specifically reference block (m-2,n-2), reference block (m-1,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.

[0190] Furthermore, in some embodiments, when constructing a list of candidate block vector parameters, the method may further include the step of adjusting at least one candidate block vector parameter in the list of candidate block vector parameters until at least one candidate block vector parameter satisfies the first availability condition, if none of the candidate block vectors in the list of candidate block vector parameters satisfy the first availability condition.

[0191] In embodiments of the present invention, if all candidate block vectors in the block vector parameter candidate list do not satisfy the first availability condition, the predicted value of the second color component of the current block can be determined based on another mode, where the other mode includes at least one of the PLANAR mode, DM mode, DC mode, CCLM mode, and skip mode.

[0192] In the embodiment of the present invention, the candidate block vector parameters for the second color component can also be determined based on the second block vector parameters of the first color component block. If the candidate block vector parameters satisfy the first availability condition, the candidate block vector parameters are modified, and the block vector parameter candidate list is determined based on the modified candidate block vector parameters. Conversely, if the candidate block vector parameters do not satisfy the first availability condition, the candidate block vector parameters are modified until the adjusted candidate block vector parameters satisfy the first availability condition.

[0193] It should be explained that in the embodiment of this application, when performing a modification process on candidate block vector parameters, the offset position of the current block can be determined based on the candidate block vector parameters and the position information of the current block. Next, a search process is performed based on the offset position of the current block to determine the modified candidate block vector parameters.

[0194] It should also be understood that, in the embodiment of this application, after scaling the second block vector parameter of the first color component block based on a predetermined sampling format, it is necessary to perform further modification processing on the obtained candidate block vector parameter. Before the modification processing, it is also necessary to determine whether the candidate block vector parameter satisfies the first availability condition. If the candidate block vector parameter satisfies the first availability condition, the candidate block vector parameter of the current block is modified, and the modified parameter is determined as the first block vector parameter of the current block. Alternatively, if the candidate block vector parameter does not satisfy the first availability condition, the candidate block vector parameter is adjusted until the adjusted block vector parameter satisfies the first availability condition. After that, the adjusted block vector parameter is modified, and the modified parameter is determined as the first block vector parameter of the current block.

[0195] In other words, in the embodiment of the present application, the color difference BVC can be modified, and then the modified BVC can be added to the color difference BVC candidate list, in which case only the modified BVC will be present in the BVC candidate list.

[0196] For example, after obtaining a color difference BV scaled based on a predetermined sampling format, further modifications are made to it. Before making modifications, it is necessary to first determine whether the BV is available or not. If it is available, modifications are made; if it is not available, adjustments are made until it becomes available before modifications are made. The modified BVC is then added to the color difference BVC candidate list.

[0197] Here, when determining whether it is available or not, we obtain the current block position (xCb, yCb) and calculate the color difference BVC = (BVC hor ,BVC ver ) obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) find, Check if the obtained offset position exceeds the image boundary. Check if the obtained offset position does not currently cover the block (see Figure 10 for details). Check whether the obtained offset position exceeds the predetermined usable area (see Figure 11 for details). The condition (i.e., the first availability condition) is determined to see if the obtained offset position has already been reconstructed. If all conditions are met, the color difference BV is available for use.

[0198] For example, in the embodiment of the present invention, the modification method can be modified using template search. That is, after obtaining the modified color difference BV parameter, the offset position is found using the current block position and the modified color difference BV parameter, and then a detailed search is performed near the offset position using the template matching method to obtain the optimal color difference BV parameter. By duplicating the reference block at the optimal offset position obtained after the detailed search, a color difference prediction block for the current block is obtained. As shown in Figure 12, the shaded area represents the color difference reconstruction area. For the current block, the optimal matching template and the corresponding optimal BV can be found using the template matching method, and the reference block for the current block can be determined based on the optimal BV (i.e., IntraTMP BV), thereby determining the color difference prediction value for the current block.

[0199] Since the availability of the BV is determined before the modification, there is no need to re-determine whether it is available (whether the first availability condition is met) in subsequent steps, and the second block vector parameter can be determined directly.

[0200] Furthermore, in the embodiments of this application, before constructing the candidate block vector parameter list, the second block vector parameter of the first color component block can be modified, and the candidate block vector parameter list can be determined based on the modified first block vector parameter. For example, the luminance BVL can be modified, and then the BVC candidate list can be constructed using the arbitrary list construction method described above.

[0201] As an example, in the embodiment of the present invention, first, the luminance region at the same position corresponding to the current block can be obtained. Here, referring to the schematic diagram of the coordinates and block size of the luminance region at the same position as the current color difference block shown in Figure 13, the position of the current block chromaPos=(xCb,yCb) is obtained, and based on Table 4 above, chromaPos is scaled according to the color sampling format to obtain the position of the luminance region at the same position corresponding to the current block lumaPos=(xCb_Y,yCb_Y). The size parameter of the current block chromaSize=(cbWidth,cbHeight) is obtained, and based on the mapping relationship in Table 9, chromaSize is scaled according to the color sampling format to obtain the size of the luminance region at the same position corresponding to the current block lumaSize=(cbWidth_Y,cbHeight_Y).

[0202] [Table 9]

[0203] For example, further modifications can be made to the luminance BVL. Before making any modifications, it is necessary to first determine whether the BVL is available (i.e., whether it meets the second availability condition). If it is available, the modifications are made; if it is not available, adjustments are made until it becomes available before the modifications are made.

[0204] In some embodiments, when determining whether BVL is available, the position of the luminance region at the same location (xCb_Y, yCb_Y) is obtained, and luminance BVL = (BVL hor BVL ver ) obtain the corresponding offset position (xCb_Y+BVL hor ,yCb_Y+BVL ver ) is found. Specifically, this is as shown in Figure 14. The luminance BVL (first block vector parameter) is usable if all of the following conditions are met. Here, the following conditions are, that is, The offset position indicated in the first block vector parameter does not extend beyond the image boundary. The offset position indicated in the first block vector parameter does not extend beyond the slice boundary. The offset position shown in the first block vector parameter does not exceed the predetermined usable area (see Figure 11). This includes, but is not limited to, the assumption that the offset position shown in the first block vector parameter has already been reconstructed.

[0205] Furthermore, in the embodiment of the present invention, when performing the modification process, the offset position of the first color component block is determined based on the second block vector parameter of the first color component block and the position information of the first color component block, and a search process is performed based on the offset position of the first color component block to determine the modified second block vector parameter.

[0206] For example, the correction process includes, but is not limited to, the following methods. Correction is performed by searching for the luminance region at the same position corresponding to the current block. That is, after obtaining the luminance BVL, the offset position is found using the position of the luminance region at the same position and the obtained luminance BVL, and a detailed search is performed near the offset position using the luminance region at the same position. The range of the detailed search must satisfy the limited usable area (as shown in Figure 11), and finally the optimal luminance BVL is obtained.

[0207] Understandably, in the embodiments of the present application, the method for constructing the block vector parameter candidate list includes, but is not limited to, the multiple cases described above, and all different methods can be used simultaneously to construct a single candidate list.

[0208] Furthermore, in some embodiments, determining the first block vector parameter of the current block based on one or more candidate block vector parameters may include the steps of: determining one candidate block vector parameter that satisfies the first availability condition as the first block vector parameter if there is one candidate block vector parameter that satisfies the first availability condition in the block vector parameter candidate list; and determining the first block vector parameter by performing a determination process on multiple candidate block vector parameters that satisfy the first availability condition if there are multiple candidate block vector parameters that satisfy the first availability condition in the block vector parameter candidate list.

[0209] It should be explained that in the embodiments of this application, if there are one or more candidate block vector parameters that satisfy the first availability condition, when determining the first block vector parameter based on one or more candidate block vector parameters, any of the candidate block vector parameters that satisfy the first availability condition can be directly determined as the first block vector parameter. That is, if only one BVC candidate satisfies the first availability condition in the constructed list of available BVC candidates, the BV (first block vector parameter) that is ultimately selected is that BVC.

[0210] Furthermore, it should be explained that in the embodiment of the present application, if there are one or more candidate block vector parameters that satisfy the first availability condition, when determining the first block vector parameter based on one or more candidate block vector parameters, the determination process can be performed on multiple candidate block vector parameters that satisfy the first availability condition. Specifically, the method includes the steps of: determining the first template of the current block; determining the first matching template for each of the multiple candidate block vector parameters based on the first template and the multiple candidate block vector parameters; if the first template and the first matching template satisfy the second condition, calculating the matching error between the first template and the first matching template of the current block based on a predetermined error criterion and determining the first generation value for each of the multiple candidate block vector parameters; and determining the least generation value from among the first generation values ​​of each of the multiple candidate block vector parameters and determining the candidate block vector parameter corresponding to the least generation value as the first block vector parameter.

[0211] In other words, in the embodiment of the present application, for multiple candidate block vector parameters that satisfy the first availability condition, after determining the first-generation values ​​corresponding to the multiple candidate block vector parameters, one or more second block vector parameters can be determined from among the multiple candidate block vector parameters based on the first-generation values. For example, if there are multiple available BVC candidates in the constructed list of available BVC candidates, a decision process must be performed on these available BVCs to obtain the final BV. The decision method includes, but is not limited to, a decision method using templates.

[0212] Understandably, in embodiments of the present application, the first template includes one or more sample values ​​in adjacent decoded regions of the current block. Correspondingly, the type of the first template may include at least one of the upper template, upper right template, left template, lower left template, and upper left template. Here, the upper template is located in the adjacent upper decoded region of the current block, the upper right template is located in the adjacent upper right decoded region of the current block, the left template is located in the adjacent left decoded region of the current block, the lower left template is located in the adjacent lower left decoded region of the current block, and the upper left template is located in the adjacent upper left decoded region of the current block.

[0213] In other words, in the embodiment of the present invention, when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template location are available (including reconstructed color difference information) based on the pixel availability of the adjacent region of the current block. Figure 15 is a schematic diagram of the template types, and as shown in Figure 15, templates can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template based on the relative positional relationship between the template and the current block. Here, the template sizes of different types for different coding blocks may be fixed and the same, or they may be different.

[0214] For example, regarding template size, select the same template size for any current block of any size, and the following formula illustrates an example of the conditions for setting the template size. Here, nTbW and nTbH are the width and height of the current block, respectively, and iTempW and iTempH are the width and height of the template to be adopted, respectively.

[0215]

number

number

[0216]

number

number

number

[0217] For example, you may select different template sizes depending on the number of pixels in the current block, and the following formula illustrates one example of the conditions for setting the template size. nTbW and nTbH are the width and height of the current block, respectively, nTbW × nTbH is the number of pixels in the current block, and iTempW and iTempH are the width and height of the template to be adopted, respectively.

[0218]

number

number

[0219] As an example, in the embodiment of the present invention, when determining the first matching template, motion compensation is performed on the obtained BVC candidates (i.e., candidate block vector parameters that satisfy the first availability condition) using the first template of the current block to obtain a template at the position of the corresponding BV (first matching template). Figure 16 is a schematic diagram of the motion compensation of the template. As shown in Figure 16, if a BV (BVC candidate) is available, motion compensation is performed using the first template and the BV to obtain a template at the position of the corresponding BV, i.e., the first matching template.

[0220] Furthermore, it is understandable that in the embodiments of this application, the predetermined error criteria include, but are not limited to, any of the following: absolute error sum SAD, transformed absolute error sum SATD, difference square sum SSE, mean absolute difference MAD, mean absolute error MAE, mean squared error MSE, etc.

[0221] For example, in the embodiment of the present application, when calculating costs, that is, when determining the first-generation value, there are multiple options for the cost function used to calculate the cost of the template area, and therefore, there may be multiple options for the predetermined error criteria. For example, evaluation criteria such as the sum of absolute errors (SAD), the sum of transformed absolute errors (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE) can be selected. Any of the evaluation criteria mentioned below can be selected from the above criteria, and taking the evaluation criterion of SAD as an example, the calculation formula is as follows.

[0222]

number

[0223] Furthermore, in some embodiments, the method further includes the step of determining the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition as the first block vector parameter if the first template and the first matching template do not satisfy the second condition, or If neither the first template nor the first matching template satisfies the second condition, the process includes determining a candidate block vector parameter in the block vector parameter candidate list that is in a predetermined position satisfying the first availability condition as the first block vector parameter.

[0224] In other words, if the first template and the first matching template satisfy the second condition, then the matching error between the first template and the first matching template of the current block can be calculated based on a predetermined error criterion, and a candidate block vector parameter corresponding to the least verifiable value can be selected as the first block vector parameter. If the first template and the first matching template do not satisfy the second condition, then the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition, or a candidate block vector parameter at a specific position, can be selected as the first block vector parameter.

[0225] For example, when calculating the cost (i.e., substitute value) to determine whether the first template and the first matching template satisfy the second condition, there are several situations in which templates can be used:

[0226] Type 1: If both the top and left templates of a block currently exist, and both the top and left templates corresponding to the BV's position also exist, then both the top and left templates are available.

[0227] Type 2: Currently, both the top and left templates of a block exist, but only the top template corresponding to the BV position exists. In this case, there are two methods. Method 1: If the left template corresponding to the BV position does not exist, it is not used, i.e., the calculation is performed using only the top template. Method 2: If the left template corresponding to the BV position does not exist, the leftmost template width column inside the reference block is used as a substitute for the left template, i.e., the calculation is performed using both the top and left templates.

[0228] Type 3: Currently, both the top and left templates of a block exist, but only the left template corresponding to the BV's position exists. In this case, there are two methods. Method 1: If the top template corresponding to the BV's position does not exist, it is not used, i.e., calculation is performed using only the left template. Method 2: If the top template corresponding to the BV's position does not exist, the row with the highest template height inside the referenced block is used as a substitute for the top template, i.e., calculation is performed using both the top and left templates.

[0229] Type 4: If only an upper template exists in the current block, there are three methods. Method 1: If no upper template exists corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If no upper template exists corresponding to the BV's position, the row with the highest template height inside the referenced block is used as the upper template. Method 3: If an upper template exists at the corresponding BV's position, it is used directly.

[0230] Type 5: If only a left template exists in the current block, there are three methods. Method 1: If there is no left template corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If there is no left template corresponding to the BV's position, the leftmost template width column within the reference block is used as the left template. Method 3: If a left template corresponding to the BV's position exists, it is used directly.

[0231] Type 6: If neither the top template nor the left template exists for the current block, the BV that is ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position.

[0232] For example, in the embodiment of the present invention, when determining the first block vector parameter based on the first generation value of each of multiple candidate block vector parameters, except in situations where the cost cannot be calculated, the cost is calculated for each candidate in the BVC candidate list and sorted. The sorting method includes, but is not limited to, bubble sort, selection sort, insertion sort, shell sort, merge sort, quicksort, radix sort, heap sort, count sort, and bucket sort. Any number of BVCs with the minimum cost are selected as the final BV (first block vector parameter), and color difference prediction is performed based on the BV. It should also be noted that when calculating the first generation value of multiple candidate block vector parameters, one cost is calculated for each candidate block vector parameter, and the candidate block vector parameter with the minimum cost is always retained, in which case neither a list nor sorting is necessary.

[0233] Furthermore, in the embodiment of the present invention, if all candidate block vector parameters in the block vector parameter candidate list do not satisfy the first availability condition, the candidate block vector parameters in the block vector parameter candidate list are adjusted until one or more candidate block vector parameters satisfy the first availability condition are present in the block vector parameter candidate list.

[0234] In other words, in the embodiment of the present invention, if all candidate block vector parameters in the block vector parameter candidate list are unavailable, that is, if all candidate block vector parameters in the block vector parameter candidate list do not satisfy the first availability condition, it is possible to choose to adjust any one or more BVC candidates (candidate block vector parameters) in the block vector parameter candidate list until they become available, and the adjustment method includes, but is not limited to, clipping and scaling. Furthermore, prediction may be performed using PLANAR mode, CCLM system mode, or angle prediction mode, that is, the predicted value of the second color component of the current block may be determined based on other modes. For example, in PLANAR mode, CCLM system mode, or angle prediction mode, a reference pixel and mode parameters can be obtained to perform color difference prediction.

[0235] In S602, based on the first block vector parameter, the first and second color component reference samples corresponding to the current block are determined, and based on the first and second color component reference samples, a mapping relationship between the first and second color components is established.

[0236] It should be explained that in the embodiments of this application, after determining the first block vector parameter, a luminance reference sample and a chrominance reference sample located at the position of the first block vector parameter can be obtained. In some embodiments, determining the first and second color component reference samples corresponding to the current block based on the first block vector parameter is possible. The process may include the steps of: determining the current block's position; scaling the current block's position to determine the position of the first color component region at the same position in the current block; scaling the first block vector parameter to determine the third block vector parameter of the first color component region at the same position in the current block; determining the reference block for the first color component based on the position of the first color component region and the third block vector parameter; determining the first color component reference sample corresponding to the current block based on the first color component reference block; and determining the reference block for the second color component based on the current block's position and the first block vector parameter; and determining the second color component reference sample corresponding to the current block based on the second color component reference block.

[0237] In the embodiment of the present application, the position of the first color component region can be obtained by scaling the position of the current block based on a predetermined sampling format, and the third block vector parameter of the first color component region can also be obtained by scaling the first block vector parameter based on a predetermined sampling format. Here, the predetermined sampling format can be found in Table 4 above. It should be noted that although the third block vector parameter can be obtained by scaling the chrominance BV (first block vector parameter), there may be accuracy losses in the luminance BV, so the luminance BV obtained by scaling the chrominance BV is not necessarily equal to the original luminance BV (second block vector parameter).

[0238] For example, the current block is a color difference block, and the first color component region at the same position is the luminance region at the same position. To obtain the first color component reference sample (luminance reference sample), first obtain the position of the current block, i.e., the position of the upper-left corner color difference sample of the current block relative to the upper-left corner color difference sample of the current image, chromaPos=(x,y). Scale chromaPos based on the color sampling format shown in Table 4 to obtain the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb).

[0239] For example, chrominance BV = (BVC hor ,BVC ver Obtain the luminance BV (BVYhor, BVYver) of the luminance region at the same position corresponding to the current block, scale the luminance BV based on the color sampling format shown in Table 4, and obtain the luminance BV = (BVYhor, BVYver). Obtain the luminance region position lumaPos = (xCb, yCb) of the same position corresponding to the current block, obtain the luminance BV = (BVYhor, BVYver), and find the offset position (xCb + BVYhor, yCb + BVYver) corresponding to the luminance region at the same position corresponding to the current block. This is shown in Figure 17.

[0240] In a specific implementation, after obtaining a luminance sample at the offset position, a luminance reference sample can be obtained by downsampling it. In some embodiments, determining the first color component reference sample corresponding to the current block based on the first color component reference block may include performing a downsampling process on the first color component reference block to determine the first color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample.

[0241] It should be explained that in the embodiment of this application, the resolutions of the luminance sample and the color difference sample do not match. Therefore, it is necessary to perform downsampling on the luminance sample so that the resolution of the downsampled luminance sample becomes the same as the resolution of the color difference sample. As shown in Figure 18, this is a schematic diagram of the downsampling position.

[0242] Furthermore, in the embodiments of this application, several sampling methods may be made to compete with each other, or any of the sampling methods may be adopted by default, including but not limited to the following six sampling methods. For example, assuming that the luminance sample before downsampling is recBvBefDownLuma, the width of the memory buffer is iRecRefLumaStride, and the luminance sample after downsampling is recBvAftDownLuma, the luminance sample after downsampling at position (i,j) will be as follows.

[0243] (1) Downsampling method 1: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]*2 +recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i-1] +recBvBefDownLuma[2*i+iRecRefLumaStride]*2 +recBvBefDownLuma[2*i+1+iRecRefLumaStride] +recBvBefDownLuma[2*i-1+iRecRefLumaStride]+4)>>3; (2) Downsampling method 2: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+1]+1)>>1; (3) Downsampling method 3: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+iRecRefLumaStride]+1)>>1; (4) Downsampling method 4: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+iRecRefLumaStride] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1; (5) Downsampling method 5: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1; (6) Downsampling method 6: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i+iRecRefLumaStride] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+2)>>2.

[0244] In this way, after downsampling, the downsampled luminance reference sample recBvAftDownLuma is obtained at the BV position of the luminance region at the same location corresponding to the current block.

[0245] Furthermore, for the color difference sample of the current block, first obtain the position of the current block (xCbC, yCbC), and then calculate the color difference BV = (BVC hor ,BVC ver ) obtain the corresponding offset position (xCbC+BVC hor ,yCbC+BVC ver This finds the `BV`, thereby obtaining the chrominance reference sample `recBvChroma` at the BV position corresponding to the current block.

[0246] In this way, a mapping relationship between luminance and chrominance can be constructed based on the luminance reference sample recBvAftDownLuma and the chrominance reference sample recBvChroma.

[0247] In some embodiments, establishing a mapping relationship between the first and second color components based on the first and second color component reference samples may include determining a first lookup table based on the first and second color component reference samples. Here, the first lookup table is used to record the value of the corresponding second color component when the index keyword is the first color component.

[0248] In some embodiments, establishing a mapping relationship between the first and second color components based on a first color component reference sample and a second color component reference sample may include determining a first discrete model based on the first and second color component reference samples. Here, the first discrete model is used to represent the mapping relationship between the first and second color components.

[0249] In other words, in the embodiments of the present invention, the mapping relationship may be a look-up table (LUT). Here, the index keyword (key) in the look-up table may be the first color component, and the value in the look-up table may be the second color component, i.e., value = LUT[key]. Alternatively, the mapping relationship may be a discrete model, which is used to represent the mapping relationship between key and value.

[0250] For example, assuming 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 ways that include, but are not limited to, the following methods.

[0251] [Equation 8] LUT[recBvAftDownLuma[i][j]]=recBvChroma[i][j] 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 to a predetermined sample range. In some embodiments, the method can further include performing a mapping process on the first color component reference samples to make the first color component reference samples fall within a predetermined sample range.

[0252] In the embodiments of the present application, the predetermined sample range can be [0, (1 << bitdepth) - 1]. Here, bitdepth represents the bit depth. As an example, the predetermined sample range can be a range such as [0, 255], [0, 511], etc., but there is no specific limitation. Here, when there are multiple sample ranges, one of them can be selected as the final predetermined sample range using the rate distortion cost method.

[0253] As an example, taking a video with a bit depth exceeding 8 bits, assuming the bit depth of the video is 10 bits, the sample range is [0, 1023]. For the recBvAftDownLuma of the key value, it can be mapped to a predetermined sample range of [0, 255] or [0, 511].

[0254] Furthermore, in some embodiments, when the first reference sample values within the first color component reference samples are the same and correspond to a plurality of different second reference sample values within the second color component reference samples, the method can further include sequentially performing an overwriting process according to the sample order, and setting the last second reference sample value as a value having a mapping relationship with the first reference sample value.

[0255] Furthermore, in some embodiments, when the first reference sample values within the first color component reference samples are the same and correspond to a plurality of different second reference sample values within the second color component reference samples, the method can further include calculating an average value for the plurality of second reference sample values, and setting the obtained average value as a value having a mapping relationship with the first reference sample value.

[0256] In other words, in the embodiment of this application, for different color difference values ​​having the same key value within a mapping relationship, the items with the same key value can be sequentially overwritten according to the sample order, or operations such as averaging can be performed. Also, in the mapping relationship, the initial setting of LUT[] is -1, i.e., an unavailable value. "Overwriting" mainly refers to saving with a new value when there are subsequent instances of the same key value, but is not limited to this method; all may be saved first, then the average value may be calculated and used as the value value corresponding to that key.

[0257] It is understandable that, in the embodiments of this application, the first and second color component reference samples used to construct the mapping relationship can also be obtained by other methods, and several implementation methods are described below as examples.

[0258] In another specific implementation, the luminance sample is not downsampled, and the color difference sample is upsampled to obtain a color difference reference sample. In some embodiments, determining the second color component reference sample corresponding to the current block based on the second color component reference block may include performing an upsampling process on the second color component reference block to determine the second color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample.

[0259] In other words, in the embodiment of the present invention, after obtaining a luminance sample recBvBefDownLuma for the luminance region at the same position, no downsampling is performed. At this time, after obtaining a color difference sample recBvChroma at the position of the corresponding BV in the current block, upsampling is performed using a method that includes, but is not limited to, linear interpolation, to obtain a color difference sample recBvChromaUp of the same size as the luminance sample at the BV position. In this way, the luminance sample recBvBefDownLuma at the BV position is used as the luminance reference sample, and the obtained upsampled color difference sample recBvChromaUp is used as the color difference reference sample. Subsequently, a mapping relationship between luminance and color difference is constructed based on the luminance reference sample and the color difference reference sample.

[0260] Correspondingly, in the embodiments of the present invention, it is necessary to further downsample the predicted value of the second color component of the current block. That is, when upsampling is performed on the color difference sample when constructing a mapping relationship, when making a prediction from luminance to color difference for the current block based on the mapping relationship, it is necessary to perform a downsampling operation on the obtained color difference prediction value to obtain the final color difference prediction value of the current block. Here, the downsampling method includes, but is not limited to, average downsampling.

[0261] In yet another specific implementation, the method may further include the steps of determining a first template for the current block, and determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first template.

[0262] In embodiments of the present application, the first and second color component reference samples used to construct the mapping relationship may include the first and second color component reference samples determined by the first template of the current block. Specifically, the first color component region template at the same location in the first template can be determined based on the first template of the current block. Subsequently, the first color component reference sample can be determined based on the reconstructed sample within the first color component region template. The second color component reference sample can be determined based on the reconstructed sample within the first template. Here, the first template includes one or more reconstructed samples in adjacent decoded regions of the current block.

[0263] As an example, in the embodiment of the present invention, a color difference reference sample can be obtained based on the current color difference template of the current block. After determining the luminance region template at the same position in the current color difference template, a luminance reference sample can be obtained based on the luminance region template at the same position. Subsequently, the luminance reference sample and color difference reference sample obtained in the above embodiment are combined to construct a mapping relationship between luminance and color difference based on these luminance reference samples and color difference reference samples.

[0264] In yet another specific implementation, the method may further include the steps of: determining a first template for the current block; determining a second matching template for the current block based on the first block vector parameters and the first template; and determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the second matching template.

[0265] In embodiments of the present invention, the first and second color component reference samples used to construct the mapping relationship may include, in addition to those determined by the first template of the reference block and the current block, first and second color component reference samples determined by the second matching template of the current block. Specifically, the first color component region matching template at the same position in the second matching template can be determined first, and then the first color component reference sample can be determined based on the reconstructed sample in the first color component region matching template. The second color component reference sample can be determined based on the reconstructed sample in the second matching template. Here, the second matching template can be determined based on the first block vector parameter and the offset position shown in the first template.

[0266] As an example, in the embodiment of the present application, the color difference matching template for the current block can be determined based on the current color difference template and the first block vector parameters of the current block. Based on the color difference matching template, a color difference reference sample can be obtained. After determining the luminance region matching template at the same position in the current color difference matching template, a luminance reference sample can be obtained based on the luminance region matching template at the same position. Subsequently, the luminance reference sample and color difference reference sample obtained in the above embodiment are combined to construct a mapping relationship between luminance and color difference based on these luminance reference samples and color difference reference samples.

[0267] In S603, the predicted value of the second color component of the current block is determined based on the mapping relationship and the sample value of the first color component of the current block.

[0268] It should be explained that in the embodiments of this application, determining the sample value of the first color component of the current block may include the steps of determining a reconstructed pixel sample of the first color component region at the same position in the current block, and determining the sample value of the first color component of the current block based on the reconstructed pixel sample of the first color component region. Here, the reconstructed pixel sample of the first color component region may be used directly as the sample value of the first color component of the current block, or a filtering process may be performed on the reconstructed pixel sample of the first color component region, and the reconstructed pixel sample after filtering may be used as the sample value of the first color component of the current block; no specific limitations are imposed here.

[0269] For example, in the embodiment of this application, the filtering process is a downsampling process. Here, a reconstructed luminance sample recBefDownLuma is obtained at the same position of the luminance region lumaPos=(xCb,yCb) corresponding to the current block. A downsampling method is then used to obtain a reconstructed luminance sample recAftDownLuma after downsampling, and this reconstructed luminance sample after downsampling is used as the first color component sample value of the current block. Furthermore, if a sample range mapping process is performed on the luminance reference sample, the same sample range mapping process is also performed on the reconstructed luminance sample after downsampling to obtain the first color component sample value of the current block.

[0270] In some embodiments, determining the 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 may include 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 if a first color component value equal to the sample value of the first color component is found within the mapping relationship.

[0271] As an example, in the embodiment of this application, assuming that the predicted value of the current block is predSamples, the following prediction method can be adopted for predSamples[cIdx][x][y] (where the variable cIdx specifies the color component index of the current block), namely, By referring to the luminance value Yc at the same location, the color difference prediction value is derived using the mapping relationship (discrete model) established in the above-described embodiment.

[0272] In some embodiments, the method for determining the predicted value of the second color component of the current block may further include the step of performing a modification on the first color component sample value if no first color component value equal to the first color component sample value is found within the mapping relationship, determining the first color component modification value, and continuing to search whether a first color component value equal to the first color component modification value exists within the mapping relationship.

[0273] In a specific embodiment, performing a correction process on the first color component reconstruction value and determining the first color component correction value may include performing an offset calculation on the first color component sample value based on one or more predetermined offset values ​​and determining the first color component correction value.

[0274] In the embodiments of this application, the offset values ​​may be +1, -1, +2, -2, +3, -3, etc., and the number and specific values ​​of the offset values ​​are not limited. Furthermore, a certain order can be set for these multiple offset values ​​in the correction process for the first color component reconstruction value, for example, the correction process may be performed in the order of {+1, -1, +2, -2, +3, -3}.

[0275] For example, in an embodiment of the present invention, if Yc is not found within the input luminance set for the mapping relationship established in the above embodiment, the following processing method is included, but not limited to, the following: a correction process is performed on Yc in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, a matching check is then performed within the input luminance set based on the corrected Yc, and then the value corresponding to the corrected Yc is determined as the color difference prediction value for the current block.

[0276] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the step of calculating an average value for the second color component reference sample if no first color component value equal to the first color component correction value is found within the mapping relationship, and determining the resulting average value as the predicted value of the second color component of the current block.

[0277] For example, in an embodiment of the present invention, if Yc is not found within the input luminance set for the mapping relationship established in the above embodiment, the following processing method is included, but not limited to, the following: a correction process is performed on Yc in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, and if the mapping relationship cannot match all of the above corrected Yc values, the color difference prediction value can be set to the average value of the reconstructed color difference sample recBvChroma corresponding to the BV position.

[0278] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of 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, and performing a modification operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

[0279] It should be explained that in the embodiments of this application, the modification operation performed on the first initial predicted value obtained by the mapping relationship may include, but is not limited to, a clipping operation, a filtering operation, or a weighting operation with predicted values ​​obtained in other prediction modes.

[0280] In a specific embodiment, performing a modification operation on a first initial predicted value to determine the predicted value of the second color component of the current block may include the steps of: performing a prediction process on the second color component of the current block based on a first predetermined mode to determine a second initial predicted value of the second color component of the current block; and performing a weighted calculation on the first and second initial predicted values ​​to determine the predicted value of the second color component of the current block. It should be noted that in the embodiment of the present application, the first predetermined mode includes at least one of the PLANAR mode, DM mode, DC mode, and CCLM mode. That is, performing a modification operation on the first initial predicted value obtained by the mapping relationship may include, but is not limited to, weighting with CCLM mode or other prediction modes, in order to obtain the predicted color difference value of the current block.

[0281] In another specific embodiment, performing a modification operation on the first initial predicted value to determine the predicted value of the second color component of the current block includes restricting the first initial predicted value to a predetermined numerical range, or may be called a "clamping operation." It should be explained that in the embodiment of the present application, the lower limit of the predetermined numerical range is the minimum predicted value (min), and the upper limit of the predetermined numerical range is the maximum predicted value (max). Here, if the first initial predicted value is within the predetermined numerical range, the first initial predicted value can be used as the predicted color difference value of the current block; if the first initial predicted value is greater than max, max can be used as the predicted color difference value of the current block; and if the first initial predicted value is less than min, min can be used as the predicted color difference value of the current block.

[0282] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes, if there are multiple first block vector parameters, the steps of determining multiple third initial predicted values ​​for the second color component of the current block, and performing a weighted calculation on the multiple third initial predicted values ​​to determine the predicted value of the second color component of the current block.

[0283] It should be explained that in the embodiment of the present application, if multiple BVs (first block vector parameters) are determined in the above-described embodiment, multiple third initial prediction values ​​can be obtained based on these multiple BVs. Subsequently, these multiple third initial prediction values ​​are weighted, and the weighted prediction value is taken as the color difference prediction value of the current block. Alternatively, the weighted prediction value can be further modified, including, but not limited to, weighting with CCLM-based modes or other prediction modes, to obtain the color difference prediction value of the current block.

[0284] In some embodiments, the method for determining the predicted value of the second color component of the current block may further include the steps of: determining the second block vector parameter for each of the multiple candidate blocks if the first color component block of the current block includes multiple candidate blocks; constructing a list of multiple block vector parameter candidates for the second color component of the current block based on the second block vector parameter for each of the multiple candidate blocks; determining multiple first block vector parameters for the second color component of the current block based on the list of multiple block vector parameter candidates; establishing a mapping relationship between the first and second color components based on the multiple first block vector parameters; and determining the 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.

[0285] It should be explained that in the embodiment of this application, multiple blocks of the luminance region at the same location are obtained, and the locations of the multiple blocks include, but are not limited to, the locations shown in Figure 19. First, it is determined whether these multiple blocks are available or not, and then, based on the luminance BV of the available blocks among these multiple blocks, a candidate list of color difference BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a mapping table LUT between a single luminance and color difference can be established using all the available color difference BVCs of these multiple blocks. In this way, a color difference prediction value for the current block can be obtained based on this mapping table LUT.

[0286] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of: determining a first color component reference sample and a second color component reference sample corresponding to a plurality of sets of current blocks based on a plurality of first block vector parameters; establishing a plurality of candidate mapping relationships between the first and second color components based on the first and second color component reference samples corresponding to the plurality of sets of current blocks; decoding the bitstream and determining a mapping relationship index value; determining a target mapping relationship based on the mapping relationship index value and the plurality of 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.

[0287] It should be explained that in the embodiment of this application, a mapping table LUT is established between multiple luminance and chrominance values, and then a selected target mapping table LUT can be indicated by a syntax element. For example, multiple blocks of the luminance region at the same location are obtained, and the locations of the multiple blocks include, but are not limited to, those shown in Figure 19. First, it is determined whether these multiple blocks are available, and then, based on the luminance BV of the available blocks among these multiple blocks, a candidate list of chrominance BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a single mapping table LUT can be established for each of these multiple blocks using their respective available chrominance BVCs. On the decoding side, the mapping relationship index value can be determined by decoding the corresponding syntax element. Then, the target mapping relationship can be determined based on the mapping relationship index value, and thereby the predicted chrominance 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 may be set to 4, and there is no specific limitation.

[0288] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of: determining a first color component reference sample and a second color component reference sample corresponding to a plurality of sets of current blocks based on a plurality of first block vector parameters; establishing a plurality of candidate mapping relationships between the first and second color components based on the first and second color component reference samples corresponding to the plurality of sets of current blocks; calculating a matching error for the plurality of candidate mapping relationships based on a template matching scheme and determining the second-order value of each of the plurality of candidate mapping relationships; determining the least-order value from among the second-order values ​​of each of the plurality of candidate mapping relationships and determining the candidate mapping relationship corresponding to the least-order value as the target mapping relationship; 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.

[0289] In a specific embodiment, calculating matching errors for multiple candidate mapping relationships based on a template matching scheme and determining the second-generation value of each of the multiple candidate mapping relationships may include the steps of: determining the first template of the current block; determining the reconstructed pixel sample value of the first color component region template at the same position in the first template; determining the predicted value of each second color component in the multiple mapping relationships of the first template based on the multiple candidate mapping relationships and the reconstructed pixel sample value of the first color component region template; and calculating costs based on the reconstructed value of the second color component of the first template and the predicted value of each second color component in the multiple mapping relationships of the first template, and determining the second-generation value of each of the multiple candidate mapping relationships.

[0290] It should be explained that in the embodiment of this application, a mapping table LUT between multiple luminance and chrominance values ​​can be established, and then the mapping table LUT to use can be selected by a template. For example, multiple blocks of the luminance region at the same location are obtained, and the locations of the multiple blocks include, but are not limited to, those shown in Figure 19. First, it is determined whether these multiple blocks are available, and then, based on the luminance BV of the available blocks among these multiple blocks, a candidate list of chrominance BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a single mapping table LUT can be established for each of these multiple blocks using their respective available chrominance BVCs. A prediction is made for the template of the current block using different mapping table LUTs, the difference with the reconstructed value of the template is calculated, and it is determined which mapping relationship to use specifically, and then the chrominance prediction value of the current block is determined using the finally determined mapping relationship. It should be noted that the number of mapping relationships established here can be set arbitrarily; for example, the number may be set to 4, and there is no specific limitation.

[0291] In one specific example, the process for performing LUT prediction on the current block template is as follows:

[0292] Currently, a reconstructed luminance sample recBefDownLumaR is obtained at the same position as the luminance region template lumaPos=(xCbR,yCbR) corresponding to the block template. This luminance sample is then downsampled to obtain a reconstructed luminance sample recAftDownLumaR after downsampling, and the same sample range mapping process is performed on this sample.

[0293] Let predSamplesR be the predicted value of the current block template. For predSamplesR[cIdx][x][y], the variable cIdx specifies the color component index of the current block. The prediction method is as follows: the luminance value Yc at the same position is referenced, and the predicted value is derived using the established mapping relationship. If Yc is not found in the input luminance set of the established mapping relationship, the system checks in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}. If the mapping relationship cannot match any of the above values, the system includes, but is not limited to, setting the predicted color difference value of the current block to the average value of the reconstructed color difference sample recBvChroma corresponding to the BV position.

[0294] Currently, when calculating costs for block templates and the template prediction values ​​for each LUT, there are several situations in which templates are used.

[0295] Type 1: If both the top template and the left template of a block currently exist, then both the top template and the left template are available.

[0296] Type 2: If only the top template exists in the current block, then only the top template is available.

[0297] Type 3: If only the left template exists in the current block, then only the left template is available.

[0298] Type 4: If neither the top template nor the left template exists for the current block, the LUT ultimately selected will be the first established LUT or the LUT at a specific designated location.

[0299] For example, in the embodiment of the present application, assuming that the reconstruction value of the current block template is recSamplesR, there are several options for the cost function used to calculate the cost of the template region. For example, evaluation criteria such as the sum of absolute errors (SAD), the sum of transformed absolute errors (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE) can be selected. Any of the evaluation criteria mentioned below can be selected from the above criteria. Taking the SAD evaluation criterion as an example, the calculation formula is as follows.

[0300]

number

[0301] It should also be explained that in the embodiments of this application, when selecting the final LUT using the current block template, except in situations where the cost cannot be calculated, the cost is calculated for each established LUT candidate and sorted. The sorting method includes, but is not limited to, bubble sort, selection sort, insertion sort, shell sort, merge sort, quicksort, radix sort, heap sort, count sort, and bucket sort. Here, the LUT candidate with the minimum cost is selected as the LUT to be used in the end.

[0302] In some embodiments, the method further includes the steps of decoding a bitstream and determining a value for a first syntax element flag information, and determining a first block vector parameter for the current block if the first syntax element flag information indicates that a target prediction mode is used for the second color component of the current block.

[0303] It should be explained that in the embodiments of the present application, when the value of the first syntax element flag information is a first value, it is determined that the first syntax element flag information indicates that the target prediction mode should be used for the second color component of the current block, and when the value of the first syntax element flag information is a second value, it is determined that the first syntax element flag information indicates that the target prediction mode should not be used for the second color component of the current block.

[0304] Furthermore, it should be explained that in the embodiment of the present application, if the first color component region at the same position in the current block is determined, and the DM mode is used for the current block, and the first color component region is predicted based on the block vector, then it is decided to use the target prediction mode for the second color component of the current block.

[0305] For example, in the embodiment of this application, in dual-tree division and DM mode, if the corresponding luminance region has BV information, prediction is performed for the current block using the target prediction mode. For example, If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, then intra_bvgplt_flag=1 is set, and the target prediction mode is used as the color difference intra-prediction mode IntraPredModeC[xCb][yCb].

[0306] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA and IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, then intra_bvgplt_flag=1 and the target prediction mode is used as the color difference intra-prediction mode IntraPredModeC[xCb][yCb].

[0307] In the embodiment of the present application, the first syntax element flag information can be represented by intra_bvgplt_flag or bvgplt_flag, and the target prediction mode can be represented by BVG-PLT or BVG-LUT. Here, the derivation of the color difference prediction mode is as follows.

[0308] The color difference intra-prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode as specified in the table below. These fill items other than BVG-LUT modes are shown as examples of corresponding values ​​and do not necessarily need to be filled in. Here, Table 10 shows an example of color difference prediction mode derivation. As shown in Table 10, 0 represents Planar mode, 1 represents DC mode, 18 represents horizontal mode, 50 represents vertical mode, and 81-83 represent CCLM mode.

[0309] [Table 10]

[0310] As can be seen from Table 10, in DM mode, if intra_ibc_flag==1, that is, if the information obtained from the center position block of the luminance region at the same location includes BV, the color difference intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT mode.

[0311] In some embodiments, the method further includes the steps of decoding a bitstream and determining the value of a second syntax element flag information, and if the second syntax element flag information indicates that the use of a target prediction mode is permitted for the second color component of the current block, then decoding the bitstream and determining the value of a first syntax element flag information.

[0312] It should be explained that in the embodiments of this application, the second syntax element flag information can be represented by BvgpltEnabled. When the value of the second syntax element flag information is the first value, the second syntax element flag information indicates that the use of target prediction mode is permitted for the second color component of the current block, and when the value of the second syntax element flag information is the second value, the second syntax element flag information indicates that the use of target prediction mode is not permitted for the second color component of the current block.

[0313] Furthermore, it should be explained that in the embodiment of this application, the first value is different from the second value. Here, the first and second values ​​may be in parameter form or numerical form. Specifically, both the first syntax element flag information and the second syntax element flag information may be parameters written to the profile or the value of a single flag / identifier, and no specific limitations are imposed here.

[0314] For example, the first value can be set to 1 and the second value to 0. Alternatively, the first value can be set to 0 and the second value to 1. Alternatively, the first value can be set to true and the second value to false. Alternatively, the first value can be set to false and the second value to true. Here, in the embodiment of the present application, the first value can be set to 1 and the second value to 0, but this is not a specific limitation.

[0315] For example, in the 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 BvgpltEnabled is equal to 0. Otherwise, the variable ModeIncludeBv is set, and if the corresponding luminance block is not encoded in a mode that has BV information, then ModeIncludeBv is equal to 0; otherwise, ModeIncludeBv is equal to 1.

[0316] If several of the following conditions are true simultaneously (including, but not limited to, the following conditions), namely, ModeIncludeBv is equal to 1, sh_slice_type is equal to I-frame, BvgpltEnabled is equal to 1 if CtbLog2SizeC is less than or equal to MaxChromaIbcSize, where MaxChromaIbcSize can be determined based on the chrominance CTU size or a given value.

[0317] Otherwise, BvgpltEnabled is equal to 0. Here, if BvgpltEnabled is equal to 0, we can infer that the value of the first syntax element flag information is 0.

[0318] Furthermore, in the embodiments of this application, the value of the first syntax element flag information can also be determined on the encoding side by competing the BVG-LUT mode with other modes. Here, in DM mode, in addition to the BVG-LUT mode, other modes can also compete. The mode to be ultimately used is determined based on the template cost. For example, the BV obtained from luminance may be used directly and the BV may be directly duplicated, or the BVG-LUT mode defined in the embodiments of this application may be used, and after applying these two modes to the template of the current block, the one with the smaller template cost is selected as the target prediction mode for the current block.

[0319] This embodiment provides a decoding method. First, the first block vector parameter of the current block is determined. Next, based on the first block vector parameter, the first and second color component reference samples corresponding to the current block are determined. Furthermore, a mapping relationship between the first and second color components is established based on the first and second color component reference samples. Based on the mapping relationship and the first color component sample value of the current block, the predicted value of the second color component of the current block is determined. In this way, after determining the first block vector parameter to be applied to the chrominance component based on the block vector parameter of the luminance block, a mapping relationship between the luminance component and the chrominance component is established based on the luminance component reference sample and the chrominance component reference sample located at the position of the first block vector parameter. Subsequently, the chrominance component is predicted using this mapping relationship. This improves the problem of unity in chrominance prediction, makes full use of related information of luminance blocks at the same position, and improves the accuracy of chrominance prediction. At the same time, pixel-level prediction can be effectively performed based on the established mapping relationship, thereby further saving bitrate and improving encoding and decoding efficiency.

[0320] In another embodiment of the present application, with reference to Figure 20, a schematic flowchart of the encoding method provided by the embodiment of the present application is shown. As shown in Figure 20, the method may include the following:

[0321] In S2001, the first block vector parameter of the current block is determined.

[0322] It should be explained that the encoding method of the embodiment of this application is applied to an encoder. Furthermore, the encoding method specifically refers to an intra prediction method, and more specifically, a color difference prediction method based on block vectors. Here, a video image can be divided into multiple encoding blocks, and each encoding block may include a first color component, a second color component, and a third color component, and the current block in the embodiment of this application refers to the encoding block in the video image that is currently the target of color difference prediction.

[0323] Here, if the current block predicts the first color component and the first color component is the luminance component, the current block is also called the luminance block. Alternatively, if the current block predicts the second color component and the second color component is the color difference component, the current block is also called the color difference block.

[0324] Furthermore, in the case of dual-tree partitioning, for DM mode, if the prediction mode of luminance blocks at the same location satisfies the first condition, the embodiment of the present invention can derive a first block vector parameter applied to the color difference based on the block vector parameter of the luminance blocks at the same location, thereby improving coding efficiency.

[0325] In some embodiments, determining the first block vector parameter of the current block may include the steps of determining the first color component block of the current block, determining the second block vector parameter of the first color component block if the prediction mode of the first color component block satisfies a first condition, and determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block.

[0326] Understandably, in the embodiments of the present application, determining the first color component block of the current block may include the steps of determining the first color component region at the same position in the current block, and determining the first color component block of the current block from among a plurality of blocks separated from the first color component region.

[0327] It should be explained that in the embodiments of this application, when the first color component is the luminance component, the first color component region is also called the "luminance region at the same position." For example, if the current block is a color difference block, the luminance region at the same position can refer to the luminance region at the same position corresponding to the current block. Block partitioning can be performed on the first color component region at the same position of the current block, and multiple blocks can be obtained by performing block partitioning using, for example, a binary tree structure, a ternary tree structure, or a quadrutree structure. Each block can be considered as a CU, a subblock, or a transformation block, and then the first color component block of the current block is determined from among these multiple blocks.

[0328] For example, in Figure 3, the shaded area represents the luminance region at the same position corresponding to the color difference component. Within this luminance region at the same position, multiple blocks may be divided. From these blocks, the central block can be selected as the corresponding luminance block for the current block. For example, in Figure 3, the black-filled block is the corresponding luminance block (first color component block) for the current block.

[0329] Furthermore, in some embodiments, determining the first color component block of the current block from among multiple blocks separated from the first color component region may include selecting a target block from among multiple blocks separated from the first color component region and making the target block the first color component block of the current block.

[0330] Here, the target block can be a block at any position. In one specific embodiment, the block at the center of the first color component region is selected as the target block. Alternatively, the block at the upper left corner of the first color component region is selected as the target block. Alternatively, the block at the lower right corner of the first color component region is selected as the target block.

[0331] Furthermore, in some embodiments, determining the first color component block of the current block may include the steps of: determining the position information of the current block; scaling the position information of the current block based on a predetermined sampling format to obtain position information for the same position region corresponding to the current block; and determining target position information based on the position information for the same position region, and designating the target block containing the target position information as the first color component block of the current block.

[0332] Furthermore, in some embodiments, determining target position information based on position information of the same location region may include performing a center position calculation based on the position information of the same location region and using the obtained center position information as the target position information, or performing an upper-left corner position calculation based on the position information of the same location region and using the obtained upper-left corner position information as the target position information, or performing a lower-right corner position calculation based on the position information of the same location region and using the obtained lower-right corner position information as the target position information.

[0333] In the embodiments of the present invention, the predetermined sampling format may be a color difference sampling format (or color sampling format). For example, the mapping relationship between the current block position (x,y) and the same positional region position (xCb,yCb) is shown in Table 4.

[0334] In one possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0335] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper-left corner of the current block relative to the upper-left corner luminance pixel of the image, and let cbWidth be the width and cbHeight be the height of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 3). In that case, the block at the center position (luminance region center position block) is a luminance block that contains the center position information (xCb + cbWidth >> 1, yCb + cbHeight >> 1), and this is the block that is filled in black in Figure 3.

[0336] In another possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0337] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper-left corner of the current block relative to the upper-left corner luminance pixel of the image, and let cbWidth and cbHeight be the width and height of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 7). In that case, the block at the upper-left corner position (the upper-left corner block of the luminance region) is a luminance block containing the position coordinates (xCb, yCb), which is the block filled in black in Figure 7.

[0338] In yet another possible implementation, the position of the current block, i.e., the position of the upper-left corner chroma difference sample of the current block relative to the upper-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chroma difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0339] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper left corner of the current block relative to the upper left corner luminance pixel of the image. Assume that the width of the luminance region at the same position corresponding to the current block (i.e., the entire region of the luminance component filled with diagonal lines in Figure 8) is cbWidth and the height is cbHeight. In this case, the block at the lower right corner (lower right corner block of the luminance region) is a luminance block containing the position coordinates (xCb + cbWidth - 1, yCb + cbHeight - 1), which is the block that is filled in black in Figure 8.

[0340] In other words, in the embodiment of the present invention, the target block as the first color component block can be any block at any position among the multiple blocks shown in Figure 3. For example, it could be the block at the center of the luminance region at the same position shown in Figure 3 (the block filled in black), the block at the upper left corner of the luminance region at the same position shown in Figure 7 (the block filled in black), the block at the lower right corner of the luminance region at the same position shown in Figure 8 (the block filled in black), and further, the block at the upper right corner, the block at the lower left corner, and the block at the center of the upper left region of the luminance region at the same position, but there is no specific limitation to these here.

[0341] Furthermore, in some embodiments, determining the first color component block of the current block from among a plurality of blocks separated from the first color component region may include the steps of determining at least one candidate block at a predetermined position from among a plurality of blocks separated from the first color component region, and determining the first color component block of the current block based on the at least one candidate block.

[0342] In a particular embodiment, determining the first color component block of the current block based on at least one candidate block may include making at least one candidate block the first color component block of the current block.

[0343] In another specific embodiment, determining the first color component block of the current block based on at least one candidate block may include determining a target candidate block that satisfies predetermined judgment conditions from among at least one candidate block, and setting the target candidate block as the first color component block of the current block.

[0344] It should be explained that in the embodiment of the present application, determining whether a candidate block satisfies a predetermined judgment condition may include sequentially acquiring at least one candidate block in a predetermined order, performing a mode determination, and if it is determined that the predicted mode of the first candidate block satisfies the first condition, then the first candidate block may be made the first color component block of the current block.

[0345] Furthermore, in the embodiment of the present application, determining whether a candidate block satisfies predetermined judgment conditions may include the steps of: determining the first block vector parameter of the first candidate block if it is determined that the prediction mode of the first candidate block satisfies the first condition; determining whether the first block vector parameter of the first candidate block satisfies the availability condition; setting the first candidate block as the first color component block of the current block if the first block vector parameter of the first candidate block satisfies the availability condition; and continuing the mode determination of the next candidate block until a target candidate block is determined in which the prediction mode satisfies the first condition and the corresponding first block vector parameter satisfies the availability condition, and setting the target candidate block as the first color component block of the current block if the first block vector parameter of the first candidate block does not satisfy the availability condition.

[0346] In the embodiments of the present application, the first color component block can also be determined by performing a mode determination on at least one candidate block at a predetermined position. For example, as shown in Figure 9, there are five luminance pixel positions CU here, specifically C, TL, TR, BL, and BR. However, the embodiments of the present application are not limited to five positions, and may include multiple different positions. Furthermore, they are not limited to the five positions shown in Figure 9, and none of these are specific limitations.

[0347] In yet another possible implementation, taking the block containing the five luminance pixel positions shown in Figure 9 as an example, the blocks can be acquired sequentially in a predetermined order until it can be determined that the acquired block is to be predictively coded in a mode that has BV information, that is, until the block of the first luminance pixel position that is to be predictively coded in a mode that has BV information is found. The predetermined order of sequential acquisition includes, but is not limited to, the order C→TL→TR→BL→BR.

[0348] For the detailed position derivation process of C, TL, TR, BL, and BR, the position of the current block, i.e., the position of the upper-left corner chromatic difference sample of the current block relative to the upper-left corner chromatic difference sample of the current image, chromaPos=(x,y), is obtained, chromaPos is scaled based on the chromatic difference sampling format shown in Table 4, and the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb), is obtained.

[0349] Here, let (xCb, yCb) be the position of the luminance pixel at the same position corresponding to the upper left corner of the current block relative to the upper left corner luminance pixel of the image (i.e., the position of the luminance pixel TL), and let cbWidth and cbHeight be the width and height of the luminance region at the same position corresponding to the current color difference coding block (i.e., the entire region filled with diagonal lines for the luminance component in Figure 9).

[0350] The coordinates of the position of luminance pixel C are (xCb+cbWidth / 2, yCb+cbHeight / 2).

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

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

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

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

[0355] In this way, for the current block, it is first necessary to determine the corresponding first color component block. For example, if the first color component is the luminance component, then it is necessary to determine the corresponding luminance block for the current block.

[0356] Furthermore, in embodiments of the present application, the method may be understood to further include the steps of determining whether to use a target prediction mode for the current block when the first color component block is predicted based on a block vector, and determining, when using a target prediction mode for the current block, that the prediction mode for the first color component block satisfies a first condition.

[0357] It should be explained that in the embodiment of the present application, the target prediction mode is a prediction mode based on BV guidance, which can be expressed here as BVG-PLT mode or BVG-LUT mode.

[0358] Furthermore, in the embodiment of the present application, when the corresponding luminance block of the current block is decoded in a mode having BV information, and the target prediction mode is applied to the current block, it can be determined that the prediction mode of the corresponding luminance block satisfies the first condition. In this case, the BV of the corresponding luminance block can be obtained, and the first block vector parameter of the current block can be determined based on the BV of the corresponding luminance block. Here, the mode using BV information includes, but is not limited to, the IBC mode or the IntraTMP mode.

[0359] Furthermore, it should be explained that in the embodiment of this application, the number of first color component blocks can be arbitrary; that is, the first color component block of the current block is not limited to one block, but may consist of multiple blocks. Accordingly, when deciding whether or not to make a prediction based on the block vector, it is necessary to make a decision for each first color component block, and only the first color component blocks that satisfy the prediction based on the block vector are used to determine the first block vector parameter of the subsequent current block.

[0360] Furthermore, in the embodiments of the present application, if the first color component block is not predicted based on the block vector, that is, if the first color component block is not processed in a mode that has BV information, it is possible to choose not to analyze the first syntax element flag information. Here, the first syntax element flag information is used to indicate whether or not to use the target prediction mode for the second color component of the current block.

[0361] In a specific implementation method, when determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block, the second block vector parameter of the first color component block can be directly selected as the first block vector parameter of the current block.

[0362] In another specific implementation, when determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block, it is also possible to construct a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter. The first block vector parameter of the current block is then determined based on the list of candidate block vector parameters.

[0363] In other words, in the embodiment of the present application, the second block vector parameter of the first color component block can be directly used as the first block vector parameter of the current block, or a candidate list of block vector parameters for the second color component can be constructed using the second block vector parameter, and then the first block vector parameter of the current block can be determined based on the candidate list of block vector parameters.

[0364] In some embodiments, constructing a candidate list of block vector parameters for the second color component of the current block based on a second block vector parameter may include the steps of adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block, and adding the candidate block vector parameter to the block vector parameter candidate list.

[0365] In other words, in the embodiment of the present application, the second block vector parameter of the first color component block can be directly set as the first block vector parameter of the current block. Alternatively, the second block vector parameter of the first color component block can be adjusted to determine a candidate block vector parameter for the second color component, and then this candidate block vector parameter can be set as the first block vector parameter of the current block. Alternatively, a candidate list of block vector parameters for the second color component can be constructed based on the candidate block vector parameter, and then the first block vector parameter of the current block can be determined based on this candidate list of block vector parameters.

[0366] Here, assuming that the current block is a chrominance block and the first color component block is a luminance block, the first block vector parameter can be the BV of the chrominance block, i.e., BVC, and the second block vector parameter can be the BV of the luminance block, i.e., BVL.

[0367] Understandably, in the embodiment of the present application, the second block vector parameter is luminance BV = (BVL hor BVL ver ) and the first block vector parameter is chrominance BV = (BVC hor ,BVC ver Assuming that ), we can choose to construct a list of candidate chrominance BVCs containing one or more candidate block vector parameters by adjusting the BVL (luminance BV) or BVC (chrominance BV).

[0368] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of determining a predetermined sampling format for the current block, and scaling the second block vector parameter based on the predetermined sampling format to determine a candidate block vector parameter for the second color component of the current block.

[0369] It should be explained that in the embodiments of the present application, the above-mentioned adjustment may include a scaling process based on a predetermined sampling format. Here, the predetermined sampling format may be a mapping relationship between the luminance BV parameters and the scaled chrominance BV parameters shown in Table 8 above.

[0370] Here, the syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, which in this case is specifically a color difference sampling format. Here, different types of color sampling formats result in different corresponding scaling operations.

[0371] For example, if the value of sps_chroma_format_idc is 0, the color sampling format is determined to be monochrome, i.e., the color difference BV parameter (BVC) hor ,BVC hor ) does not exist. If the value of sps_chroma_format_idc is 1, the color sampling format is determined to be 4:2:0, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter at this time is BVC hor =BVL hor >>1, BVC hor =BVL ver >>1. When the value of sps_chroma_format_idc is 2, the color sampling format is determined to be 4:2:2, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter at this time is BVC hor =BVL hor >>1, BVC hor =BVL ver Therefore, if the value of sps_chroma_format_idc is 3, it indicates that the color sampling format is 4:4:4, and the mapping relationship between the luminance BV parameter and the chrominance BV parameter in this case is BVC. hor =BVL hor BVC hor =BVL ver That is the case.

[0372] Thus, based on Table 8, you can choose to perform scaling according to the color sampling format and add the scaled BVC to the color difference BVC candidate list (block vector parameter candidate list) as a candidate block vector parameter.

[0373] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of: determining a predetermined sampling format for the current block; scaling the second block vector parameter based on the predetermined sampling format to determine a first initial block vector parameter for the second color component of the current block; and performing an offset calculation on the first initial block vector parameter based on one or more offset values ​​to determine a candidate block vector parameter for the second color component of the current block.

[0374] Furthermore, in some embodiments, adjusting the second block vector parameter to determine a candidate block vector parameter for the second color component of the current block may include the steps of: determining one or more second initial block vector parameters by performing an offset calculation on the second block vector parameter based on one or more offset values; and determining a predetermined sampling format for the current block, scaling one or more second initial block vector parameters based on the predetermined sampling format, and determining a candidate block vector parameter for the second color component of the current block.

[0375] It should be explained that in the embodiments of this application, the one or more offset values ​​can be any number of arbitrary numbers, such as -1, +1, -2, +2, -3, +3, etc., but no specific limitations are imposed here.

[0376] In other words, in the embodiments of the present invention, after obtaining the BV of the corresponding luminance block, it is denoted as BVL, and the chrominance BV obtained by the BVL is denoted as BVC. Subsequently, by adjusting the BVL or BVC, one or more chrominance BVC candidates can be constructed. That is, based on Table 8, scaling can be performed according to the color sampling format, and the scaled BVL or BVC can be selected to be added to the chrominance BVC candidate list as a candidate block vector parameter.

[0377] For example, in the embodiment of the present application, four cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver We take four cases: +1). If BVL is even, then BVL = (BVL hor BVL ver Next, we take the BVL based on the color sampling format using Table 8 to obtain the BVC. In this way, if the BVL is odd, four BVC candidate block vector parameters are formed and these candidate block vector parameters are added to the chrominance BVC candidate list.

[0378] For example, in the embodiment of the present application, four cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL verWe take four cases: +1). If BVL is even, then BVL = (BVL hor BVL ver ), BVL=(BVL hor -1, BVL ver ), BVL=(BVL hor BVL ver -1), BVL=(BVL hor -1, BVL ver We take the four cases in -1). Next, we use Table 8 to scale the BVL based on the color sampling format to obtain the BVC. In this way, if the BVL is odd or even, four BVC candidates are formed in either case, and these candidates are added to the color difference BVC candidate list.

[0379] For example, in the embodiment of this application, the operation in odd and even situations can be unified by the following calculation: That is, directly BVL = (BVL hor -1, BVL ver -1), BVL=(BVL hor +1, BVL ver -1), BVL=(BVLho-1r,BVL ver +1), BVL=(BVL hor +1, BVL ver We take the four cases of +1).

[0380] For example, in the embodiment of the present application, multiple cases can be formed by adjusting BVL, thereby enabling adjustment of BVC. Here, if BVL is an odd number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver +1), BVL=(BVL hor +3, BVL ver ), BVL=(BVL hor BVL ver +3), BVL=(BVL hor +3, BVL ver+3), BVL=(BVL hor -2, BVL ver ), BVL=(BVL hor BVL ver Take multiple cases such as -2) and build a list of these candidates in order. If BVL is even, then BVL = (BVL hor BVL ver ), BVL=(BVL hor -1, BVL ver ), BVL=(BVL hor BVL ver -1), BVL=(BVL hor -1, BVL ver -1), BVL=(BVL hor -3, BVL ver ), BVL=(BVL hor BVL ver -3), BVL=(BVL hor -3, BVL ver -3), BVL=(BVL hor +2, BVL ver ), BVL=(BVL hor BVL ver Multiple cases are taken, such as +2). Next, using Table 8, the BVL is scaled based on the color sampling format to obtain the BVC. In this way, if the BVL is odd or even, multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0381] For example, in the embodiment of this application, the operation in odd and even situations can be unified by the following calculation: That is, directly BVL = (BVL hor -1, BVL ver -1), BVL=(BVL hor +1, BVL ver -1), BVL=(BVL hor -1, BVL ver +1), BVL=(BVL hor +1, BVL ver +1), BVL=(BVL hor +3, BVL ver -1), BVL=(BVL hor -1, BVL ver+3), BVL=(BVL hor +3, BVL ver +3), BVL=(BVL hor -3, BVL ver -1), BVL=(BVL hor -1, BVL ver -3) and so on.

[0382] For example, in the embodiment of the present application, nine candidates can be obtained by adjusting the obtained BVC. That is, BVC = (BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVC hor ,BVC ver +1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver Set it to -1), and in this way nine BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0383] For example, in the embodiment of the present application, multiple candidates can be obtained by adjusting the obtained BVC. That is, BVC = (BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVC hor ,BVC ver+1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver -1), BVC=(BVC hor -2, BVC ver ), BVC=(BVC hor ,BVC ver -2), BVC=(BVC hor -2, BVC ver -2), BVC=(BVC hor +2, BVC ver ), BVC=(BVC hor ,BVC ver +2), BVC=(BVC hor +2, BVC ver +2), BVC=(BVC hor -2, BVC ver +2), BVC=(BVC hor +2, BVC ver Set it as -2), and in this way multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0384] It should be explained that in the embodiments of this application, the situation where BVL is odd or even refers specifically to the case where one of its components is odd or even, since BVL is a two-dimensional vector. Also, "+1", "-1", "+2", "-2", "+3", and "-3" here all refer to integer pixel precision.

[0385] Furthermore, in some embodiments, when determining a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter of the first color component block, the optimal block vector parameter can first be determined based on the second block vector parameter. Next, a scaling process is performed on the optimal block vector parameter based on a predetermined sampling format to determine the candidate block vector parameter for the second color component. This allows for the determination of a list of candidate block vector parameters based on the candidate block vector parameter.

[0386] For example, in the embodiment of the present invention, in single-tree interpretation and IBC mode under single-tree splitting, the luminance BV (denoted as BVL) is determined by RDO to find the optimal BVL (optimal block vector parameter), and then the optimal block vector parameter is scaled based on a predetermined sampling format to obtain the chrominance BV (denoted as BVC). Here, the scaling process for the optimal block vector parameter can be performed using Table 8 above, and the optimal block vector parameter can be adjusted by combining any of the above adjustment or scaling methods, and the corresponding candidate block vector parameter can be obtained to construct a block vector parameter candidate list.

[0387] Furthermore, in some embodiments, when determining a candidate list of block vector parameters for the second color component of the current block based on the second block vector parameter of the first color component block, it is possible to first determine the optimal block vector parameter corresponding to the first color component block. Then, based on the optimal block vector parameter, a candidate list of block vector parameters for the second color component of the current block is determined.

[0388] For example, in the embodiment of this application, the optimal block vector parameter (denoted as BVL) for the corresponding luminance block can be found by detailed search using a template. Subsequently, a list of candidate block vector parameters is constructed based on the optimal block vector parameter by combining the arbitrary list construction methods described above.

[0389] Furthermore, it is understandable that in the embodiments of this application, when determining the first block vector parameter of the current block based on the block vector parameter candidate list, it is also necessary to determine whether the candidate block vector parameter is available, that is, it is necessary to select one or more available candidate block vector parameters from the block vector parameter candidate list. Therefore, in some embodiments, determining the first block vector parameter of the current block based on the block vector parameter candidate list is, The method may include the steps of: determining whether there is one or more candidate block vector parameters in the block vector parameter candidate list that satisfy the first availability condition; and, if there is one or more candidate block vector parameters in the block vector parameter candidate list that satisfy the first availability condition, determining the first block vector parameter of the current block based on one or more candidate block vector parameters.

[0390] Specifically, in the embodiment of the present invention, the candidate block vector parameter can be determined as the first block vector parameter of the current block only if the candidate block vector parameter satisfies the first availability condition.

[0391] In some embodiments, one or more candidate block vector parameters satisfy the first availability condition. The offset position indicated by one or more candidate block vector parameters does not extend beyond the image boundary. The offset position indicated by one or more candidate block vector parameters does not extend beyond the slice boundary. The offset position indicated by one or more candidate block vector parameters does not currently cover the block. The offset position indicated by one or more candidate block vector parameters does not exceed a predetermined usable area. This includes, but is not limited to, that the offset positions indicated in one or more candidate block vector parameters have already been reconstructed.

[0392] It should be explained that in the embodiment of this application, the current block position is assumed to be (xCb, yCb), and for each candidate block vector parameter, BVC = (BVChor, BVCver), and in this case, the corresponding offset position (xCb + BVChor, yCb + BVCver) is found. Here, the fact that the offset position does not cross the image boundary can also be specifically described using data such as coordinate position information and the size parameter of the current block. For example, xCb + width + BVC hor <= xCb or yCb + height + BVCver <= yCb.

[0393] Furthermore, in the embodiments of the present application, the first availability condition may also consider whether or not it crosses a slice boundary. For example, whether the offset position indicated by one or more candidate block vector parameters crosses a slice boundary, or whether the offset position indicated by one or more candidate block vector parameters crosses a tile boundary.

[0394] It should be understood that, in the embodiments of the present application, a candidate block vector parameter can be determined to satisfy the first availability condition, that is, to be available, only if all of the above conditions are met. In a particular embodiment, taking any candidate block vector parameter as an example, the candidate block vector parameter satisfying the first availability condition includes at least the following: the offset position indicated in the candidate block vector parameter does not exceed the image boundary; the offset position indicated in the candidate block vector parameter does not exceed the slice boundary; the offset position indicated in the candidate block vector parameter does not currently cover a block; the offset position indicated in the candidate block vector parameter does not exceed a predetermined available area; and the offset position indicated in the candidate block vector parameter has already been reconstructed.

[0395] Furthermore, in some embodiments, when constructing a list of candidate block vector parameters, the method may further include the step of adjusting at least one candidate block vector parameter in the list of candidate block vector parameters until at least one candidate block vector parameter satisfies the first availability condition, if none of the candidate block vectors in the list of candidate block vector parameters satisfy the first availability condition.

[0396] In embodiments of the present invention, if all candidate block vectors in the block vector parameter candidate list do not satisfy the first availability condition, the predicted value of the second color component of the current block can be determined based on another mode, where the other mode includes at least one of the PLANAR mode, DM mode, DC mode, CCLM mode, and skip mode.

[0397] In the embodiment of the present invention, the candidate block vector parameters for the second color component can also be determined based on the second block vector parameters of the first color component block. If the candidate block vector parameters satisfy the first availability condition, the candidate block vector parameters are modified, and the block vector parameter candidate list is determined based on the modified candidate block vector parameters. Conversely, if the candidate block vector parameters do not satisfy the first availability condition, the candidate block vector parameters are modified until the adjusted candidate block vector parameters satisfy the first availability condition.

[0398] It should be explained that in the embodiment of this application, when performing a modification process on candidate block vector parameters, the offset position of the current block can be determined based on the candidate block vector parameters and the position information of the current block. Next, a search process is performed based on the offset position of the current block to determine the modified candidate block vector parameters.

[0399] It should also be understood that, in the embodiment of this application, after scaling the second block vector parameter of the first color component block based on a predetermined sampling format, it is necessary to perform further modification processing on the obtained candidate block vector parameter. Before the modification processing, it is also necessary to determine whether the candidate block vector parameter satisfies the first availability condition. If the candidate block vector parameter satisfies the first availability condition, the candidate block vector parameter of the current block is modified, and the modified parameter is determined as the first block vector parameter of the current block. Alternatively, if the candidate block vector parameter does not satisfy the first availability condition, the candidate block vector parameter is adjusted until the adjusted block vector parameter satisfies the first availability condition. After that, the adjusted block vector parameter is modified, and the modified parameter is determined as the first block vector parameter of the current block.

[0400] In other words, in the embodiment of the present application, the color difference BVC can be modified, and then the modified BVC can be added to the color difference BVC candidate list, in which case only the modified BVC will be present in the BVC candidate list.

[0401] For example, after obtaining a color difference BV scaled based on a predetermined sampling format, further modifications are made to it. Before making modifications, it is necessary to first determine whether the BV is available or not. If it is available, modifications are made; if it is not available, adjustments are made until it becomes available before modifications are made. The modified BVC is then added to the color difference BVC candidate list.

[0402] Here, when determining whether it is available or not, we obtain the current block position (xCb, yCb) and calculate the color difference BVC = (BVC hor ,BVC ver ) obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) find, Check if the obtained offset position exceeds the image boundary. Check if the obtained offset position does not currently cover the block (see Figure 10 for details). Check whether the obtained offset position exceeds the predetermined usable area (see Figure 11 for details). The condition (i.e., the first availability condition) is determined to see if the obtained offset position has already been reconstructed. If all conditions are met, the color difference BV is available for use.

[0403] For example, in the embodiment of the present invention, the modification method can be modified using template search. That is, after obtaining the modified color difference BV parameter, the offset position is found using the current block position and the modified color difference BV parameter, and then a detailed search is performed near the offset position using the template matching method to obtain the optimal color difference BV parameter. By duplicating the reference block at the optimal offset position obtained after the detailed search, a color difference prediction block for the current block is obtained. As shown in Figure 12, the shaded area represents the color difference reconstruction area. For the current block, the optimal matching template and the corresponding optimal BV can be found using the template matching method, and the reference block for the current block can be determined based on the optimal BV (i.e., IntraTMP BV), thereby determining the color difference prediction value for the current block.

[0404] Since the availability of the BV is determined before the modification, there is no need to re-determine whether it is available (whether the first availability condition is met) in subsequent steps, and the second block vector parameter can be determined directly.

[0405] Furthermore, in the embodiments of this application, before constructing the candidate block vector parameter list, the second block vector parameter of the first color component block can be modified, and the candidate block vector parameter list can be determined based on the modified first block vector parameter. For example, the luminance BVL can be modified, and then the BVC candidate list can be constructed using the arbitrary list construction method described above.

[0406] As an example, in the embodiment of the present invention, first, the luminance region at the same position corresponding to the current block can be obtained. Here, referring to the schematic diagram of the coordinates and block size of the luminance region at the same position as the current color difference block shown in Figure 13, the position of the current block chromaPos=(xCb,yCb) is obtained, and based on Table 4 above, chromaPos is scaled according to the color sampling format to obtain the position of the luminance region at the same position corresponding to the current block lumaPos=(xCb_Y,yCb_Y). The size parameter of the current block chromaSize=(cbWidth,cbHeight) is obtained, and based on the mapping relationship in Table 9, chromaSize is scaled according to the color sampling format to obtain the size of the luminance region at the same position corresponding to the current block lumaSize=(cbWidth_Y,cbHeight_Y).

[0407] For example, further modifications can be made to the luminance BVL. Before making any modifications, it is necessary to first determine whether the BVL is available (i.e., whether it meets the second availability condition). If it is available, the modifications are made; if it is not available, adjustments are made until it becomes available before the modifications are made.

[0408] In some embodiments, when determining whether BVL is available, the position of the luminance region at the same location (xCb_Y, yCb_Y) is obtained, and luminance BVL = (BVL hor BVL ver ) obtain the corresponding offset position (xCb_Y+BVL hor ,yCb_Y+BVL ver ) is found. Specifically, this is as shown in Figure 14. The luminance BVL (first block vector parameter) is usable if all of the following conditions are met. Here, the following conditions are, that is, The offset position indicated in the first block vector parameter does not extend beyond the image boundary. The offset position indicated in the first block vector parameter does not extend beyond the slice boundary. The offset position shown in the first block vector parameter does not exceed the predetermined usable area (see Figure 11). This includes, but is not limited to, the assumption that the offset position shown in the first block vector parameter has already been reconstructed.

[0409] Furthermore, in the embodiment of the present invention, when performing the modification process, the offset position of the first color component block is determined based on the second block vector parameter of the first color component block and the position information of the first color component block, and a search process is performed based on the offset position of the first color component block to determine the modified second block vector parameter.

[0410] For example, the correction process includes, but is not limited to, the following methods. Correction is performed by searching for the luminance region at the same position corresponding to the current block. That is, after obtaining the luminance BVL, the offset position is found using the position of the luminance region at the same position and the obtained luminance BVL, and a detailed search is performed near the offset position using the luminance region at the same position. The range of the detailed search must satisfy the limited usable area (as shown in Figure 11), and finally the optimal luminance BVL is obtained.

[0411] Understandably, in the embodiments of the present application, the method for constructing the block vector parameter candidate list includes, but is not limited to, the multiple cases described above, and all different methods can be used simultaneously to construct a single candidate list.

[0412] Furthermore, in some embodiments, determining the first block vector parameter of the current block based on one or more candidate block vector parameters may include the steps of: determining one candidate block vector parameter that satisfies the first availability condition as the first block vector parameter if there is one candidate block vector parameter that satisfies the first availability condition in the block vector parameter candidate list; and determining the first block vector parameter by performing a determination process on multiple candidate block vector parameters that satisfy the first availability condition if there are multiple candidate block vector parameters that satisfy the first availability condition in the block vector parameter candidate list.

[0413] It should be explained that in the embodiments of this application, if there are one or more candidate block vector parameters that satisfy the first availability condition, when determining the first block vector parameter based on one or more candidate block vector parameters, any of the candidate block vector parameters that satisfy the first availability condition can be directly determined as the first block vector parameter. That is, if only one BVC candidate satisfies the first availability condition in the constructed list of available BVC candidates, the BV (first block vector parameter) that is ultimately selected is that BVC.

[0414] Furthermore, it should be explained that in the embodiment of the present application, if there are one or more candidate block vector parameters that satisfy the first availability condition, when determining the first block vector parameter based on one or more candidate block vector parameters, the determination process can be performed on multiple candidate block vector parameters that satisfy the first availability condition. Specifically, the method includes the steps of: determining the first template of the current block; determining the first matching template for each of the multiple candidate block vector parameters based on the first template and the multiple candidate block vector parameters; if the first template and the first matching template satisfy the second condition, calculating the matching error between the first template and the first matching template of the current block based on a predetermined error criterion and determining the first generation value for each of the multiple candidate block vector parameters; and determining the least generation value from among the first generation values ​​of each of the multiple candidate block vector parameters and determining the candidate block vector parameter corresponding to the least generation value as the first block vector parameter.

[0415] In other words, in the embodiment of the present application, for multiple candidate block vector parameters that satisfy the first availability condition, after determining the first-generation values ​​corresponding to the multiple candidate block vector parameters, one or more second block vector parameters can be determined from among the multiple candidate block vector parameters based on the first-generation values. For example, if there are multiple available BVC candidates in the constructed list of available BVC candidates, a decision process must be performed on these available BVCs to obtain the final BV. The decision method includes, but is not limited to, a decision method using templates.

[0416] Understandably, in embodiments of the present application, the first template includes one or more sample values ​​within adjacent encoded regions of the current block. Correspondingly, the type of the first template may include at least one of the following: upper template, upper right template, left template, lower left template, and upper left template. Here, the upper template is located in the upper encoded region adjacent to the current block, the upper right template is located in the upper right encoded region adjacent to the current block, the left template is located in the left encoded region adjacent to the current block, the lower left template is located in the lower left encoded region adjacent to the current block, and the upper left template is located in the upper left encoded region adjacent to the current block.

[0417] In other words, in the embodiment of the present invention, when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template location are available (including reconstructed color difference information) based on the pixel availability of the adjacent region of the current block. As shown in Figure 15, based on the relative positional relationship between the template and the current block, templates can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template. Here, the template sizes of different types of different coding blocks may be fixed and the same, or they may be different.

[0418] For example, the template size is selected for any current block of any size, and the following formula illustrates an example of the conditions for setting the template size. Here, nTbW and nTbH are the width and height of the current block, respectively, and iTempW and iTempH are the width and height of the template to be adopted, respectively.

[0419]

number

number

[0420]

number

number

number

[0421] For example, you may select different template sizes depending on the number of pixels in the current block, and the following formula illustrates one example of the conditions for setting the template size. nTbW and nTbH are the width and height of the current block, respectively, nTbW × nTbH is the number of pixels in the current block, and iTempW and iTempH are the width and height of the template to be adopted, respectively.

[0422]

number

number

[0423] As an example, in the embodiment of the present invention, when determining the first matching template, motion compensation is performed on the obtained BVC candidates (i.e., candidate block vector parameters that satisfy the first availability condition) using the first template of the current block to obtain a template at the position of the corresponding BV (first matching template). As shown in Figure 16, if a BV (BVC candidate) is available, motion compensation is performed using the first template and the BV to obtain a template at the position of the corresponding BV, i.e., the first matching template.

[0424] Furthermore, it is understandable that in the embodiments of this application, the predetermined error criteria include, but are not limited to, any of the following: absolute error sum SAD, transformed absolute error sum SATD, difference square sum SSE, mean absolute difference MAD, mean absolute error MAE, mean squared error MSE, etc.

[0425] For example, in the embodiment of the present application, when calculating costs, that is, when determining the first-generation value, there are multiple options for the cost function used to calculate the cost of the template area, and therefore, there may be multiple options for the predetermined error criteria. For example, evaluation criteria such as the sum of absolute errors (SAD), the sum of transformed absolute errors (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE) can be selected. Any of the evaluation criteria mentioned below can be selected from the above criteria, and taking the evaluation criterion of SAD as an example, the calculation formula is as follows.

[0426]

number

[0427] Furthermore, in some embodiments, the method further includes the step of determining the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition as the first block vector parameter if the first template and the first matching template do not satisfy the second condition, or If neither the first template nor the first matching template satisfies the second condition, the process includes determining a candidate block vector parameter in the block vector parameter candidate list that is in a predetermined position satisfying the first availability condition as the first block vector parameter.

[0428] In other words, if the first template and the first matching template satisfy the second condition, then the matching error between the first template and the first matching template of the current block can be calculated based on a predetermined error criterion, and a candidate block vector parameter corresponding to the least verifiable value can be selected as the first block vector parameter. If the first template and the first matching template do not satisfy the second condition, then the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition, or a candidate block vector parameter at a specific position, can be selected as the first block vector parameter.

[0429] For example, when calculating the cost (i.e., substitute value) to determine whether the first template and the first matching template satisfy the second condition, there are several situations in which templates can be used:

[0430] Type 1: If both the top and left templates of a block currently exist, and both the top and left templates corresponding to the BV's position also exist, then both the top and left templates are available.

[0431] Type 2: Currently, both the top and left templates of a block exist, but only the top template corresponding to the BV position exists. In this case, there are two methods. Method 1: If the left template corresponding to the BV position does not exist, it is not used, i.e., the calculation is performed using only the top template. Method 2: If the left template corresponding to the BV position does not exist, the leftmost template width column inside the reference block is used as a substitute for the left template, i.e., the calculation is performed using both the top and left templates.

[0432] Type 3: Currently, both the top and left templates of a block exist, but only the left template corresponding to the BV's position exists. In this case, there are two methods. Method 1: If the top template corresponding to the BV's position does not exist, it is not used, i.e., calculation is performed using only the left template. Method 2: If the top template corresponding to the BV's position does not exist, the row with the highest template height inside the referenced block is used as a substitute for the top template, i.e., calculation is performed using both the top and left templates.

[0433] Type 4: If only an upper template exists in the current block, there are three methods. Method 1: If no upper template exists corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If no upper template exists corresponding to the BV's position, the row with the highest template height inside the referenced block is used as the upper template. Method 3: If an upper template exists at the corresponding BV's position, it is used directly.

[0434] Type 5: If only a left template exists in the current block, there are three methods. Method 1: If there is no left template corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If there is no left template corresponding to the BV's position, the leftmost template width column within the reference block is used as the left template. Method 3: If a left template corresponding to the BV's position exists, it is used directly.

[0435] Type 6: If neither the top template nor the left template exists for the current block, the BV that is ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position.

[0436] For example, in the embodiment of the present invention, when determining the first block vector parameter based on the first generation value of each of multiple candidate block vector parameters, except in situations where the cost cannot be calculated, the cost is calculated for each candidate in the BVC candidate list and sorted. The sorting method includes, but is not limited to, bubble sort, selection sort, insertion sort, shell sort, merge sort, quicksort, radix sort, heap sort, count sort, and bucket sort. Any number of BVCs with the minimum cost are selected as the final BV (first block vector parameter), and color difference prediction is performed based on the BV. It should also be noted that when calculating the first generation value of multiple candidate block vector parameters, one cost is calculated for each candidate block vector parameter, and the candidate block vector parameter with the minimum cost is always retained, in which case neither a list nor sorting is necessary.

[0437] Furthermore, in the embodiment of the present invention, if all candidate block vector parameters in the block vector parameter candidate list do not satisfy the first availability condition, the candidate block vector parameters in the block vector parameter candidate list are adjusted until one or more candidate block vector parameters satisfy the first availability condition are present in the block vector parameter candidate list.

[0438] In other words, in the embodiment of the present invention, if all candidate block vector parameters in the block vector parameter candidate list are unavailable, that is, if all candidate block vector parameters in the block vector parameter candidate list do not satisfy the first availability condition, it is possible to choose to adjust any one or more BVC candidates (candidate block vector parameters) in the block vector parameter candidate list until they become available, and the adjustment method includes, but is not limited to, clipping and scaling. Furthermore, prediction may be performed using PLANAR mode, CCLM system mode, or angle prediction mode, that is, the predicted value of the second color component of the current block may be determined based on other modes. For example, in PLANAR mode, CCLM system mode, or angle prediction mode, a reference pixel and mode parameters can be obtained to perform color difference prediction.

[0439] In S2002, based on the first block vector parameter, the first and second color component reference samples corresponding to the current block are determined, and based on the first and second color component reference samples, a mapping relationship between the first and second color components is established.

[0440] It should be explained that in the embodiments of this application, after determining the first block vector parameter, a luminance reference sample and a chrominance reference sample located at the position of the first block vector parameter can be obtained. In some embodiments, determining the first and second color component reference samples corresponding to the current block based on the first block vector parameter is possible. The process may include the steps of: determining the current block's position; scaling the current block's position to determine the position of the first color component region at the same position in the current block; scaling the first block vector parameter to determine the third block vector parameter of the first color component region at the same position in the current block; determining the reference block for the first color component based on the position of the first color component region and the third block vector parameter; determining the first color component reference sample corresponding to the current block based on the first color component reference block; and determining the reference block for the second color component based on the current block's position and the first block vector parameter; and determining the second color component reference sample corresponding to the current block based on the second color component reference block.

[0441] In the embodiment of the present application, the position of the first color component region can be obtained by scaling the position of the current block based on a predetermined sampling format, and the third block vector parameter of the first color component region can also be obtained by scaling the first block vector parameter based on a predetermined sampling format. Here, the predetermined sampling format can be found in Table 4 above. It should be noted that although the third block vector parameter can be obtained by scaling the chrominance BV (first block vector parameter), there may be accuracy losses in the luminance BV, so the luminance BV obtained by scaling the chrominance BV is not necessarily equal to the original luminance BV (second block vector parameter).

[0442] For example, the current block is a color difference block, and the first color component region at the same position is the luminance region at the same position. To obtain the first color component reference sample (luminance reference sample), first obtain the position of the current block, i.e., the position of the upper-left corner color difference sample of the current block relative to the upper-left corner color difference sample of the current image, chromaPos=(x,y). Scale chromaPos based on the color sampling format shown in Table 4 to obtain the position of the luminance region at the same position corresponding to the current block, lumaPos=(xCb,yCb).

[0443] For example, chrominance BV = (BVC hor ,BVC ver Obtain the luminance BV (BVYhor, BVYver) of the luminance region at the same position corresponding to the current block, scale the luminance BV based on the color sampling format shown in Table 4, and obtain the luminance BV = (BVYhor, BVYver). Obtain the luminance region position lumaPos = (xCb, yCb) of the same position corresponding to the current block, obtain the luminance BV = (BVYhor, BVYver), and find the offset position (xCb + BVYhor, yCb + BVYver) corresponding to the luminance region at the same position corresponding to the current block. This is shown in Figure 17.

[0444] In a specific implementation, after obtaining a luminance sample at the offset position, a luminance reference sample can be obtained by downsampling it. In some embodiments, determining the first color component reference sample corresponding to the current block based on the first color component reference block may include performing a downsampling process on the first color component reference block to determine the first color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample.

[0445] It should be explained that in the embodiment of this application, the resolutions of the luminance sample and the color difference sample do not match. Therefore, it is necessary to perform downsampling on the luminance sample so that the resolution of the downsampled luminance sample becomes the same as the resolution of the color difference sample. As shown in Figure 18, this is a schematic diagram of the downsampling position.

[0446] Furthermore, in the embodiments of this application, several sampling methods may be made to compete with each other, or any of the sampling methods may be adopted by default, including but not limited to the following six sampling methods. For example, assuming that the luminance sample before downsampling is recBvBefDownLuma, the width of the memory buffer is iRecRefLumaStride, and the luminance sample after downsampling is recBvAftDownLuma, the luminance sample after downsampling at position (i,j) will be as follows.

[0447] (1) Downsampling method 1: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i]*2 +recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i-1] +recBvBefDownLuma[2*i+iRecRefLumaStride]*2 +recBvBefDownLuma[2*i+1+iRecRefLumaStride] +recBvBefDownLuma[2*i-1+iRecRefLumaStride]+4)>>3; (2) Downsampling method 2: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+1]+1)>>1; (3) Downsampling method 3: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+iRecRefLumaStride]+1)>>1; (4) Downsampling method 4: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+iRecRefLumaStride] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1; (5) Downsampling method 5: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+1)>>1; (6) Downsampling method 6: recBvAftDownLuma[i][j]=(recBvBefDownLuma[2*i] +recBvBefDownLuma[2*i+1] +recBvBefDownLuma[2*i+iRecRefLumaStride] +recBvBefDownLuma[2*i+1+iRecRefLumaStride]+2)>>2.

[0448] In this way, after downsampling, the downsampled luminance reference sample recBvAftDownLuma is obtained at the BV position of the luminance region at the same location corresponding to the current block.

[0449] Furthermore, for the color difference sample of the current block, first obtain the position of the current block (xCbC, yCbC), and then calculate the color difference BV = (BVC hor ,BVC ver ) obtain the corresponding offset position (xCbC+BVC hor ,yCbC+BVC ver This finds the `BV`, thereby obtaining the chrominance reference sample `recBvChroma` at the BV position corresponding to the current block.

[0450] In this way, a mapping relationship between luminance and chrominance can be constructed based on the luminance reference sample recBvAftDownLuma and the chrominance reference sample recBvChroma.

[0451] In some embodiments, establishing a mapping relationship between the first and second color components based on the first and second color component reference samples may include determining a first lookup table based on the first and second color component reference samples. Here, the first lookup table is used to record the value of the corresponding second color component when the index keyword is the first color component.

[0452] In some embodiments, establishing a mapping relationship between the first and second color components based on a first color component reference sample and a second color component reference sample may include determining a first discrete model based on the first and second color component reference samples. Here, the first discrete model is used to represent the mapping relationship between the first and second color components.

[0453] In other words, in the embodiments of the present invention, the mapping relationship may be a look-up table (LUT). Here, the index keyword (key) in the look-up table may be the first color component, and the value in the look-up table may be the second color component, i.e., LUT[key] = value. Alternatively, the mapping relationship may be a discrete model, which is used to represent the mapping relationship between key and value.

[0454] For example, assuming 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 ways that include, but are not limited to, the following methods.

[0455] [Formula 17] LUT[recBvAftDownLuma[i][j]]=recBvChroma[i][j] It should also be noted that in the embodiments of the present application, the first color component parameter samples can also be limited to a predetermined sample range. In some embodiments, the method may further include performing a mapping process on the first color component reference sample to make the first color component reference sample fall within the predetermined sample range.

[0456] In the embodiments of the present application, the predetermined sample range can be [0, (1 << bitdepth) - 1]. Here, bitdepth represents the bit depth. As an example, the predetermined sample range can be a range such as [0, 255], [0, 511], etc., but there is no specific limitation. Here, when there are multiple sample ranges, one of them can be selected as the final predetermined sample range using the rate distortion cost method.

[0457] As an example, taking a video with a bit depth exceeding 8 bits, assuming the bit depth of the video is 10 bits, the sample range is [0, 1023]. For the key value recBvAftDownLuma, it can be mapped to a predetermined sample range of [0, 255] or [0, 511].

[0458] Furthermore, in some embodiments, when the first reference sample values within the first color component reference sample are the same and correspond to a plurality of different second reference sample values within the second color component reference sample, the method may further include sequentially performing an overwriting process according to the sample order, and setting the last second reference sample value as a value having a mapping relationship with the first reference sample value.

[0459] Furthermore, in some embodiments, when the first reference sample values within the first color component reference sample are the same and correspond to a plurality of different second reference sample values within the second color component reference sample, the method may further include calculating an average value for the plurality of second reference sample values, and setting the obtained average value as a value having a mapping relationship with the first reference sample value.

[0460] In other words, in the embodiment of this application, for different color difference values ​​having the same key value within a mapping relationship, the items with the same key value can be sequentially overwritten according to the sample order, or operations such as averaging can be performed. Also, in the mapping relationship, the initial setting of LUT[] is -1, i.e., an unavailable value. "Overwriting" mainly refers to saving with a new value when there are subsequent instances of the same key value, but is not limited to this method; all may be saved first, then the average value may be calculated and used as the value value corresponding to that key.

[0461] It is understandable that, in the embodiments of this application, the first and second color component reference samples used to construct the mapping relationship can also be obtained by other methods, and several implementation methods are described below as examples.

[0462] In another specific implementation, the luminance sample is not downsampled, and the color difference sample is upsampled to obtain a color difference reference sample. In some embodiments, determining the second color component reference sample corresponding to the current block based on the second color component reference block may include performing an upsampling process on the second color component reference block to determine the second color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample.

[0463] In other words, in the embodiment of the present invention, after obtaining a luminance sample recBvBefDownLuma for the luminance region at the same position, no downsampling is performed. At this time, after obtaining a color difference sample recBvChroma at the position of the corresponding BV in the current block, upsampling is performed using a method that includes, but is not limited to, linear interpolation, to obtain a color difference sample recBvChromaUp of the same size as the luminance sample at the BV position. In this way, the luminance sample recBvBefDownLuma at the BV position is used as the luminance reference sample, and the obtained upsampled color difference sample recBvChromaUp is used as the color difference reference sample. Subsequently, a mapping relationship between luminance and color difference is constructed based on the luminance reference sample and the color difference reference sample.

[0464] Correspondingly, in the embodiments of the present invention, it is necessary to further downsample the predicted value of the second color component of the current block. That is, when upsampling is performed on the color difference sample when constructing a mapping relationship, when making a prediction from luminance to color difference for the current block based on the mapping relationship, it is necessary to perform a downsampling operation on the obtained color difference prediction value to obtain the final color difference prediction value of the current block. Here, the downsampling method includes, but is not limited to, average downsampling.

[0465] In yet another specific implementation, the method may further include the steps of determining a first template for the current block, and determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first template.

[0466] In embodiments of the present application, the first and second color component reference samples used to construct the mapping relationship may include the first and second color component reference samples determined by the first template of the current block. Specifically, the first color component region template at the same location in the first template can be determined based on the first template of the current block. Subsequently, the first color component reference sample can be determined based on the reconstructed sample in the first color component region template. The second color component reference sample can be determined based on the reconstructed sample in the first template. Here, the first template includes one or more reconstructed samples in adjacent encoded regions of the current block.

[0467] As an example, in the embodiment of the present invention, a color difference reference sample can be obtained based on the current color difference template of the current block. After determining the luminance region template at the same position in the current color difference template, a luminance reference sample can be obtained based on the luminance region template at the same position. Subsequently, the luminance reference sample and color difference reference sample obtained in the above embodiment are combined to construct a mapping relationship between luminance and color difference based on these luminance reference samples and color difference reference samples.

[0468] In yet another specific implementation, the method may further include the steps of: determining a first template for the current block; determining a second matching template for the current block based on the first block vector parameters and the first template; and determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the second matching template.

[0469] In embodiments of the present invention, the first and second color component reference samples used to construct the mapping relationship may include, in addition to those determined by the first template of the reference block and the current block, first and second color component reference samples determined by the second matching template of the current block. Specifically, the first color component region matching template at the same position in the second matching template can be determined first, and then the first color component reference sample can be determined based on the reconstructed sample in the first color component region matching template. The second color component reference sample can be determined based on the reconstructed sample in the second matching template. Here, the second matching template can be determined based on the first block vector parameter and the offset position shown in the first template.

[0470] As an example, in the embodiment of the present application, the color difference matching template for the current block can be determined based on the current color difference template and the first block vector parameters of the current block. Based on the color difference matching template, a color difference reference sample can be obtained. After determining the luminance region matching template at the same position in the current color difference matching template, a luminance reference sample can be obtained based on the luminance region matching template at the same position. Subsequently, the luminance reference sample and color difference reference sample obtained in the above embodiment are combined to construct a mapping relationship between luminance and color difference based on these luminance reference samples and color difference reference samples.

[0471] In S2003, the predicted value of the second color component of the current block is determined based on the mapping relationship and the sample value of the first color component of the current block.

[0472] It should be explained that in the embodiments of this application, determining the sample value of the first color component of the current block may include the steps of determining a reconstructed pixel sample of the first color component region at the same position in the current block, and determining the sample value of the first color component of the current block based on the reconstructed pixel sample of the first color component region. Here, the reconstructed pixel sample of the first color component region may be used directly as the sample value of the first color component of the current block, or a filtering process may be performed on the reconstructed pixel sample of the first color component region, and the reconstructed pixel sample after filtering may be used as the sample value of the first color component of the current block; no specific limitations are imposed here.

[0473] For example, in the embodiment of this application, the filtering process is a downsampling process. Here, a reconstructed luminance sample recBefDownLuma is obtained at the same position of the luminance region lumaPos=(xCb,yCb) corresponding to the current block. A downsampling method is then used to obtain a reconstructed luminance sample recAftDownLuma after downsampling, and this reconstructed luminance sample after downsampling is used as the first color component sample value of the current block. Furthermore, if a sample range mapping process is performed on the luminance reference sample, the same sample range mapping process is also performed on the reconstructed luminance sample after downsampling to obtain the first color component sample value of the current block.

[0474] In some embodiments, determining the 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 may include 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 if a first color component value equal to the sample value of the first color component is found within the mapping relationship.

[0475] As an example, in the embodiment of this application, assuming that the predicted value of the current block is predSamples, the following prediction method can be adopted for predSamples[cIdx][x][y] (where the variable cIdx specifies the color component index of the current block), namely, By referring to the luminance value Yc at the same location, the color difference prediction value is derived using the mapping relationship (discrete model) established in the above-described embodiment.

[0476] In some embodiments, the method for determining the predicted value of the second color component of the current block may further include the step of performing a modification on the first color component sample value if no first color component value equal to the first color component sample value is found within the mapping relationship, determining the first color component modification value, and continuing to search whether a first color component value equal to the first color component modification value exists within the mapping relationship.

[0477] In a specific embodiment, performing a correction process on the first color component reconstruction value and determining the first color component correction value may include performing an offset calculation on the first color component sample value based on one or more predetermined offset values ​​and determining the first color component correction value.

[0478] In the embodiments of this application, the offset values ​​may be +1, -1, +2, -2, +3, -3, etc., and the number and specific values ​​of the offset values ​​are not limited. Furthermore, a certain order can be set for these multiple offset values ​​in the correction process for the first color component reconstruction value, for example, the correction process may be performed in the order of {+1, -1, +2, -2, +3, -3}.

[0479] For example, in an embodiment of the present invention, if Yc is not found within the input luminance set for the mapping relationship established in the above embodiment, the following processing method is included, but not limited to, the following: a correction process is performed on Yc in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, a matching check is then performed within the input luminance set based on the corrected Yc, and then the value corresponding to the corrected Yc is determined as the color difference prediction value for the current block.

[0480] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the step of calculating an average value for the second color component reference sample if no first color component value equal to the first color component correction value is found within the mapping relationship, and determining the resulting average value as the predicted value of the second color component of the current block.

[0481] For example, in an embodiment of the present invention, if Yc is not found within the input luminance set for the mapping relationship established in the above embodiment, the following processing method is included, but not limited to, the following: a correction process is performed on Yc in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}, and if the mapping relationship cannot match all of the above corrected Yc values, the color difference prediction value can be set to the average value of the reconstructed color difference sample recBvChroma corresponding to the BV position.

[0482] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of 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, and performing a modification operation on the first initial predicted value to determine the predicted value of the second color component of the current block.

[0483] It should be explained that in the embodiments of this application, the modification operation performed on the first initial predicted value obtained by the mapping relationship may include, but is not limited to, a clipping operation, a filtering operation, or a weighting operation with predicted values ​​obtained in other prediction modes.

[0484] In a specific embodiment, performing a modification operation on a first initial predicted value to determine the predicted value of the second color component of the current block may include the steps of: performing a prediction process on the second color component of the current block based on a first predetermined mode to determine a second initial predicted value of the second color component of the current block; and performing a weighted calculation on the first and second initial predicted values ​​to determine the predicted value of the second color component of the current block. It should be noted that in the embodiment of the present application, the first predetermined mode includes at least one of the PLANAR mode, DM mode, DC mode, and CCLM mode. That is, performing a modification operation on the first initial predicted value obtained by the mapping relationship may include, but is not limited to, weighting with CCLM mode or other prediction modes, in order to obtain the predicted color difference value of the current block.

[0485] In another specific embodiment, performing a modification operation on the first initial predicted value to determine the predicted value of the second color component of the current block includes restricting the first initial predicted value to a predetermined numerical range, or may be called a "clamping operation." It should be explained that in the embodiment of the present application, the lower limit of the predetermined numerical range is the minimum predicted value (min), and the upper limit of the predetermined numerical range is the maximum predicted value (max). Here, if the first initial predicted value is within the predetermined numerical range, the first initial predicted value can be used as the predicted color difference value of the current block; if the first initial predicted value is greater than max, max can be used as the predicted color difference value of the current block; and if the first initial predicted value is less than min, min can be used as the predicted color difference value of the current block.

[0486] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes, if there are multiple first block vector parameters, the steps of determining multiple third initial predicted values ​​for the second color component of the current block, and performing a weighted calculation on the multiple third initial predicted values ​​to determine the predicted value of the second color component of the current block.

[0487] It should be explained that in the embodiment of the present application, if multiple BVs (first block vector parameters) are determined in the above-described embodiment, multiple third initial prediction values ​​can be obtained based on these multiple BVs. Subsequently, these multiple third initial prediction values ​​are weighted, and the weighted prediction value is taken as the color difference prediction value of the current block. Alternatively, the weighted prediction value can be further modified, including, but not limited to, weighting with CCLM-based modes or other prediction modes, to obtain the color difference prediction value of the current block.

[0488] In some embodiments, the method for determining the predicted value of the second color component of the current block may further include the steps of: determining the second block vector parameter for each of the multiple candidate blocks if the first color component block of the current block includes multiple candidate blocks; constructing a list of multiple block vector parameter candidates for the second color component of the current block based on the second block vector parameter for each of the multiple candidate blocks; determining multiple first block vector parameters for the second color component of the current block based on the list of multiple block vector parameter candidates; establishing a mapping relationship between the first and second color components based on the multiple first block vector parameters; and determining the 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.

[0489] It should be explained that in the embodiment of this application, multiple blocks of the luminance region at the same location are obtained, and the locations of the multiple blocks include, but are not limited to, the locations shown in Figure 19. First, it is determined whether these multiple blocks are available or not, and then, based on the luminance BV of the available blocks among these multiple blocks, a candidate list of color difference BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a mapping table LUT between a single luminance and color difference can be established using all the available color difference BVCs of these multiple blocks. In this way, a color difference prediction value for the current block can be obtained based on this mapping table LUT.

[0490] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of: determining a first color component reference sample and a second color component reference sample corresponding to a plurality of sets of current blocks based on a plurality of first block vector parameters; establishing a plurality of candidate mapping relationships between the first and second color components based on the first and second color component reference samples corresponding to the plurality of sets of current blocks; determining a target mapping relationship from among the plurality of 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.

[0491] In a specific embodiment, determining a target mapping relationship from among several candidate mapping relationships may include the steps of: calculating costs for each of the candidate mapping relationships based on a rate-distortion cost scheme and determining multiple rate-distortion cost results; and determining the minimum rate-distortion cost result from among the multiple rate-distortion cost results and determining the candidate mapping relationship corresponding to the minimum rate-distortion cost result as the target mapping relationship.

[0492] It should be explained that in the embodiment of this application, the cost result can be determined using a strain value method, and specifically, the cost result can be determined using a rate strain cost method. However, the magnitude of SAD, the magnitude of MSE, the magnitude of SSE, or other criteria for judgment cost may also be used, and no specific limitations are imposed here.

[0493] Furthermore, in some embodiments, the method further includes the step of determining a mapping relationship index value, where the mapping relationship index value is used to indicate a candidate mapping relationship corresponding to the smallest rate-distortion cost result among a plurality of rate-distortion cost results, encoding the mapping relationship index value, and writing the resulting encoded bits to a bitstream.

[0494] Furthermore, in the embodiment of the present invention, a mapping relationship index value can be determined based on the index number in multiple candidate mapping relationships corresponding to the minimum rate distortion cost result, and written to the bitstream, so that the decoding side can determine the corresponding target mapping relationship based on the mapping relationship index value obtained by decoding.

[0495] In other words, in the embodiment of the present invention, a mapping table LUT can be established between multiple luminance and chrominance values, and then a selected target mapping table LUT can be indicated by a syntax element. For example, multiple blocks of the same luminance region can be obtained, and the locations of the multiple blocks include, but are not limited to, those shown in Figure 19. First, it is determined whether these multiple blocks are available, and then, based on the luminance BVs of the available blocks among these multiple blocks, a candidate list of chrominance BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a single mapping table LUT can be established for each of these multiple blocks using their respective available chrominance BVCs. On the encoding side, a prediction is made for the template of the current block using different mapping table LUTs, and then the difference between that and the reconstructed value of the template is calculated to determine which mapping relationship to use. On the subsequent decoding side, the mapping relationship index value can be determined by decoding the corresponding syntax element. Then, the target mapping relationship can be determined based on the mapping relationship index value, and 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, you could set the number to 4, and there are no specific limitations.

[0496] In some embodiments, the method for determining the predicted value of the second color component of the current block further includes the steps of: determining a first color component reference sample and a second color component reference sample corresponding to a plurality of sets of current blocks based on a plurality of first block vector parameters; establishing a plurality of candidate mapping relationships between the first and second color components based on the first and second color component reference samples corresponding to the plurality of sets of current blocks; calculating a matching error for the plurality of candidate mapping relationships based on a template matching scheme and determining the second-order value of each of the plurality of candidate mapping relationships; determining the least-order value from among the second-order values ​​of each of the plurality of candidate mapping relationships and determining the candidate mapping relationship corresponding to the least-order value as the target mapping relationship; 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.

[0497] In a specific embodiment, calculating matching errors for multiple candidate mapping relationships based on a template matching scheme and determining the second-generation value of each of the multiple candidate mapping relationships may include the steps of: determining the first template of the current block; determining the reconstructed pixel sample value of the first color component region template at the same position in the first template; determining the predicted value of each second color component in the multiple mapping relationships of the first template based on the multiple candidate mapping relationships and the reconstructed pixel sample value of the first color component region template; and calculating costs based on the reconstructed value of the second color component of the first template and the predicted value of each second color component in the multiple mapping relationships of the first template, and determining the second-generation value of each of the multiple candidate mapping relationships.

[0498] It should be explained that in the embodiment of this application, a mapping table LUT between multiple luminance and chrominance values ​​can be established, and then the mapping table LUT to use can be selected by a template. For example, multiple blocks of the luminance region at the same location are obtained, and the locations of the multiple blocks include, but are not limited to, those shown in Figure 19. First, it is determined whether these multiple blocks are available, and then, based on the luminance BV of the available blocks among these multiple blocks, a candidate list of chrominance BVC candidates is constructed for each. The availability of BVs in the candidate list is determined for each of the multiple blocks, and one or more BVs are determined for each of the multiple blocks, and a single mapping table LUT can be established for each of these multiple blocks using their respective available chrominance BVCs. A prediction is made for the template of the current block using different mapping table LUTs, the difference with the reconstructed value of the template is calculated, and it is determined which mapping relationship to use specifically, and then the chrominance prediction value of the current block is determined using the finally determined mapping relationship. It should be noted that the number of mapping relationships established here can be set arbitrarily; for example, the number may be set to 4, and there is no specific limitation.

[0499] In one specific example, the process for performing LUT prediction on the current block template is as follows:

[0500] Currently, a reconstructed luminance sample recBefDownLumaR is obtained at the same position as the luminance region template lumaPos=(xCbR,yCbR) corresponding to the block template. This luminance sample is then downsampled to obtain a reconstructed luminance sample recAftDownLumaR after downsampling, and the same sample range mapping process is performed on this sample.

[0501] Let predSamplesR be the predicted value of the current block template. For predSamplesR[cIdx][x][y], the variable cIdx specifies the color component index of the current block. The prediction method is as follows: the luminance value Yc at the same position is referenced, and the predicted value is derived using the established mapping relationship. If Yc is not found in the input luminance set of the established mapping relationship, the system checks in the order of {Yc+1, Yc-1, Yc+2, Yc-2, Yc+3, Yc-3}. If the mapping relationship cannot match any of the above values, the system includes, but is not limited to, setting the predicted color difference value of the current block to the average value of the reconstructed color difference sample recBvChroma corresponding to the BV position.

[0502] Currently, when calculating costs for block templates and the template prediction values ​​for each LUT, there are several situations in which templates are used.

[0503] Type 1: If both the top template and the left template of a block currently exist, then both the top template and the left template are available.

[0504] Type 2: If only the top template exists in the current block, then only the top template is available.

[0505] Type 3: If only the left template exists in the current block, then only the left template is available.

[0506] Type 4: If neither the top template nor the left template exists for the current block, the LUT ultimately selected will be the first established LUT or the LUT at a specific designated location.

[0507] For example, in the embodiment of the present application, assuming that the reconstruction value of the current block template is recSamplesR, there are several options for the cost function used to calculate the cost of the template region. For example, evaluation criteria such as the sum of absolute errors (SAD), the sum of transformed absolute errors (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE) can be selected. Any of the evaluation criteria mentioned below can be selected from the above criteria. Taking the SAD evaluation criterion as an example, the calculation formula is as follows.

[0508]

number

[0509] It should also be explained that in the embodiments of this application, when selecting the final LUT using the current block template, except in situations where the cost cannot be calculated, the cost is calculated for each established LUT candidate and sorted. The sorting method includes, but is not limited to, bubble sort, selection sort, insertion sort, shell sort, merge sort, quicksort, radix sort, heap sort, count sort, and bucket sort. Here, the LUT candidate with the minimum cost is selected as the LUT to be used in the end.

[0510] Furthermore, in embodiments of the present application, the method further includes the steps of determining a prediction mode for the current block and, if the prediction mode indicates that a target prediction mode is used for the second color component of the current block, determining a first block vector parameter for the current block.

[0511] In some embodiments, determining the prediction mode of the current block includes the steps of determining a plurality of candidate modes, the plurality of candidate modes including at least a target prediction mode, calculating the cost for each of the plurality of candidate modes based on a predetermined cost scheme to determine a plurality of third-order values, and determining the least-order value from the plurality of third-order values ​​and determining the candidate mode corresponding to the least-order value as the prediction mode of the current block. Here, the predetermined cost scheme includes at least one of a rate-distortion cost scheme and a template matching scheme.

[0512] In other words, in the embodiments of the present invention, the BVG-LUT mode and other modes can be used simultaneously. Here, in the DM mode, in addition to the BVG-LUT mode, other modes can also compete. The mode to be ultimately used is determined based on the template cost. For example, the BV obtained from luminance may be used directly and the BV may be directly duplicated, or the BVG-LUT mode defined in the embodiments of the present invention may be used, and after applying these two modes to the template of the current block, the one with the lower template cost is selected as the target prediction mode for the current block.

[0513] Furthermore, in embodiments of the present application, the method further includes the steps of determining a first color component region at the same location in the current block, and determining to use a target prediction mode for the second color component of the current block if the DM mode is used for the current block and the first color component region is predicted based on the block vector.

[0514] For example, in the embodiment of this application, in dual-tree division and DM mode, if the corresponding luminance region has BV information, prediction is performed for the current block using the target prediction mode. For example, If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, then intra_bvgplt_flag=1 is set, and the target prediction mode is used as the color difference intra-prediction mode IntraPredModeC[xCb][yCb].

[0515] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA and IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, then intra_bvgplt_flag=1, and the color difference intra prediction mode IntraPredModeC[xCb][yCb] uses the target prediction mode.

[0516] In the embodiment of the present application, the first syntax element flag information can be represented by intra_bvgplt_flag or bvgplt_flag, and the target prediction mode can be represented by BVG-PLT or BVG-LUT. Here, the derivation of the color difference prediction mode is as follows.

[0517] The color difference intra-prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode as specified in the table below. These fill items other than BVG-LUT modes are shown as examples of corresponding values ​​and do not necessarily need to be filled in. Here, Table 10 shows an example of color difference prediction mode derivation. As shown in Table 10 above, 0 represents Planar mode, 1 represents DC mode, 18 represents horizontal mode, 50 represents vertical mode, and 81~83 represents CCLM mode.

[0518] As can be seen from Table 10, in DM mode, if intra_ibc_flag==1, that is, if the information obtained from the center position block of the luminance region at the same location includes BV, the color difference intra prediction mode IntraPredModeC[xCb][yCb] uses BVG-LUT mode.

[0519] Furthermore, in embodiments of the present application, the method further includes the step of determining a value of first syntax element flag information, where the first syntax element flag information is used to indicate whether or not to use a target prediction mode for the second color component of the current block, encoding the value of the first syntax element flag information, and writing the resulting encoded bits to a bitstream.

[0520] It should be explained that, in the embodiments of this application, when the target prediction mode is used for the second color component of the current block, the value of the first syntax element flag information is determined to be the first value, and when the target prediction mode is not used for the second color component of the current block, the value of the first syntax element flag information is determined to be the second value. Furthermore, in the embodiments of this application, when the first syntax element flag information indicates that the target prediction mode is used for the second color component of the current block, the step of determining the first block vector parameter of the current block is performed.

[0521] Furthermore, in embodiments of the present application, the method further includes the step of determining a value of a second syntax element flag information, where the second syntax element flag information is used to indicate whether or not the use of a target prediction mode is permitted for the second color component of the current block; encoding the value of the second syntax element flag information; and writing the resulting encoded bits to a bitstream.

[0522] It should be explained that in the embodiment of this application, the second syntax element flag information can be represented by BvgpltEnabled. If the use of target prediction mode is permitted for the second color component of the current block, the value of the second syntax element flag information is determined to be the first value, and if the use of target prediction mode is not permitted for the second color component of the current block, the value of the second syntax element flag information is determined to be the second value.

[0523] Furthermore, it should be explained that in the embodiment of this application, the first value is different from the second value. Here, the first and second values ​​may be in parameter form or numerical form. Specifically, both the first syntax element flag information and the second syntax element flag information may be parameters written to the profile or the value of a single flag / identifier, and no specific limitations are imposed here.

[0524] For example, the first value can be set to 1 and the second value to 0. Alternatively, the first value can be set to 0 and the second value to 1. Alternatively, the first value can be set to true and the second value to false. Alternatively, the first value can be set to false and the second value to true. Here, in the embodiment of the present application, the first value can be set to 1 and the second value to 0, but this is not a specific limitation.

[0525] For example, in the 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 BvgpltEnabled is equal to 0. Otherwise, the variable ModeIncludeBv is set, and if the corresponding luminance block is not encoded in a mode that has BV information, then ModeIncludeBv is equal to 0; otherwise, ModeIncludeBv is equal to 1.

[0526] If several of the following conditions are true simultaneously (including, but not limited to, the following conditions), namely, ModeIncludeBv is equal to 1, sh_slice_type is equal to I-frame, BvgpltEnabled is equal to 1 if CtbLog2SizeC is less than or equal to MaxChromaIbcSize, where MaxChromaIbcSize can be determined based on the chrominance CTU size or a given value.

[0527] Otherwise, BvgpltEnabled is equal to 0. Here, if BvgpltEnabled is equal to 0, we can infer that the value of the first syntax element flag information is 0.

[0528] Furthermore, referring to Figure 20, the embodiment of the present application should be understood to include the following after step S2003.

[0529] In S2004, the residual value of the second color component of the current block is determined based on the predicted value of the second color component of the current block.

[0530] It should be explained that in the embodiment of this application, the original value of the second color component of the current block is determined, and the residual value of the second color component of the current block is determined based on the original value and predicted value of the second color component of the current block. Specifically, a subtraction operation is performed on the original value and predicted value of the second color component of the current block to obtain the residual value of the second color component of the current block.

[0531] Furthermore, in the embodiment of the present invention, the residual value of the second color component of the current block is encoded, and the resulting encoded bits are written to the bitstream. In this way, the decoding side determines the residual value of the second color component of the current block by decoding the bitstream, and determines the reconstructed value of the second color component of the current block based on the residual value and the predicted value. Specifically, the reconstructed value of the second color component of the current block can be restored by performing an addition operation on the residual value and the predicted value of the second color component of the current block.

[0532] Furthermore, embodiments of the present application further provide a bitstream which is generated by bit encoding based on coding awaiting information, the coding awaiting information which includes at least one of the residual value of the second color component of the current block, the value of the first syntax element flag information, the value of the second syntax element flag information, and the mapping relation index value.

[0533] In the embodiment of the present invention, the first syntax element flag information is used to indicate whether or not to use the target prediction mode for the second color component of the current block, the second syntax element flag information is used to indicate whether or not to allow the use of the target prediction mode for the second color component of the current block, and the mapping relationship index value is used to indicate the index number in a plurality of candidate mapping relationships of the candidate mapping relationship corresponding to the minimum rate distortion cost result. In this way, the encoding side writes the pending encoding information to the bitstream, transmits it from the encoding side to the decoding side, and the decoding side obtains this information by decoding the bitstream, thereby restoring the color difference reconstruction value of the current block.

[0534] This embodiment provides an encoding method. First, the first block vector parameter of the current block is determined. Next, based on the first block vector parameter, the first and second color component reference samples corresponding to the current block are determined. Furthermore, a mapping relationship between the first and second color components is established based on the first and second color component reference samples. Based on the mapping relationship and the first color component sample value of the current block, the predicted value of the second color component of the current block is determined. In this way, after determining the first block vector parameter to be applied to the chrominance component based on the block vector parameter of the luminance block, a mapping relationship between the luminance component and the chrominance component is established based on the luminance component reference sample and the chrominance component reference sample located at the position of the first block vector parameter. Subsequently, the chrominance component is predicted using this mapping relationship. This improves the problem of unity in chrominance prediction, makes full use of related information of luminance blocks at the same position, and improves the accuracy of chrominance prediction. At the same time, pixel-level prediction can be effectively performed based on the established mapping relationship, thereby further saving bitrate and improving encoding and decoding efficiency.

[0535] In yet another embodiment of the present invention, based on the encoding and decoding method described in the above embodiment, the embodiment of the present invention adds a new prediction mode BVG-LUT mode (i.e., Solution 1). In the flow of Solution 1, a corresponding luminance block is obtained, it is determined whether the corresponding luminance block is encoded in a mode having BV information, and then the following processing method can be adopted.

[0536] Otherwise, the syntax elements of that mode are not transmitted within the bitstream.

[0537] If so, and the BVG-LUT mode is true, the BV of the corresponding luminance block is obtained, the luminance BV (BVL) is adjusted and applied to the color difference to build a list of candidate color difference BVs (BVCs). Then, it is determined whether the BVC candidates in the list of candidate color difference BVCs are available. If they are available, the process proceeds to the decision stage. If they are not available, the BVCs are adjusted until they are available, and then the process proceeds to the decision stage. Alternatively, if all BVC candidates in the list of candidate color difference BVCs are unavailable, the prediction is performed in PLANAR mode or another color difference prediction mode. Figures 21 and 22 show different processing flow diagrams for when BVC candidates are unavailable.

[0538] Referring to Figure 21, a schematic diagram of the detailed flow of the encoding method provided by the embodiment of the present application is shown. As shown in Figure 21, the detailed flow may include the following:

[0539] In S2101, the corresponding luminance block is obtained.

[0540] In S2102, it is determined whether the prediction mode of the corresponding luminance block is a mode that has BV information.

[0541] In S2103, DBV mode syntax elements are not transmitted within the bitstream.

[0542] In S2104, it is determined whether the BVG-LUT mode is currently applied to the block.

[0543] In S2105, if the BVG-LUT mode is not currently applied to the block, color difference prediction is performed using another prediction mode.

[0544] In S2106, if the BVG-LUT mode is applied to the current block, the BV parameter of the corresponding luminance block is obtained.

[0545] In S2107, a list of BVC candidate values ​​for color difference is constructed.

[0546] In S2108, it is determined whether or not a candidate BV is available.

[0547] In S2109, if a candidate BV is unavailable, the system will be adjusted until a candidate BV becomes available.

[0548] In S2110, if candidate BVs are available, the final chromatic difference BV is determined.

[0549] In S2111, color difference prediction is performed based on the color difference BV.

[0550] Referring to Figure 22, a detailed flowchart of another encoding method provided by an embodiment of the present application is shown. As shown in Figure 22, the detailed flowchart may include the following:

[0551] In S2201, the corresponding luminance block is obtained.

[0552] In S2202, it is determined whether the prediction mode of the corresponding luminance block is a mode that has BV information.

[0553] In S2203, DBV mode syntax elements are not transmitted within the bitstream.

[0554] In S2204, it is determined whether the BVG-LUT mode is currently applied to the block.

[0555] In S2205, if the BVG-LUT mode is not currently applied to the block, color difference prediction is performed using another prediction mode.

[0556] In S2206, if the BVG-LUT mode is applied to the current block, the BV parameter of the corresponding luminance block is obtained.

[0557] In S2207, a list of BVC candidates for color difference is constructed.

[0558] In S2208, it is determined whether or not a candidate BV is available.

[0559] In S2209, if a candidate BV is unavailable, color difference prediction is performed using another prediction mode.

[0560] In S2210, if candidate BVs are available, the final chromatic difference BV is determined.

[0561] In S2211, color difference prediction is performed based on the color difference BV.

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

[0563] In S1, obtain the corresponding luminance block.

[0564] The block location to be retrieved can be any location, including, but not limited to, the following locations:

[0565] (1) Obtain the central block of the brightness region at the same location (see Figure 3).

[0566] (2) Obtain the block in the upper left corner of the brightness region at the same location (see Figure 7).

[0567] (3) Obtain the block in the lower right corner of the brightness region at the same location (see Figure 8).

[0568] (4) In a block containing the five luminance pixel positions shown in Figure 9 (not limited to five positions, but may be multiple different positions), the blocks are acquired sequentially until it can be determined that the acquired block is encoded in a mode that has BV information, that is, until the first block of luminance pixel positions that is encoded in a mode that has BV information is found. The order of acquisition includes, but is not limited to, the order C→TL→TR→BL→BR.

[0569] In S2, the luminance blocks are encoded in a mode that includes BV information.

[0570] The block at the corresponding position is retrieved, and it is determined whether the luminance block is being processed in a mode that contains BV information (including, but not limited to, IBC mode or IntraTMP mode).

[0571] If so, obtain the BV of the corresponding luminance block.

[0572] Otherwise, the syntax elements of that mode are not transmitted within the bitstream.

[0573] In S3, construct a list of candidate color difference BVCs.

[0574] Luminance BV = (BVL) hor BVL ver ), color difference BV=(BVC hor ,BVC ver Assuming that ), a list of chromatic difference BVC candidates containing one or more candidates is constructed by adjusting the BVL or BVC. The construction method includes, but is not limited to, any of the following situations, and all different methods can be used simultaneously to construct a single candidate list.

[0575] Method 1: Perform scaling based on the color difference sampling format, and add the scaled BVC to the color difference BVC candidate list.

[0576] Method 2: After obtaining the BV of the corresponding luminance block, denote it as BVL. Denote the chrominance BV obtained by BVL as BVC. By adjusting BVL or BVC, construct a chrominance BVC candidate containing one or more candidates.

[0577] The candidate construction methods include, but are not limited to, the following situations:

[0578] Construction Method 1: Adjust the BVL to form four cases, thereby achieving adjustment of the BVC.

[0579] If BVL is odd, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver We take the four cases of +1).

[0580] If BVL is an even number, then BVL = (BVL hor BVL ver )

[0581] Based on the color difference sampling format of Method 1, the BVL is scaled to obtain the BVC. In this way, if the BVL is odd, four BVC candidates are formed and these candidates are added to the color difference BVC candidate list.

[0582] Construction method 2: Adjust the BVL to form four cases, thereby achieving adjustment of the BVC.

[0583] If BVL is odd, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver We take the four cases of +1).

[0584] If BVL is an even number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor -1, BVL ver ), BVL=(BVL hor BVL ver -1), BVL=(BVL hor -1, BVL ver We take the following four cases: -1)

[0585] Based on the color difference sampling format of Method 1, the BVL is scaled to obtain the BVC. In this way, whether the BVL is odd or even, four BVC candidates are formed, and these candidates are added to the color difference BVC candidate list. This method can also be operated in a way that does not distinguish between odd and even situations by the following calculation.

[0586] BVL=(BVL hor -1, BVL ver -1), BVL=(BVL hor +1, BVL ver -1), BVL=(BVL hor -1, BVL ver +1), BVL=(BVL hor +1, BVL ver We set up four cases (+1), but we do not impose any specific limitations on them.

[0587] Construction Method 3: Adjust the BVL to form multiple cases, thereby achieving adjustment of the BVC.

[0588] If BVL is odd, then BVL = (BVL hor BVL ver ), BVL=(BVL hor +1, BVL ver ), BVL=(BVL hor BVL ver +1), BVL=(BVL hor +1, BVL ver +1), BVL=(BVL hor +3, BVL ver ), BVL=(BVL hor BVL ver +3), BVL=(BVL hor +3, BVL ver +3), BVL=(BVL hor -2, BVL ver ), BVL=(BVL hor BVL ver -2) and other cases are taken.

[0589] If BVL is an even number, then BVL = (BVL hor BVL ver ), BVL=(BVL hor -1, BVL ver ), BVL=(BVL hor BVL ver -1), BVL=(BVL hor -1, BVL ver -1), BVL=(BVL hor -3, BVL ver ), BVL=(BVL hor BVL ver -3), BVL=(BVL hor -3, BVL ver -3), BVL=(BVL hor +2, BVL ver ), BVL=(BVL hor BVL ver It can take multiple cases, such as +2).

[0590] The BVL is scaled based on the color difference sampling format of Method 1 to obtain the BVC. In this way, if the BVL is odd or even, multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list. It should be noted that these candidates can be added to the color difference BVC candidate list in order.

[0591] Similar to method 2, here we can also express odd and even situations uniformly as follows, without distinguishing between them.

[0592] BVL=(BVL hor -1, BVL ver -1), BVL=(BVL hor +1, BVL ver -1), BVL=(BVL hor -1, BVL ver +1), BVL=(BVL hor +1, BVL ver +1), BVL=(BVL hor +3, BVL ver -1), BVL=(BVL hor -1, BVL ver +3), BVL=(BVL hor+3, BVL ver +3), BVL=(BVL hor -3, BVL ver -1), BVL=(BVL hor -1, BVL ver Set it to -3), for example.

[0593] Construction Method 4: Adjust the BVC obtained in Method 1 to obtain nine candidates, but the specific number is not limited.

[0594] BVC=(BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVC hor ,BVC ver +1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver Set it to -1), and in this way nine BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0595] Construction method 5: Adjust the BVC obtained in method 1 to obtain multiple candidates.

[0596] BVC=(BVC hor ,BVC ver ), BVC=(BVC hor -1, BVC ver ), BVC=(BVC hor ,BVC ver -1), BVC=(BVC hor -1, BVC ver -1), BVC=(BVC hor +1, BVC ver ), BVC=(BVChor ,BVC ver +1), BVC=(BVC hor +1, BVC ver +1), BVC=(BVC hor -1, BVC ver +1), BVC=(BVC hor +1, BVC ver -1), BVC=(BVC hor -2, BVC ver ), BVC=(BVC hor ,BVC ver -2), BVC=(BVC hor -2, BVC ver -2), BVC=(BVC hor +2, BVC ver ), BVC=(BVC hor ,BVC ver +2), BVC=(BVC hor +2, BVC ver +2), BVC=(BVC hor -2, BVC ver +2), BVC=(BVC hor +2, BVC ver Set it as -2), and in this way multiple BVC candidates are formed, and these candidates are added to the color difference BVC candidate list.

[0597] In S4, determine whether BV is available.

[0598] Get the current block position (xCb, yCb), retrieve all BVC candidates obtained in S3, and for each BVC candidate, calculate BVC = (BVC hor ,BVC ver ) and the corresponding offset position (xCb+BVC hor ,yCb+BVC ver Find the candidate color difference BV, determine the conditions (including, but not limited to, the following conditions), and if all conditions are met, the candidate color difference BV is available. In this way, a list of available BVC candidates is constructed. The above conditions are: Check if the obtained offset position exceeds the picture boundary (e.g., xCb + width + BVC) hor <=xCb or yCb+height+BVCver <=yCb), Check if the obtained offset position does not currently cover the block (see Figure 10). Check if the obtained offset position exceeds the available area (see Figure 11). This includes whether the obtained offset position has already been reconstructed.

[0599] Here, if at least one BVC candidate is available, proceed to S5 to make a BV decision. If none are available, adjust until one of the BVC candidates becomes available, then proceed to S5 to make a BV decision. The adjustment method includes, but is not limited to, clipping and scaling.

[0600] If all other modes are unavailable, you can instead use PLANAR mode, CCLM mode, or other angle prediction modes to obtain reference pixels and mode parameters and perform chromatic difference mode prediction.

[0601] In S5, the BV (Best Value) is determined.

[0602] If there is only one BVC candidate in the list of available BVC candidates obtained in S4, then this BVC will be the one ultimately selected.

[0603] If there are multiple BVC candidates in the list of available BVC candidates obtained in S4, a decision must be made on these BVCs in order to obtain the final BV, and the decision method includes, but is not limited to, the following methods.

[0604] The decision will be made using a template.

[0605] (1) Select a template.

[0606] Based on the pixel availability of adjacent regions in the current block, it is determined whether the pixels at the template location are available (including reconstructed color difference information). Based on the relative positional relationship between the template and the current block, templates can be classified into template types such as top templates, left templates, top-right templates, bottom-left templates, and top-left templates, but are not limited to these (see Figure 15).

[0607] The sizes of different types of templates in different current blocks may be fixed and the same, or they may be different.

[0608] For example, the template size is selected for any current coding block, and the following formula illustrates an example of the conditions for setting the template size. nTbW and nTbH are the width and height of the current color difference coding block, and iTempW and iTempH are the width and height of the template to be adopted.

[0609]

number

number

[0610]

number

number

number

[0611] For example, different template sizes can be selected depending on the number of pixels in the current color difference coding block, and the following formula illustrates one example of the conditions for setting the template size. nTbW and nTbH are the width and height of the current color difference coding block, nTbW × nTbH is the number of pixels in the current color difference coding block, and iTempW and iTempH are the width and height of the template to be adopted.

[0612]

number

number

[0613] For the multiple BVC candidates obtained, motion compensation is performed using the current block template to obtain the template at the corresponding BVC position (see Figure 16). There are several situations in which templates are used when calculating costs, as follows:

[0614] Type 1: If both the top and left templates of a block currently exist, and both the top and left templates corresponding to the BV's position also exist, then both the top and left templates are available.

[0615] Type 2: Currently, both the top and left templates of a block exist, but only the top template corresponding to the BV position exists. In this case, there are two methods. Method 1: If the left template corresponding to the BV position does not exist, it is not used, i.e., the calculation is performed using only the top template. Method 2: If the left template corresponding to the BV position does not exist, the leftmost template width column inside the reference block is used as a substitute for the left template, i.e., the calculation is performed using both the top and left templates.

[0616] Type 3: Currently, both the top and left templates of a block exist, but only the left template corresponding to the BV's position exists. In this case, there are two methods. Method 1: If the top template corresponding to the BV's position does not exist, it is not used, i.e., calculation is performed using only the left template. Method 2: If the top template corresponding to the BV's position does not exist, the row with the highest template height inside the referenced block is used as a substitute for the top template, i.e., calculation is performed using both the top and left templates.

[0617] Type 4: If only an upper template exists in the current block, there are three methods. Method 1: If no upper template exists corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If no upper template exists corresponding to the BV's position, the row with the highest template height inside the referenced block is used as the upper template. Method 3: If an upper template exists at the corresponding BV's position, it is used directly.

[0618] Type 5: If only a left template exists in the current block, there are three methods. Method 1: If there is no left template corresponding to the BV's position, it is not used, and the BV ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position. Method 2: If there is no left template corresponding to the BV's position, the leftmost template width column within the reference block is used as the left template. Method 3: If a left template corresponding to the BV's position exists, it is used directly.

[0619] Type 6: If neither the top template nor the left template exists for the current block, the BV that is ultimately selected is the first BVC in the BVC candidate list, or the BVC at a specific designated position.

[0620] (3) Cost calculation There are several cost functions to choose from when calculating the cost of a template region. For example, you can select evaluation criteria such as the sum of absolute errors (SAD), the sum of transformed absolute errors (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), and the rate distortion function (RDO). Any of the evaluation criteria mentioned here can be selected from the above criteria to perform the cost calculation.

[0621] (4) Final BV selection Except for situations where the cost cannot be calculated in (2), the cost is calculated for each candidate in the BVC candidate list and sorted. Sorting methods include, but are not limited to, bubble sort, selection sort, insertion sort, shell sort, merge sort, quicksort, radix sort, heap sort, count sort, and bucket sort. The BVC with the minimum cost is selected as the final BV, and color difference prediction is performed based on the BV. It should be noted that when calculating the cost of multiple candidate block vector parameters, one cost is calculated for each candidate block vector parameter, and the candidate block vector parameter with the minimum cost is always kept; in this case, neither a list nor sorting is necessary.

[0622] In S6, color difference prediction is based on BV.

[0623] Color difference prediction methods include, but are not limited to, the following.

[0624] In Method 1, Figure 23 is a schematic diagram of the color difference prediction flow based on BV provided in the embodiment of the present application. As shown in Figure 23, the flow may include the following:

[0625] In S231, acquire luminance and color difference samples at the BV position.

[0626] (1) Obtain a luminance sample.

[0627] The current block's position, i.e., the position of the top-left corner chroma difference sample of the current block relative to the top-left corner chroma difference sample of the current image, chromaPos=(x,y), is obtained. chromaPos is then scaled based on the chroma difference sampling format to obtain lumaPos=(xCb,yCb), the position of the corresponding luminance region at the same position within the current block.

[0628] Color difference BV=(BVC hor ,BVC ver The luminance BV is obtained by adjusting the color difference BV based on the color difference sampling format, and the luminance BV = (BVYhor, BVYver) of the lu...

Claims

1. A decoding method applied to a decoder, The steps are to determine the first block vector parameter of the current block, The steps include determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter, and establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample, A decoding method characterized by comprising the step of determining a 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.

2. The step of determining the first block vector parameter of the current block is: The steps include determining the first color component block of the current block, If the prediction mode of the first color component block satisfies the first condition, the steps include determining the second block vector parameter of the first color component block, The feature includes the step of determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block. The decoding method according to claim 1.

3. The step of determining the first color component block of the current block is: The steps include determining the first color component region at the same position in the current block, The features include the step of determining the first color component block of the current block from among a plurality of blocks separated from the first color component region. The decoding method according to claim 2.

4. The step of determining the first color component block of the current block from among a plurality of blocks separated from the first color component region is: The steps include determining at least one candidate block at a predetermined position from among a plurality of blocks separated from the first color component region, The step of determining the first color component block of the current block based on the at least one candidate block is characterized by including the step of The decoding method according to claim 3.

5. The decoding method further, If the first color component block is predicted based on the block vector, the step is to determine whether or not to use the target prediction mode for the current block. The method is characterized by including the step of determining that the prediction mode of the first color component block satisfies a first condition when the target prediction mode is used for the current block. The decoding method according to claim 2.

6. The step of determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block is: The steps include constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter, The step of determining the first block vector parameter of the current block based on the block vector parameter candidate list is characterized by including the step of The decoding method according to claim 2.

7. The step of constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter is: The steps include adjusting the second block vector parameter and determining a candidate block vector parameter for the second color component of the current block, The step of adding the candidate block vector parameter to the candidate block vector parameter list is included. The decoding method according to claim 6.

8. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: The steps include determining a predetermined sampling format for the current block, The step of scaling the second block vector parameter based on the predetermined sampling format and determining a candidate block vector parameter for the second color component of the current block is included. The decoding method according to claim 7.

9. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: The steps include determining a predetermined sampling format for the current block, The steps include scaling the second block vector parameter based on the predetermined sampling format and determining the first initial block vector parameter of the second color component of the current block, The method is characterized by comprising the step of performing an offset calculation on the first initial block vector parameter based on one or more offset values ​​to determine a candidate block vector parameter for the second color component of the current block. The decoding method according to claim 7.

10. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: A step of calculating an offset for the second block vector parameter based on one or more offset values ​​to determine one or more second initial block vector parameters, The step of determining a predetermined sampling format for the current block, scaling one or more second initial block vector parameters based on the predetermined sampling format, and determining candidate block vector parameters for the second color component of the current block is characterized by including these steps. The decoding method according to claim 7.

11. The step of determining the first block vector parameter of the current block based on the aforementioned block vector parameter candidate list is: The steps include determining whether the candidate block vector parameter list contains one or more candidate block vector parameters that satisfy the first availability condition, The feature includes the step of determining the first block vector parameter of the current block based on the one or more candidate block vector parameters that satisfy the first availability condition if the candidate block vector parameter list contains one or more candidate block vector parameters. The decoding method according to claim 6.

12. The decoding method further, If none of the candidate block vectors in the candidate block vector parameter list satisfy the first availability condition, the method includes the step of adjusting at least one candidate block vector parameter in the candidate block vector parameter list until the at least one candidate block vector parameter satisfies the first availability condition. The decoding method according to claim 11.

13. The fact that one or more candidate block vector parameters satisfy the first availability condition means that, The offset position indicated by one or more candidate block vector parameters does not extend beyond the image boundary, The offset position indicated by one or more candidate block vector parameters does not extend beyond the slice boundary, The offset position indicated in one or more candidate block vector parameters does not cover the current block, The offset position indicated by one or more candidate block vector parameters does not exceed a predetermined usable area, The features include that the offset positions indicated in the one or more candidate block vector parameters have already been reconstructed. The decoding method according to claim 11.

14. The step of determining the first block vector parameter of the current block based on the one or more candidate block vector parameters is: If there is one candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition, the step of determining the one candidate block vector parameter that satisfies the first availability condition as the first block vector parameter, The method is characterized by including the step of determining the first block vector parameter if there are multiple candidate block vector parameters that satisfy the first availability condition in the block vector parameter candidate list, by performing a determination process on the multiple candidate block vector parameters that satisfy the first availability condition. The decoding method according to claim 11.

15. The step of determining the first block vector parameter by performing a determination process on multiple candidate block vector parameters that satisfy the first availability condition is: The steps include determining the first template of the current block, A step of determining a first matching template for each of the multiple candidate block vector parameters based on the first template and the multiple candidate block vector parameters, If the first template and the first matching template satisfy the second condition, the matching error between the first template and the first matching template of the current block is calculated based on a predetermined error criterion, and the first generation value of each of the plurality of candidate block vector parameters is determined. The features include the step of determining the least epochal value from among the first epochal values ​​of each of the plurality of candidate block vector parameters, and determining the candidate block vector parameter corresponding to the least epochal value as the first block vector parameter. The decoding method according to claim 14.

16. The first template type includes at least one of the following: top template, top right template, left template, bottom left template, and top left template. The upper template is located in the decoded region adjacent to the current block above, the upper right template is located in the decoded region adjacent to the current block above, the left template is located in the decoded region adjacent to the current block above, the lower left template is located in the decoded region adjacent to the current block below, and the upper left template is located in the decoded region adjacent to the current block above. The decoding method according to claim 15.

17. The decoding method further, If neither the first template nor the first matching template satisfies the second condition, the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition is determined as the first block vector parameter, or The method is characterized by including the step of determining a candidate block vector parameter located at a predetermined position in the block vector parameter candidate list that satisfies the first availability condition as the first block vector parameter if the first template and the first matching template do not satisfy the second condition. The decoding method according to claim 15.

18. The step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter is: The step of determining the position of the current block, The steps include scaling the position of the current block, determining the position of the first color component region at the same position of the current block, scaling the first block vector parameter, and determining the third block vector parameter of the first color component region at the same position of the current block. The steps include determining a reference block for the first color component based on the position of the first color component region and the third block vector parameter, and determining a first color component reference sample corresponding to the current block based on the reference block for the first color component, The step of determining a reference block for the second color component based on the position of the current block and the first block vector parameter, and determining a reference sample for the second color component corresponding to the current block based on the reference block for the second color component, is characterized by comprising these steps. The decoding method according to any one of claims 1 to 17.

19. The step of determining the first color component reference sample corresponding to the current block based on the first color component reference block is: The method is characterized by including the step of performing a downsampling process on the reference block of the first color component to determine the first color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample. The decoding method according to claim 18.

20. The step of determining the second color component reference sample corresponding to the current block based on the second color component reference block is: The process includes the steps of performing an upsampling process on the reference block of the second color component to determine the second color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample, Correspondingly, the decoding method further includes the step of performing a downsampling process on the predicted value of the second color component of the current block. The decoding method according to claim 18.

21. The decoding method further, The steps include determining the first template of the current block, The method is characterized by including the step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first template. The decoding method according to claim 18.

22. The decoding method further, The steps include determining the first template of the current block, A step of determining a second matching template for the current block based on the first block vector parameters and the first template, The method is characterized by including the step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the second matching template. The decoding method according to claim 18 or 21.

23. The step of establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample is: The process includes the step of determining a first lookup table based on the first color component reference sample and the second color component reference sample, wherein the first lookup table is used to record the value of the corresponding second color component when the index keyword is the first color component. The decoding method according to claim 1.

24. The step of establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample is: The method includes the step of determining a first discrete model based on the first color component reference sample and the second color component reference sample, wherein the first discrete model is used to show the mapping relationship between the first color component and the second color component. The decoding method according to claim 1.

25. The decoding method further, The method is characterized by including the step of performing a mapping process on the first color component reference sample, thereby bringing the first color component reference sample within a predetermined sample range. The decoding method according to claim 23 or 24.

26. The decoding method further, The method is characterized by including the step of, if the first reference sample values ​​in the first color component reference sample are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample, then sequentially overwriting the samples according to the sample order, and setting the last second reference sample value to a value that has a mapping relationship with the first reference sample value. The decoding method according to claim 23 or 24.

27. The decoding method further, The method is characterized by including the step of, if the first reference sample values ​​in the first color component reference sample are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample, calculating an average value for the multiple second reference sample values ​​and setting the obtained average value to a value that has a mapping relationship with the first reference sample value. The decoding method according to claim 23 or 24.

28. The decoding method further, The steps include determining a reconstructed pixel sample of the first color component region at the same position in the current block, The step of determining the first color component sample value of the current block based on the reconstructed pixel sample of the first color component region is characterized by including the step of The decoding method according to claim 1.

29. The step of determining the 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 is: If a first color component value equal to the first color component sample value is found within the mapping relationship, the step of 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 is included. The decoding method according to claim 1.

30. The decoding method further, The following steps are included: if no first color component value equal to the first color component sample value is found within the mapping relationship, a correction process is performed on the first color component sample value to determine the first color component correction value, and the mapping relationship is continuously searched for whether or not a first color component value equal to the first color component correction value exists. The decoding method according to claim 29.

31. The step of performing a correction process on the first color component reconstruction value and determining the first color component correction value is: The method is characterized by including the step of performing an offset calculation on the first color component sample value based on one or more predetermined offset values, and determining the first color component correction value. The decoding method according to claim 30.

32. The decoding method further, If no first color component value equal to the first color component correction value is found within the mapping relationship, the method includes the step of calculating an average value for the second color component reference sample and determining the obtained average value as the predicted value of the second color component of the current block. The decoding method according to claim 30.

33. The step of determining the 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 is: The steps include determining a first initial predicted value for 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, The step of performing a correction operation on the first initial predicted value and determining the predicted value of the second color component of the current block is characterized by including this step. The decoding method according to claim 1.

34. The step of performing a correction operation on the first initial predicted value and determining the predicted value of the second color component of the current block is: A step of performing a prediction process on the second color component of the current block based on a first predetermined mode and determining a second initial predicted value of the second color component of the current block, wherein the first predetermined mode includes at least one of the PLANAR mode, DM mode, DC mode, and CCLM mode. The features include the step of 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. The decoding method according to claim 33.

35. The decoding method further, If there are multiple first block vector parameters, the steps include determining multiple third initial predicted values ​​for the second color component of the current block, The step of performing a weighted calculation on the plurality of third initial predicted values ​​to determine the predicted value of the second color component of the current block is characterized by including this step. The decoding method according to claim 1.

36. The decoding method further, If the first color component block of the current block includes multiple candidate blocks, the steps include determining the second block vector parameter for each of the multiple candidate blocks. The steps include: constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter of each of the plurality of candidate blocks; and determining a list of first block vector parameters for the second color component of the current block based on the list of candidate block vector parameters; The method is characterized by comprising the steps of establishing a mapping relationship between a first color component and a second color component based on the plurality of first block vector parameters, and determining a 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. The decoding method according to claim 4.

37. The decoding method further, The steps include determining a set of first color component reference samples and a second color component reference sample corresponding to the current block based on the plurality of first block vector parameters, The steps include establishing multiple candidate mapping relationships between the first and second color components based on a first color component reference sample and a second color component reference sample corresponding to multiple sets of the current block, The steps include: decoding the bitstream and determining the mapping relation index value, A step of determining a target mapping relationship based on the mapping relationship index value and the plurality of candidate mapping relationships, The step of determining a predicted value for the second color component of the current block based on the target mapping relationship and the sample value of the first color component of the current block is characterized by including the step of determining a predicted value for the second color component of the current block. The decoding method according to claim 36.

38. The decoding method further, The steps include determining a set of first color component reference samples and a second color component reference sample corresponding to the current block based on the plurality of first block vector parameters, The steps include establishing multiple candidate mapping relationships between the first and second color components based on a first color component reference sample and a second color component reference sample corresponding to multiple sets of the current block, The steps include: calculating matching errors for the multiple candidate mapping relationships based on a template matching method, and determining the second-generation value of each of the multiple candidate mapping relationships; The steps include determining the minimum value from among the second-order values ​​of each of the multiple candidate mapping relationships, and determining the candidate mapping relationship corresponding to the minimum value as the target mapping relationship, The step of determining a predicted value for the second color component of the current block based on the target mapping relationship and the sample value of the first color component of the current block is characterized by including the step of determining a predicted value for the second color component of the current block. The decoding method according to claim 36.

39. The step of calculating the matching error for the plurality of candidate mapping relationships based on the template matching method and determining the second-generation value of each of the plurality of candidate mapping relationships is: The steps include determining the first template of the current block, The steps include determining the reconstructed pixel sample value of the first color component region template at the same position in the first template, The steps include determining the predicted value of each second color component in the plurality of mapping relationships of the first template based on the plurality of candidate mapping relationships and the reconstructed pixel sample values ​​of the first color component region template, The method is characterized by including the step of calculating a cost based on the reconstructed value of the second color component of the first template and the predicted value of each of the multiple mapping relationships of the first template, and determining the second value of each of the multiple candidate mapping relationships. The decoding method according to claim 38.

40. The decoding method further, The steps include: decoding the bitstream and determining the value of the first syntax element flag information; The first syntax element flag information indicates that the target prediction mode should be used for the second color component of the current block, and the step of determining the first block vector parameter of the current block is performed, characterized in that The decoding method according to any one of claims 1 to 39.

41. The decoding method further, The steps include determining the first color component region at the same position in the current block, The step of determining to use the target prediction mode for the second color component of the current block if the DM mode is used for the current block and the first color component region is predicted based on the block vector is also included. The decoding method according to claim 40.

42. The decoding method further, The steps include: decoding the bitstream and determining the value of the second syntax element flag information; The method is characterized by the step of decoding the bitstream and determining the value of the first syntax element flag information if the second syntax element flag information indicates that the use of target prediction mode is permitted for the second color component of the current block. The decoding method according to claim 40.

43. An encoding method applied to an encoder, The steps are to determine the first block vector parameter of the current block, The steps include determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter, and establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample, An encoding method characterized by comprising the step of determining a 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.

44. The step of determining the first block vector parameter of the current block is: The steps include determining the first color component block of the current block, If the prediction mode of the first color component block satisfies the first condition, the steps include determining the second block vector parameter of the first color component block, The feature includes the step of determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block. The encoding method according to claim 43.

45. The step of determining the first color component block of the current block is: The steps include determining the first color component region at the same position in the current block, The features include the step of determining the first color component block of the current block from among a plurality of blocks separated from the first color component region. The encoding method according to claim 44.

46. The step of determining the first color component block of the current block from among a plurality of blocks separated from the first color component region is: The steps include determining at least one candidate block at a predetermined position from among a plurality of blocks separated from the first color component region, The step of determining the first color component block of the current block based on the at least one candidate block is characterized by including the step of The encoding method according to claim 45.

47. The aforementioned encoding method further, If the first color component block is predicted based on the block vector, the step is to determine whether or not to use the target prediction mode for the current block. The method is characterized by including the step of determining that the prediction mode of the first color component block satisfies a first condition when the target prediction mode is used for the current block. The encoding method according to claim 44.

48. The step of determining the first block vector parameter of the current block based on the second block vector parameter of the first color component block is: The steps include constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter, The step of determining the first block vector parameter of the current block based on the block vector parameter candidate list is characterized by including the step of The encoding method according to claim 44.

49. The step of constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter is: The steps include adjusting the second block vector parameter and determining a candidate block vector parameter for the second color component of the current block, The step of adding the candidate block vector parameter to the candidate block vector parameter list is included. The encoding method according to claim 48.

50. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: The steps include determining a predetermined sampling format for the current block, The step of scaling the second block vector parameter based on the predetermined sampling format and determining a candidate block vector parameter for the second color component of the current block is included. The encoding method according to claim 49.

51. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: The steps include determining a predetermined sampling format for the current block, The steps include scaling the second block vector parameter based on the predetermined sampling format and determining the first initial block vector parameter of the second color component of the current block, The method is characterized by comprising the step of performing an offset calculation on the first initial block vector parameter based on one or more offset values ​​to determine a candidate block vector parameter for the second color component of the current block. The encoding method according to claim 49.

52. The step of adjusting the second block vector parameter and determining the candidate block vector parameter for the second color component of the current block is: A step of calculating an offset for the second block vector parameter based on one or more offset values ​​to determine one or more second initial block vector parameters, The step of determining a predetermined sampling format for the current block, scaling one or more second initial block vector parameters based on the predetermined sampling format, and determining candidate block vector parameters for the second color component of the current block is characterized by including these steps. The encoding method according to claim 49.

53. The step of determining the first block vector parameter of the current block based on the aforementioned block vector parameter candidate list is: The steps include determining whether the candidate block vector parameter list contains one or more candidate block vector parameters that satisfy the first availability condition, The feature includes the step of determining the first block vector parameter of the current block based on the one or more candidate block vector parameters that satisfy the first availability condition if the candidate block vector parameter list contains one or more candidate block vector parameters. The encoding method according to claim 48.

54. The aforementioned encoding method further, If none of the candidate block vectors in the candidate block vector parameter list satisfy the first availability condition, the method includes the step of adjusting at least one candidate block vector parameter in the candidate block vector parameter list until the at least one candidate block vector parameter satisfies the first availability condition. The encoding method according to claim 53.

55. The fact that one or more candidate block vector parameters satisfy the first availability condition means that, The offset position indicated by one or more candidate block vector parameters does not extend beyond the image boundary, The offset position indicated by one or more candidate block vector parameters does not extend beyond the slice boundary, The offset position indicated in one or more candidate block vector parameters does not cover the current block, The offset position indicated by one or more candidate block vector parameters does not exceed a predetermined usable area, The features include that the offset positions indicated in the one or more candidate block vector parameters have already been reconstructed. The encoding method according to claim 53.

56. The step of determining the first block vector parameter of the current block based on the one or more candidate block vector parameters is: If there is one candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition, the step of determining the one candidate block vector parameter that satisfies the first availability condition as the first block vector parameter, The method is characterized by including the step of determining the first block vector parameter if there are multiple candidate block vector parameters that satisfy the first availability condition in the block vector parameter candidate list, by performing a determination process on the multiple candidate block vector parameters that satisfy the first availability condition. The encoding method according to claim 53.

57. The step of determining the first block vector parameter by performing a determination process on multiple candidate block vector parameters that satisfy the first availability condition is: The steps include determining the first template of the current block, A step of determining a first matching template for each of the multiple candidate block vector parameters based on the first template and the multiple candidate block vector parameters, If the first template and the first matching template satisfy the second condition, the matching error between the first template and the first matching template of the current block is calculated based on a predetermined error criterion, and the first generation value of each of the plurality of candidate block vector parameters is determined. The features include the step of determining the least epochal value from among the first epochal values ​​of each of the plurality of candidate block vector parameters, and determining the candidate block vector parameter corresponding to the least epochal value as the first block vector parameter. The encoding method according to claim 56.

58. The first template type includes at least one of the following: top template, top right template, left template, bottom left template, and top left template. The upper template is located in the upper encoded region adjacent to the current block; the upper right template is located in the upper right encoded region adjacent to the current block; the left template is located in the left encoded region adjacent to the current block; the lower left template is located in the lower left encoded region adjacent to the current block; and the upper left template is located in the upper left encoded region adjacent to the current block. The encoding method according to claim 57.

59. The aforementioned encoding method further, If neither the first template nor the first matching template satisfies the second condition, the first candidate block vector parameter in the block vector parameter candidate list that satisfies the first availability condition is determined as the first block vector parameter, or The method is characterized by including the step of determining a candidate block vector parameter located at a predetermined position in the block vector parameter candidate list that satisfies the first availability condition as the first block vector parameter if the first template and the first matching template do not satisfy the second condition. The encoding method according to claim 57.

60. The step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter is: The step of determining the position of the current block, The steps include scaling the position of the current block, determining the position of the first color component region at the same position of the current block, scaling the first block vector parameter, and determining the third block vector parameter of the first color component region at the same position of the current block. The steps include determining a reference block for the first color component based on the position of the first color component region and the third block vector parameter, and determining a first color component reference sample corresponding to the current block based on the reference block for the first color component, The step of determining a reference block for the second color component based on the position of the current block and the first block vector parameter, and determining a reference sample for the second color component corresponding to the current block based on the reference block for the second color component, is characterized by comprising these steps. The encoding method according to any one of claims 43 to 59.

61. The step of determining the first color component reference sample corresponding to the current block based on the first color component reference block is: The method is characterized by including the step of performing a downsampling process on the reference block of the first color component to determine the first color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample. The encoding method according to claim 60.

62. The step of determining the second color component reference sample corresponding to the current block based on the second color component reference block is: The process includes the steps of performing an upsampling process on the reference block of the second color component to determine the second color component reference sample corresponding to the current block, thereby making the resolution of the first color component reference sample the same as the resolution of the second color component reference sample, Correspondingly, the encoding method further includes the step of performing a downsampling process on the predicted value of the second color component of the current block. The encoding method according to claim 60.

63. The aforementioned encoding method further, The steps include determining the first template of the current block, The method is characterized by including the step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the first template. The encoding method according to claim 60.

64. The aforementioned encoding method further, The steps include determining the first template of the current block, A step of determining a second matching template for the current block based on the first block vector parameters and the first template, The method is characterized by including the step of determining a first color component reference sample and a second color component reference sample corresponding to the current block based on the second matching template. The encoding method according to claim 60.

65. The step of establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample is: The process includes the step of determining a first lookup table based on the first color component reference sample and the second color component reference sample, wherein the first lookup table is used to record the value of the corresponding second color component when the index keyword is the first color component. The encoding method according to claim 43.

66. The step of establishing a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample is: The method includes the step of determining a first discrete model based on the first color component reference sample and the second color component reference sample, wherein the first discrete model is used to show the mapping relationship between the first color component and the second color component. The encoding method according to claim 43.

67. The aforementioned encoding method further, The method is characterized by including the step of performing a mapping process on the first color component reference sample, thereby bringing the first color component reference sample within a predetermined sample range. The encoding method according to claim 65 or 66.

68. The aforementioned encoding method further, The method is characterized by including the step of, if the first reference sample values ​​in the first color component reference sample are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample, then sequentially overwriting the samples according to the sample order, and setting the last second reference sample value to a value that has a mapping relationship with the first reference sample value. The encoding method according to claim 65 or 66.

69. The aforementioned encoding method further, The method is characterized by including the step of, if the first reference sample values ​​in the first color component reference sample are the same and correspond to multiple different second reference sample values ​​in the second color component reference sample, calculating an average value for the multiple second reference sample values ​​and setting the obtained average value to a value that has a mapping relationship with the first reference sample value. The encoding method according to claim 65 or 66.

70. The aforementioned encoding method further, The steps include determining a reconstructed pixel sample of the first color component region at the same position in the current block, The step of determining the first color component sample value of the current block based on the reconstructed pixel sample of the first color component region is characterized by including the step of The encoding method according to claim 43.

71. The step of determining the 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 is: If a first color component value equal to the first color component sample value is found within the mapping relationship, the step of 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 is included. The encoding method according to claim 43.

72. The aforementioned encoding method further, The following steps are included: if no first color component value equal to the first color component sample value is found within the mapping relationship, a correction process is performed on the first color component sample value to determine the first color component correction value, and the mapping relationship is continuously searched for whether or not a first color component value equal to the first color component correction value exists. The encoding method according to claim 71.

73. The step of performing a correction process on the first color component reconstruction value and determining the first color component correction value is: The method is characterized by including the step of performing an offset calculation on the first color component sample value based on one or more predetermined offset values, and determining the first color component correction value. The encoding method according to claim 72.

74. The aforementioned encoding method further, If no first color component value equal to the first color component correction value is found within the mapping relationship, the method includes the step of calculating an average value for the second color component reference sample and determining the obtained average value as the predicted value of the second color component of the current block. The encoding method according to claim 72.

75. The step of determining the 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 is: The steps include determining a first initial predicted value for 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, The step of performing a correction operation on the first initial predicted value and determining the predicted value of the second color component of the current block is characterized by including this step. The encoding method according to claim 43.

76. The step of performing a correction operation on the first initial predicted value and determining the predicted value of the second color component of the current block is: A step of performing a prediction process on the second color component of the current block based on a first predetermined mode and determining a second initial predicted value of the second color component of the current block, wherein the first predetermined mode includes at least one of the PLANAR mode, DM mode, DC mode, and CCLM mode. The features include the step of 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. The encoding method according to claim 75.

77. The aforementioned encoding method further, If there are multiple first block vector parameters, the steps include determining multiple third initial predicted values ​​for the second color component of the current block, The step of performing a weighted calculation on the plurality of third initial predicted values ​​to determine the predicted value of the second color component of the current block is characterized by including this step. The encoding method according to claim 43.

78. The aforementioned encoding method further, If the first color component block of the current block includes multiple candidate blocks, the steps include determining the second block vector parameter for each of the multiple candidate blocks. The steps include: constructing a list of candidate block vector parameters for the second color component of the current block based on the second block vector parameter of each of the plurality of candidate blocks; and determining a list of first block vector parameters for the second color component of the current block based on the list of candidate block vector parameters; The method is characterized by comprising the steps of establishing a mapping relationship between a first color component and a second color component based on the plurality of first block vector parameters, and determining a 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. The encoding method according to claim 46.

79. The aforementioned encoding method further, The steps include determining a set of first color component reference samples and a second color component reference sample corresponding to the current block based on the plurality of first block vector parameters, The steps include establishing multiple candidate mapping relationships between the first and second color components based on a first color component reference sample and a second color component reference sample corresponding to multiple sets of the current block, The step of determining a target mapping relationship from among the aforementioned multiple candidate mapping relationships, The step of determining a predicted value for the second color component of the current block based on the target mapping relationship and the sample value of the first color component of the current block is characterized by including the step of determining a predicted value for the second color component of the current block. The encoding method according to claim 78.

80. The step of determining the target mapping relationship from among the aforementioned multiple candidate mapping relationships is: The steps include: calculating the cost for each of the multiple candidate mapping relationships based on the rate-distortion cost method and determining multiple rate-distortion cost results; The features include the step of determining the smallest rate distortion cost result from among the plurality of rate distortion cost results, and determining the candidate mapping relationship corresponding to the smallest rate distortion cost result as the target mapping relationship. The encoding method according to claim 79.

81. The aforementioned encoding method further, A step of determining a mapping relationship index value, wherein the mapping relationship index value is used to indicate a candidate mapping relationship corresponding to the smallest rate strain cost result among the plurality of rate strain cost results, The step of encoding the mapping relation index value and writing the resulting encoded bits to a bitstream is included. The encoding method according to claim 80.

82. The aforementioned encoding method further, The steps include determining a set of first color component reference samples and a second color component reference sample corresponding to the current block based on the plurality of first block vector parameters, The steps include establishing multiple candidate mapping relationships between the first and second color components based on a first color component reference sample and a second color component reference sample corresponding to multiple sets of the current block, The steps include: calculating matching errors for the multiple candidate mapping relationships based on a template matching method, and determining the second-generation value of each of the multiple candidate mapping relationships; The steps include determining the minimum value from among the second-order values ​​of each of the multiple candidate mapping relationships, and determining the candidate mapping relationship corresponding to the minimum value as the target mapping relationship, The step of determining a predicted value for the second color component of the current block based on the target mapping relationship and the sample value of the first color component of the current block is characterized by including the step of determining a predicted value for the second color component of the current block. The encoding method according to claim 78.

83. The step of calculating the matching error for the plurality of candidate mapping relationships based on the template matching method and determining the second-generation value of each of the plurality of candidate mapping relationships is: The steps include determining the first template of the current block, The steps include determining the reconstructed pixel sample value of the first color component region template at the same position in the first template, The steps include determining the predicted value of each second color component in the plurality of mapping relationships of the first template based on the plurality of candidate mapping relationships and the reconstructed pixel sample values ​​of the first color component region template, The method is characterized by including the step of calculating a cost based on the reconstructed value of the second color component of the first template and the predicted value of each of the multiple mapping relationships of the first template, and determining the second value of each of the multiple candidate mapping relationships. The encoding method according to claim 82.

84. The aforementioned encoding method further, The steps include determining the prediction mode of the current block, If the prediction mode indicates that a target prediction mode should be used for the second color component of the current block, the prediction mode is characterized by the step of determining the first block vector parameter of the current block. The encoding method according to any one of claims 43 to 83.

85. The step of determining the prediction mode of the current block is: A step of determining a plurality of candidate modes, wherein the plurality of candidate modes include at least a target prediction mode, The steps include: calculating costs for each of the multiple candidate modes based on a predetermined cost scheme and determining multiple third-generation values; The steps include: determining the least value from among the plurality of third values, and determining a candidate mode corresponding to the least value as the prediction mode for the current block; The predetermined cost method is characterized by including at least one of the rate-distortion cost method and the template matching method. The encoding method according to claim 84.

86. The aforementioned encoding method further, The steps include determining the first color component region at the same position in the current block, The step of determining to use the target prediction mode for the second color component of the current block if the DM mode is used for the current block and the first color component region is predicted based on the block vector is also included. The encoding method according to claim 84.

87. The aforementioned encoding method further, A step of determining the value of a first syntax element flag information, wherein the first syntax element flag information is used to indicate whether or not to use a target prediction mode for the second color component of the current block. The method is characterized by comprising the steps of encoding the value of the first syntax element flag information and writing the resulting encoded bits to a bitstream. The encoding method according to claim 84.

88. The aforementioned encoding method further, A step of determining the value of a second syntax element flag information, wherein the second syntax element flag information is used to indicate whether or not the use of a target prediction mode is permitted for the second color component of the current block. The method is characterized by comprising the steps of encoding the value of the second syntax element flag information and writing the resulting encoded bits to a bitstream. The encoding method according to claim 87.

89. A bitstream, wherein the bitstream is generated by bit encoding based on encoding waiting information, and the encoding waiting information is The system includes at least one of the values ​​of a first syntax element flag information, a second syntax element flag information, and a mapping relation index value, wherein the first syntax element flag information is used to indicate whether or not to use the target prediction mode for the second color component of the current block, and the second syntax element flag information is used to indicate whether or not to allow the use of the target prediction mode for the second color component of the current block. Bitstream.

90. An encoder comprising a first decision unit, a first establishment unit, and a first prediction unit, The first decision unit is configured to determine the first block vector parameter of the current block, The first establishment unit is configured to determine a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameter, and to establish a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample. The encoder is characterized in that the first prediction unit is configured to determine a 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.

91. An encoder comprising a first memory and a first processor, The first memory is used to store computer programs that can be executed on the first processor. The encoder is characterized in that the first processor is used to execute the encoding method described in any one of claims 43 to 88 when executing the computer program.

92. A decoder comprising a second decision unit, a second establishment unit, and a second prediction unit, The second decision unit is configured to determine the first block vector parameter of the current block, The second establishment unit is configured to determine a first color component reference sample and a second color component reference sample corresponding to the current block based on the first block vector parameters, and to establish a mapping relationship between the first color component and the second color component based on the first color component reference sample and the second color component reference sample. The decoder is characterized in that the second prediction unit is configured to determine a 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.

93. A decoder, comprising a second memory and a second processor, The second memory is used to store computer programs that can be executed on the second processor. The decoder is characterized in that the second processor is used to execute the decoding method described in any one of claims 1 to 42 when executing the computer program.

94. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program, when executed, implements either the decoding method described in any one of claims 1 to 42, or the encoding method described in any one of claims 43 to 88.