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

CN120323020APending Publication Date: 2025-07-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280102291.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

In the H.266/VVC video coding standard, the single chroma prediction mode leads to low coding efficiency and fails to effectively utilize the relevant information of the same luma block, especially in video sequences of screen content type.

Method used

By determining the luminance block vector parameters of the current block, the vector parameters of the chrominance block are determined, thus improving chrominance prediction and making full use of relevant information from co-located luminance blocks to enhance the accuracy of chrominance prediction.

Benefits of technology

It improves encoding and decoding efficiency, saves bitrate, and enhances encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120323020A_ABST
    Figure CN120323020A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a coding and decoding method, a code stream, a coder, a decoder and a storage medium. The method comprises the steps that the coder and the decoder determine a first color component block of a current block; if the first color component block performs intra-frame prediction based on the block vector, determining a second block vector parameter of a second color component block according to a first block vector parameter of the first color component block; and determining a prediction value of the second color component according to the second block vector parameter.
Need to check novelty before this filing date? Find Prior Art

Description

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

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

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

[0003] In the related art, for the Direct Mode (DM), if the luminance block uses the IBC mode, then the chrominance prediction mode is set improperly, resulting in inaccurate chrominance prediction of the current block and loss of coding efficiency.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium, which can save bit rate, improve coding and decoding efficiency, and thus enhance coding and decoding performance.

[0006] The technical solution of the embodiment of the present application can be implemented as follows:

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

[0008] Determine a first color component block of the current block;

[0009] If the first color component block is intra-predicted based on a block vector, determining a second block vector parameter of a second color component block of the current block according to a first block vector parameter of the first color component block;

[0010] A predicted value of the second color component is determined based on the second block vector parameter.

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

[0012] Determine a first color component block of the current block;

[0013] If the first color component block is intra-predicted based on a block vector, determining a second block vector parameter of a second color component block of the current block according to a first block vector parameter of the first color component block;

[0014] A predicted value of the second color component is determined based on the second block vector parameter.

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

[0016] Prediction mode identification information and color sampling format of the current block.

[0017] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit; wherein,

[0018] The first determination unit is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of the current block based on a first block vector parameter of the first color component block; and determine a predicted value of the second color component based on the second block vector parameter.

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

[0020] The first memory is used to store a computer program that can be run on the first processor;

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

[0022] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second determining unit; wherein,

[0023] The second determination unit is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of a second color component block of the current block according to the first block vector parameter of the first color component block; and determine a predicted value of the second color component according to the second block vector parameter.

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

[0025] The second memory is used to store a computer program that can be run on the second processor;

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

[0027] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method as described in the first aspect or the method as described in the second aspect is implemented.

[0028] The embodiment of the present application provides a coding and decoding method, an encoder, a decoder and a storage medium, wherein the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on the block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in the embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on the block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding and decoding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding and decoding efficiency, and thus improve coding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0031] FIG3 is a first schematic diagram of the positional relationship between a luma CU and a chroma CU provided in an embodiment of the present application;

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

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

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

[0035] FIG6 is a schematic diagram of a decoding method;

[0036] FIG7 is a second schematic diagram of the positional relationship between a luma CU and a chroma CU provided in an embodiment of the present application;

[0037] FIG8 is a third schematic diagram of the positional relationship between a luma CU and a chroma CU provided in an embodiment of the present application;

[0038] FIG9 is a fourth schematic diagram of the positional relationship between a luma CU and a chroma CU provided in an embodiment of the present application;

[0039] FIG10 is a fifth schematic diagram of the positional relationship between a luma CU and a chroma CU provided in an embodiment of the present application;

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

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

[0042] FIG13 is a schematic diagram of a structure for determining optimal chromaticity BV parameters according to an embodiment of the present application;

[0043] FIG14 is a schematic diagram showing the coordinates and block sizes of the current chroma block and the co-located luminance region;

[0044] FIG15 is a schematic diagram of a co-located brightness region search according to an embodiment of the present application;

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

[0046] FIG17 is a schematic diagram of a template motion compensation provided by an embodiment of the present application;

[0047] FIG18 is a schematic diagram of a block replication structure based on the IBC extension mode provided in an embodiment of the present application;

[0048] FIG19 is a schematic diagram of an encoding method;

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

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

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

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

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

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

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

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

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

[0058] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

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

[0060] Coding Block (CB);

[0061] Intra block copy (IBC);

[0062] Screen Content Coding (SCC);

[0063] Block Maching (BM);

[0064] Coding Unit (CU);

[0065] Block Vector (BV);

[0066] Motion Vector (MV);

[0067] Direct Block Vector (DBV);

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

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

[0070] Merge Mode

[0071] Planar Mode;

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

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

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

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

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

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

[0078] S101: Derive block vector.

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

[0080] Here, the IBC mode is divided into IBC MERGE mode and IBC AMVP mode. When deriving bvL, it is necessary to establish an IBC block vector candidate list bvCandList. The following will introduce the process of establishing the IBC MERGE list in detail. Among them, the process of establishing the IBC AMVP list is consistent with that of the IBC MERGE list, but the maximum number of candidates for the two is different.

[0081] Step 1: When IsGt4by4 is equal to TRUE (the variable IsGt4by4 is TRUE when the width multiplied by the height of the luma block is greater than 16), the derivation process of the spatial block vector candidates from the adjacent coding units specified in the decoding specification is called using the luma block position (xCb, yCb), the width cbWidth and the height cbHeight of the luma block as input, and the output is the availability flags availableFlagA1 and availableFlagB1 and the block vectors bvA1 and bvB1. The relative positions of the adjacent blocks A1 and B1 with respect to the current block are shown in Figure 2.

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

[0083] i=0

[0084] if(availableFlagA1)

[0085] bvCandList[i++]=bvA1

[0086] if(availableFlagB1)

[0087] bvCandList[i++]=bvB1

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

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

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

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

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

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

[0094] numCurrCand increases by 1.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0126] xVb=(x+(bv[0]>>5))&(IbcBufWidthC-1);

[0127] yVb=(y+(bv[1]>>5))&((CtbSizeY / subHeightC)-1);

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

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

[0130] Table 1

[0131] sps_chroma_format_idc color sampling format SubWidthCSubHeightC0 monochrome 11

[0132] 14:2:02224:2:22134:4:411

[0133] S103: derive residual samples.

[0134] For residual samples, the residual decoding process specified by the decoding specification can be called.

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

[0136] For reconstructing samples (ie, reconstructing pixel values), an image reconstruction process of a specified color component specified by the decoding specification may be called.

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

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

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

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

[0141] otherwise:

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

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

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

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

[0146] Among them, the IntraTmp mode is newly introduced in ECM. If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, and it is IntraTmp mode, lumaIntraPredMode is set to be equal to NTRA_PLANAR.

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

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

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

[0150] otherwise:

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

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

[0153] Table 2

[0154]

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

[0156] Table 3

[0157] mode X012345678910111213141516mode Y016162636465662356810121314mode Y1820222324262830313334353637383940mode X54555657585960616263646566 mode Y52535455555656575758595960

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

[0159] When dual-tree partitioning is used for I-frames, independent block partitioning structures are allowed for the luma and chroma components. In this case, the luma component corresponding to the chroma CU may contain multiple luma CUs, as shown in Figure 3. In H.266 / VVC, the chroma CU inherits the intra prediction mode of the CU at the center of the corresponding luma block, that is, intra_chroma_pred_mode is equal to 4.

[0160] The CU positions used in the DM mode are described in detail as follows:

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

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

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

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

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

[0166] Table 4

[0167]

[0168] Table 5

[0169] Value of intra_chroma_pred_modeBin string010011012110311140

[0170] Table 6

[0171]

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

[0173] In the related art, under dual-tree partitioning: for the DM mode, if the corresponding luminance block is in IBC mode, then the obtained chrominance prediction mode is DC mode, which results in a loss of coding efficiency. This is because for chrominance prediction, a fixed DC mode is used for prediction, which not only causes the predicted pixels to all be the same value, but also fails to express the chrominance texture feature content of the current block; and in chrominance prediction, the information of the same-position luminance block of the IBC mode is not used, nor is there a prediction algorithm for block copying similar to IBC, making it impossible to effectively compress video sequences similar to screen content. In short, the current chrominance prediction mode is relatively simple, which makes the chrominance prediction of the current block inaccurate, resulting in a loss of coding efficiency.

[0174] In order to solve the above problems, the embodiment of the present application provides a coding and decoding method, an encoder, a decoder and a storage medium, wherein the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on the block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in the embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on the block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding and decoding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding and decoding efficiency, and thus improve coding and decoding performance.

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

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

[0177] Referring to FIG4B , which shows a block diagram of a decoder provided in an embodiment of the present application, as shown in FIG4B , the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG4A , a code stream of the video signal is output; the code stream is input to the decoder 200 and first passes through the decoding unit 201 to obtain decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from the previously decoded block of the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0178] Furthermore, the embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein FIG5 shows a schematic diagram of a network architecture of a coding and decoding system provided by the embodiment of the present application. As shown in FIG5 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which is not specifically limited in the embodiment of the present application. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0179] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 4A and the intra-frame prediction unit 203 shown in Figure 4B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.

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

[0181] An embodiment of the present application provides a decoding method, which is applied to a decoder. FIG6 is a schematic diagram of the decoding method. As shown in the figure, the decoding method performed by the decoder may include the following steps:

[0182] Step 101: Determine the first color component block of the current block.

[0183] It should be noted that the method of the embodiment of the present application can be applied to an encoder or a decoder. In addition, the prediction mode here can specifically refer to an intra-frame prediction mode. Here, assuming that the first color component is a luma component and the second color component is a chroma component, then more specifically, this is a method for determining a chroma intra-frame prediction mode.

[0184] It should also be noted that in this embodiment of the present application, the current block includes at least a first color component and a second color component. For the first color component of the current block, the block can be simply referred to as a first color component block; and when the first color component is a luminance component, the first color component block can also be referred to as a luminance block. Similarly, for the second color component of the current block, the block can be simply referred to as a second color component block; and when the second color component is a chrominance component, the second color component block can also be referred to as a chrominance block.

[0185] It should also be noted that under dual-tree partitioning, for the DM mode, when the prediction mode of the luminance block at the same position is the IBC mode, the embodiment of the present application can determine the BV information corresponding to the chrominance of the current block based on the block vector BV information of the luminance block at the same position, and then use the BV information of the chrominance block to perform intra-frame prediction sorting, which can improve the uniformity of the chrominance prediction and thus improve the coding efficiency.

[0186] In some embodiments, determining the first color component block of the current block may include: determining a first color component region at the same location of the current block; and determining the first color component block of the current block from a plurality of blocks divided from the first color component region.

[0187] It should be noted that in an embodiment of the present application, for the current block, the first color component area in the same position can be divided into blocks, for example, by using a binary tree structure, a ternary tree structure, a quadtree structure, etc. to perform block division, and multiple blocks can be obtained, each of which can be regarded as a CU; then the first color component block of the current block is determined from these multiple CUs.

[0188] For example, in Figure 3, the area filled with diagonal lines represents the luminance area at the same location of the chroma CU. This luminance area can be divided into multiple blocks; the block at the center can be selected from these blocks as the corresponding luminance block of the current block. For example, the block filled with black in Figure 3 is the corresponding luminance block of the current block.

[0189] Further, in some embodiments, determining the first color component block of the current block from the multiple blocks divided by the first color component area may include: selecting a target block from the multiple blocks divided by the first color component area, and using the target block as the first color component block of the current block.

[0190] The target block can be a block at any position. In a specific embodiment, the block at the center of the first color component area is selected as the target block; or the block at the upper left corner of the first color component area is selected as the target block; or the block at the lower right corner of the first color component area is selected as the target block.

[0191] It should be understood that in the embodiment of the present application, the target block serving as the first color component block may be a block at any position among the multiple blocks shown in FIG3 . For example, the target block may be the block at the center of the collocated luminance region shown in FIG3 (a block filled with black), the block at the upper left corner of the collocated luminance region shown in FIG7 (a block filled with black), the block at the lower right corner of the collocated luminance region shown in FIG8 (a block filled with black), or even the block at the upper right corner or the block at the lower left corner of the collocated luminance region, or even the block at the center of the upper left region, etc., and this is not specifically limited here.

[0192] Furthermore, in an embodiment of the present application, when selecting a target block from multiple blocks divided into the first color component area, the position information of the current block can be determined first; then, the position information of the current block can be scaled according to a preset sampling format (color sampling format) to obtain the co-located area position information corresponding to the current block; and then, the target position information can be determined based on the co-located area position information, and the block containing the target position information can be used as the target block.

[0193] It can be understood that, in some embodiments, the mapping relationship between the position information (x, y) of the chrominance block and the position information (xCb, yCb) of the scaled luminance block is as shown in Table 7.

[0194] Table 7

[0195] sps_chroma_format_idc color sampling format xCbyCb0 monochrome--14:2:0x<<1y<<124:2:2x<<1y34:4:4xy

[0196] Exemplarily, in an embodiment of the present application, when the block at the center position in the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight. The block at the center position of the luminance area is the luminance block (the black-filled block in Figure 3) containing the position coordinates (xCb+cbWidth>>1, yCb+cbHeight>>1).

[0197] Exemplarily, in an embodiment of the present application, when the block in the upper left corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight. The block at the upper left corner of the luminance area is the luminance block containing the position coordinates (xCb, yCb) (the black-filled block in Figure 7).

[0198] Exemplarily, in an embodiment of the present application, when the block in the lower right corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth and the height is cbHeight. The block at the lower right corner of the luminance area is the luminance block containing the position coordinates (xCb+cbWidth-1, yCb+cbHeight-1) (the black-filled block in Figure 8).

[0199] Further, in some embodiments, determining the first color component block of the current block from a plurality of blocks divided from the first color component area may include: determining at least one candidate block at a preset position from a plurality of blocks divided from the first color component area; traversing at least one candidate block according to a preset order, and determining the first candidate block in the at least one candidate block that is intra-predicted based on a block vector as the first color component block of the current block.

[0200] It should be understood that in this embodiment of the present application, for the first color component block, the determination of whether to perform intra prediction based on a block vector may also be made for at least one candidate block at a preset position. For example, as shown in Figure 9 , this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; multiple positions may be used. Furthermore, the five positions shown in Figure 9 are not specifically limited to these positions.

[0201] It should also be understood that in an embodiment of the present application, the five positions shown in Figure 9 can be obtained in sequence according to a preset order until the candidate block is determined to be intra-frame predicted based on a block vector (that is, encoded and decoded in a mode with BV information), that is, the CU at the first luminance pixel position is found to be intra-frame predicted based on a block vector, and the CU at the first luminance pixel position is used as the corresponding luminance block of the current block, that is, the first color component block.

[0202] That is to say, in an embodiment of the present application, when determining the first color component block, at least one candidate block at a preset position is determined, such as the block containing five luminance pixel positions shown in Figure 9, and is acquired in sequence until it is determined that the obtained block is encoded in a mode with BV information (intra-frame prediction based on block vector), that is, the block at the first luminance pixel position is found to be encoded in a mode with BV information.

[0203] In addition, in an embodiment of the present application, the preset order may include, but is not limited to, the following order: C->TL->TR->BL->BR. Specifically, for the detailed position derivation process of C, TL, TR, BL, and BR, the position information of the current block may be determined first; then, the position information of the current block may be scaled according to a preset sampling format (color sampling format) to obtain the co-located area position information corresponding to the current block; then, the target position information may be determined based on the co-located area position information, and the block containing the target position information may be used as at least one candidate block at a preset position, such as C, TL, TR, BL, and BR.

[0204] Exemplarily, in an embodiment of the present application, when the block at the lower right corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format (see Table 7) to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner position of the current block relative to the luminance pixel in the upper left corner of the image (that is, the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (that is, the entire diagonal filled area of ​​the luminance component in Figure 9) is cbWidth, and the height is cbHeight.

[0205] The coordinate information of the position of the brightness pixel C is (xCb+cbWidth / 2, yCb+cbHeight / 2);

[0206] The coordinate information of the position of the luminance pixel TL is (xCb, yCb);

[0207] The coordinate information of the position of the brightness pixel TR is (xCb+cbWidth-1, yCb);

[0208] The coordinate information of the position of the brightness pixel BL is (xCb, yCb+cbHeight-1);

[0209] The coordinate information of the position of the luminance pixel BR is (xCb+cbWidth-1, yCb+cbHeight-1).

[0210] Thus, for the current block, the corresponding first color component block needs to be determined first. When the first color component is a luminance component, the luminance block (ie, luminance CU) at the corresponding position needs to be determined.

[0211] Further, in some embodiments, determining the first color component block of the current block from the multiple blocks divided by the first color component area may include: determining at least one candidate block at a preset position from the multiple blocks divided by the first color component area; and directly determining the at least one candidate block as the first color component block of the current block.

[0212] It should be understood that in this embodiment of the present application, the first color component block can also be determined based on at least one candidate block at a preset position. For example, as shown in Figure 10 , this also includes CUs at five luma pixel positions. However, this embodiment of the present application is not limited to these five positions; multiple positions are possible. Furthermore, the five positions shown in Figure 10 are not specifically limited to this.

[0213] It should also be understood that in the embodiment of the present application, for the five positions shown in FIG. 10 , the CUs of multiple luminance pixel positions are used as corresponding luminance blocks of the current block, that is, multiple first color component blocks.

[0214] That is, when determining the first color component block, multiple blocks in the same brightness area may be obtained, and the positions of the multiple blocks include but are not limited to the multiple positions in FIG. 10 .

[0215] Furthermore, when determining the first color component block, at least one candidate block at a preset position may be determined from the multiple blocks divided into the first color component region; then, the at least one candidate block is traversed according to a preset order, and the first candidate block among the at least one candidate block that meets the preset condition is determined as the first color component block of the current block. If the candidate block is intra-predicted based on a block vector, and a block vector parameter of a second color component block determined based on the candidate block meets a first usability condition, then the candidate block may be determined to meet the preset condition.

[0216] It should be understood that in this embodiment of the present application, for the first color component block, the determination of whether a preset condition is satisfied can also be performed for at least one candidate block at a preset position. For example, as shown in Figure 9 , this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; multiple positions are possible, and the five positions shown in Figure 9 are not specifically limited to these positions.

[0217] In addition, in an embodiment of the present application, the preset order may include but is not limited to the following order: C->TL->TR->BL->BR. In which, when determining in sequence whether at least one candidate block at a preset position meets the preset conditions, first determine whether the luminance blocks at the five positions obtained are encoded in a mode with BV information, that is, determine whether intra-frame prediction is performed based on the block vector. If not, the luminance block is not obtained, and the prediction mode identification information of the second color component may be not parsed. If one or more luminance blocks at the five positions are encoded in a mode with BV information, the five positions will be re-acquired in sequence until the first luminance block that meets the following conditions is found, which is: determine whether the luminance block is encoded in a mode with BV information, and after adjusting the luminance BV to obtain the chrominance BV, determine whether the chrominance BV is available. If available, this luminance block is selected as the luminance block for finally obtaining the BV, that is, the first color component block.

[0218] Correspondingly, if the chroma BV is not available, the luminance block is not obtained, but prediction is performed using a mode including but not limited to the PLANAR mode or CCLM-type mode or other angle prediction modes; or the first luminance block encoded in a mode with BV information is found, its BV is adjusted to be available, and this luminance block is selected as the luminance block for finally obtaining the BV, that is, the first color component block.

[0219] Among them, the detailed position derivation process of C, TL, TR, BL, and BR includes: assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image (that is, the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block (that is, the entire gray area on the left of the figure below) is cbWidth, and the height is cbHeight.

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

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

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

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

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

[0225] Step 102: If the first color component block is intra-predicted based on the block vector, determine the second block vector parameter of the second color component block of the current block according to the first block vector parameter of the first color component block.

[0226] It should be noted that, in the embodiment of the present application, after determining the first color component block, it is necessary to determine whether the first color component block is intra-predicted based on a block vector. If the first color component block is intra-predicted based on a block vector, that is, if the first color component block is determined to be processed in a mode with BV information, then a first block vector parameter of the first color component block (such as the BV of the luminance block) can be further determined, and a second block vector parameter of the second color component block (such as the BV of the chrominance block) can be determined based on the first block vector parameter of the first color component block.

[0227] It should be understood that in an embodiment of the present application, the condition for determining whether intra-frame prediction is performed based on a block vector may be: the prediction mode of the first color component block is a mode using BV information, wherein the mode using BV information includes but is not limited to an IBC mode or an IntraTMP mode.

[0228] It should be noted that, in the embodiment of the present application, the first block vector parameter represents the vector of the current block pointing to the reference block, and the reference block is obtained by searching in the reconstructed area of ​​the frame where the current block is located (ie, the current image).

[0229] It should also be understood that in the embodiments of the present application, the number of first color component blocks may be any number. That is, the first color component block of the current block is not limited to a single block and may also be composed of multiple blocks. Accordingly, when determining whether to perform intra-frame prediction based on a block vector, a determination needs to be made for each first color component block. Only first color components that meet the requirements for intra-frame prediction based on a block vector can be used to subsequently determine the second block vector parameters of the second color component.

[0230] It is understandable that in this embodiment of the present application, after determining the first color component block, it is necessary to determine whether the first color component block is intra-predicted based on the block vector, that is, to determine whether the first color component block is processed in a mode with BV information. If the first color component block is intra-predicted based on the block vector, then the first block vector parameters of the first color component block can be determined, and the second block vector parameters of the second color component block can be determined based on the first block vector parameters.

[0231] Furthermore, in an embodiment of the present application, if the first color component block is not intra-predicted based on a block vector, that is, the first color component block is not processed in a mode with BV information, then it is possible to choose not to parse the prediction mode identification information of the second color component.

[0232] It should be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block, it is possible to directly choose to determine the first block vector parameters of the first color component block as the second block vector parameters of the second color component block.

[0233] It should be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block, it is also possible to determine a block vector parameter candidate list of the second color component block of the current block based on the first block vector parameters of the first color component block; and then determine the second block vector parameters of the second color component block based on the block vector parameter candidate list.

[0234] That is to say, in the embodiments of the present application, the first block vector parameters of the first color component block can be directly used as the second block vector parameters of the second color component block, or the first block vector parameters can be used to first construct a block vector parameter candidate list of the second color component block, and then the second block vector parameters of the second color component block are determined based on the block vector parameter candidate list.

[0235] In some embodiments, determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block may include: directly using the first block vector parameters of the first color component block as the second block vector parameters of the second color component block; or, adjusting the first block vector parameters of the first color component block to determine the second block vector parameters of the second color component block; or, constructing a block vector parameter candidate list of the second color component block based on the first block vector parameters, and then determining the second block vector parameters of the second color component block based on the block vector parameter candidate list.

[0236] Here, assuming that the first color component block is a luminance block, the first block vector parameter may be the BV of the luminance block, namely BVL; assuming that the second color component block is a chrominance block, the second block vector parameter may be the BV of the chrominance block, namely BVC.

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

[0238] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of a second color component block of a current block based on a first block vector parameter of a first color component block, the first block vector parameter can be adjusted first to determine the candidate block vector parameter of the second color component block; and then the candidate list of block vector parameters can be determined based on the candidate block vector parameter.

[0239] It can be understood that, in an embodiment of the present application, the above adjustment process may include scaling according to the chroma sampling format, wherein the mapping relationship between the luma BV parameter and the scaled chroma BV parameter is shown in Table 8.

[0240] Table 8

[0241] sps_chroma_format_idc color sampling format BVC hor BVC ver 0 monochrome--14:2:0BVL hor >>1BVL ver >>124:2:2BVL hor >>1BVL ver 34:4:4BVL hor BVL ver

[0242] The syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, which is specifically the chroma sampling format. Different types of chroma sampling formats have different corresponding scaling operations.

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

[0244] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters and determining the candidate block vector parameters of the second color component block, the color sampling format of the current block can be determined first; then the first block vector parameters can be scaled according to the color sampling format to determine the candidate block vector parameters.

[0245] That is to say, in an embodiment of the present application, based on Table 8, it is possible to choose to scale according to the chroma sampling format, and add the scaled BVC as a candidate block vector parameter to the chroma BVC candidate list (block vector parameter candidate list).

[0246] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters to determine the candidate block vector parameters of the second color component block, the color sampling format of the current block can be determined first; then, the first block vector parameters can be scaled according to the color sampling format to determine the first initial block vector parameters; finally, the candidate block vector parameters can be determined based on the first initial block vector parameters and one or more numerical values.

[0247] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters and determining the candidate block vector parameters of the second color component block, one or more second initial block vector parameters can be first determined based on the first block vector parameters and one or more numerical values; then, the color sampling format of the current block is determined, and the second initial block vector parameters are scaled according to the color sampling format to determine the candidate block vector parameters.

[0248] It should be noted that the above one or more values ​​can be any number of arbitrary values.

[0249] That is, in the embodiment of the present application, after obtaining the BV of the corresponding luma block, it can be recorded as BVL, and the chroma BV obtained through the BVL can be recorded as BVC. By adjusting the BVL or BVC, a chroma BVC candidate list containing one or more candidates can be constructed. That is, based on Table 8, it can be selected to scale according to the chroma sampling format, and the scaled BVL or BVC can be added as the candidate block vector parameter to the chroma BVC candidate list.

[0250] Exemplarily, in an embodiment of the present application, BVL can be adjusted to form four situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, take four situations: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, take BVL = (BVLhor, BVLver). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is an odd number, four BVC candidate block vector parameters will be formed, and these candidate block vector parameters will be added to the chroma BVC candidate list.

[0251] For example, in an embodiment of the present application, BVL can be adjusted to form four situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, four situations are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, four situations are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor-1, BVLver), BVL = (BVLhor, BVLver-1), and BVL = (BVLhor-1, BVLver-1). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is an odd number or an even number, four BVC candidates will be formed, and these candidates will be added to the chroma BVC candidate list.

[0252] Exemplarily, in an embodiment of the present application, operations under different circumstances of unified parity and even numbers can also be performed by the following calculation: that is, directly taking four cases: BVL = (BVLhor-1, BVLver-1), BVL = (BVLhor+1, BVLver-1), BVL = (BVLho-1r, BVLver+1), and BVL = (BVLhor+1, BVLver+1).

[0253] For example, in an embodiment of the present application, BVL can be adjusted to form multiple situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, BVL=(BVLhor, BVLver), BVL=(BVLhor+1, BVLver), BVL=(BVLhor, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver), BVL=(BVLhor, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-2, BVLver), BVL=(BVLhor, BVLver-2), and other situations are taken, and a list is constructed for these candidates in order. When BVL is even, various cases are taken, such as BVL=(BVLhor, BVLver), BVL=(BVLhor-1, BVLver), BVL=(BVLhor, BVLver-1), BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor-3, BVLver), BVL=(BVLhor, BVLver-3), BVL=(BVLhor-3, BVLver-3), BVL=(BVLhor+2, BVLver), and BVL=(BVLhor, BVLver+2). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is odd or even, multiple BVC candidates will be formed, and these candidates will be added to the chroma BVC candidate list.

[0254] Exemplarily, in the embodiments of the present application, the operations under different circumstances of unified parity and even numbers can also be calculated as follows: that is, directly taking BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor+1, BVLver-1), BVL=(BVLhor-1, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver-1), BVL=(BVLhor-1, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-3, BVLver-1), BVL=(BVLhor-1, BVLver-3), etc.

[0255] Exemplarily, in an embodiment of the present application, the obtained BVC can also be adjusted to obtain nine candidates: that is, set BVC = (BVChor, BVCver), BVC = (BVChor-1, BVCver), BVC = (BVChor, BVCver-1), BVC = (BVChor-1, BVCver-1), BVC = (BVChor+1, BVCver), BVC = (BVChor, BVCver+1), BVC = (BVChor+1, BVCver+1), BVC = (BVChor-1, BVCver+1), BVC = (BVChor+1, BVCver-1), thus forming nine BVC candidates, which are added to the chroma BVC candidate list.

[0256] Exemplarily, in an embodiment of the present application, the obtained BVC may be adjusted to obtain a variety of candidates: that is, setting BVC=(BVChor, BVCver), BVC=(BVChor-1, BVCver), BVC=(BVChor, BVCver-1), BVC=(BVChor-1, BVCver-1), BVC=(BVChor+1, BVCver), BVC=(BVChor, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, +1, BVCver-1), BVC=(BVChor-2, BVCver), BVC=(BVChor, BVCver-2), BVC=(BVChor-2, BVCver-2), BVC=(BVChor+2, BVCver), BVC=(BVChor, BVCver+2), BVC=(BVChor+2, BVCver+2), BVC=(BVChor-2, BVCver+2), BVC=(BVChor+2, BVCver-2), etc., thus forming a variety of BVC candidates, which are added to the chroma BVC candidate list.

[0257] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of a second color component block of a current block based on a first block vector parameter of a first color component block, the optimal block vector parameter can be first determined based on the first block vector parameter; then, the color sampling format of the current block is determined, and the optimal block vector parameter is scaled according to the color sampling format to determine the candidate block vector parameter of the second color component block; and then, a candidate list of block vector parameters can be determined based on the candidate block vector parameter.

[0258] For example, in an embodiment of the application, in single-tree inter-frame prediction and single-tree partitioning IBC mode, the luma BV, denoted as BVL, is subjected to RDO to determine the optimal BVL (optimal block vector parameter). The optimal block vector parameter is then scaled according to the chroma sampling format to obtain the chroma BV, denoted as BVC. The optimal block vector parameter can be scaled using Table 8 above, or the optimal block vector parameter can be adjusted in combination with any of the above adjustment or scaling methods to obtain the corresponding candidate block vector parameters, thereby completing the construction of the block vector parameter candidate list.

[0259] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of the second color component block of the current block based on the first block vector parameters of the first color component block, the optimal block vector parameters corresponding to the first color component block can be determined first; and then the candidate list of block vector parameters of the second color component block of the current block can be determined based on the optimal block vector parameters.

[0260] Exemplarily, in an embodiment of the application, for the IntraTmp mode, the optimal mode (optimal block vector parameter) of the luminance block can be searched through the template, denoted as BVL. When IntraTmp is applied to chrominance, the construction method of any of the above lists is then used to complete the construction of the block vector parameter candidate list based on the optimal block vector parameter.

[0261] It should be noted that in the embodiment of the present application, a new prediction mode can be introduced in the embodiment of the present application, which can be represented by INTRA_DBV. In this prediction mode, the second color component of the current block can be predicted based on the determined second block vector parameter to determine a predicted value of the second color component.

[0262] It should also be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the block vector parameter candidate list, it is also necessary to determine whether the candidate block vector parameters are available, that is, one or more available candidate block vector parameters need to be selected from the block vector parameter candidate list.

[0263] In some embodiments, when determining the second block vector parameter of the second color component block based on the block vector parameter candidate list, it can be first determined whether there are one or more candidate block vector parameters that meet the first availability condition in the block vector parameter candidate list; if there are one or more candidate block vector parameters that meet the first availability condition, the second block vector parameter is determined based on the one or more candidate block vector parameters.

[0264] Specifically, in the embodiment of the present application, the candidate block vector parameter can be determined as the second block vector parameter only when the candidate block vector parameter meets the first availability condition.

[0265] Furthermore, in some embodiments, one or more candidate block vector parameters satisfying a first availability condition may at least include:

[0266] Whether the offset position indicated by one or more candidate block vector parameters does not exceed the image boundary;

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

[0268] whether the offset position indicated by one or more candidate block vector parameters does not exceed a preset available area;

[0269] Whether the offset position indicated by one or more candidate block vector parameters has been reconstructed.

[0270] It should be understood that in the embodiment of the present application, only when all of the above conditions are met can it be determined that the candidate block vector parameters meet the first usability condition, that is, the candidate block vector parameters are usable. In a specific embodiment, for the candidate block vector parameters to meet the first usability condition, at least the following conditions are met: the offset position indicated by the candidate block vector parameters does not exceed the image boundary; the offset position indicated by the candidate block vector parameters does not overlap the current block; the offset position indicated by the candidate block vector parameters does not exceed the preset usable area; and the offset position indicated by the candidate block vector parameters has been reconstructed.

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

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

[0273] Furthermore, in an embodiment of the present application, when constructing a block vector parameter candidate list, the candidate block vector parameters of the second color component block can be first determined based on the first block vector parameters; if the candidate block vector parameters meet the first availability condition, the candidate block vector parameters are corrected, and the block vector parameter candidate list is determined based on the corrected candidate block vector parameters.

[0274] Correspondingly, if the candidate block vector parameters do not meet the first availability condition, the candidate block vector parameters are adjusted until the adjusted candidate block vector parameters meet the first availability condition.

[0275] It should be noted that in an embodiment of the present application, when the candidate block vector parameters are corrected, the offset position of the second color component block can be determined based on the candidate block vector parameters and the position information of the second color component block; then, a search process is performed based on the offset position of the second color component block to determine the corrected candidate block vector parameters.

[0276] It should also be understood that in the embodiment of the present application, after scaling the first block vector parameters of the first color component block according to the color sampling format, the obtained candidate block vector parameters need to be further corrected. Prior to the correction, it is necessary to determine whether the candidate block vector parameters meet a first usability condition. If the candidate block vector parameters meet the first usability condition, the candidate block vector parameters of the current block are corrected, thereby determining the corrected parameters as the second block vector parameters. Alternatively, if the candidate block vector parameters do not meet the first usability condition, the candidate block vector parameters are adjusted until the adjusted block vector parameters meet the first usability condition. The adjusted block vector parameters are then corrected, thereby determining the corrected parameters as the second block vector parameters.

[0277] That is to say, in the embodiment of the present application, the chroma BV may be corrected, and then the corrected BVC may be added to the chroma BVC candidate list. At this time, the BVC candidate list only contains the corrected BVC.

[0278] For example, after obtaining the chroma BV scaled according to the chroma sampling format, it is further modified. Before the modification, it is necessary to first determine whether the BV is available. If it is available, the modification is performed, or if it is not available, it is adjusted to be available and then modified. The modified BVC is added to the chroma BVC candidate list.

[0279] Among them, when making a judgment on whether it is available, you can get the position of the current chroma block (xCb, yCb), get the chroma BVC = (BVChor, BVCver), find the corresponding offset position (xCb + BVChor, yCb + BVCver), and judge the following conditions (i.e., the first available condition). If all are true, the chroma BV is available:

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

[0281] Whether the obtained offset position does not cover the current block; as shown in Figure 10 above;

[0282] Whether the obtained offset position does not exceed the preset available area; as shown in Figure 11 above;

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

[0284] For example, in an embodiment of the present application, the correction method can be performed using a template search. That is, after obtaining the corrected chroma BV parameters, the offset position is found using the position of the current block and the corrected chroma BV parameters. Then, a template matching method is used to perform a fine search near the offset position to obtain the optimal chroma BV parameters. The reference block at the optimal offset position obtained after the fine search is copied to obtain the chroma prediction block of the current block. As shown in FIG13 , the area filled with oblique lines represents the chroma reconstruction area. For the current block, the template matching method can be used to find the best matching template and the corresponding best BV. Based on the best BV (i.e., the IntraTMP BV), the reference block of the current block can be determined, and the chroma prediction value of the current block can be determined.

[0285] Since whether BV is available has been determined before the correction, it is not necessary to determine whether it is available (whether the first availability condition is met) subsequently, but the second block vector parameters can be determined directly.

[0286] Furthermore, in an embodiment of the present application, when constructing a block vector parameter candidate list, if the first block vector parameter meets the second availability condition, the first block vector parameter is corrected, and the block vector parameter candidate list is determined based on the corrected first block vector parameter.

[0287] That is, before constructing the block vector parameter candidate list, the first block vector parameter may be modified, for example, the luminance BVL may be modified, and then the BVC candidate list may be constructed using any of the above list construction schemes.

[0288] For example, in an embodiment of the present application, the co-located luminance region corresponding to the current chroma block can be first obtained. As shown in FIG14 , which is a schematic diagram of the coordinates and block size of the current chroma block and the co-located luminance region, the position of the current chroma block chromaPos = (xCb, yCb) is obtained. Based on Table 7 above, chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance region corresponding to the current chroma block lumaPos = (xCb_Y, yCb_Y). The size of the current chroma block chromaSize = (cbWidth, cbHeight) is obtained. Based on the mapping relationship shown in Table 9, chromaSize is scaled according to the chroma sampling format to obtain the size of the co-located luminance region corresponding to the current chroma block lumaSize = (cbWidth_Y, cbHeight_Y).

[0289] Table 9

[0290] sps_chroma_format_idc color sampling format cbWidth_YcbHeight_Y0 monochrome--14:2:0cbWidth<<1cbHeight<<124:2:2cbWidth<<1cbHeight34:4:4cbWidthcbHeight

[0291] Exemplarily, the brightness BVL can be further corrected. Before the correction, it is necessary to determine whether the BVL is available (whether it meets the second availability condition). If it is available, the correction is performed; or, if it is unavailable, it is adjusted to be available and then corrected.

[0292] In some embodiments, when determining whether the BVL is available, the position (xCb_Y, yCb_Y) of the co-located luminance region is obtained, the luminance BVL is obtained as (BVLhor, BVLver), the corresponding offset position (xCb_Y+BVLhor, yCb_Y+BVLver) is found, and the following conditions are determined. If all of them are met, the luminance BVL (first block vector parameter) is available, that is, the first block vector parameter satisfies the second availability condition, which may at least include:

[0293] The offset position indicated by the first block vector parameter does not exceed the image boundary;

[0294] The offset position indicated by the first block vector parameter does not exceed the preset available area, as shown in FIG12 ;

[0295] The offset position indicated by the first block vector parameter has been reconstructed.

[0296] Compared with the first usable condition, the second usable condition does not need to determine whether the co-located luminance area corresponding to the current block is covered.

[0297] Furthermore, in an embodiment of the present application, when performing correction processing, the offset position of the first color component block is determined based on the first block vector parameters 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 corrected first block vector parameters.

[0298] Exemplary correction processing includes, but is not limited to, the following methods: correction is performed using a co-located luminance area search corresponding to the current chrominance block. That is, after obtaining the luminance BVL, the position of the co-located luminance area and the obtained luminance BVL are used to find the offset position. A detailed search is then performed near the offset position using the co-located luminance area. The detailed search range must meet the limited available area, such as Figure 12. Ultimately, the optimal luminance BVL is obtained, as shown in Figure 15 by the co-located luminance area search.

[0299] It can be understood that, in the embodiments of the present application, the methods for constructing the block vector parameter candidate list include but are not limited to the multiple situations described above, and different methods can be used simultaneously to construct a candidate list.

[0300] Furthermore, in an embodiment of the present application, if there are one or more candidate block vector parameters that meet the first availability condition, then when determining the second block vector parameter based on the one or more candidate block vector parameters, a candidate block vector parameter that meets the first availability condition can be directly determined as the second block vector parameter.

[0301] That is, if the constructed available BVC candidate list has only one BVC candidate that meets the first availability condition, then the BV (second block vector parameter) finally selected is this BVC.

[0302] Furthermore, in an embodiment of the present application, if there are one or more candidate block vector parameters that meet the first availability condition, then when determining the second block vector parameter based on the one or more candidate block vector parameters, for the multiple candidate block vector parameters that meet the first availability condition, a first matching template is determined based on the multiple candidate block vector parameters; according to a preset error criterion, the matching error between the first template of the current block and the first matching template is calculated to determine the first generation values ​​corresponding to the multiple candidate block vector parameters; finally, one or more second block vector parameters can be determined from the multiple candidate block vector parameters based on the first generation values.

[0303] That is to say, in an embodiment of the present application, if the constructed available BVC candidate list has multiple available BVC candidates, then it is necessary to make a decision on these available BVCs to obtain the final BV, and the decision-making method includes but is not limited to the method of using a template to make the decision.

[0304] It can be understood that in the embodiment of the present application, the preset error criterion includes any one of the absolute difference SAD, the transformed absolute difference SATD, the difference square sum SSE, the mean absolute difference MAD, the mean absolute error MAE, and the mean square error MSE.

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

[0306]

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

[0308] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block.

[0309] For example, in an embodiment of the present application, when selecting a template (the first template of the current block), the availability of pixels at the template position can be determined based on the pixel availability of the neighboring area of ​​the current block, including the reconstruction of brightness information. Figure 16 is a schematic diagram of template types. As shown in Figure 16, based on the relative position relationship between the template and the current block, the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template. Among them, the sizes of different types of templates for different coding blocks can be fixed to the same or different.

[0310] For example, the template size selects the same template size for any current coding block (current block). The following formula illustrates a setting condition for the template size, where nTbW and nTbH are the width and height of the current luminance coding block (current block), and iTempW and iTempH are the width and height of the adopted template, respectively:

[0311] Upper template:

[0312] Left template:

[0313] For example, different template sizes can be selected according to the different sizes of the current coding block. The following formula illustrates a template size setting condition, where nTbW and nTbH are the width and height of the current luma coding block, respectively, and iTempW and iTempH are the width and height of the adopted template, respectively:

[0314] Upper template:

[0315] Left template:

[0316]

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

[0318] Upper template:

[0319] Left template:

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

[0321] Exemplarily, in an embodiment of the present application, when determining the first matching template, the obtained multiple BVC candidates (i.e., candidate block vector parameters that meet the first availability condition) are motion compensated using the first template of the current block to obtain a template corresponding to the BV (first matching template). Figure 17 is a schematic diagram of template motion compensation. As shown in the figure, if the BV (BVC candidate) is available, the first template and the new BV are used to perform motion compensation to obtain a template corresponding to the BV, i.e., the first matching template.

[0322] The following are the usage scenarios for templates when calculating costs:

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

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

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

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

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

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

[0329] For example, in an embodiment of the present application, one or more second block vector parameters are determined based on the first generation value. Except for cases where the cost cannot be calculated, the cost of each candidate in the BVC candidate list is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. Any number of BVCs with the lowest cost are selected as the final BV (second block vector parameter) to perform BV-based chrominance prediction.

[0330] Furthermore, in an embodiment of the present application, if all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the predicted value of the second color component may be determined according to the first preset mode.

[0331] In some embodiments, the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode, CCLM mode, and skip mode, but is not limited thereto.

[0332] Exemplarily, when the prediction mode of the first color component block is not the IBC mode, the first preset mode may include but is not limited to the PLANAR mode, the inter-component prediction mode (such as the CCLM mode) or other angle prediction modes, and then obtain reference pixels and related parameters for prediction processing; in addition, the first preset mode can also be a skip mode, that is, the current block can skip the prediction processing of this mode.

[0333] Furthermore, in an embodiment of the present application, if all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the candidate block vector parameters in the block vector parameter candidate list are adjusted until there are one or more candidate block vector parameters in the block vector parameter candidate list that meet the first availability condition.

[0334] That is, in an embodiment of the present application, 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 meet the first availability condition, then any one or more BVC candidates (candidate block vector parameters) in the block vector parameter candidate list may be adjusted until they are available. The adjustment method may include, but is not limited to, cropping, scaling, etc. A prediction method using BV information, including, but not limited to, a PLANAR mode, a CCLM-type mode, or other angular prediction mode instead of a DBV mode, may also be adopted, that is, the prediction value of the second color component is determined according to the first preset mode.

[0335] For example, in an embodiment of the present application, if it is a PLANAR mode or a CCLM-type mode or other angle mode, reference pixels and mode parameters can be obtained to perform chroma mode prediction.

[0336] Step 103: Determine a predicted value of the second color component according to the second block vector parameter.

[0337] When determining the predicted value of the second color component based on the second block vector parameter, the offset position of the current block can be determined based on the second block vector parameter and the position information of the current block; block copy processing is performed based on the offset position of the current block to obtain the first predicted block; and the predicted value of the second color component is determined based on the first predicted block.

[0338] In some embodiments, in the embodiment of the present application, if the second block vector parameter is used to predict the second color component of the current block, the position information (xCb, yCb) of the current block can be obtained, and the chrominance BV=(BVC hor , BVC ver ); thereby being able to find the offset position (xCb+BVChor, yCb+BVCver) for block copying, as shown in FIG18 .

[0339] For example, cbWidth represents the width of the current block in chroma samples, cbHeight represents the height of the current block in chroma samples, predSamples[x][y] represents the chroma prediction value of the current block, and cIdx specifies the color component index of the current block. The specific process is as follows:

[0340] For x=xCb...xCb+cbWidth-1 and y=yCb...yCb+cbHeight-1:

[0341] xVb=(xCb+BVChor)&(IbcBufWidthC-1);

[0342] yVb=(yCb+BVCver)&(CtbSizeC-1);

[0343] predSamples[x][y]=ibcVirChromaBuf[xVb][yVb].

[0344] Where BufWidthC is the width of the chroma pixels in the reconstructed buffer, CtbSizeC is the size of the chroma pixels in the Coding Tree Unit (CTU), and VirChromaBuf stores the reconstructed chroma pixels. function() is the function that processes the pixel values, which can be a direct copy, a shift operation to ensure computational accuracy, or a filtering operation.

[0345] Furthermore, when determining the predicted value of the second color component based on the second block vector parameter, multiple offset positions of the current block can be determined based on the multiple second block vector parameters and the position information of the current block; block copying can be performed based on the multiple offset positions of the current block to obtain multiple second prediction blocks; the second prediction blocks can be weighted to determine the first prediction block; and the predicted value of the second color component can be determined based on the first prediction block.

[0346] That is to say, in an embodiment of the present application, if multiple BVs are decided, that is, if multiple second block vector parameters are determined based on the block vector parameter candidate list, then multiple second prediction values ​​are obtained through prediction based on multiple BVs, and then these multiple second prediction values ​​are weighted to obtain a weighted first prediction value.

[0347] Furthermore, in an embodiment of the present application, when determining the predicted value of the second color component based on the first prediction block, it is possible to directly determine the first prediction block as the predicted value of the second color component.

[0348] Furthermore, in an embodiment of the present application, when determining the predicted value of the second color component based on the first prediction block, it is also possible to select to perform correction processing on the first prediction block to determine the predicted value of the second color component.

[0349] After obtaining the first prediction value, the first prediction value may also be corrected. The correction method includes but is not limited to weighting with the CCLM-type model or other models.

[0350] Exemplarily, in an embodiment of the present application, the position of the current chrominance block (xCb, yCb) can be obtained, the chrominance BV = (BVChor, BVCver) can be obtained, the corresponding offset position (xCb+BVChor, yCb+BVCver) can be found, the block can be copied, and the copied value can be corrected to obtain the final prediction value. The correction method includes but is not limited to weighting with CCLM-type modes or other modes.

[0351] Exemplarily, in a specific embodiment, determining the predicted value of the second color component based on the first prediction block may include: performing intra-frame prediction processing on the second color component of the current block according to a second preset mode to obtain a second prediction block; performing weighted fusion processing on the first prediction block and the second prediction block to determine the predicted value of the second color component; wherein the second preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode and CCLM mode.

[0352] It should be understood that in the embodiment of the present application, for the predicted value of the second color component, if it is obtained by block copying the second block vector parameter, the predicted value can be corrected by a method including but not limited to weighting with the conventional prediction mode.

[0353] Furthermore, in an embodiment of the present application, prediction mode identification information is determined; when the prediction mode identification information indicates that the second color component of the current block uses the DBV mode, a second block vector parameter of the second color component block is determined; and a predicted value of the second color component is determined based on the second block vector parameter.

[0354] In an embodiment of the present application, it can be determined whether the second color component of the current block is allowed to use the DBV mode (prediction based on BV information) based on the prediction mode identification information, wherein the value of the prediction mode identification information can be decoded to determine whether the prediction mode identification information indicates that the second color component of the current block uses the DBV mode.

[0355] Exemplarily, in an embodiment of the present application, if the value of the prediction mode identification information is a first value, it is determined that the prediction mode identification information indicates that the second color component of the current block is predicted using BV information; if the value of the prediction mode identification information is a second value, it is determined that the prediction mode identification information indicates that the second color component of the current block is not predicted using BV information.

[0356] In an embodiment of the present application, the prediction mode identification information may be represented by intra_dbv_flag or intra_chroma_ibc_flag, and is used to indicate whether the second color component of the current block is predicted using BV information.

[0357] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the prediction mode identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0358] For example, assuming the first value is set to 1 and the second value is set to 0, decoding determines the value of the prediction mode identification information. If the value of the prediction mode identification information is also 1, it can be determined that the second color component of the current block is predicted using the BV information. Furthermore, the second block vector parameters of the second color component block can be determined according to the above method, and the predicted value of the second color component can be determined based on the second block vector parameters.

[0359] It can also be understood that the decoding method proposed in the embodiment of the present application can also modify the DM mode of the related art so that the modified DM mode can take into account the INTRA_DBV mode.

[0360] In the embodiment of the present application, in dual-tree partitioning and DM mode, if the corresponding luminance area has BV information, the current chrominance block is predicted using the DBV mode, that is, prediction can be performed based on the BV information. For example:

[0361] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, set intra_dbv_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.

[0362] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, if IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, set intra_dbv_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.

[0363] Among them, the chroma prediction mode is derived as follows:

[0364] The chroma intra prediction mode IntraPredModeC[xCb][yCb] uses ccm_mode_flag, ccm_mode_idx, and the intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode specified in Table 10. Among them, 0 represents Planar mode, 1 represents DC, 18 represents horizontal and 50 represent vertical prediction modes, and 81 to 83 represent CCLM prediction modes. It should be noted that these fill items other than DBV mode are given as examples and are not required to be filled in with these values.

[0365] Table 10

[0366]

[0367]

[0368] In some embodiments, in DM mode, if intra_dbv_flag == 1, that is, the information obtained from the block at the center of the same luminance region contains BV, the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV. Then, the second color component can be predicted based on the decoding method of steps 101 to 103. If the first color component block is the center block of the same luminance region, the BV of the corresponding luminance block can be directly obtained as the first block vector parameter. Furthermore, if the candidate block vector parameter (candidate chroma BV) determined based on the first block vector parameter is not available, the corresponding luminance prediction mode can be obtained to predict the second color component.

[0369] That is to say, when using the INTRA_DBV mode for prediction, for obtaining the CU at the center position in the same-position luminance area, if the CU at the center position in the obtained same-position luminance area is not available, then its corresponding luminance prediction mode can be obtained for chrominance prediction.

[0370] Furthermore, in an embodiment of the present application, if any block in the first color component region performs intra-frame prediction based on a block vector, it is determined that the second color component of the current block uses the DBV mode; a second block vector parameter of the second color component block is determined; and a predicted value of the second color component is determined based on the second block vector parameter. That is, if it is determined that the second color component of the current block uses the DBV mode, the second block vector parameter of the second color component block can be determined according to the above method, and the predicted value of the second color component can be determined based on the second block vector parameter.

[0371] That is, the judgment condition of the DM method can be that there is BV information at any position in the entire corresponding luminance area. In some embodiments, in the DM mode, if the prediction information of the corresponding luminance area contains BV information, the current chroma block is encoded using the DBV mode. For example: if for x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, there is any pair (x, y) such that CuPredMode[0][x][y] is equal to MODE_IBC, then Intra_DBV_flag is set to 1, and the chroma intra-frame prediction mode IntraPredModeC[xCb][yCb] uses DBV. If for x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, there is any pair (x, y) such that CuPredMode[0][x][y] is equal to MODE_INTRA, and IntraTmpFlag[x][y] is equal to 1, then Intra_DBV_flag is set to 1, and the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV. Among them, IntraTmpFlag indicates whether IntraTmp mode is used.

[0372] Furthermore, in an embodiment of the present application, when transforming and inversely transforming the corresponding residual of a chroma block predicted in a DBV mode, the following methods are included but are not limited to: only one transform may be performed (for example, only a discrete cosine transform (DCT) transform is performed without a low-frequency non-separable transform (LFNST)), or two transforms may be performed (one transform and a second transform, for example, the encoder first performs a DCT transform and then a LFNST transform). The forward transform methods implemented by the decoder and the encoder are kept in the same reverse order.

[0373] It should be noted that the encoding and decoding method proposed in the embodiment of the present application, on the one hand, improves the uniformity of chroma prediction, makes full use of the information of the same-position luminance area, and effectively improves the accuracy of chroma prediction; on the other hand, it adjusts the accuracy of chroma BV and constructs a candidate list, which can adaptively provide multiple possibilities according to different content and sampling formats, making DBV prediction more effective, thereby further improving coding efficiency.

[0374] The coding and decoding method proposed in the embodiment of the present application was tested, and the test data is as follows:

[0375] Table 11

[0376]

[0377] It can be seen from the test data that the encoding and decoding method proposed in the embodiment of the present application improves the encoding performance.

[0378] In summary, the encoding and decoding method proposed in the embodiment of the present application fully considers the reconstruction of brightness, available information such as BV, and predicts chrominance based on this information, thereby improving the singleness of chrominance prediction. After obtaining the brightness BV, the brightness BV or chrominance BV is adjusted to construct multiple chrominance BV candidates. It can adaptively provide multiple options according to different content and sampling formats to make DBV prediction more effective, thereby further improving coding efficiency.

[0379] That is to say, in the embodiments of the present application, the BV parameters of the corresponding luminance block can be obtained, and the BV parameters can be adjusted and applied to the chrominance, thereby improving the uniformity of the chrominance prediction and making full use of the information of the same-position luminance area, thereby improving the accuracy of the chrominance prediction and effectively improving the encoding and decoding efficiency.

[0380] An embodiment of the present application provides a coding method, in which the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on a block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in an embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on a block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding efficiency, and thus improve coding performance.

[0381] An embodiment of the present application provides an encoding method, which is applied to an encoder. FIG19 is a schematic diagram of the encoding method. As shown in the figure, the encoding method performed by the encoder may include the following steps:

[0382] Step 201: Determine the first color component block of the current block.

[0383] It should be noted that the method of the embodiment of the present application can be applied to an encoder or a decoder. In addition, the prediction mode here can specifically refer to an intra-frame prediction mode. Here, assuming that the first color component is a luma component and the second color component is a chroma component, then more specifically, this is a method for determining a chroma intra-frame prediction mode.

[0384] It should also be noted that in this embodiment of the present application, the current block includes at least a first color component and a second color component. For the first color component of the current block, the block can be simply referred to as a first color component block; and when the first color component is a luminance component, the first color component block can also be referred to as a luminance block. Similarly, for the second color component of the current block, the block can be simply referred to as a second color component block; and when the second color component is a chrominance component, the second color component block can also be referred to as a chrominance block.

[0385] It should also be noted that under dual-tree partitioning, for the DM mode, when the prediction mode of the luminance block at the same position is the IBC mode, the embodiment of the present application can determine the BV information corresponding to the chrominance of the current block based on the block vector BV information of the luminance block at the same position, and then use the BV information of the chrominance block to perform intra-frame prediction sorting, which can improve the uniformity of the chrominance prediction and thus improve the coding efficiency.

[0386] In some embodiments, determining the first color component block of the current block may include: determining a first color component region at the same location of the current block; and determining the first color component block of the current block from a plurality of blocks divided from the first color component region.

[0387] It should be noted that in an embodiment of the present application, for the current block, the first color component area in the same position can be divided into blocks, for example, by using a binary tree structure, a ternary tree structure, a quadtree structure, etc. to perform block division, and multiple blocks can be obtained, each of which can be regarded as a CU; then the first color component block of the current block is determined from these multiple CUs.

[0388] For example, in Figure 3, the area filled with diagonal lines represents the luminance area at the same location of the chroma CU. This luminance area can be divided into multiple blocks; the block at the center can be selected from these blocks as the corresponding luminance block of the current block. For example, the block filled with black in Figure 3 is the corresponding luminance block of the current block.

[0389] Further, in some embodiments, determining the first color component block of the current block from the multiple blocks divided by the first color component area may include: selecting a target block from the multiple blocks divided by the first color component area, and using the target block as the first color component block of the current block.

[0390] The target block can be a block at any position. In a specific embodiment, the block at the center of the first color component area is selected as the target block; or the block at the upper left corner of the first color component area is selected as the target block; or the block at the lower right corner of the first color component area is selected as the target block.

[0391] It should be understood that in the embodiment of the present application, the target block serving as the first color component block may be a block at any position among the multiple blocks shown in FIG3 . For example, the target block may be the block at the center of the collocated luminance region shown in FIG3 (a block filled with black), the block at the upper left corner of the collocated luminance region shown in FIG7 (a block filled with black), the block at the lower right corner of the collocated luminance region shown in FIG8 (a block filled with black), or even the block at the upper right corner or the block at the lower left corner of the collocated luminance region, or even the block at the center of the upper left region, etc., and this is not specifically limited here.

[0392] Furthermore, in an embodiment of the present application, when selecting a target block from multiple blocks divided into the first color component area, the position information of the current block can be determined first; then, the position information of the current block can be scaled according to a preset sampling format (color sampling format) to obtain the co-located area position information corresponding to the current block; and then, the target position information can be determined based on the co-located area position information, and the block containing the target position information can be used as the target block.

[0393] It can be understood that, in some embodiments, the mapping relationship between the position information (x, y) of the chrominance block and the position information (xCb, yCb) of the scaled luminance block is as shown in Table 7.

[0394] Exemplarily, in an embodiment of the present application, when the block at the center position in the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight. The block at the center position of the luminance area is the luminance block (the black-filled block in Figure 3) containing the position coordinates (xCb+cbWidth>>1, yCb+cbHeight>>1).

[0395] Exemplarily, in an embodiment of the present application, when the block in the upper left corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth, and the height is cbHeight. The block at the upper left corner of the luminance area is the luminance block containing the position coordinates (xCb, yCb) (the black-filled block in Figure 7).

[0396] Exemplarily, in an embodiment of the present application, when the block in the lower right corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block is cbWidth and the height is cbHeight. The block at the lower right corner of the luminance area is the luminance block containing the position coordinates (xCb+cbWidth-1, yCb+cbHeight-1) (the black-filled block in Figure 8).

[0397] Further, in some embodiments, determining the first color component block of the current block from a plurality of blocks divided from the first color component area may include: determining at least one candidate block at a preset position from a plurality of blocks divided from the first color component area; traversing at least one candidate block according to a preset order, and determining the first candidate block in the at least one candidate block that is intra-predicted based on a block vector as the first color component block of the current block.

[0398] It should be understood that in this embodiment of the present application, for the first color component block, the determination of whether to perform intra prediction based on a block vector may also be made for at least one candidate block at a preset position. For example, as shown in Figure 9 , this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; multiple positions may be used. Furthermore, the five positions shown in Figure 9 are not specifically limited to these positions.

[0399] It should also be understood that in an embodiment of the present application, the five positions shown in Figure 9 can be obtained in sequence according to a preset order until the candidate block is determined to be intra-frame predicted based on a block vector (that is, encoded and decoded in a mode with BV information), that is, the CU at the first luminance pixel position is found to be intra-frame predicted based on a block vector, and the CU at the first luminance pixel position is used as the corresponding luminance block of the current block, that is, the first color component block.

[0400] That is to say, in an embodiment of the present application, when determining the first color component block, at least one candidate block at a preset position is determined, such as the block containing five luminance pixel positions shown in Figure 9, and is acquired in sequence until it is determined that the obtained block is encoded in a mode with BV information (intra-frame prediction based on block vector), that is, the block at the first luminance pixel position is found to be encoded in a mode with BV information.

[0401] In addition, in an embodiment of the present application, the preset order may include, but is not limited to, the following order: C->TL->TR->BL->BR. Specifically, for the detailed position derivation process of C, TL, TR, BL, and BR, the position information of the current block may be determined first; then, the position information of the current block may be scaled according to a preset sampling format (color sampling format) to obtain the co-located area position information corresponding to the current block; then, the target position information may be determined based on the co-located area position information, and the block containing the target position information may be used as at least one candidate block at a preset position, such as C, TL, TR, BL, and BR.

[0402] Exemplarily, in an embodiment of the present application, when the block at the lower right corner of the first color component area is selected as the target block, the position of the current chroma block is obtained, that is, the position of the upper left chroma sample of the current chroma block relative to the upper left chroma sample of the current image, chromaPos = (x, y), and chromaPos is scaled according to the chroma sampling format (see Table 7) to obtain the position of the co-located luminance area corresponding to the current chroma block, lumaPos = (xCb, yCb). It is assumed that the position of the co-located luminance pixel corresponding to the upper left corner position of the current block relative to the luminance pixel in the upper left corner of the image (that is, the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current block (that is, the entire diagonal filled area of ​​the luminance component in Figure 9) is cbWidth, and the height is cbHeight.

[0403] The coordinate information of the position of the brightness pixel C is (xCb+cbWidth / 2, yCb+cbHeight / 2);

[0404] The coordinate information of the position of the luminance pixel TL is (xCb, yCb);

[0405] The coordinate information of the position of the brightness pixel TR is (xCb+cbWidth-1, yCb);

[0406] The coordinate information of the position of the brightness pixel BL is (xCb, yCb+cbHeight-1);

[0407] The coordinate information of the position of the luminance pixel BR is (xCb+cbWidth-1, yCb+cbHeight-1).

[0408] Thus, for the current block, the corresponding first color component block needs to be determined first. When the first color component is a luminance component, the luminance block (ie, luminance CU) at the corresponding position needs to be determined.

[0409] Further, in some embodiments, determining the first color component block of the current block from the multiple blocks divided by the first color component area may include: determining at least one candidate block at a preset position from the multiple blocks divided by the first color component area; and directly determining the at least one candidate block as the first color component block of the current block.

[0410] It should be understood that in this embodiment of the present application, the first color component block can also be determined based on at least one candidate block at a preset position. For example, as shown in Figure 10 , this also includes CUs at five luma pixel positions. However, this embodiment of the present application is not limited to these five positions; multiple positions are possible. Furthermore, the five positions shown in Figure 10 are not specifically limited to this.

[0411] It should also be understood that in the embodiment of the present application, for the five positions shown in FIG. 10 , the CUs of multiple luminance pixel positions are used as corresponding luminance blocks of the current block, that is, multiple first color component blocks.

[0412] That is, when determining the first color component block, multiple blocks in the same brightness area may be obtained, and the positions of the multiple blocks include but are not limited to the multiple positions in FIG. 10 .

[0413] Furthermore, when determining the first color component block, at least one candidate block at a preset position may be determined from the multiple blocks divided into the first color component region. The at least one candidate block is then traversed according to a preset order, and the first candidate block among the at least one candidate block that meets a preset condition is determined as the first color component block of the current block. If intra prediction is performed on the candidate block based on a block vector, and block vector parameters of a second color component block determined based on the candidate block meet a first usability condition, then the candidate block may be determined to meet the preset condition.

[0414] It should be understood that in this embodiment of the present application, for the first color component block, the determination of whether a preset condition is satisfied can also be performed for at least one candidate block at a preset position. For example, as shown in Figure 9 , this includes CUs at five luma pixel positions: C, TL, TR, BL, and BR. However, this embodiment of the present application is not limited to these five positions; multiple positions are possible, and the five positions shown in Figure 9 are not specifically limited to these positions.

[0415] In addition, in an embodiment of the present application, the preset order may include but is not limited to the following order: C->TL->TR->BL->BR. In which, when determining in sequence whether at least one candidate block at a preset position meets the preset conditions, it is first determined whether the luminance blocks at the five positions obtained are encoded in a mode with BV information, that is, whether intra-frame prediction is performed based on the block vector. If not, the luminance block is not obtained, and the identifier of the mode is not transmitted in the bitstream. If one or more luminance blocks at the five positions are encoded in a mode with BV information, the five positions are re-acquired in sequence until the first luminance block that meets the following conditions is found, which is: determining whether the luminance block is encoded in a mode with BV information, and after adjusting the luminance BV to obtain the chrominance BV, whether the chrominance BV is available. If available, this luminance block is selected as the luminance block for finally obtaining the BV, that is, the first color component block.

[0416] Correspondingly, if the chroma BV is not available, the luminance block is not obtained, but prediction is performed using a mode including but not limited to the PLANAR mode or CCLM-type mode or other angle prediction modes; or the first luminance block encoded in a mode with BV information is found, its BV is adjusted to be available, and this luminance block is selected as the luminance block for finally obtaining the BV, that is, the first color component block.

[0417] Among them, the detailed position derivation process of C, TL, TR, BL, and BR includes: assuming that the position of the co-located luminance pixel corresponding to the upper left corner of the current chroma coding block relative to the luminance pixel in the upper left corner of the image (that is, the position of the luminance pixel TL) is (xCb, yCb), and the width of the co-located luminance area corresponding to the current chroma coding block (that is, the entire gray area on the left of the figure below) is cbWidth, and the height is cbHeight.

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

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

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

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

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

[0423] Step 202: If the first color component block performs intra prediction based on the block vector, determine the second block vector parameter of the second color component block of the current block according to the first block vector parameter of the first color component block.

[0424] It should be noted that, in the embodiment of the present application, after determining the first color component block, it is necessary to determine whether the first color component block is intra-predicted based on a block vector. If the first color component block is intra-predicted based on a block vector, that is, if the first color component block is determined to be processed in a mode with BV information, then a first block vector parameter of the first color component block (such as the BV of the luminance block) can be further determined, and a second block vector parameter of the second color component block (such as the BV of the chrominance block) can be determined based on the first block vector parameter of the first color component block.

[0425] It should be understood that in an embodiment of the present application, the condition for determining whether intra-frame prediction is performed based on a block vector may be: the prediction mode of the first color component block is a mode using BV information, wherein the mode using BV information includes but is not limited to an IBC mode or an IntraTMP mode.

[0426] It should be noted that, in the embodiment of the present application, the first block vector parameter represents the vector of the current block pointing to the reference block, and the reference block is obtained by searching in the reconstructed area of ​​the frame where the current block is located (ie, the current image).

[0427] It should also be understood that in the embodiments of the present application, the number of first color component blocks may be any number. That is, the first color component block of the current block is not limited to a single block and may also be composed of multiple blocks. Accordingly, when determining whether to perform intra-frame prediction based on a block vector, a determination needs to be made for each first color component block. Only first color components that meet the requirements for intra-frame prediction based on a block vector can be used to subsequently determine the second block vector parameters of the second color component.

[0428] It is understandable that in this embodiment of the present application, after determining the first color component block, it is necessary to determine whether the first color component block is intra-predicted based on the block vector, that is, to determine whether the first color component block is processed in a mode with BV information. If the first color component block is intra-predicted based on the block vector, then the first block vector parameters of the first color component block can be determined, and the second block vector parameters of the second color component block can be determined based on the first block vector parameters.

[0429] Furthermore, in an embodiment of the present application, if the first color component block is not intra-predicted based on a block vector, that is, the first color component block is not processed in a mode with BV information, then it may be possible to choose not to transmit the identifier of the mode in the bitstream.

[0430] It should be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block, it is possible to directly choose to determine the first block vector parameters of the first color component block as the second block vector parameters of the second color component block.

[0431] It should be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block, it is also possible to determine a block vector parameter candidate list of the second color component block of the current block based on the first block vector parameters of the first color component block; and then determine the second block vector parameters of the second color component block based on the block vector parameter candidate list.

[0432] That is to say, in the embodiments of the present application, the first block vector parameters of the first color component block can be directly used as the second block vector parameters of the second color component block, or the first block vector parameters can be used to first construct a block vector parameter candidate list of the second color component block, and then the second block vector parameters of the second color component block are determined based on the block vector parameter candidate list.

[0433] In some embodiments, determining the second block vector parameters of the second color component block based on the first block vector parameters of the first color component block may include: directly using the first block vector parameters of the first color component block as the second block vector parameters of the second color component block; or, adjusting the first block vector parameters of the first color component block to determine the second block vector parameters of the second color component block; or, constructing a block vector parameter candidate list of the second color component block based on the first block vector parameters, and then determining the second block vector parameters of the second color component block based on the block vector parameter candidate list.

[0434] Here, assuming that the first color component block is a luminance block, the first block vector parameter may be the BV of the luminance block, namely BVL; assuming that the second color component block is a chrominance block, the second block vector parameter may be the BV of the chrominance block, namely BVC.

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

[0436] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of a second color component block of a current block based on a first block vector parameter of a first color component block, the first block vector parameter can be adjusted first to determine the candidate block vector parameter of the second color component block; and then the candidate list of block vector parameters can be determined based on the candidate block vector parameter.

[0437] It can be understood that in an embodiment of the present application, the above adjustment process may include scaling according to the chroma sampling format, wherein the mapping relationship between the luma BV parameter and the scaled chroma BV parameter is shown in Table 8. Among them, the syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, and the color sampling format here is specifically the chroma sampling format. Here, different types of chroma sampling formats have different corresponding scaling operations.

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

[0439] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters and determining the candidate block vector parameters of the second color component block, the color sampling format of the current block can be determined first; then the first block vector parameters can be scaled according to the color sampling format to determine the candidate block vector parameters.

[0440] That is to say, in an embodiment of the present application, based on Table 8, it is possible to choose to scale according to the chroma sampling format, and add the scaled BVC as a candidate block vector parameter to the chroma BVC candidate list (block vector parameter candidate list).

[0441] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters to determine the candidate block vector parameters of the second color component block, the color sampling format of the current block can be determined first; then, the first block vector parameters can be scaled according to the color sampling format to determine the first initial block vector parameters; finally, the candidate block vector parameters can be determined based on the first initial block vector parameters and one or more numerical values.

[0442] Furthermore, in an embodiment of the present application, when adjusting the first block vector parameters and determining the candidate block vector parameters of the second color component block, one or more second initial block vector parameters can be first determined based on the first block vector parameters and one or more numerical values; then, the color sampling format of the current block is determined, and the second initial block vector parameters are scaled according to the color sampling format to determine the candidate block vector parameters.

[0443] It should be noted that the above one or more values ​​can be any number of arbitrary values.

[0444] That is, in the embodiment of the present application, after obtaining the BV of the corresponding luma block, it can be recorded as BVL, and the chroma BV obtained through the BVL can be recorded as BVC. By adjusting the BVL or BVC, a chroma BVC candidate list containing one or more candidates can be constructed. That is, based on Table 8, it can be selected to scale according to the chroma sampling format, and the scaled BVL or BVC can be added as the candidate block vector parameter to the chroma BVC candidate list.

[0445] Exemplarily, in an embodiment of the present application, BVL can be adjusted to form four situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, take four situations: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, take BVL = (BVLhor, BVLver). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is an odd number, four BVC candidate block vector parameters will be formed, and these candidate block vector parameters will be added to the chroma BVC candidate list.

[0446] For example, in an embodiment of the present application, BVL can be adjusted to form four cases, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor+1, BVLver), BVL = (BVLhor, BVLver+1), and BVL = (BVLhor+1, BVLver+1). When BVL is an even number, four cases are taken: BVL = (BVLhor, BVLver), BVL = (BVLhor-1, BVLver), BVL = (BVLhor, BVLver-1), and BVL = (BVLhor-1, BVLver-1). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is an odd number or an even number, four BVC candidates will be formed, and these candidates will be added to the chroma BVC candidate list.

[0447] Exemplarily, in an embodiment of the present application, operations under different circumstances of unified parity and even numbers can also be performed by the following calculation: that is, directly taking four cases: BVL = (BVLhor-1, BVLver-1), BVL = (BVLhor+1, BVLver-1), BVL = (BVLho-1r, BVLver+1), and BVL = (BVLhor+1, BVLver+1).

[0448] For example, in an embodiment of the present application, BVL can be adjusted to form multiple situations, thereby achieving adjustment of BVC. Among them, when BVL is an odd number, BVL=(BVLhor, BVLver), BVL=(BVLhor+1, BVLver), BVL=(BVLhor, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver), BVL=(BVLhor, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-2, BVLver), BVL=(BVLhor, BVLver-2), and other situations are taken, and a list is constructed for these candidates in order. When BVL is even, various cases are taken, such as BVL=(BVLhor, BVLver), BVL=(BVLhor-1, BVLver), BVL=(BVLhor, BVLver-1), BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor-3, BVLver), BVL=(BVLhor, BVLver-3), BVL=(BVLhor-3, BVLver-3), BVL=(BVLhor+2, BVLver), and BVL=(BVLhor, BVLver+2). Then, Table 8 can be used to scale BVL according to the chroma sampling format to obtain BVC. In this way, when BVL is odd or even, multiple BVC candidates will be formed, and these candidates will be added to the chroma BVC candidate list.

[0449] Exemplarily, in the embodiments of the present application, the operations under different circumstances of unified parity and even numbers can also be calculated as follows: that is, directly taking BVL=(BVLhor-1, BVLver-1), BVL=(BVLhor+1, BVLver-1), BVL=(BVLhor-1, BVLver+1), BVL=(BVLhor+1, BVLver+1), BVL=(BVLhor+3, BVLver-1), BVL=(BVLhor-1, BVLver+3), BVL=(BVLhor+3, BVLver+3), BVL=(BVLhor-3, BVLver-1), BVL=(BVLhor-1, BVLver-3), etc.

[0450] Exemplarily, in an embodiment of the present application, the obtained BVC can also be adjusted to obtain nine candidates: that is, set BVC = (BVChor, BVCver), BVC = (BVChor-1, BVCver), BVC = (BVChor, BVCver-1), BVC = (BVChor-1, BVCver-1), BVC = (BVChor+1, BVCver), BVC = (BVChor, BVCver+1), BVC = (BVChor+1, BVCver+1), BVC = (BVChor-1, BVCver+1), BVC = (BVChor+1, BVCver-1), thus forming nine BVC candidates, which are added to the chroma BVC candidate list.

[0451] Exemplarily, in an embodiment of the present application, the obtained BVC may be adjusted to obtain a variety of candidates: that is, setting BVC=(BVChor, BVCver), BVC=(BVChor-1, BVCver), BVC=(BVChor, BVCver-1), BVC=(BVChor-1, BVCver-1), BVC=(BVChor+1, BVCver), BVC=(BVChor, BVCver+1), BVC=(BVChor+1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, BVCver+1), BVC=(BVChor-1, +1, BVCver-1), BVC=(BVChor-2, BVCver), BVC=(BVChor, BVCver-2), BVC=(BVChor-2, BVCver-2), BVC=(BVChor+2, BVCver), BVC=(BVChor, BVCver+2), BVC=(BVChor+2, BVCver+2), BVC=(BVChor-2, BVCver+2), BVC=(BVChor+2, BVCver-2), etc., thus forming a variety of BVC candidates, which are added to the chroma BVC candidate list.

[0452] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of a second color component block of a current block based on a first block vector parameter of a first color component block, the optimal block vector parameter can be first determined based on the first block vector parameter; then, the color sampling format of the current block is determined, and the optimal block vector parameter is scaled according to the color sampling format to determine the candidate block vector parameter of the second color component block; and then, a candidate list of block vector parameters can be determined based on the candidate block vector parameter.

[0453] For example, in an embodiment of the application, in single-tree inter-frame prediction and single-tree partitioning IBC mode, the luma BV, denoted as BVL, is subjected to RDO to determine the optimal BVL (optimal block vector parameter). The optimal block vector parameter is then scaled according to the chroma sampling format to obtain the chroma BV, denoted as BVC. The optimal block vector parameter can be scaled using Table 8 above, or the optimal block vector parameter can be adjusted in combination with any of the above adjustment or scaling methods to obtain the corresponding candidate block vector parameters, thereby completing the construction of the block vector parameter candidate list.

[0454] Furthermore, in an embodiment of the present application, when determining a candidate list of block vector parameters of the second color component block of the current block based on the first block vector parameters of the first color component block, the optimal block vector parameters corresponding to the first color component block can be determined first; and then the candidate list of block vector parameters of the second color component block of the current block can be determined based on the optimal block vector parameters.

[0455] Exemplarily, in an embodiment of the application, for the IntraTmp mode, the optimal mode (optimal block vector parameter) of the luminance block can be searched through the template, denoted as BVL. When IntraTmp is applied to chrominance, the construction method of any of the above lists is then used to complete the construction of the block vector parameter candidate list based on the optimal block vector parameter.

[0456] It should be noted that in the embodiment of the present application, a new prediction mode can be introduced in the embodiment of the present application, which can be represented by INTRA_DBV. In this prediction mode, the second color component of the current block can be predicted based on the determined second block vector parameter to determine a predicted value of the second color component.

[0457] It should also be noted that, in an embodiment of the present application, when determining the second block vector parameters of the second color component block based on the block vector parameter candidate list, it is also necessary to determine whether the candidate block vector parameters are available, that is, one or more available candidate block vector parameters need to be selected from the block vector parameter candidate list.

[0458] In some embodiments, when determining the second block vector parameter of the second color component block based on the block vector parameter candidate list, it can be first determined whether there are one or more candidate block vector parameters that meet the first availability condition in the block vector parameter candidate list; if there are one or more candidate block vector parameters that meet the first availability condition, the second block vector parameter is determined based on the one or more candidate block vector parameters.

[0459] Specifically, in the embodiment of the present application, the candidate block vector parameter can be determined as the second block vector parameter only when the candidate block vector parameter meets the first availability condition.

[0460] Furthermore, in some embodiments, one or more candidate block vector parameters satisfying a first availability condition may at least include:

[0461] Whether the offset position indicated by one or more candidate block vector parameters does not exceed the image boundary;

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

[0463] whether the offset position indicated by one or more candidate block vector parameters does not exceed a preset available area;

[0464] Whether the offset position indicated by one or more candidate block vector parameters has been reconstructed.

[0465] It should be understood that in the embodiment of the present application, only when all of the above conditions are met can it be determined that the candidate block vector parameters meet the first usability condition, that is, the candidate block vector parameters are usable. In a specific embodiment, for the candidate block vector parameters to meet the first usability condition, at least the following conditions are met: the offset position indicated by the candidate block vector parameters does not exceed the image boundary; the offset position indicated by the candidate block vector parameters does not overlap the current block; the offset position indicated by the candidate block vector parameters does not exceed the preset usable area; and the offset position indicated by the candidate block vector parameters has been reconstructed.

[0466] For example, as shown in FIG11 , a block filled with black represents the current block, an area filled with slashes represents an available area, and an unfilled area represents an unavailable area. For the current block, if the offset position indicated by the candidate block vector parameter is in the unavailable area, then the offset position will overlap the current block.

[0467] For example, as shown in FIG12 , a block filled with black represents the current block, an area filled with oblique lines represents the available area, and the reference blocks in the available area have all been reconstructed. In an embodiment of the present application, taking into account the storage capacity of the buffer, under normal circumstances, the reference blocks adjacent to the current block (m, n) can be specifically: reference block (m-2, n-2), reference block (m-1, n-2), reference block (m, n-2), reference block (m+1, n-2), reference block (m-2, n-1), reference block (m-1, n-1), reference block (m, n-1), reference block (m+1, n-1), reference block (m-2, n), reference block (m-1, n), etc. as preset available areas.

[0468] Furthermore, in an embodiment of the present application, when constructing a block vector parameter candidate list, the candidate block vector parameters of the second color component block can be first determined based on the first block vector parameters; if the candidate block vector parameters meet the first availability condition, the candidate block vector parameters are corrected, and the block vector parameter candidate list is determined based on the corrected candidate block vector parameters.

[0469] Correspondingly, if the candidate block vector parameters do not meet the first availability condition, the candidate block vector parameters are adjusted until the adjusted candidate block vector parameters meet the first availability condition.

[0470] It should be noted that in an embodiment of the present application, when the candidate block vector parameters are corrected, the offset position of the second color component block can be determined based on the candidate block vector parameters and the position information of the second color component block; then, a search process is performed based on the offset position of the second color component block to determine the corrected candidate block vector parameters.

[0471] It should also be understood that in the embodiment of the present application, after scaling the first block vector parameters of the first color component block according to the color sampling format, the obtained candidate block vector parameters need to be further corrected. Prior to the correction, it is necessary to determine whether the candidate block vector parameters meet a first usability condition. If the candidate block vector parameters meet the first usability condition, the candidate block vector parameters of the current block are corrected, thereby determining the corrected parameters as the second block vector parameters. Alternatively, if the candidate block vector parameters do not meet the first usability condition, the candidate block vector parameters are adjusted until the adjusted block vector parameters meet the first usability condition. The adjusted block vector parameters are then corrected, thereby determining the corrected parameters as the second block vector parameters.

[0472] That is to say, in the embodiment of the present application, the chroma BV may be corrected, and then the corrected BVC may be added to the chroma BVC candidate list. At this time, the BVC candidate list only contains the corrected BVC.

[0473] For example, after obtaining the chroma BV scaled according to the chroma sampling format, it is further modified. Before the modification, it is necessary to first determine whether the BV is available. If it is available, the modification is performed, or if it is not available, it is adjusted to be available and then modified. The modified BVC is added to the chroma BVC candidate list.

[0474] Among them, when making a judgment on whether it is available, you can get the position of the current chroma block (xCb, yCb), get the chroma BVC = (BVChor, BVCver), find the corresponding offset position (xCb + BVChor, yCb + BVCver), and judge the following conditions (i.e., the first available condition). If all are true, the chroma BV is available:

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

[0476] Whether the obtained offset position does not cover the current block; as shown in Figure 10 above;

[0477] Whether the obtained offset position does not exceed the preset available area; as shown in Figure 11 above;

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

[0479] For example, in an embodiment of the present application, the correction method can be performed using a template search. That is, after obtaining the corrected chroma BV parameters, the offset position is found using the position of the current block and the corrected chroma BV parameters. Then, a template matching method is used to perform a fine search near the offset position to obtain the optimal chroma BV parameters. The reference block at the optimal offset position obtained after the fine search is copied to obtain the chroma prediction block of the current block. As shown in FIG13 , the area filled with oblique lines represents the chroma reconstruction area. For the current block, the template matching method can be used to find the best matching template and the corresponding best BV. Based on the best BV (i.e., the IntraTMP BV), the reference block of the current block can be determined, and the chroma prediction value of the current block can be determined.

[0480] Since whether BV is available has been determined before the correction, it is not necessary to determine whether it is available (whether the first availability condition is met) subsequently, but the second block vector parameters can be determined directly.

[0481] Furthermore, in an embodiment of the present application, when constructing a block vector parameter candidate list, if the first block vector parameter meets the second availability condition, the first block vector parameter is corrected, and the block vector parameter candidate list is determined based on the corrected first block vector parameter.

[0482] That is, before constructing the block vector parameter candidate list, the first block vector parameter may be modified, for example, the luminance BVL may be modified, and then the BVC candidate list may be constructed using any of the above list construction schemes.

[0483] For example, in an embodiment of the present application, the co-located luminance region corresponding to the current chroma block can be first obtained. As shown in FIG14 , which is a schematic diagram of the coordinates and block size of the current chroma block and the co-located luminance region, the position of the current chroma block chromaPos = (xCb, yCb) is obtained. Based on Table 7 above, chromaPos is scaled according to the chroma sampling format to obtain the position of the co-located luminance region corresponding to the current chroma block lumaPos = (xCb_Y, yCb_Y). The size of the current chroma block chromaSize = (cbWidth, cbHeight) is obtained. Based on the mapping relationship shown in Table 9, chromaSize is scaled according to the chroma sampling format to obtain the size of the co-located luminance region corresponding to the current chroma block lumaSize = (cbWidth_Y, cbHeight_Y).

[0484] Exemplarily, the brightness BVL can be further corrected. Before the correction, it is necessary to determine whether the BVL is available (whether it meets the second availability condition). If it is available, the correction is performed; or, if it is unavailable, it is adjusted to be available and then corrected.

[0485] In some embodiments, when determining whether the BVL is available, the position (xCb_Y, yCb_Y) of the co-located luminance region is obtained, the luminance BVL is obtained as (BVLhor, BVLver), the corresponding offset position (xCb_Y+BVLhor, yCb_Y+BVLver) is found, and the following conditions are determined. If all of them are met, the luminance BVL (first block vector parameter) is available, that is, the first block vector parameter satisfies the second availability condition, which may at least include:

[0486] The offset position indicated by the first block vector parameter does not exceed the image boundary;

[0487] The offset position indicated by the first block vector parameter does not exceed the preset available area, as shown in FIG12 ;

[0488] The offset position indicated by the first block vector parameter has been reconstructed.

[0489] Compared with the first usable condition, the second usable condition does not need to determine whether the co-located luminance area corresponding to the current block is covered.

[0490] Furthermore, in an embodiment of the present application, when performing correction processing, the offset position of the first color component block is determined based on the first block vector parameters 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 corrected first block vector parameters.

[0491] Exemplary correction processing includes, but is not limited to, the following methods: correction is performed using a co-located luminance area search corresponding to the current chrominance block. That is, after obtaining the luminance BVL, the position of the co-located luminance area and the obtained luminance BVL are used to find the offset position. A detailed search is then performed near the offset position using the co-located luminance area. The detailed search range must meet the limited available area, such as Figure 12. Ultimately, the optimal luminance BVL is obtained, as shown in Figure 15 by the co-located luminance area search.

[0492] It can be understood that, in the embodiments of the present application, the methods for constructing the block vector parameter candidate list include but are not limited to the multiple situations described above, and different methods can be used simultaneously to construct a candidate list.

[0493] Furthermore, in an embodiment of the present application, if there are one or more candidate block vector parameters that meet the first availability condition, then when determining the second block vector parameter based on the one or more candidate block vector parameters, a candidate block vector parameter that meets the first availability condition can be directly determined as the second block vector parameter.

[0494] That is, if the constructed available BVC candidate list has only one BVC candidate that meets the first availability condition, then the BV (second block vector parameter) finally selected is this BVC.

[0495] Furthermore, in an embodiment of the present application, if there are one or more candidate block vector parameters that meet the first availability condition, then when determining the second block vector parameter based on the one or more candidate block vector parameters, for the multiple candidate block vector parameters that meet the first availability condition, a first matching template is determined based on the multiple candidate block vector parameters; according to a preset error criterion, the matching error between the first template of the current block and the first matching template is calculated to determine the first generation values ​​corresponding to the multiple candidate block vector parameters; finally, one or more second block vector parameters can be determined from the multiple candidate block vector parameters based on the first generation values.

[0496] That is to say, in an embodiment of the present application, if the constructed available BVC candidate list has multiple available BVC candidates, then it is necessary to make a decision on these available BVCs to obtain the final BV, and the decision-making method includes but is not limited to the method of using a template to make the decision.

[0497] It can be understood that in the embodiment of the present application, the preset error criterion includes any one of the absolute difference SAD, the transformed absolute difference SATD, the difference square sum SSE, the mean absolute difference MAD, the mean absolute error MAE, and the mean square error MSE.

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

[0499] It should be noted that, in the embodiment of the present application, the first template includes one or more sample values ​​in the adjacent decoded area of ​​the current block.

[0500] For example, in an embodiment of the present application, when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template position are available, including reconstructing brightness information, based on the pixel availability of the neighboring area of ​​the current block. Figure 16 is a schematic diagram of the template type. As shown in Figure 16, based on the relative position relationship between the template and the current block, the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template. Among them, the sizes of different types of templates for different coding blocks can be fixed the same or different.

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

[0502] Exemplarily, in an embodiment of the present application, when determining the first matching template, the obtained multiple BVC candidates (i.e., candidate block vector parameters that meet the first availability condition) are motion compensated using the first template of the current block to obtain a template corresponding to the BV (first matching template). Figure 17 is a schematic diagram of template motion compensation. As shown in the figure, if the BV (BVC candidate) is available, the first template and the new BV are used to perform motion compensation to obtain a template corresponding to the BV, i.e., the first matching template.

[0503] The following are the usage scenarios for templates when calculating costs:

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

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

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

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

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

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

[0510] For example, in an embodiment of the present application, one or more second block vector parameters are determined based on the first generation value. Except for cases where the cost cannot be calculated, the cost of each candidate in the BVC candidate list is calculated and sorted. The sorting method includes but is not limited to bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. Any number of BVCs with the lowest cost are selected as the final BV (second block vector parameter) to perform BV-based chrominance prediction.

[0511] Furthermore, in an embodiment of the present application, if all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the predicted value of the second color component may be determined according to the first preset mode.

[0512] In some embodiments, the first preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode, CCLM mode, and skip mode, but is not limited thereto.

[0513] Exemplarily, when the prediction mode of the first color component block is not the IBC mode, the first preset mode may include but is not limited to the PLANAR mode, the inter-component prediction mode (such as the CCLM mode) or other angle prediction modes, and then obtain reference pixels and related parameters for prediction processing; in addition, the first preset mode can also be a skip mode, that is, the current block can skip the prediction processing of this mode.

[0514] Furthermore, in an embodiment of the present application, if all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the candidate block vector parameters in the block vector parameter candidate list are adjusted until there are one or more candidate block vector parameters in the block vector parameter candidate list that meet the first availability condition.

[0515] That is, in an embodiment of the present application, 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 meet the first availability condition, then any one or more BVC candidates (candidate block vector parameters) in the block vector parameter candidate list may be adjusted until they are available. The adjustment method may include, but is not limited to, cropping, scaling, etc. A prediction method using BV information, including, but not limited to, a PLANAR mode, a CCLM-type mode, or other angular prediction mode instead of a DBV mode, may also be adopted, that is, the prediction value of the second color component is determined according to the first preset mode.

[0516] For example, in an embodiment of the present application, if it is a PLANAR mode or a CCLM-type mode or other angle mode, reference pixels and mode parameters can be obtained to perform chroma mode prediction.

[0517] Step 203: Determine a predicted value of the second color component according to the second block vector parameter.

[0518] When determining the predicted value of the second color component based on the second block vector parameter, the offset position of the current block can be determined based on the second block vector parameter and the position information of the current block; block copy processing is performed based on the offset position of the current block to obtain the first predicted block; and the predicted value of the second color component is determined based on the first predicted block.

[0519] In some embodiments, in the embodiment of the present application, if the second block vector parameter is used to predict the second color component of the current block, the position information (xCb, yCb) of the current block can be obtained, and the chrominance BV=(BVC hor , BVC ver ); thereby being able to find the offset position (xCb+BVChor, yCb+BVCver) for block copying, as shown in FIG18 .

[0520] For example, cbWidth represents the width of the current block in chroma samples, cbHeight represents the height of the current block in chroma samples, predSamples[x][y] represents the chroma prediction value of the current block, and cIdx specifies the color component index of the current block. The specific process is as follows:

[0521] For x=xCb...xCb+cbWidth-1 and y=yCb...yCb+cbHeight-1:

[0522] xVb=(xCb+BVChor)&(IbcBufWidthC-1);

[0523] yVb=(yCb+BVCver)&(CtbSizeC-1);

[0524] predSamples[x][y]=ibcVirChromaBuf[xVb][yVb].

[0525] Where BufWidthC is the width of the chroma pixels in the reconstructed buffer, CtbSizeC is the size of the chroma pixels in the Coding Tree Unit (CTU), and VirChromaBuf stores the reconstructed chroma pixels. function() is the function that processes the pixel values, which can be a direct copy, a shift operation to ensure computational accuracy, or a filtering operation.

[0526] Furthermore, when determining the predicted value of the second color component based on the second block vector parameter, multiple offset positions of the current block can be determined based on the multiple second block vector parameters and the position information of the current block; block copying can be performed based on the multiple offset positions of the current block to obtain multiple second prediction blocks; the second prediction blocks can be weighted to determine the first prediction block; and the predicted value of the second color component can be determined based on the first prediction block.

[0527] That is to say, in an embodiment of the present application, if multiple BVs are decided, that is, if multiple second block vector parameters are determined based on the block vector parameter candidate list, then multiple second prediction values ​​are obtained through prediction based on multiple BVs, and then these multiple second prediction values ​​are weighted to obtain a weighted first prediction value.

[0528] Furthermore, in an embodiment of the present application, when determining the predicted value of the second color component based on the first prediction block, it is possible to directly determine the first prediction block as the predicted value of the second color component.

[0529] Furthermore, in an embodiment of the present application, when determining the predicted value of the second color component based on the first prediction block, it is also possible to select to perform correction processing on the first prediction block to determine the predicted value of the second color component.

[0530] After obtaining the first prediction value, the first prediction value may also be corrected. The correction method includes but is not limited to weighting with the CCLM-type model or other models.

[0531] Exemplarily, in an embodiment of the present application, the position of the current chrominance block (xCb, yCb) can be obtained, the chrominance BV = (BVChor, BVCver) can be obtained, the corresponding offset position (xCb+BVChor, yCb+BVCver) can be found, the block can be copied, and the copied value can be corrected to obtain the final prediction value. The correction method includes but is not limited to weighting with CCLM-type modes or other modes.

[0532] Exemplarily, in a specific embodiment, determining the predicted value of the second color component based on the first prediction block may include: performing intra-frame prediction processing on the second color component of the current block according to a second preset mode to obtain a second prediction block; performing weighted fusion processing on the first prediction block and the second prediction block to determine the predicted value of the second color component; wherein the second preset mode includes at least one of the following: PLANAR mode, DM mode, DC mode and CCLM mode.

[0533] It should be understood that in the embodiment of the present application, for the predicted value of the second color component, if it is obtained by block copying the second block vector parameter, the predicted value can be corrected by a method including but not limited to weighting with the conventional prediction mode.

[0534] Furthermore, in an embodiment of the present application, prediction mode identification information is determined; when the prediction mode identification information indicates that the second color component of the current block uses the DBV mode, a second block vector parameter of the second color component block is determined; and a predicted value of the second color component is determined based on the second block vector parameter.

[0535] In an embodiment of the present application, it can be determined whether the second color component of the current block is allowed to use the DBV mode (prediction based on BV information) based on the prediction mode identification information, wherein the value of the prediction mode identification information can be decoded to determine whether the prediction mode identification information indicates that the second color component of the current block uses the DBV mode.

[0536] Exemplarily, in an embodiment of the present application, if the value of the prediction mode identification information is a first value, it is determined that the prediction mode identification information indicates that the second color component of the current block is predicted using BV information; if the value of the prediction mode identification information is a second value, it is determined that the prediction mode identification information indicates that the second color component of the current block is not predicted using BV information.

[0537] In an embodiment of the present application, the prediction mode identification information may be represented by intra_dbv_flag or intra_chroma_ibc_flag, and is used to indicate whether the second color component of the current block is predicted using BV information.

[0538] In the embodiment of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in digital form. Specifically, the prediction mode identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0539] For example, assuming the first value is set to 1 and the second value is set to 0, decoding determines the value of the prediction mode identification information. If the value of the prediction mode identification information is also 1, it can be determined that the second color component of the current block is predicted using the BV information. Furthermore, the second block vector parameters of the second color component block can be determined according to the above method, and the predicted value of the second color component can be determined based on the second block vector parameters.

[0540] It can also be understood that the decoding method proposed in the embodiment of the present application can also modify the DM mode of the related art so that the modified DM mode can take into account the INTRA_DBV mode.

[0541] In the embodiment of the present application, in dual-tree partitioning and DM mode, if the corresponding luminance area has BV information, the current chrominance block is predicted using the DBV mode, that is, prediction can be performed based on the BV information. For example:

[0542] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC, set intra_dbv_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.

[0543] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, if IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, set intra_dbv_flag=1, then the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.

[0544] Among them, the chroma prediction mode is derived as follows:

[0545] The chroma intra prediction mode IntraPredModeC[xCb][yCb] uses ccm_mode_flag, ccm_mode_idx, and the intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode specified in Table 10. Among them, 0 represents Planar mode, 1 represents DC, 18 represents horizontal and 50 represent vertical prediction modes, and 81 to 83 represent CCLM prediction modes. It should be noted that these fill items other than DBV mode are given as examples and are not required to be filled in with these values.

[0546] In some embodiments, in DM mode, if intra_dbv_flag == 1, that is, the information obtained from the block at the center of the same luminance region contains BV, the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV. Then, the second color component can be predicted based on the decoding method of steps 101 to 103. If the first color component block is the center block of the same luminance region, the BV of the corresponding luminance block can be directly obtained as the first block vector parameter. Furthermore, if the candidate block vector parameter (candidate chroma BV) determined based on the first block vector parameter is not available, the corresponding luminance prediction mode can be obtained to predict the second color component.

[0547] That is to say, when using the INTRA_DBV mode for prediction, for obtaining the CU at the center position in the same-position luminance area, if the CU at the center position in the obtained same-position luminance area is not available, then its corresponding luminance prediction mode can be obtained for chrominance prediction.

[0548] Furthermore, in an embodiment of the present application, if any block in the first color component region performs intra-frame prediction based on a block vector, it is determined that the second color component of the current block uses the DBV mode; a second block vector parameter of the second color component block is determined; and a predicted value of the second color component is determined based on the second block vector parameter. That is, if it is determined that the second color component of the current block uses the DBV mode, the second block vector parameter of the second color component block can be determined according to the above method, and the predicted value of the second color component can be determined based on the second block vector parameter.

[0549] That is, the judgment condition of the DM method can be that there is BV information at any position in the entire corresponding luminance area. In some embodiments, in the DM mode, if the prediction information of the corresponding luminance area contains BV information, the current chroma block is encoded using the DBV mode. For example: if for x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, there is any pair (x, y) such that CuPredMode[0][x][y] is equal to MODE_IBC, then Intra_DBV_flag is set to 1, and the chroma intra-frame prediction mode IntraPredModeC[xCb][yCb] uses DBV. If for x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, there is any pair (x, y) such that CuPredMode[0][x][y] is equal to MODE_INTRA, and IntraTmpFlag[x][y] is equal to 1, then Intra_DBV_flag is set to 1, and the chroma intra prediction mode IntraPredModeC[xCb][yCb] uses DBV. Among them, IntraTmpFlag indicates whether IntraTmp mode is used.

[0550] Furthermore, in an embodiment of the present application, when transforming and inversely transforming the corresponding residual of a chroma block predicted in a DBV mode, the following methods are included but are not limited to: only one transform may be performed (for example, only a discrete cosine transform (DCT) transform is performed without a low-frequency non-separable transform (LFNST)), or two transforms may be performed (one transform and a second transform, for example, the encoder first performs a DCT transform and then a LFNST transform). The forward transform methods implemented by the decoder and the encoder are kept in the same reverse order.

[0551] It should be noted that the encoding and decoding method proposed in the embodiment of the present application, on the one hand, improves the uniformity of chroma prediction, makes full use of the information of the same-position luminance area, and effectively improves the accuracy of chroma prediction; on the other hand, it adjusts the accuracy of chroma BV and constructs a candidate list, which can adaptively provide multiple possibilities according to different content and sampling formats, making DBV prediction more effective, thereby further improving coding efficiency.

[0552] In summary, the encoding and decoding method proposed in the embodiment of the present application fully considers the reconstruction of brightness, available information such as BV, and predicts chrominance based on this information, thereby improving the singleness of chrominance prediction. After obtaining the brightness BV, the brightness BV or chrominance BV is adjusted to construct multiple chrominance BV candidates. It can adaptively provide multiple options according to different content and sampling formats to make DBV prediction more effective, thereby further improving coding efficiency.

[0553] That is to say, in the embodiments of the present application, the BV parameters of the corresponding luminance block can be obtained, and the BV parameters can be adjusted and applied to the chrominance, thereby improving the uniformity of the chrominance prediction and making full use of the information of the same-position luminance area, thereby improving the accuracy of the chrominance prediction and effectively improving the encoding and decoding efficiency.

[0554] An embodiment of the present application provides a coding method, in which the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on a block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in an embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on a block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding efficiency, and thus improve coding performance.

[0555] Based on the above embodiments, the encoding and decoding method proposed in the embodiment of the present application may include a new prediction mode, and may also include an improvement to modify the DM mode. Among them, for the new chroma prediction mode INTRA_DBV, FIG20 is a detailed flow diagram of an encoding method provided in the embodiment of the present application. As shown in FIG20, the detailed flow may include:

[0556] S1401: Obtain the corresponding luminance block of the current block.

[0557] S1402: Determine whether the corresponding luminance block is encoded in a mode with BV information.

[0558] S1403: Obtain a first BV parameter corresponding to the luminance block.

[0559] S1404: Construct a BV candidate list for chroma according to a BV parameter.

[0560] S1405: Determine whether the BV in the BV candidate list is available.

[0561] S1406: Adjust the BV until the BV is available.

[0562] S1407: Make a decision on the available BVs and determine the second BV parameters.

[0563] S1408: The DBV mode identifier is not transmitted in the code stream.

[0564] S1409: Use the second BV parameter to perform chrominance prediction.

[0565] It should be noted that in this embodiment of the present application, the corresponding luma block is used to indicate the co-located luma CU of the chroma component of the current block. For S1402, if the judgment result is yes, then S1403 to S1407 can be executed; if the judgment result is no, then S1408 can be executed. For S1405, if the judgment result is yes, then S1407 can be executed; if the judgment result is no, then S1406 can be executed first, and then S1407 can be executed.

[0566] In another specific embodiment, FIG21 is a schematic diagram of a detailed process of another encoding method provided in an embodiment of the present application. As shown in FIG21 , the detailed process may include:

[0567] S1501: Obtain the corresponding luminance block of the current block.

[0568] S1502: Determine whether the corresponding luminance block is encoded in a mode with BV information.

[0569] S1503: Obtain a first BV parameter corresponding to the luminance block.

[0570] S1504: Construct a BV candidate list for chroma according to a BV parameter.

[0571] S1505: Determine whether the BV in the BV candidate list is available.

[0572] S1506: Perform chroma prediction on the current block using the first preset mode.

[0573] S1507: Make a decision on the available BVs and determine the second BV parameters.

[0574] S1508: The DBV mode identifier is not transmitted in the code stream.

[0575] S1509: Use the second BV parameter to perform chrominance prediction.

[0576] It should be noted that in this embodiment of the present application, the corresponding luma block is used to indicate the co-located luma CU of the chroma component of the current block. For S1502, if the judgment result is yes, then S1503 to S1507 can be executed; if the judgment result is no, then S1508 can be executed. For S1505, if the judgment result is yes, then S1507 can be executed; if the judgment result is no, then S1506 can be executed.

[0577] It should also be noted that, in the embodiment of the present application, the first preset mode may be the PLANAR mode or other chroma prediction mode to replace or skip this mode, and there is no specific limitation on this.

[0578] That is, the prediction process for predicting a chroma block is as follows: obtain the corresponding luminance block, determine whether the corresponding luminance block is encoded in a mode with BV information, and then take the following processing methods: If not, do not transmit the mode identifier in the bitstream; if so, obtain the BV of the corresponding luminance block, adjust the luminance BV (BVL) and apply it to the chroma, and build a candidate list of chroma BV (BVC). Then, determine whether the BVC candidates in the candidate list of chroma BVC are available: if available, enter the decision stage; if not available, adjust the BVC to available and then enter the decision stage, or if all BVC candidates in the candidate list of chroma BVC are unavailable, use the PLANAR mode or other chroma prediction mode for prediction.

[0579] Furthermore, in the embodiment of the present application, the encoding is inside MODE_INTRA and added before intra_chroma_pred_mode. Table 12 here only lists one code stream parsing position for illustration only:

[0580] Table 12

[0581]

[0582] If sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, DbvEnabled is equal to 0.

[0583] Otherwise, set the variable ModeIncludeBv. If the corresponding luminance block is not encoded in a mode with BV information, ModeIncludeBv is equal to 0; otherwise, ModeIncludeBv is equal to 1.

[0584] DbvEnabled equals 1 if multiple of the following conditions are true simultaneously (including but not limited to the following):

[0585] ModeIncludeBv is equal to 1.

[0586] sh_slice_type is equal to 1.

[0587] CtbLog2SizeC is less than or equal to MaxChromaIbcSize.

[0588] MaxChromaIbcSize can be determined based on the chroma CTU size or a preset value.

[0589] Otherwise, DbvEnabled is equal to 0.

[0590] If DbvEnabled is equal to 0, dbv_flag is inferred to be FALSE.

[0591] dbv_flag is TRUE, indicating that the current chrominance prediction mode is DBV, including but not limited to the binarization method in the following table, which can be encoded in context or bypass mode.

[0592] Table 13

[0593] dbv_flagFLcMax=1

[0594] Table 14

[0595] Value of intra_chroma_pred_modeBin string010011012110311140

[0596] Table 15

[0597]

[0598] Table 16

[0599]

[0600] Furthermore, in the embodiment of the present application, the encoding is in MODE_IBC, as shown in the following table:

[0601] Table 17

[0602]

[0603] If sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, DbvEnabled is equal to 0. Otherwise, set the variable ModeIncludeBv to 0 if the corresponding luminance block is not encoded in a mode with BV information; otherwise, ModeIncludeBv is equal to 1.

[0604] DbvEnabled equals 1 if multiple of the following conditions are true simultaneously (including but not limited to the following):

[0605] ModeIncludeBv is equal to 1.

[0606] sh_slice_type is equal to 1.

[0607] CtbLog2SizeC is less than or equal to MaxChromaIbcSize.

[0608] MaxChromaIbcSize can be determined based on the chroma CTU size or a preset value.

[0609] Otherwise, DbvEnabled is equal to 0.

[0610] When treeType == DUAL_TREE_CHROMA and DbvEnabled is 0, pred_mode_ibc_flag is inferred to be FALSE. When treeType == DUAL_TREE_CHROMA and pred_mode_ibc_flag is TRUE, it indicates that the current chroma prediction mode is DBV:

[0611] Table 18

[0612] pred_mode_ibc_flagFLcMax=1

[0613] Table 19

[0614]

[0615] Table 20

[0616]

[0617] Table 21

[0618]

[0619] Table 22

[0620] Value of intra_chroma_pred_modeBin string010011012110311140

[0621] For the 0th bin of intra_chroma_pred_mode, it represents the DM mode, and the encoding method is the same as VVC.

[0622] The derivation process of DbvEnabled is as follows:

[0623] If sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, DbvEnabled is equal to 0.

[0624] Otherwise, DbvEnabled equals 1 if multiple of the following conditions are true simultaneously (including but not limited to the following):

[0625] sh_slice_type is equal to 1.

[0626] CtbLog2SizeC is less than or equal to MaxChromaIbcSize.

[0627] MaxChromaIbcSize can be determined based on the chroma CTU size or a preset value.

[0628] If DbvEnabled is equal to 1:

[0629] When intra_chroma_pred_mode is equal to the four chroma prediction modes of 0, 1, 2 or 3, these four chroma prediction modes refer to Table 4; when intra_chroma_pred_mode is equal to 4, solution 2 is implemented.

[0630] Otherwise, refer to the chrominance prediction process in the H.266 standard.

[0631] In summary, the encoding and decoding method proposed in the embodiment of the present application fully considers the reconstruction of brightness, available information such as BV, and predicts chrominance based on this information, thereby improving the singleness of chrominance prediction. After obtaining the brightness BV, the brightness BV or chrominance BV is adjusted to construct multiple chrominance BV candidates. It can adaptively provide multiple options according to different content and sampling formats to make DBV prediction more effective, thereby further improving coding efficiency.

[0632] That is to say, in the embodiments of the present application, the BV parameters of the corresponding luminance block can be obtained, and the BV parameters can be adjusted and applied to the chrominance, thereby improving the uniformity of the chrominance prediction and making full use of the information of the same-position luminance area, thereby improving the accuracy of the chrominance prediction and effectively improving the encoding and decoding efficiency.

[0633] An embodiment of the present application provides a coding method, in which the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on a block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in an embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on a block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding efficiency, and thus improve coding performance.

[0634] In another embodiment of the present application, see Figure 22, which shows a schematic diagram of the structure of an encoder provided by an embodiment of the present application. As shown in Figure 22, the encoder 180 may include: a first determining unit 1801; wherein,

[0635] The first determination unit 1801 is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of the current block based on a first block vector parameter of the first color component block; and determine a predicted value of the second color component based on the second block vector parameter.

[0636] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

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

[0638] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 180. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0639] Based on the composition of the encoder 180 and the computer-readable storage medium, refer to Figure 23, which shows a specific hardware structure diagram of the encoder 180 provided in an embodiment of the present application. As shown in Figure 23, the encoder 180 may include: a first communication interface 1901, a first memory 1902 and a first processor 1903; each component is coupled together through a first bus system 1904. It can be understood that the first bus system 1904 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1904 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1904 in Figure 19. Among them,

[0640] The first communication interface 1901 is used to receive and send signals when sending and receiving information with other external network elements;

[0641] A first memory 1902 is used to store computer programs that can be run on the first processor 1903;

[0642] The first processor 1903 is configured to, when running the computer program, execute:

[0643] Determine a first color component block of the current block;

[0644] If the first color component block is intra-predicted based on a block vector, determining a second block vector parameter of a second color component block of the current block according to a first block vector parameter of the first color component block;

[0645] A predicted value of the second color component is determined based on the second block vector parameter.

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

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

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

[0649] Optionally, as another embodiment, the first processor 1903 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0650] In another embodiment of the present application, see FIG24, which shows a schematic diagram of the structure of a decoder provided by an embodiment of the present application. As shown in FIG24, the decoder 200 may include: a second determining unit 2001; wherein,

[0651] The second determination unit 2001 is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of a second color component block of the current block based on the first block vector parameter of the first color component block; and determine a predicted value of the second color component based on the second block vector parameter.

[0652] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

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

[0654] Based on the composition of the decoder 200 and the computer-readable storage medium, refer to Figure 25, which shows a specific hardware structure diagram of the decoder 200 provided in an embodiment of the present application. As shown in Figure 25, the decoder 200 may include: a second communication interface 2201, a second memory 2202 and a second processor 2203; each component is coupled together through a second bus system 2204. It can be understood that the second bus system 2204 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 2204 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 2204 in Figure 22. Among them,

[0655] The second communication interface 2201 is used to receive and send signals during the process of sending and receiving information between other external network elements;

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

[0657] The second processor 2203 is configured to, when running the computer program, execute:

[0658] Determine a first color component block of a current block; if the first color component block is intra-predicted based on a block vector, determine second block vector parameters of a second color component block of the current block based on first block vector parameters of the first color component block; and determine a predicted value of the second color component based on the second block vector parameters.

[0659] Optionally, as another embodiment, the second processor 2203 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0660] It can be understood that the hardware functions of the second memory 2202 are similar to those of the first memory 1902, and the hardware functions of the second processor 2203 are similar to those of the first processor 1903; they will not be described in detail here.

[0661] The present embodiment provides a codec that determines the first color component block of the current block; if the first color component block is intra-predicted based on a block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in the embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on a block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding and decoding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding and decoding efficiency, and thus improve coding and decoding performance.

[0662] In yet another embodiment of the present application, referring to FIG26 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG26 , the coding and decoding system 230 may include an encoder 2301 and a decoder 2302 .

[0663] In the embodiment of the present application, the encoder 2301 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2302 may be the decoder described in any one of the aforementioned embodiments.

[0664] Furthermore, an embodiment of the present application also provides a code stream, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: prediction mode identification information, and color sampling format of the current block.

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

[0666] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

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

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

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

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

[0671] The embodiment of the present application provides a coding and decoding method, an encoder, a decoder and a storage medium, wherein the codec determines the first color component block of the current block; if the first color component block is intra-predicted based on the block vector, the second block vector parameters of the second color component block are determined based on the first block vector parameters of the first color component block; and the predicted value of the second color component is determined based on the second block vector parameters. It can be seen that in the embodiment of the present application, if the luminance block corresponding to the current block is intra-predicted based on the block vector, the second block vector parameters of the chrominance component can be determined based on the block vector parameters of the luminance block, and the chrominance component can be predicted using the second block vector parameters. In other words, the coding and decoding method proposed in the embodiment of the present application improves the singleness problem of chrominance prediction, makes full use of the relevant information of the same-position luminance block, can improve the accuracy of chrominance prediction, can save bit rate, improve coding and decoding efficiency, and thus improve coding and decoding performance.

Claims

1. A decoding method, applied to a decoder, comprising: Determine a first color component block of the current block; If the first color component block is intra-predicted based on a block vector, determining a second block vector parameter of a second color component block of the current block according to a first block vector parameter of the first color component block; A predicted value of the second color component is determined based on the second block vector parameter.

2. The method according to claim 1, wherein Determine the first color component block of the current block, including: Determining a first color component region at a same position as the current block; A first color component block of the current block is determined from a plurality of blocks divided into the first color component area.

3. The method according to claim 2, wherein: The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: A target block is selected from a plurality of blocks divided into the first color component area, and the target block is used as the first color component block of the current block.

4. The method according to claim 3, wherein: The method further comprises: Selecting a block at a central position in the first color component area as the target block; or, Selecting the block at the upper left corner in the first color component area as the target block; or, The block at the lower right corner in the first color component area is selected as the target block.

5. The method according to claim 2, wherein: The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is traversed according to a preset order, and a first candidate block among the at least one candidate block that is intra-predicted based on a block vector is determined as the first color component block of the current block.

6. The method according to claim 2, wherein: The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is determined as the first color component block of the current block.

7. The method according to claim 1, wherein The determining, according to the first block vector parameter of the first color component block, the second block vector parameter of the second color component block of the current block includes: The first block vector parameter of the first color component block is determined as the second block vector parameter of the second color component block.

8. The method according to claim 1, wherein The determining, according to the first block vector parameter of the first color component block, the second block vector parameter of the second color component block of the current block includes: determining a candidate list of block vector parameters for a second color component block of the current block according to a first block vector parameter of the first color component block; A second block vector parameter of the second color component block is determined based on the block vector parameter candidate list.

9. The method according to claim 8, wherein The determining, according to the first block vector parameter of the first color component block, a candidate list of block vector parameters of the second color component block of the current block includes: adjusting the first block vector parameters to determine candidate block vector parameters for the second color component block; The block vector parameter candidate list is determined according to the candidate block vector parameters.

10. The method according to claim 9, wherein: The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: Determining a color sampling format of the current block; Scaling processing is performed on the first block vector parameter according to the color sampling format to determine the candidate block vector parameter.

11. The method according to claim 9, wherein The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: Determining a color sampling format of the current block; Scaling the first block vector parameter according to the color sampling format to determine a first initial block vector parameter; The candidate block vector parameters are determined according to the first initial block vector parameters and one or more numerical values.

12. The method according to claim 9, wherein The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: determining one or more second initial block vector parameters based on the first block vector parameter and one or more numerical values; A color sampling format of the current block is determined, and the second initial block vector parameters are scaled according to the color sampling format to determine the candidate block vector parameters.

13. The method according to claim 8, wherein The determining, according to the first block vector parameter of the first color component block, a candidate list of block vector parameters of the second color component block of the current block includes: determining an optimal block vector parameter based on the first block vector parameter; determining a color sampling format of the current block, and scaling the optimal block vector parameters according to the color sampling format to determine candidate block vector parameters of the second color component block; The block vector parameter candidate list is determined according to the candidate block vector parameters.

14. The method according to claim 8, wherein The method further comprises: determining optimal block vector parameters corresponding to the first color component block; A block vector parameter candidate list of the second color component block of the current block is determined according to the optimal block vector parameter.

15. The method according to claim 8, wherein The determining, based on the block vector parameter candidate list, a second block vector parameter of the second color component block, comprises: determining whether the block vector parameter candidate list contains one or more candidate block vector parameters that meet a first availability condition; If there are one or more candidate block vector parameters that meet the first availability condition, the second block vector parameter is determined according to the one or more candidate block vector parameters.

16. The method according to claim 15, wherein The one or more candidate block vector parameters satisfy a first availability condition, including at least: The offset position indicated by the one or more candidate block vector parameters does not exceed the image boundary; The offset position indicated by the one or more candidate block vector parameters does not cover the current block; The offset position indicated by the one or more candidate block vector parameters does not exceed a preset available area; The offset position indicated by the one or more candidate block vector parameters has been reconstructed.

17. The method according to claim 15, wherein: The determining the second block vector parameter according to the one or more candidate block vector parameters includes: A candidate block vector parameter that meets a first availability condition is determined as the second block vector parameter.

18. The method according to claim 15, wherein The determining the second block vector parameter according to the one or more candidate block vector parameters includes: For a plurality of candidate block vector parameters that meet a first availability condition, determining a first matching template according to the plurality of candidate block vector parameters; Calculating a matching error between the first template of the current block and the first matching template according to a preset error criterion to determine first generation values ​​corresponding to the plurality of candidate block vector parameters; One or more second block vector parameters are determined from the plurality of candidate block vector parameters according to the first generation value.

19. The method according to claim 18, wherein The first template includes one or more sample values ​​in a neighboring decoded area of ​​the current block.

20. The method according to claim 19, wherein The determining a first matching template according to the plurality of candidate block vector parameters includes: Taking the position of the current point as a starting point, the region indicated by the multiple candidate block vector parameters, which has the same shape and contains the same number of samples as the first template, is determined as the first matching template.

21. The method according to claim 18, wherein The preset error criterion includes any one of the sum of absolute differences (SAD), the sum of transformed absolute differences (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE).

22. The method according to claim 15, wherein The method further comprises: Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is traversed according to a preset order, and a first candidate block among the at least one candidate block that meets a preset condition is determined as the first color component block of the current block.

23. The method according to claim 22, wherein The method further comprises: If the candidate block performs intra-frame prediction based on a block vector, and the block vector parameter of the second color component block determined based on the candidate block meets a first usability condition, it is determined that the candidate block meets a preset condition.

24. The method according to claim 15, wherein The determining the predicted value of the second color component according to the second block vector parameter includes: determining an offset position of the current block according to the second block vector parameter and the position information of the current block; Performing block copying processing according to the offset position of the current block to obtain a first prediction block; A predicted value of the second color component is determined based on the first prediction block.

25. The method according to claim 15, wherein The determining the predicted value of the second color component according to the second block vector parameter includes: determining a plurality of offset positions of the current block according to the plurality of second block vector parameters and the position information of the current block; Performing block copying processing according to multiple offset positions of the current block to obtain multiple second prediction blocks; performing weighted processing on the second prediction block to determine a first prediction block; A predicted value of the second color component is determined based on the first prediction block.

26. The method according to claim 24 or 25, wherein The determining, according to the first prediction block, a predicted value of the second color component, includes: The first prediction block is determined as a predicted value of the second color component.

27. The method according to claim 24 or 25, wherein The determining, according to the first prediction block, a predicted value of the second color component, includes: Correction processing is performed on the first prediction block to determine a prediction value of the second color component.

28. The method according to claim 15 or 16, wherein The method further comprises: If all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the predicted value of the second color component is determined according to a first preset mode; wherein the first preset mode includes: PLANAR mode, DM mode, DC mode, CCLM mode and skip mode.

29. The method according to claim 15 or 16, wherein The method further comprises: If all candidate block vector parameters in the block vector parameter candidate list do not meet 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 that meet the first availability condition exist in the block vector parameter candidate list.

30. The method according to claim 15 or 16, wherein The method further comprises: determining candidate block vector parameters for the second color component block based on the first block vector parameters; If the candidate block vector parameters meet the first availability condition, the candidate block vector parameters are corrected, and the block vector parameter candidate list is determined according to the corrected candidate block vector parameters.

31. The method according to claim 30, wherein The method further comprises: If the candidate block vector parameters do not meet the first availability condition, the candidate block vector parameters are adjusted until the adjusted candidate block vector parameters meet the first availability condition.

32. The method according to claim 30, wherein The method further comprises: determining an offset position of the second color component block according to the candidate block vector parameter and position information of the second color component block; A search process is performed according to the offset position of the second color component block to determine the corrected candidate block vector parameters.

33. The method according to any one of claims 10, 11, 30-32, wherein: The method further comprises: If the first block vector parameter meets the second usability condition, the first block vector parameter is corrected, and the block vector parameter candidate list is determined according to the corrected first block vector parameter.

34. The method according to claim 33, wherein The first block vector parameters satisfy the second usability condition, which at least includes: The offset position indicated by the first block vector parameter does not exceed the image boundary; The offset position indicated by the first block vector parameter does not exceed a preset available area; The offset position indicated by the first block vector parameter has been reconstructed.

35. The method according to claim 33 or 34, wherein described determining an offset position of the first color component block according to the first block vector parameter and position information of the first color component block; A search process is performed according to the offset position of the first color component block to determine the corrected vector parameters of the first block.

36. The method of claim 2, wherein: The method further comprises: If any block in the first color component area performs intra prediction based on a block vector, determining that the second color component of the current block uses a DBV mode; determining second block vector parameters of the second color component block; A predicted value of the second color component is determined based on the second block vector parameter.

37. The method of claim 1, wherein: The method further comprises: Decoding the code stream and determining the prediction mode identification information; When the prediction mode identification information indicates that the second color component of the current block uses the DBV mode, determining a second block vector parameter of the second color component block; A predicted value of the second color component is determined based on the second block vector parameter.

38. A coding method, applied to an encoder, comprising: Determine a first color component block of the current block; If the first color component block is intra-predicted based on a block vector, determining a second block vector parameter of the second color component block according to a first block vector parameter of the first color component block; A predicted value of the second color component is determined based on the second block vector parameter.

39. The method according to claim 38, wherein Determine the first color component block of the current block, including: Determining a first color component region at a same position as the current block; A first color component block of the current block is determined from a plurality of blocks divided into the first color component area.

40. The method of claim 39, wherein The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: A target block is selected from a plurality of blocks divided into the first color component area, and the target block is used as the first color component block of the current block.

41. The method according to claim 40, wherein The method further comprises: Selecting a block at a central position in the first color component area as the target block; or, Selecting the block at the upper left corner in the first color component area as the target block; or, The block at the lower right corner in the first color component area is selected as the target block.

42. The method of claim 39, wherein: The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is traversed according to a preset order, and a first candidate block among the at least one candidate block that is intra-predicted based on a block vector is determined as the first color component block of the current block.

43. The method of claim 39, wherein: The step of determining the first color component block of the current block from the plurality of blocks divided from the first color component area includes: Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is determined as the first color component block of the current block.

44. The method of claim 38, wherein The determining, according to the first block vector parameter of the first color component block, the second block vector parameter of the second color component block of the current block includes: The first block vector parameter of the first color component block is determined as the second block vector parameter of the second color component block.

45. The method of claim 38, wherein The determining, according to the first block vector parameter of the first color component block, the second block vector parameter of the second color component block of the current block includes: determining a candidate list of block vector parameters for a second color component block of the current block according to a first block vector parameter of the first color component block; A second block vector parameter of the second color component block is determined based on the block vector parameter candidate list.

46. ​​The method of claim 38, wherein The determining, according to the first block vector parameter of the first color component block, a candidate list of block vector parameters of the second color component block of the current block includes: adjusting the first block vector parameters to determine candidate block vector parameters for the second color component block; The block vector parameter candidate list is determined according to the candidate block vector parameters.

47. The method of claim 46, wherein The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: Determining a color sampling format of the current block; Scaling processing is performed on the first block vector parameter according to the color sampling format to determine the candidate block vector parameter.

48. The method of claim 46, wherein The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: Determining a color sampling format of the current block; Scaling the first block vector parameter according to the color sampling format to determine a first initial block vector parameter; The candidate block vector parameters are determined according to the first initial block vector parameters and one or more numerical values.

49. The method of claim 46, wherein The adjusting the first block vector parameter to determine the candidate block vector parameter of the second color component block includes: determining one or more second initial block vector parameters based on the first block vector parameter and one or more numerical values; A color sampling format of the current block is determined, and the second initial block vector parameters are scaled according to the color sampling format to determine the candidate block vector parameters.

50. The method of claim 38, wherein The determining, according to the first block vector parameter of the first color component block, a candidate list of block vector parameters of the second color component block of the current block includes: determining an optimal block vector parameter based on the first block vector parameter; determining a color sampling format of the current block, and scaling the optimal block vector parameters according to the color sampling format to determine candidate block vector parameters of the second color component block; The block vector parameter candidate list is determined according to the candidate block vector parameters.

51. The method of claim 38, wherein The method further comprises: determining optimal block vector parameters corresponding to the first color component block; A block vector parameter candidate list of the second color component block of the current block is determined according to the optimal block vector parameter.

52. The method of claim 38, wherein The determining, based on the block vector parameter candidate list, a second block vector parameter of the second color component block, comprises: determining whether the block vector parameter candidate list contains one or more candidate block vector parameters that meet a first availability condition; If there are one or more candidate block vector parameters that meet the first availability condition, the second block vector parameter is determined according to the one or more candidate block vector parameters.

53. The method of claim 52, wherein: The one or more candidate block vector parameters satisfy a first availability condition, including at least: The offset position indicated by the one or more candidate block vector parameters does not exceed the image boundary; The offset position indicated by the one or more candidate block vector parameters does not cover the current block; The offset position indicated by the one or more candidate block vector parameters does not exceed a preset available area; The offset position indicated by the one or more candidate block vector parameters has been reconstructed.

54. The method of claim 52, wherein: The determining the second block vector parameter according to the one or more candidate block vector parameters includes: A candidate block vector parameter that meets a first availability condition is determined as the second block vector parameter.

55. The method of claim 52, wherein: The determining the second block vector parameter according to the one or more candidate block vector parameters includes: For a plurality of candidate block vector parameters that meet a first availability condition, determining a first matching template according to the plurality of candidate block vector parameters; Calculating a matching error between the first template of the current block and the first matching template according to a preset error criterion to determine first generation values ​​corresponding to the plurality of candidate block vector parameters; One or more second block vector parameters are determined from the plurality of candidate block vector parameters according to the first generation value.

56. The method of claim 55, wherein: The first template includes one or more sample values ​​in an adjacent coded area of ​​the current block.

57. The method of claim 56, wherein The determining a first matching template according to the plurality of candidate block vector parameters includes: Taking the position of the current point as a starting point, the region indicated by the multiple candidate block vector parameters, which has the same shape and contains the same number of samples as the first template, is determined as the first matching template.

58. The method of claim 55, wherein The preset error criterion includes any one of the sum of absolute differences (SAD), the sum of transformed absolute differences (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), and the mean squared error (MSE).

59. The method of claim 52, wherein: The method further includes Determining at least one candidate block at a preset position from a plurality of blocks divided into the first color component area; The at least one candidate block is traversed according to a preset order, and a first candidate block among the at least one candidate block that meets a preset condition is determined as the first color component block of the current block.

60. The method of claim 59, wherein The method further comprises: If the candidate block performs intra-frame prediction based on a block vector, and the block vector parameter of the second color component block determined based on the candidate block meets a first usability condition, it is determined that the candidate block meets a preset condition.

61. The method of claim 52, wherein: The determining the predicted value of the second color component according to the second block vector parameter includes: determining an offset position of the current block according to the second block vector parameter and the position information of the current block; Performing block copying processing according to the offset position of the current block to obtain a first prediction block; A predicted value of the second color component is determined based on the first prediction block.

62. The method of claim 52, wherein: The determining the predicted value of the second color component according to the second block vector parameter includes: determining a plurality of offset positions of the current block according to the plurality of second block vector parameters and the position information of the current block; Performing block copying processing according to multiple offset positions of the current block to obtain multiple second prediction blocks; performing weighted processing on the second prediction block to determine a first prediction block; A predicted value of the second color component is determined based on the first prediction block.

63. The method according to claim 61 or 62, wherein The determining, according to the first prediction block, a predicted value of the second color component, includes: The first prediction block is determined as a predicted value of the second color component.

64. The method according to claim 61 or 62, wherein The determining, according to the first prediction block, a predicted value of the second color component, includes: Correction processing is performed on the first prediction block to determine a prediction value of the second color component.

65. The method of claim 52 or 53, wherein: The method further comprises: If all candidate block vector parameters in the block vector parameter candidate list do not meet the first availability condition, the predicted value of the second color component is determined according to a first preset mode; wherein the first preset mode includes: PLANAR mode, DM mode, DC mode, CCLM mode and skip mode.

66. The method of claim 52 or 53, wherein The method further comprises: If all candidate block vector parameters in the block vector parameter candidate list do not meet 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 that meet the first availability condition exist in the block vector parameter candidate list.

67. The method of claim 52 or 53, wherein: The method further comprises: determining candidate block vector parameters for the second color component block based on the first block vector parameters; If the candidate block vector parameters meet the first availability condition, the candidate block vector parameters are corrected, and the block vector parameter candidate list is determined according to the corrected candidate block vector parameters.

68. The method of claim 67, wherein The method further comprises: If the candidate block vector parameters do not meet the first availability condition, the candidate block vector parameters are adjusted until the adjusted candidate block vector parameters meet the first availability condition.

69. The method of claim 67, wherein The method further comprises: determining an offset position of the second color component block according to the candidate block vector parameter and position information of the second color component block; A search process is performed according to the offset position of the second color component block to determine the corrected candidate block vector parameters.

70. The method according to any one of claims 47, 48, 67-69, wherein: The method further comprises: If the first block vector parameter meets the second usability condition, the first block vector parameter is corrected, and the block vector parameter candidate list is determined according to the corrected first block vector parameter.

71. The method of claim 70, wherein The first block vector parameters satisfy the second usability condition, which at least includes: The offset position indicated by the first block vector parameter does not exceed the image boundary; The offset position indicated by the first block vector parameter does not exceed a preset available area; The offset position indicated by the first block vector parameter has been reconstructed.

72. The method according to claim 70 or 71, wherein described determining an offset position of the first color component block according to the first block vector parameter and position information of the first color component block; A search process is performed according to the offset position of the first color component block to determine the corrected vector parameters of the first block.

73. The method of claim 39, wherein: The method further comprises: If any block in the first color component area performs intra prediction based on a block vector, determining that the second color component of the current block uses a DBV mode; determining second block vector parameters of the second color component block; A predicted value of the second color component is determined based on the second block vector parameter.

74. The method of claim 38, wherein: The method further comprises: Determining prediction mode identification information; When the prediction mode identification information indicates that the second color component of the current block uses the DBV mode, determining a second block vector parameter of the second color component block; A predicted value of the second color component is determined based on the second block vector parameter.

75. A code stream, wherein The code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: Prediction mode identification information and color sampling format of the current block.

76. An encoder comprising a first determining unit; wherein, The first determination unit is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of a second color component block of the current block based on a first block vector parameter of the first color component block; and determine a predicted value of the second color component based on the second block vector parameter.

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

78. A decoder comprising a second determining unit; wherein, The second determination unit is configured to determine a first color component block of the current block; if the first color component block is intra-predicted based on a block vector, determine a second block vector parameter of a second color component block of the current block according to the first block vector parameter of the first color component block; and determine a predicted value of the second color component according to the second block vector parameter.

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

80. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 37, or implements the method according to any one of claims 38 to 74.