Coding method, decoding method, coder, decoder and storage medium

WO2026143741A9PCT designated stage Publication Date: 2026-09-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/070888
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2026-09-03

Smart Images

  • Figure CN2025070888_03092026_PF_FP_ABST
    Figure CN2025070888_03092026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a coding method, a decoding method, a coder, a decoder and a storage medium. The decoding method comprises: acquiring block vector information of a reference block of a current block, wherein the block vector information comprises a first block vector and / or block vector related information; on the basis of the block vector information of the reference block, determining a block vector of the current block; and on the basis of the block vector of the current block, determining a predicted value of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

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

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

[0002] In the field of video encoding and decoding, improving video compression rates is crucial. The digitization process of images and videos generates a significant amount of data redundancy, making video compression technology possible. Because of the strong similarity between adjacent blocks in video images, intra-frame prediction methods are used in video encoding and decoding to eliminate temporal redundancy between adjacent blocks, thereby improving video compression rates.

[0003] However, there is still room for improvement in the performance of intra-frame prediction in existing video codec standards. Therefore, researching how to further improve the accuracy of intra-frame prediction, thereby enhancing video codec performance, remains significant. Summary of the Invention

[0004] In a first aspect, embodiments of this application provide a decoding method applied to a decoder. The method includes: obtaining block vector information of a reference block of the current block, the block vector information including a first block vector and / or block vector related information; determining the block vector of the current block based on the block vector information of the reference block; and determining the predicted value of the current block based on the block vector of the current block.

[0005] Secondly, embodiments of this application provide an encoding method applied to an encoder. The method includes: obtaining block vector information of a reference block of the current block, the block vector information including a first block vector and / or block vector related information; determining the block vector of the current block based on the block vector information of the reference block; and determining the prediction value of the current block based on the block vector of the current block.

[0006] Thirdly, embodiments of this application provide an encoder, which includes a first acquisition unit, a first determination unit, and a first prediction unit, wherein: the first acquisition unit is configured to acquire block vector information of a reference block of the current block, the block vector information including a first block vector and / or block vector related information; the first determination unit is configured to determine the block vector of the current block based on the block vector information of the reference block; and the first prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.

[0007] Fourthly, embodiments of this application provide an encoder, which includes a first memory and a first processor, wherein: the first memory is used to store a computer program that can run on the first processor; and the first processor is used to execute the method described in the second aspect when running the computer program.

[0008] Fifthly, embodiments of this application provide a decoder, which includes a second acquisition unit, a second determination unit, and a second prediction unit, wherein: the second acquisition unit is configured to acquire block vector information of a reference block of the current block, the block vector information including a first block vector and / or block vector related information; the second determination unit is configured to determine the block vector of the current block based on the block vector information of the reference block; and the second prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.

[0009] In a sixth aspect, embodiments of this application provide a decoder, which includes a second memory and a second processor, wherein: the second memory is used to store a computer program that can run on the second processor; and the second processor is used to execute the method described in the first aspect when running the computer program.

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

[0011] Eighthly, embodiments of this application provide a computer program product, including a computer program or instructions that, when executed by a processor, implement the method described in the first aspect or the method described in the second aspect.

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

[0013] It is understood that in the embodiments of this application, whether at the encoding end or the decoding end, the block vector information of the reference block of the current block (such as the first block vector and / or block vector related information) is considered when predicting the current block; thus, it is beneficial to improve the accuracy of the predicted value of the current block, thereby enhancing the performance of video encoding and decoding. Attached Figure Description

[0014] Figure 1 is a schematic diagram of the prediction process of BVG-CCCM technology;

[0015] Figure 2 is a schematic diagram of the positional relationship between luminance blocks and chrominance blocks;

[0016] Figure 3 shows BV nbr A schematic diagram of horizontal flip perception adjustment;

[0017] Figure 4 shows BV nbr A schematic diagram of vertical flip perception adjustment;

[0018] Figure 5 is a schematic diagram of the further implementation process of step S2 above;

[0019] Figure 6 is a schematic diagram of determining the reference region based on BV;

[0020] Figure 7 is a schematic diagram of the prediction process of BVG-EIP technology.

[0021] Figure 8 is a schematic diagram of the search area;

[0022] Figure 9 is a schematic diagram of the further implementation process of step S2 above;

[0023] Figure 10 is a schematic diagram of determining the reference region based on BV;

[0024] Figure 11 is a schematic diagram of the shape of a 15-tap filter;

[0025] Figure 12 is a schematic diagram of the brightness input and brightness output of EIP mode for obtaining the available location of the reference area;

[0026] Figure 13 is a schematic diagram of the diagonal prediction order of the EIP model;

[0027] Figure 14 is a schematic diagram of the prediction process of BVG-TIMD technology.

[0028] Figure 15 is a schematic diagram of obtaining spatial neighbor blocks based on sampling points;

[0029] Figure 16 is a schematic diagram of template prediction based on BV.

[0030] Figure 17 is a schematic diagram of the further implementation process of step S2;

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

[0032] Figure 19 is a schematic block diagram of the system composition of an encoder provided in an embodiment of this application;

[0033] Figure 20 is a schematic block diagram of a decoder system provided in an embodiment of this application;

[0034] Figure 21 is a schematic diagram of the implementation flow of the decoding method provided in the embodiment of this application;

[0035] Figure 22 is a schematic diagram of a further implementation process of step 2102 provided in an embodiment of this application;

[0036] Figure 23 is a schematic diagram of a further implementation process of step 2202 provided in an embodiment of this application;

[0037] Figure 24 is a schematic diagram of a further implementation process of step 2302 provided in an embodiment of this application;

[0038] Figure 25 is a schematic diagram of the template of the current block provided in an embodiment of this application;

[0039] Figure 26 is a schematic diagram of the implementation flow of the method for determining the first-generation value corresponding to the candidate block vector information provided in the embodiment of this application;

[0040] Figure 27 is a schematic diagram of the implementation process of the method for determining the predicted value of the current block provided in an embodiment of this application;

[0041] Figure 28 is a schematic diagram of the implementation process of the method for determining the predicted value of the current block provided in the embodiments of this application;

[0042] Figure 29 is a schematic diagram of the implementation flow of the method for determining the predicted value of the current block provided in the embodiment of this application;

[0043] Figure 30 is a schematic diagram of the implementation flow of the encoding method provided in the embodiment of this application;

[0044] Figure 31 is a schematic diagram of tBV and lBV after horizontal flip sensing adjustment provided in an embodiment of this application;

[0045] Figure 32 is a schematic diagram of tBV and lBV after vertical flip sensing adjustment provided in the embodiment of this application;

[0046] Figure 33 is a schematic diagram of obtaining the reference area without flipping, provided in an embodiment of this application.

[0047] Figure 34 is a schematic diagram of obtaining the reference area under horizontal flipping conditions according to an embodiment of this application;

[0048] Figure 35 is a schematic diagram of obtaining the reference area under vertical flipping conditions provided in an embodiment of this application;

[0049] Figure 36 is a schematic diagram of the composition structure of the encoder provided in the embodiment of this application;

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

[0051] Figure 38 is a schematic diagram of the composition structure of the decoder provided in the embodiment of this application;

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

[0053] Figure 40 is a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application. Detailed Implementation

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

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

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

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

[0058] In video images, three color components are generally used to represent a coding block (CB). 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, video images can be represented in YCbCr format or YUV format. In the embodiments of this application, "chrominance sampling format" can also be described as "color sampling format".

[0059] Before providing a further detailed description of the embodiments of this application, the nouns and terms that may be involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.

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

[0061] VVC's reference software testing platform (VVC Test Model, VTM);

[0062] Enhanced Compression Model (ECM);

[0063] Joint Video Experts Team (JVET);

[0064] Spatial Geometric Partitioning Mode (SGPM);

[0065] Block Vector (BV);

[0066] Intra Block Copy (IBC);

[0067] Reconstruction-Reordered IBC (RRIBC);

[0068] Intra-template matching prediction (Intra TMP);

[0069] Coding Unit (CU);

[0070] Decode Side Intra Mode Derivation (DIMD);

[0071] Template-based Intra Mode Derivation (TIMD);

[0072] Extrapolation filter-based intra-prediction (EIP);

[0073] Intra Prediction Mode (IPM);

[0074] Coding Tree Unit (CTU);

[0075] Block Vector-Guided Convolutional Cross-Component Models (BVG-CCCM);

[0076] Block Vector-Guided (BVG);

[0077] Intra-template matching prediction (Intra TMP);

[0078] (I) Block Vector Guided Convolutional Cross Component Model (BVG-CCCM)

[0079] The Block Vector Guided Convolutional Cross Component Model (BVG-CCCM) mode is an intra-frame inter-chroma component prediction mode. It determines a reference region for calculating CCCM model parameters based on the block vector information of the co-position luminance CU encoded in Intra TMP or IBC. Then, it uses the reconstructed luminance and reconstructed chroma information of the reference region to derive the BVG-CCCM model. Finally, it generates the final chroma prediction block based on the BVG-CCCM model.

[0080] The following is a detailed introduction:

[0081] The inputs for BVG-CCCM are: the position of the current chroma block (xTbCmp, yTbCmp), the width of the current chroma block nTbW, and the height of the current chroma block nTbH.

[0082] The output of BVG-CCCM is the predicted value of the current chroma block, predSamples[x][y], where the origin of the coordinate system is the top left corner of the current chroma block, x = 0..nTbW-1, y = 0..nTbH-1.

[0083] Figure 1 is a schematic diagram of the prediction process of BVG-CCCM technology. As shown in Figure 1, the prediction process of BVG-CCCM technology includes the following steps S1 and S2: Step S1, constructing a BV candidate list; Step S2, obtaining the predicted value based on the current BV information. After the above steps, the chromaticity prediction value of the current chromaticity block can be obtained.

[0084] Step S1: Construct a candidate list of BVs. The possible implementations of step S1 are described below.

[0085] An example of obtaining a BV candidate list is as follows:

[0086] (1) Obtain BV information of the reconstructed CU

[0087] In the block shown in Figure 2 containing five brightness sample locations (including but not limited to five locations, which can be multiple different locations), the checks are performed sequentially, and the order of the checks includes but is not limited to the following:

[0088] C->TL->TR->BL->BR

[0089] The following explains the detailed derivation process of the positions of C, TL, TR, BL, and BR:

[0090] Get the position of the current chroma block, that is, the position of the top left chroma sample of the current chroma block relative to the top left chroma sample of the current image, chromaPos=(x,y). Scale chromaPos according to the chroma sampling format to get the position of the corresponding brightness region of the current chroma block, lumaPos=(xCb,yCb).

[0091] Table 1 shows the scaling of chromaPos based on the chroma sampling format.

[0092] Assume that the position of the corresponding luminance sample at the top left corner of the current chroma block relative to the luminance sample at the top left corner of the current image (i.e., the position of the luminance sample TL) is (xCb, yCb), and the width of the corresponding luminance region (i.e., the entire shaded region on the chroma component region in Figure 2) of the current chroma block (i.e., the entire shaded region on the luminance component region in Figure 2) is cbWidth, and the height is cbHeight.

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

[0094] 2) The coordinates of the position of the brightness sample TL are (xCb, yCb);

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

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

[0097] 5) The coordinates of the position of the brightness sample BR are (xCb+cbWidth-1, yCb+cbHeight-1).

[0098] In addition, multiple locations can be searched for neighboring locations at each brightness sample location, including but not limited to the following examples: the current check location coordinates are shifted to the upper left (-8, -8), the current check location coordinates are shifted to the upper left (0, -8), and the current check location coordinates are shifted to the left (-8, 0).

[0099] When inspecting each luminance block, if the luminance block contains BV information, then obtain its stored luminance BV information BVL = (BVLhor, BVLver).

[0100] (2) Adjust BV information

[0101] Based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.), the obtained BV information of the reconstructed CU is adjusted to determine the BV information that can be used for the current block. The adjustment operations include, but are not limited to, the following methods:

[0102] ① Flip perception adjustment

[0103] Let the BV information obtained from the reconstructed CU be: BV value (let's say...). ), Flip flag (set to rribcFlipType) nbr ) and color components (set as compID); let the BV information after flip adjustment be: BV value (set as ) and the flip flag (set to rribcFlipType) cur Let the center coordinates (or top-left corner coordinates) of the neighboring block be (x...). nbr ,y nbr ).

[0104] No need to flip

[0105] For rribcFlipType nbr In the case where =0, no adjustment is needed; that is, the BV information after inversion adjustment is:

[0106] rribcFlipType cur =rribcFlipType nbr =0

[0107] · Horizontal flip

[0108] For rribcFlipType nbr In the case where BV = 1, it is necessary to adjust BV. nbr Perform a horizontal flip perception adjustment; the BV information after the flip adjustment is as follows:

[0109] rribcFlipType cur =rribcFlipType nbr =1

[0110] Where, x nbr The X-coordinate of the center (or top left corner) of the reconstructed CU, if the current block is a chroma-coded block and BV nbr If it originates from a reconstructed luminance block, then x cur The x-coordinate is the center position (or top-left corner position) of the current block's corresponding brightness region; otherwise, x... cur This is the X-coordinate of the center (or top-left corner) of the current block. (BV) nbrFigure 3 shows a schematic diagram of the horizontal flip perception adjustment.

[0111] Vertical flip

[0112] For rribcFlipType nbr =2 cases, BV needs to be adjusted. nbr Perform vertical flip perception adjustment; the BV information after flip adjustment is as follows:

[0113] rribcFlipType cur =rribcFlipType nbr =2

[0114] Among them, y nbr The Y coordinate of the center (or top left corner) of the reconstructed CU, if the current block is a chroma-coded block and BV nbr If it originates from a reconstructed luminance block, then y cur The Y-coordinate is the center position (or top left corner position) of the current block's corresponding brightness region; otherwise, y... cur This is the Y-coordinate of the center (or top-left corner) of the current block. (BV) nbr Figure 4 shows a schematic diagram of the vertical flip perception adjustment.

[0115] ② Scaling adjustment

[0116] If the acquired BV information originates from a luma block, it needs to be scaled according to the chroma sampling format to obtain the chroma BV. Let the luma BV before scaling be BVL = (BVL... h BVL v The chromaticity BV obtained after scaling is BVC = (BVC) h BVC v As shown in Table 2.

[0117] Table 2 shows the chromaticity BV after scaling adjustment according to the chromaticity sampling format.

[0118] (3) Determine BV availability

[0119] The availability of chroma BV information is determined, and available chroma BV information is added to the chroma BVC candidate list. An example of a method for checking whether the current BV information is valid (available) for the current block is as follows:

[0120] It is necessary to check whether the current BV information is valid for the current block. An example of a method to check the validity of the current BV information for the current block is as follows:

[0121] If all of the following conditions are met, then the BV is valid for the current block:

[0122] The current chroma block has a width of width and a height of height. The current chroma block's position is obtained as chromaPos = (x, y). Based on the chroma BV information BVC = (BVChor, BVCver), the corresponding offset position (x + BVChor, y + BVCver) is found. A reference region of the same size as the current block is determined based on this offset position. The following conditions are checked; if all conditions are met, then the BV is valid for the current block:

[0123] (1) The obtained offset position does not exceed the image (Picture) boundary;

[0124] (2) The reference area determined by the offset position contains a reconstructed area;

[0125] (3) BV cur It does not duplicate any existing BVs in the current block's BVC candidate list.

[0126] (4) Decision BV

[0127] Use all BVs from the available BV candidate list obtained above.

[0128] Step S2: Obtain the predicted value based on the current BV information. The possible implementation methods for step S2 are described below.

[0129] Figure 5 is a schematic diagram of the further implementation process of step S2 above; as shown in Figure 5, step S2 above may further include the following steps S2.1 to S2.3: step S2.1, determine the reference area based on the current BV; step S2.2, determine the BVG-CCCM model parameters; step S2.3, obtain the chromaticity prediction value of the current block.

[0130] Step S2.1: Determine the reference region based on the current BV. The possible implementations of step S2.1 are described below.

[0131] Traverse all BVs in the chroma BVC candidate list to determine the reference region of the current chroma coding block. For example, as shown in Figure 6.

[0132] Step S2.2: Determine the parameters of the BVG-CCCM model. The possible implementations of step S2.2 are described below.

[0133] (1) Obtain luminance and chromaticity samples of the reference area.

[0134] Iterate through each reference region, obtaining the luminance downsampled value and corresponding chrominance reconstructed value of the reference region. Then, based on the flip flag (set as rribcFlipType)...cur Determine whether a flip adjustment is needed.

[0135] No need to flip

[0136] For rribcFlipType cur If the value is 0, no adjustment is needed.

[0137] · Horizontal flip

[0138] For rribcFlipType cur In the case of 1, the luminance downsampled value and the corresponding chromaticity reconstructed value of the reference area are horizontally flipped.

[0139] Vertical flip

[0140] For rribcFlipType cur In the case of 1, the luminance downsampled value and the corresponding chromaticity reconstructed value of the reference area are vertically flipped.

[0141] (2) Solving for model parameters

[0142] The BVG-CCCM mode uses an 11-tap filter. The input to the 11-tap convolutional filter includes the brightness reconstruction samples corresponding to the current sample point and its four adjacent sample points (up, down, left, and right), five nonlinear terms, and one offset term. The specific prediction process of BVG-CCCM is shown in the following equation:

[0143] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B;

[0144] Among them, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 and c 10 The 11 coefficients represent the convolution filter. C, N, S, W, and E represent the downsampled luminance values ​​at positions (x,y), (x,y-1), (x,y+1), (x-1,y), and (x+1,y) of the current chroma block. P(C), P(N), P(S), P(E), and P(W) represent nonlinear terms, and B represents the offset term. The specific derivation of the nonlinear and offset terms is shown below:

[0145] P(C)=(C×C+midVal)>>bitDepth

[0146] P(N)=(N×N+midVal)>>bitDepth

[0147] P(S)=(S×S+midVal)>>bitDepth

[0148] P(E)=(E×E+midVal)>>bitDepth

[0149] P(W)=(W×W+midVal)>>bitDepth

[0150] B = midval

[0151] Among them, the nonlinear term and the offset term are midval = 512 in a video with a bit depth of 10. Model parameters c0~c 10 The filter coefficients are obtained by minimizing the mean square error (MSE) between the chromaticity prediction samples and the chromaticity reconstruction samples in the reference region. Specifically, the autocorrelation matrix of the luminance downsampling input and the cross-correlation vector between the luminance downsampling input and the chromaticity output in the reference region are constructed, and the filter coefficients are obtained by LDL decomposition.

[0152] (3) Obtain the chromaticity prediction value of the current block.

[0153] By using the downsampled luminance sample of the current block as input to the convolution filter, the predicted value of the chroma prediction block is obtained as follows.

[0154] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B

[0155] (II) Block Vector Guided Intra-Prediction Based on Extrapolation Filter (BVG-EIP) Mode

[0156] Block Vector Guided Extrapolation Filter-Based Intra-Prediction (BVG-EIP) mode is an intra-prediction mode that uses block vectors (BV) to determine the reference region for calculating EIP filter parameters. This reference region is then used to derive the BVG-EIP model, and finally, the final predicted value for the current block is generated based on the BVG-EIP model. The block vectors (BV) may originate from: BV obtained through template matching search, BV inherited from reconstructed blocks, etc.

[0157] The following is a detailed introduction:

[0158] The inputs to BVG-EIP are: the position of the current luma block (xTbCmp, yTbCmp), the width of the current luma block nTbW, and the height of the current chroma block nTbH.

[0159] The output of BVG-EIP is the predicted value of the current luma block, predSamples[x][y], where the origin of the coordinate system is the top left corner of the current luma block, x = 0..nTbW-1, y = 0..nTbH-1.

[0160] Figure 7 is a schematic diagram of the prediction process of BVG-EIP technology. As shown in Figure 7, the prediction process of BVG-EIP technology includes the following steps S1 and S2: Step S1, constructing a candidate BV list; Step S2, obtaining the predicted value based on the current BV information. After the above steps, the predicted value of the current prediction block can be obtained.

[0161] Step S1: Construct a candidate list of block vectors. The possible implementations of step S1 are described below.

[0162] BVG-EIP technology uses block vectors to determine the location of reference regions, thereby obtaining the predicted value of the current block. The block vectors can be constructed in the following ways:

[0163] (1) Construct a coarse search list within the search area: Within each region of the surrounding rectangular search area (one or more regions R1 to R6 as shown in Figure 8), a coarse search is performed with a step size of 3, where pX is between bvXMinsregionId and bvXMaxsregionId, and pY is between bvYMinsregionId and bvYMaxsregionId. The coarse search with a step size of 3 records the cost of the first P optimal matches obtained by template matching as pDiff1_BEST[p], p = 0, ..., P-1, and the corresponding block vector BV is denoted as the best block vector BV1_BEST[p], p = 0, ..., P-1. Where P can be an integer value of 1 or greater than 1 as needed, and the search area where the best matching search point is located is bestRegionId[p], p = 0, ..., P-1. Figure 8 is a schematic diagram of the search area; where the search area includes one or more regions R1 to R6.

[0164] (2) Update the coarse search list: After finding P reference points in the search area, the BV information of the reconstructed CU is obtained using multiple predefined search locations, and a candidate BV list, referred to as the BV-Merge list, is constructed for reference by the current block. After constructing the BV-Merge list, the coarse search list is updated. The specific update operation is as follows: sequentially access each item in the BV-Merge list, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the initial coarse search list, and if it is less than the maximum template matching cost in the coarse search list, then replace the worse BV in the coarse search list with this BV. For example, the specific replacement operation is as follows: insert this BV into the coarse search list in order of cost size, and delete the item with the largest cost in the coarse search list.

[0165] (3) Determine the fine search list near the coarse search list BV with a step size of 1: Further search is performed near the fine search reference point BV1_BEST[p], p=0,…,M-1 obtained from the coarse search.

[0166] Specifically, for each fine search reference point, the position of the best matching reconstruction block obtained from the coarse search is first used as the reference position of the fine search region: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST. Then, the fine search ranges TmpRefineRangeHor and TmpRefineRangeVer are determined. The fine search range can be a fixed size or it can be related to the search region.

[0167] (4) Decision BV

[0168] Take the first BV from the block vector candidate list and determine it as the BV information of the current block.

[0169] Step S2: Obtain the predicted value based on the current BV information. The possible implementation methods for step S2 are described below.

[0170] Figure 9 is a schematic diagram of the further implementation process of step S2; as shown in Figure 9, step S2 can further include the following steps S2.1 to S2.3: step S2.1, determine the reference area based on the current BV; step S2.2, determine the BVG-EIP model parameters; step S2.3, obtain the predicted value of the current block.

[0171] Step S2.1: Determine the reference region based on the current BV. The possible implementations of step S2.1 are described below.

[0172] Based on the determination in step S2 And the position of the top left corner of the current block (xCb, yCb), find the corresponding offset position. This means that the reconstructed brightness sample at the BV corresponding to the current block has been obtained, which is the reference region. Figure 10 is a schematic diagram of determining the reference region based on BV.

[0173] Step S2.2: Determine the BVG-EIP model parameters. The possible implementations of step S2.2 are described below.

[0174] (1) Obtain the brightness sample of the reference area

[0175] For example, obtain the brightness reconstruction value of the reference area.

[0176] (2) Solving for model parameters

[0177] The BVG-EIP mode uses a 15-tap filter. Figure 11 shows a schematic diagram of the shape of a 15-tap filter. As shown in Figure 11, there are three possible shapes for a 15-tap filter.

[0178] The model used in BVG-EIP technology is a 15-tap filter consisting of 14 spatial luminance samples and one bias term, as shown in the following equation:

[0179] The bias term B = 2bitdepth - 1, where bitDepth is the bit depth. For example, in a video with a bit depth of 10, B = 512.

[0180] Model parameters c0~c 14 The solution is obtained by solving the equation. Specifically:

[0181] Using a sample as the step size, the selected filter is moved horizontally or vertically in the selected reference area to determine the brightness input and brightness output of the EIP mode at each available position. Taking a square filter shape as an example, the schematic diagram of obtaining the brightness input and brightness output of the EIP mode at the available position in the reference area is shown in Figure 12.

[0182] Subsequently, the autocorrelation matrix of the luminance input and the cross-correlation vector between the luminance input and luminance output are constructed, and the filter coefficients are obtained through LDL decomposition.

[0183] Step S2.3: Obtain the predicted value of the current block. The possible implementations of step S2.3 are described below.

[0184] The current block and its neighboring reconstructed brightness samples and brightness prediction samples are used as inputs to the convolutional filter. Through the following BVG-EIP model, the predicted values ​​of the current block from the top left corner to the bottom right corner are generated according to the diagonal prediction order. Taking a square filter shape as an example, the diagonal prediction order of the EIP mode is shown in Figure 13:

[0185] The formula for calculating the predicted value at the current block (x, y) is as follows:

[0186] Among them, pred (x,y) This is the predicted value at position (x, y) in the current coding block, where ci (i = 0, ..., 13) are filter coefficients. For brightness reconstruction samples or prediction samples.

[0187] (III) Block Vector Guided Template-Based Intra-Frame Mode Derivation (BVG-TIMD) Mode

[0188] Block Vector Guided Template-Based Intra-Mode Derivation (BVG-TIMD) is an intra-prediction mode that uses block vectors (BV) to determine a reference region, then builds a list of intra-candidate modes. These modes are then used to calculate the predicted value for the reference region. The predicted and reconstructed values ​​are sorted according to their matching costs (e.g., SAD), and the mode with the lowest matching cost is selected as the predicted mode for the current block, generating the final predicted value for that block. The block vectors (BV) may originate from template matching searches, inherited BVs from reconstructed blocks, etc.

[0189] The following is a detailed introduction:

[0190] The inputs to BVG-TIMD are: the position of the current luminance prediction block (xTbCmp, yTbCmp), the width of the current luminance prediction block nTbW, and the height of the current luminance prediction block nTbH.

[0191] The output of BVG-TIMD is the predicted value of the current luminance prediction block, predSamples[x][y], where the origin of the coordinate system is the top left corner of the current luminance prediction block, x = 0..nTbW-1, y = 0..nTbH-1.

[0192] Figure 14 is a schematic diagram of the prediction process of BVG-TIMD technology. As shown in Figure 14, the prediction process of BVG-TIMD technology includes the following steps S1 and S2: Step S1, constructing a candidate list of block vectors; Step S2, obtaining the predicted value based on the current BV information. After the above steps, the chromaticity prediction value of the current prediction block can be obtained.

[0193] Step S1: Construct a candidate list of block vectors. The possible implementations of step S1 are described below.

[0194] An example of a candidate list for constructing a block vector is as follows:

[0195] (1) Obtain BV information of the reconstructed CU

[0196] Figure 15 is a schematic diagram of obtaining spatial neighbor blocks based on sampling points. As shown in Figure 15, the spatial neighbor blocks of the current block are obtained using 5 adjacent and 18 non-adjacent sampling points. Then, it is determined whether these neighbor blocks have BV information (e.g., neighbor blocks are encoded using IBC or IntraTMP). If BV information exists, it is added to the block vector candidate list.

[0197] (2) Obtain BV information of the reconstructed CU

[0198] The candidate list of block vectors is then sorted using templates. Specifically, the reconstructed regions adjacent to the current CU are used as templates (e.g., the row above and column to the left of the current CU are used as templates). Each BV in the BV Merge list is traversed to obtain the predicted value of the current block template under each BV mode. The prediction cost (e.g., SAD) of the template reconstruction value and the predicted value is calculated and sorted in ascending order accordingly. The specific template prediction process is shown in Figure 16.

[0199] (3) Decision BV

[0200] Take the first BV from the sorted block vector candidate list and determine it as the BV information of the current block.

[0201] Step S2: Obtain the predicted value based on the current BV information. The possible implementation methods for step S2 are described below.

[0202] Figure 17 is a schematic diagram of the further implementation process of step S2; as shown in Figure 17, step S2 may further include the following steps S2.1 to S2.3: step S2.1, determine the reference area based on the current BV; step S2.2, derive the BVG-TIMD intra-frame mode; step S2.3, obtain the prediction value of the current block.

[0203] Step S2.1: Determine the reference area based on the current location. The possible implementations of step S2.1 are described below.

[0204] Determined according to step S2 And the position of the top left corner of the current block (xCb, yCb), find the corresponding offset position. That is, the reconstructed brightness sample at the BV corresponding to the current block is obtained, i.e., the reference area, see Figure 10.

[0205] Step S2.2, derive the BVG-TIMD intra-frame mode. The possible implementations of step S2.1 are described below.

[0206] (1) Establish an intra-frame prediction mode candidate list

[0207] An example of obtaining a candidate list of intra-frame prediction modes is as follows:

[0208] Based on the prediction patterns of the adjacent reconstructed blocks (left, lower left, upper right, upper, upper left) in the current reference area, determine the IPM candidate list.

[0209] Specifically, if there is no angle prediction mode in adjacent blocks, the IPM candidate list includes the Planar mode and the DC mode; if there is an angle prediction mode in adjacent blocks, some modes, wide-angle prediction mode and DC / HOR / VER mode from the MPM list are added to the IPM candidate list in sequence without repetition.

[0210] (2) Sort the candidate list of intra-frame prediction modes using the reference region.

[0211] If the IPM candidate list contains only one intra-prediction mode, sorting is not required;

[0212] If the IPM candidate list contains multiple intra-prediction modes, then each intra-prediction mode in the IPM candidate list is traversed, the predicted value of the reference region under that intra-prediction mode is calculated, and the regions are sorted according to the cost (e.g., SATD) between the predicted value and the reconstructed value of the reference region.

[0213] (3) Determine the BVG-TIMD mode

[0214] If the IPM candidate list contains only one intra-prediction mode, then that mode is determined as the corresponding BVG-TIMD mode.

[0215] If the IPM candidate list contains multiple intra-prediction modes, then T IPMs are determined based on the sorted IPM list and their corresponding cost, and their fusion weights are calculated according to certain rules.

[0216] Step S2.3: Obtain the predicted value of the current block. The possible implementations of step S2.3 are described below.

[0217] Based on the weighted fusion identifier determined in step S2.2 and the corresponding intra-frame prediction mode, the prediction value for the current block is generated. Specifically:

[0218] If weighted fusion is not performed, the predicted value is directly generated based on the individual IPM determined in step S2.2;

[0219] If weighted fusion is performed, then based on the T IPMs determined in step S2.3, their prediction values ​​for the current block are obtained (denoted as timdPred). n (n = 0, ..., T-1), then according to the fusion weights (denoted as weight) n (n = 0, ..., T-1), generate the predicted value, that is, the predicted value at the current block (x, y) is calculated using the following formula;

[0220] predSamples[x][y]=timdPred0[x][y]*weight0+…+timdPred T-1 [x][y]*weight T-1

[0221] The inventors of this application discovered in their research and analysis that in some block vector-guided prediction modes (e.g., BVG-EIP), the current block uses the block vector information of neighboring encoded CUs to participate in prediction, but does not fully consider the uncertainty of the meaning of the BV information of neighboring blocks. Under certain circumstances, this can lead to inaccurate information obtained when BV participates in prediction and the final prediction value, which has an adverse effect on coding efficiency.

[0222] In view of this, embodiments of this application provide an encoding / decoding method.

[0223] This application provides an encoding method, namely, obtaining block vector information of a reference block for the current block, the block vector information including a first block vector and / or block vector related information; determining the block vector of the current block based on the block vector information of the reference block; and determining the predicted value of the current block based on the block vector of the current block. This application also provides a decoding method, namely, obtaining block vector information of a reference block for the current block, the block vector information including a first block vector and / or block vector related information; determining the block vector of the current block based on the block vector information of the reference block; and determining the predicted value of the current block based on the block vector of the current block.

[0224] It is understandable that, whether at the encoding or decoding end, the block vector information of the reference block (such as the first block vector and / or block vector related information) is considered when predicting the current block; this is beneficial to improving the accuracy of the predicted value of the current block, thereby enhancing the performance of video encoding and decoding.

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

[0226] Figure 18 is a schematic diagram of a video encoding and decoding network architecture provided in an embodiment of this application. As shown in Figure 18, the network architecture includes one or more electronic devices 31 to 3N and a communication network 01, wherein the electronic devices 31 to 3N can perform video interaction through the communication network 01. The electronic devices can be various types of devices with video encoding and decoding capabilities, such as mobile phones, tablets, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc., and this embodiment of the application does not limit the scope of the application.

[0227] This application provides a network architecture for a video encoding / decoding system that includes decoding and encoding methods. The decoder or encoder in this application can be the aforementioned electronic device, or the aforementioned electronic device may include a decoder or encoder. In other words, the electronic device in this application has video encoding / decoding capabilities and generally includes a video encoder (i.e., encoder) and a video decoder (i.e., decoder).

[0228] Figure 19 is a schematic block diagram of an encoder system according to an embodiment of this application. As shown in Figure 19, the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control and analysis unit 107, a filtering unit 108, an encoding unit 109, and a Decoded Picture Buffer (DPB) unit 110, etc. Here, the input of the encoder 100 can be a video composed of a series of images or a single static image, and the output of the encoder 100 can be a bitstream (also called a "bitstream") representing a compressed version of the input video. The images in the input video can be segmented into one or more Coding Tree Units (CTUs). For example, an image can be divided into multiple tiles, and a tile can be further divided into one or more bricks. Here, a tile or a brick may include one or more complete and / or partial CTUs.

[0229] The filtering unit 108 can implement deblocking filtering and Sample Adaptive Offset (SAO) filtering, while the encoding unit 109 can implement header information encoding and Context-based Adaptive Binary Arithmetic Coding (CABAC). For the input raw video signal, the coding tree unit... The partitioning of a video coding unit (CTU) yields a video coding block. The residual sample information obtained after intra-frame or inter-frame prediction is then transformed by the transform and quantization unit 101. This transformation includes converting the residual information from the sample domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. Intra-frame estimation unit 102 and intra-frame prediction unit 103 perform intra-frame prediction on the video coding block. Specifically, intra-frame estimation unit 102 and intra-frame prediction unit 103 determine the intra-frame prediction mode to be used to encode the video coding block. Motion compensation unit 104 and motion estimation unit 105 perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information. The motion estimation performed by motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, motion compensation unit 104 uses the motion vectors determined by motion estimation unit 105 to generate motion vectors. The motion compensation is performed. After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109. In addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the sample domain, and remove the block artifacts by the filter control analysis unit 107 and the filtering unit 108. Then, the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-prediction mode and output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.

[0230] Furthermore, encoder 100 may be a first memory having a first processor and a computer program for recording. When the first processor reads and runs the computer program, encoder 100 reads the input video and generates a corresponding bitstream. Alternatively, encoder 100 may also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have connection and data exchange functions similar to the corresponding units in Figure 19.

[0231] Figure 20 is a schematic block diagram of a decoder system according to an embodiment of this application. As shown in Figure 20, the decoder 370 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc. Here, the input of the decoder 370 is a bitstream representing a compressed version of a video or a still image, and the output of the decoder 370 can be a decoded video composed of a series of images or a decoded still image.

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

[0233] Furthermore, decoder 370 can be a second memory having a second processor and a computer program for recording. When the first processor reads and runs the computer program, decoder 370 reads the input bitstream and generates the corresponding decoded video. Alternatively, decoder 370 can also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have connection and data exchange functions similar to the corresponding units in Figure 20.

[0234] It should also be noted that when the embodiments of this application are applied to the encoder 100, the "current block" specifically refers to the block to be encoded in the video image (which can also be simply referred to as the "encoded block"); when the embodiments of this application are applied to the decoder 370, the "current block" specifically refers to the block to be decoded in the video image (which can also be simply referred to as the "decoded block").

[0235] This application provides a decoding method that is applied to a decoder.

[0236] Figure 21 is a schematic diagram of the implementation flow of the decoding method provided in the embodiment of this application. As shown in Figure 21, the method may include the following steps 2101 to 2103:

[0237] Step 2101: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information;

[0238] Step 2102: Determine the block vector of the current block based on the block vector information of the reference block;

[0239] Step 2103: Determine the predicted value of the current block based on the block vector of the current block.

[0240] It is understood that in the embodiments of this application, when predicting the current block, the block vector information of the reference block of the current block (such as the first block vector and / or block vector related information) is considered; thus, it is beneficial to improve the accuracy of the predicted value of the current block, thereby enhancing the performance of video encoding and decoding.

[0241] The following sections will describe further optional implementation methods for each of the above steps, as well as related terms.

[0242] In step 2101, the block vector information of the reference block of the current block is obtained, and the block vector information includes the first block vector and / or block vector related information.

[0243] In this embodiment of the application, the block vector related information of the reference block is not limited, and the block vector related information may include color information and / or flip identifier.

[0244] In this embodiment, block vector information of one or more reference blocks can be obtained through step 2101. The reference block is not limited; it only needs to be a reconstructed CU. Exemplarily, in some embodiments, the reference block may include one or more of the following: a reconstructed CU in a neighboring luma region, a reconstructed CU in a co-located luma region, or a reconstructed CU in a neighboring chroma region. If the reconstructed CU contains BV information (e.g., a CU encoded using IntraTMP, IBC, or other modes), then the block vector information of the reconstructed CU (e.g., BV value, flip identifier, etc.) is obtained.

[0245] In possible implementations, the block vector information of the reference block of the current block can be obtained through one or more of the following methods:

[0246] (1) As mentioned above, the luminance blocks (including but not limited to the five positions, but can be multiple different positions) to which the five luminance sample positions C, TL, TR, BL, and BR belong, as shown in Figure 2, can be searched sequentially to check whether the CUs at these five positions contain BV information, thereby obtaining the block vector information of the reference block of the current block. In addition, multiple positions can be searched in the vicinity of each luminance sample position, including but not limited to the following examples: the current check position coordinates are shifted to the upper left (-8, -8), the current check position coordinates are shifted to the upper left (0, -8), and the current check position coordinates are shifted to the left (-8, 0).

[0247] (2) As mentioned above, spatial neighbor blocks (i.e., an example of a reference block) can also be obtained according to the sampling points shown in Figure 15. Then, it is determined whether these neighbor blocks have BV information (e.g., neighbor blocks are encoded using IBC or IntraTMP) to obtain the block vector information of the reference block of the current block.

[0248] Of course, the above implementation method does not limit the protection scope of step 2101. In short, the block vector information of the reference block can include the block vector related information of one or more reconstructed CUs.

[0249] In step 2102, the block vector of the current block is determined based on the block vector information of the reference block.

[0250] In some embodiments, as shown in FIG22, step 2102 may further include the following steps 2201 and 2202:

[0251] Step 2201: Adjust the first block vector of the reference block according to the block vector related information of the reference block, and determine the second block vector of the reference block;

[0252] Step 2202: Determine the block vector of the current block based on the second block vector of the reference block.

[0253] It can be understood that, by integrating the steps shown in Figure 22 into the overall scheme of the decoding method, in this embodiment, the block vector information of the reference block of the current block is obtained, the block vector information including a first block vector and / or block vector related information; based on the block vector related information of the reference block, the first block vector of the reference block is adjusted to determine the second block vector of the reference block; based on the second block vector of the reference block, the block vector of the current block is determined; based on the block vector of the current block, the prediction value of the current block is determined. Thus, before determining the block vector of the current block based on the first block vector of the reference block, or in other words, before determining the prediction value of the current block based on the first block vector of the reference block, the first block vector of the reference block is first adjusted based on the block vector related information of the reference block; then, the block vector of the current block is determined based on the adjusted and determined second block vector; this makes the determined block vector of the current block more accurate, thereby improving the accuracy of the prediction value of the current block and thus improving the performance of video encoding and decoding.

[0254] Specifically, in step 2201, the first block vector of the reference block is adjusted based on the block vector information of the reference block to determine the second block vector of the reference block.

[0255] In some embodiments, the first block vector of a reference block may include the block vector of the second color component and / or the block vector of the corresponding first color component. The adjustment methods for the block vectors of the second color component and the corresponding first color component of the reference block are the same. Based on the block vector information of the reference block, the block vectors of the two components in the first block vector of the reference block can be adjusted separately, and the determined second block vector of the reference block includes the block vector of the first color component and / or the block vector of the second color component. For example, the second block vector of the reference block includes the block vector obtained by adjusting the block vector of the first color component in the first block vector and / or the block vector obtained by adjusting the second color component in the first block vector.

[0256] In embodiments of this application, the first color component and the second color component can be any two different color components. In some embodiments, the first color component can be a chromaticity component, and the second color component can be a luminance component; for example, the first color component can be a blue chromaticity component or a red chromaticity component, and the second color component can be a luminance component. In other embodiments, the first color component can be a luminance component, and the second color component can be a chromaticity component; for example, the second color component can be a blue chromaticity component or a red chromaticity component. In still other embodiments, the first color component can be a blue chromaticity component, and the second color component can be a red chromaticity component.

[0257] In this application embodiment, the block vector related information of the reference block is not limited. Exemplarily, in some embodiments, the block vector related information of the reference block includes a flip identifier and / or color information; wherein, the color information refers to the color component corresponding to the block vector. In one implementation, in the single-tree case, the stored block vector corresponds to the luminance component in the current CU; in the dual-tree case, depending on the color type of the current CU, the stored block vector corresponds to either the luminance component or the chrominance component in the current CU.

[0258] Specifically, in step 2201, the first block vector of the reference block is adjusted based on the block vector information of the reference block to determine the second block vector of the reference block.

[0259] In this embodiment, the first block vector included in the block vector information of the reference block can be the third block vector of the reference block (i.e., the initial block vector), or the first block vector can be a block vector obtained by scaling the third block vector of the reference block. For example, if the current block is the block of the first color component and the third block vector of the reference block is the block vector corresponding to the second color component, then the first block vector can be obtained by scaling the third block vector according to the chroma sampling format.

[0260] Specifically, in step 2202, the block vector of the current block is determined based on the second block vector of the reference block.

[0261] In some embodiments, if the first block vector included in the block vector information of the reference block is the third block vector of the reference block (i.e., the initial block vector), and if the current block is a block of the first color component, and the first or second block vector of the reference block is the block vector corresponding to the second color component, the second block vector can be scaled according to the chroma sampling format, and then the block vector of the current block can be determined based on the scaled second block vector.

[0262] Specifically, in step 2201, the first block vector of the reference block is adjusted based on the block vector information of the reference block to determine the second block vector of the reference block.

[0263] In this embodiment, the first vector of the reference block is adjusted to obtain the second vector of the reference block. Alternatively, the first vector of the reference block is adjusted to obtain the adjusted first vector, and then the adjusted first vector is further processed to obtain the second vector of the reference block.

[0264] In some embodiments, the first block vector of the reference block can be adjusted according to the flip flag of the reference block to determine the second block vector of the reference block. Of course, different values ​​of the flip flag will correspond to different adjustment methods. The adjustment methods corresponding to different values ​​of the flip flag are described in detail below.

[0265] In some embodiments, if the value of the flip identifier of the reference block is equal to the first value, step 2201 may further include: if the value of the flip identifier of the reference block is equal to the first value, the second block vector of the reference block is equal to the first block vector of the reference block.

[0266] It should be understood that when the value of the flip flag is equal to the first value, it indicates that no flipping is required. In this case, the second block vector of the reference block is the same as the first block vector of the reference block. In the embodiments of this application, there is no limitation on the first value; the first value can be any value, as long as it is different from the second and third values ​​described below. For example, the first value is 0. In one example, when the value of the flip flag of the reference block is equal to 0, the second block vector of the reference block is equal to the first block vector of the reference block.

[0267] In some embodiments, if the value of the flip identifier of the reference block is equal to the second value, step 2201 may further include: adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to the second value.

[0268] It should be understood that when the flip identifier value is equal to the second value, it indicates a horizontal flip. In this case, the horizontal component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. In the embodiments of this application, there is no limitation on the second value; the second value can be any value, as long as it is different from the first value and the third value mentioned below. For example, the second value is 1. In one example, when the flip identifier value of the reference block is equal to 1, the horizontal component of the first block vector of the reference block is adjusted to determine the second vector of the reference block.

[0269] In the embodiments of this application, the adjustment methods for the horizontal components of the first block vector of the first color component and the first block vector of the second color component of the reference block can be the same or different. The different adjustment methods are described below.

[0270] In some embodiments, the block vector related information of the reference block further includes color information; the current block is a block of a first color component; adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block may include: when the color information of the reference block includes that the first block vector of the reference block belongs to a second color component, determining the co-location region of the second color component corresponding to the current block; adjusting the horizontal component of the first block vector of the reference block according to the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the co-location region to determine the second vector of the reference block.

[0271] For example, in one possible implementation, the horizontal component of the second vector block = the horizontal component of the first vector block + 2 × (the horizontal coordinate of the first position of the reference block - the horizontal coordinate of the first position of the corresponding region); the vertical component of the second vector block = the vertical component of the first vector block. In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the reference block and the reference block, and the relative relationship between the first position of the corresponding region and the corresponding region, can be consistent. For example, the first position of the reference block can be the center position or the upper left corner position of the reference block, etc., and the first position of the corresponding region can be the center position or the upper left corner position of the corresponding region, etc.

[0272] In other embodiments, the block vector related information of the reference block further includes color information; the current block is a block of a first color component; adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block includes: when the color information includes that the first block vector of the reference block belongs to the first color component, adjusting the horizontal component of the first block vector of the reference block according to the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the current block to determine the second block vector of the reference block.

[0273] For example, in one possible implementation, the horizontal component of the second vector block = the horizontal component of the first vector block + 2 × (the horizontal coordinate of the first position of the reference block - the horizontal coordinate of the first position of the current block); the vertical component of the second vector block = the vertical component of the first vector block. In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the reference block and the reference block is consistent with the relative relationship between the first position of the current block and the current block. For example, the first position of the reference block can be the center position or the upper left corner position of the reference block, etc., and the first position of the current block can be the center position or the upper left corner position of the current block, etc.

[0274] That is, if the value of the flip identifier of the reference block is equal to the third value, in some embodiments, step 901 may further include: adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to the third value.

[0275] It should be understood that when the value of the flip identifier is equal to the third value, it indicates a vertical flip. In this case, the vertical component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. In this embodiment, there is no limitation on the third value; the third value can be any value, as long as it is different from the first and second values. For example, the third value is 2. In one example, when the value of the flip identifier of the reference block is equal to 2, the vertical component of the first block vector of the reference block is adjusted to determine the second vector of the reference block.

[0276] In the embodiments of this application, the adjustment methods for the vertical components of the first block vector of the first color component and the first block vector of the second color component of the reference block can be the same or different. The different adjustment methods are described below.

[0277] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of a first color component; adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: when the color information includes that the first block vector of the reference block belongs to a second color component, determining the co-location region of the second color component corresponding to the current block; adjusting the vertical component of the first block vector of the reference block according to the vertical coordinate of the first position of the reference block and the vertical coordinate of the first position of the co-location region to determine the second block vector of the reference block.

[0278] For example, in one possible implementation, the horizontal component of the second vector block equals the horizontal component of the first vector block; the vertical component of the second vector block equals the vertical component of the first vector block plus 2 × (vertical coordinates of the first position of the reference block - vertical coordinates of the first position of the corresponding region)). In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the reference block and the reference block, and the relative relationship between the first position of the corresponding region and the corresponding region, can be consistent. For example, the first position of the reference block can be the center position or the upper left corner position of the reference block, etc., and the first position of the corresponding region can be the center position or the upper left corner position of the corresponding region, etc.

[0279] Furthermore, in some other embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: when the color information includes that the first block vector of the reference block belongs to the first color component, adjusting the vertical component of the first block vector of the reference block according to the vertical coordinates of the first position of the reference block and the vertical coordinates of the first position of the current block to determine the second block vector of the reference block.

[0280] For example, in one possible implementation, the horizontal component of the second vector block equals the horizontal component of the first vector block; the vertical component of the second vector block equals the vertical component of the first vector block plus 2 × (vertical coordinates of the first position of the reference block - vertical coordinates of the first position of the current block)). In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the reference block and the reference block is consistent with the relative relationship between the first position of the current block and the current block. For example, the first position of the reference block is the center position or the upper left corner position of the reference block, etc., and the first position of the current block is the center position or the upper left corner position of the current block, etc.

[0281] Step 2202: Determine the block vector of the current block based on the second block vector of the reference block.

[0282] In some embodiments, as shown in FIG23, step 2202 may further include the following steps 2301 and 2302:

[0283] Step 2301: Determine the first candidate list of the current block based on the second block vector of the reference block and the block vector related information of the reference block;

[0284] Step 2302: Determine the block vector of the current block based on the first candidate list of the current block.

[0285] Specifically, in step 2301, the first candidate list of the current block is determined based on the second block vector of the reference block and the relevant information of the block vector of the reference block.

[0286] As mentioned earlier, in a further implementation of step 2202, if the first block vector included in the block vector information of the reference block is the third block vector of the reference block (i.e., the initial block vector), and if the current block is a block of the first color component and the second block vector of the reference block is the block vector corresponding to the second color component, then the second block vector can be scaled according to the chroma sampling format, and then the block vector of the current block can be determined based on the scaled second block vector. Therefore, for step 2301, a further implementation includes: if the current block is a block of the first color component and the first or second block vector of the reference block is the second color component, the second block vector of the reference block is scaled according to the chroma sampling format, and the first candidate list of the current block is determined based on the scaled second block vector and the block vector information of the reference block. Of course, if the first block vector included in the block vector information of the reference block is a block vector obtained by scaling the third block vector of the reference block, then it is not necessary to scale the second vector again in step 2302.

[0287] Specifically, in step 2301, the first candidate list of the current block is determined based on the second block vector of the reference block and the relevant information of the block vector of the reference block.

[0288] In some embodiments, the current block is a block of the first color component; step 2301 may further include:

[0289] If the nth reference block satisfies the first condition, the second block vector of the nth reference block and the block vector related information of the reference block are added as block vector information candidates to the first candidate list of the current block; n is greater than 0 and less than or equal to the number of reference blocks;

[0290] The first condition includes one or more of the following conditions:

[0291] (1) The template area of ​​the current block has been reconstructed;

[0292] (2) The template region of the co-position region of the second color component corresponding to the current block has been reconstructed;

[0293] (3) The template region of the area pointed to by the second block vector of the nth reference block has been reconstructed;

[0294] (4) The template region of the region pointed to by the second block vector of the other color component corresponding to the second block vector of the nth reference block has been reconstructed;

[0295] (5) The region pointed to by the second block vector of the nth reference block has been reconstructed;

[0296] (6) The region pointed to by the second block vector of the other color component corresponding to the second block vector of the nth reference block has been reconstructed;

[0297] (7) The offset position obtained based on the second block vector of the nth reference block is on the current image (i.e., the offset position does not exceed the boundary of the current image);

[0298] (8) The reference region obtained based on the second block vector of the nth reference block does not overlap with the current block (i.e., it does not cover the current block);

[0299] (9) The second block vector of the nth reference block is not repeated with the block vector currently existing in the first candidate list.

[0300] In some embodiments, the block vector-related information of the reference block includes color information and / or flip identifiers.

[0301] For step 2302, the block vector of the current block is determined according to the first candidate list of the current block.

[0302] In this embodiment, the first candidate list includes, but is not limited to, one or more types of block vector information as follows: block vector information of adjacent or neighboring blocks, block vector information derived from a predefined search range, or block vector information carried by the reference block itself to which the block vector of an adjacent or neighboring block points. In one possible implementation, the block vector information obtained based on the predefined search range may be block vector information obtained by template matching within the predefined search range.

[0303] In the embodiments of this application, all or part of the block vectors in the first candidate list of the current block can be used as the block vector of the current block. In one implementation, all block vectors in the first candidate list of the current block can be used as the block vector of the current block. In another implementation, the block vector of the current block can also be determined from the first candidate list based on template cost. The method for determining the block vector of the current block based on template cost will be described below.

[0304] It is understood that there may be one or more block vector information candidates in the first candidate list. A block vector information candidate may include one or more of the following: block vector of the first color component of the reference block, block vector of the second color component of the reference block, color information of the reference block, and flip identifier of the reference block; wherein, the block vector of the first color component of the reference block can be obtained by adjusting (e.g., scaling) the second color component of the reference block according to the color sampling format, or the block vector of the second color component of the reference block can be obtained by adjusting (e.g., scaling) the first color component of the reference block according to the color sampling format.

[0305] The following describes a further implementation of step 2302, namely, a scheme for determining the block vector of the current block based on template cost.

[0306] In some embodiments, step 2302, as shown in FIG24, may further include the following steps 2401 to 2403:

[0307] Step 2401: Determine the template region of the current block;

[0308] Step 2402: Based on the template region of the current block, determine the first generation value of one or more block vector information candidates in the first candidate list of the current block;

[0309] Step 2403: Determine the block vector of the current block based on the first-generation values ​​corresponding to the one or more block vector information candidates.

[0310] It is understood that, in the embodiments of this application, the first generation value of the block vector information in the first candidate list is determined based on the template region of the current block, and the block vector of the current block is determined based on the first generation value; thus, the determined block vector of the current block is more accurate, thereby improving the accuracy of the predicted value of the current block and enhancing the performance of video encoding and decoding.

[0311] The following describes further optional implementation methods and related terms for steps 2401 to 2403.

[0312] For step 2401, determine the template region of the current block.

[0313] In some embodiments, if adjacent reference samples of the current block are available, the template region of the current block is determined.

[0314] Furthermore, in some embodiments, determining the template region of the current block includes: determining the template region of the current block based on available adjacent reference samples of the current block.

[0315] In this embodiment, the template region of the current block is not limited. For example, FIG25 is a schematic diagram of the template of the current block provided in this embodiment; as shown in FIG25, the template region of the current block may include one or more of the templates shown in FIG25. That is, the template region of the current block may include one or more of the following templates: lower left template, left template, upper left template, upper template, and upper right template. In some embodiments, if one or more of the above templates are available (e.g., the included sample has been reconstructed), the one or more available templates are used as the template region of the current block.

[0316] For step 2402, based on the template region of the current block, determine the first generation value of one or more block vector information candidates in the first candidate list of the current block.

[0317] Furthermore, in some embodiments, step 2402 may further include the following: determining one or more block vector information candidates from the first candidate list of the current block and obtaining the first generation value by predicting them on the template region of the current block.

[0318] In the embodiments of this application, for predicting the same color component, the prediction method based on the candidate block vector information on the template region of the current block and the prediction method based on the block vector of the current block on the current block can be the same (for the same color component, the prediction method of the template region and the prediction method of the current block are the same). Of course, in another implementation, for predicting the same color component, the prediction method based on the candidate block vector information on the template region of the current block and the prediction method based on the block vector of the current block on the current block can also be different (for the same color component, the prediction method of the template region and the prediction method of the current block can also be different).

[0319] In one example, the first-generation value can be obtained based on the IBC prediction model. The method for obtaining the first-generation value based on the IBC prediction model is described below.

[0320] That is, further, in some embodiments, as shown in FIG26, determining the first generation value obtained by predicting one or more block vector information candidates in the first candidate list of the current block on the template region of the current block may include the following steps 2601 to 2603:

[0321] Step 2601: Determine the block vector information of the template region based on the p-th block vector information candidate; wherein, the block vector information of the template region includes the block vector of the template region and / or the block vector related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block;

[0322] Step 2602: Determine the first prediction block of the template region based on the block vector information of the template region;

[0323] Step 2603: Determine the first generation value corresponding to the candidate vector information of the p-th block based on the first predicted block of the template region and the reconstructed value of the template region.

[0324] The following describes further optional implementation methods and related terms for steps 2601 to 2603.

[0325] For step 2601, based on the p-th block vector information candidate, the block vector information of the template region is determined; wherein, the block vector information of the template region includes the block vector of the template region and / or the block vector-related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block. It should be understood that the method for determining the first cost value for each block vector information candidate is the same.

[0326] In some embodiments, the p-th block vector information candidate includes the second block vector of the reference block and the block vector-related information of the reference block. For example, the block vector-related information of the reference block includes the flip identifier and / or color information of the reference block.

[0327] In some embodiments, when determining the block vector related information of the template region based on the p-th block vector information candidate, the block vector related information of the template region may be the same as the block vector related information in the p-th block vector information candidate.

[0328] It is understood that in the embodiments of this application, when determining the block vector of the template region, not only the second block vector in the p-th block vector information candidate is considered, but also the relevant information of the block vector in the candidate is also considered. In this way, it is beneficial to improve the accuracy of the block vector of the template region, thereby being beneficial to determine a more accurate first-generation value, and further beneficial to determine a more accurate block vector of the current block based on the first-generation value of one or more block vector information candidates in the first candidate list, thereby improving the accuracy of the predicted value of the current block.

[0329] In this embodiment of the application, for step 2601, the block vector of the template region can be determined based on the flip identifier in the p-th block vector information candidate; wherein, different values ​​of the flip identifier correspond to different methods for determining the block vector of the current block. The determination methods corresponding to different values ​​of the flip identifier are described in detail below.

[0330] It should be noted that, in the embodiments of this application, the method for determining the block vector of the first color component of the template region is the same as the method for determining the block vector of the second color component of the template region. The method for determining the block vector of the template region (i.e., the implementation method) described below is applicable to both the block vector of the first color component and the block vector of the second color component of the template region.

[0331] In one possible implementation, step 2601 may further include: when the value of the flip identifier of the p-th block vector information candidate is equal to the first value, the block vector of the template region includes the block vector (i.e., the second block vector) in the p-th block vector information candidate. For example, Figure 16 shows a schematic diagram of tBV and lBV when no flip adjustment is required. It can be understood that the first value is used to indicate that no flip adjustment is needed. The first value can be any value, and this application does not limit it; in short, the first value must be different from the second and third values. For example, the first value is 0.

[0332] In another possible implementation, step 2601 may further include: if the value of the flip identifier of the p-th block vector information candidate is equal to the second value, adjusting the horizontal component of the block vector of the p-th block vector information candidate to determine the block vector of the left template of the template region; and / or, the block vector of the upper template of the template region includes the block vector in the p-th block vector information candidate. It is understood that the second value is used to indicate horizontal flipping. The second value can be any value, and this application does not limit it; in short, the second value must be different from the first and third values. For example, the second value is equal to 1.

[0333] Furthermore, in some embodiments, adjusting the horizontal component of the block vector of the p-th block vector information candidate to determine the block vector of the left template of the template region includes: adjusting the horizontal component of the block vector of the p-th block vector information candidate based on the horizontal coordinate of the first position of the current block and the horizontal coordinate of the first position of the left template of the template region to determine the block vector of the left template of the template region.

[0334] Furthermore, in some embodiments, when the value of the flip identifier of the p-th block vector information candidate is equal to the second value, the horizontal component of the block vector of the left template of the template region is the result of adjusting the horizontal component of the block vector of the p-th block vector information candidate, and the vertical component of the block vector of the left template is the vertical component of the block vector of the p-th block vector information candidate.

[0335] For example, in one possible implementation, when the value of the flip identifier of the p-th block vector information candidate is equal to the second value, the horizontal component of the block vector of the left template of the template region = the horizontal component of the block vector of the p-th block vector information candidate + 2 × (the horizontal coordinate of the first position of the current block - the horizontal coordinate of the first position of the left template). In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the current block and the current block and the relative relationship between the first position of the left template and the left template can be consistent. For example, the first position of the reference block is the center position or the upper left corner position of the reference block, etc., and the first position of the corresponding region is the center position or the upper left corner position of the corresponding region, etc. For example, the schematic diagram of tBV and lBV after horizontal flip perception adjustment shown in Figure 31 mentioned below.

[0336] In another possible implementation, step 2601 may further include: if the value of the flip identifier of the p-th block vector information candidate is equal to the third value, adjusting the vertical component of the block vector of the p-th block vector information candidate to determine the block vector of the upper template of the template region; and / or, the block vector of the left template of the template region includes the block vector in the p-th block vector information candidate. It is understood that the third value is used to indicate vertical flipping. The third value can be any value, and this application does not limit it; in short, the third value must be different from the first and second values. For example, the third value is equal to 2.

[0337] Further, in some embodiments, adjusting the vertical component of the block vector of the p-th block vector information candidate to determine the block vector of the upper template of the template region includes: adjusting the vertical component of the block vector of the p-th block vector information candidate according to the vertical coordinate of the first position of the current block and the vertical coordinate of the first position of the upper template of the template region to determine the block vector of the upper template of the template region.

[0338] Furthermore, in some embodiments, when the value of the flip identifier of the p-th block vector information candidate is equal to the third value, the horizontal component of the block vector of the upper template of the template region is the horizontal component of the block vector of the p-th block vector information candidate; the vertical component of the block vector of the upper template of the template region is the result of adjusting the vertical component of the block vector of the p-th block vector information candidate.

[0339] For example, in one possible implementation, when the value of the flip identifier of the p-th block vector information candidate is equal to the third value, the vertical component of the block vector of the left template of the template region = the vertical component of the block vector of the p-th block vector information candidate + 2 × (vertical coordinate of the first position of the current block - vertical coordinate of the first position of the left template). In this embodiment, the first position is not limited; in short, the relative relationship between the first position of the current block and the current block and the relative relationship between the first position of the left template and the left template can be consistent. For example, the first position of the reference block is the center position or the upper left corner position of the reference block, etc., and the first position of the corresponding region is the center position or the upper left corner position of the corresponding region, etc. For example, the schematic diagram of tBV and lBV after vertical flip perception adjustment shown in Figure 32 mentioned below.

[0340] In other embodiments, step 2302 may further include: if the first candidate list of the current block includes a block vector information candidate, the block vector of the current block includes the block vector in the first candidate list. In some embodiments, if the first candidate list of the current block includes a block vector information candidate, the block vector-related information of the current block includes the block vector-related information in the first candidate list.

[0341] In cases where the first candidate list of the current block includes multiple block vector information candidates, in some embodiments, the block vector of the current block can be determined by the method shown in Figure 26 or by a further implementation.

[0342] For step 2602, the first predicted block of the template region is determined based on the block vector information of the template region.

[0343] In this embodiment, the block vector information of the template region may include the block vector of the template region and / or the flip identifier of the template region. In this embodiment, further implementation of step 2602 is not limited. The predicted value of the template region obtained based on the block copy method may be adjusted without referring to the block vector information of the template region; instead, the reconstructed value or downsampled value of the region pointed to by the block vector of the template region may be directly used as the first predicted block of the template region. Alternatively, the predicted value of the template region obtained based on the block copy method may be adjusted with reference to the block vector information of the template region, and the first predicted block of the template region may be determined based on the adjusted result, thereby improving the accuracy of the first predicted block and enhancing video encoding / decoding performance. The implementation of adjusting the predicted value of the template region is described below.

[0344] That is, in some embodiments, step 2602 may further include: determining a second prediction block of the template region based on the block vector of the template region; and adjusting the second prediction block of the template region based on the block vector related information of the template region to determine a first prediction block of the template region.

[0345] Regarding the determination of the second prediction block, in one possible implementation, the second prediction block of the template region can be obtained by block copying based on the block vector of the template region, that is, the second prediction block is obtained by using the IBC prediction mode.

[0346] For example, the block vector related information of the template region includes the flip identifier of the template region and / or the color information of the template region. In one example, the flip identifier of the template region is inherited from the flip identifier in the corresponding block vector information candidate.

[0347] Based on this, the second prediction block can be adjusted according to the flipping flag of the template region to obtain the first prediction block of the template region.

[0348] That is, in some embodiments, adjusting the second predicted block of the template region based on the block vector related information of the template region to determine the first predicted block of the template region includes: when the value of the flip identifier of the template region is equal to the first value, the first predicted block of the template region is equal to the second predicted block of the template region.

[0349] In other embodiments, adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: when the value of the flip identifier of the template region is equal to a second value, horizontally flipping the second prediction block of the template region to obtain the first prediction block of the template region.

[0350] In some other embodiments, adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: vertically flipping the second prediction block of the template region when the value of the flip identifier of the template region is equal to a third value to obtain the first prediction block of the template region.

[0351] It should be understood that when the flip flag value is equal to the first value, it indicates that no flipping is required. In this case, the first predicted block of the template region is equal to the second predicted block of the template region. In this embodiment, the first value is not limited in any way; it can be any value, as long as it is different from the second and third values. For example, the first value is 0. In one example, when the flip flag value of the reference block is equal to 0, the first predicted block of the template region is equal to the second predicted block of the template region.

[0352] It should be understood that the value of the flip identifier is equal to the second value, indicating a horizontal flip. For example, as shown in the following formula, the second prediction block of the template region is horizontally flipped to obtain the first prediction block of the template region:

[0353] p′ top (x,y)=p top (w top -1-x,y)

[0354] p′ left (x,y)=p left (w left -1-x,y)

[0355] Here, in this formula, w top h is the width of the upper template in the template area. top w is the height of the upper template in the template area. left h is the width of the left template in the template area. left p is the height of the left template in the template area. top (x,y) is the predicted value at position (x,y) in the template region before the upper template is flipped (i.e., the value at position (x,y) in the second prediction block of the upper template), p′ top( x, y) is the final template prediction value at position (x, y) after flipping the upper template of the template region, p left (x,y) is the predicted value at position (x,y) of the left template of the template region before it is flipped (i.e., the value at position (x,y) in the second prediction block of the left template), p′ left (x,y) is the final template prediction value at position (x,y) after flipping the left template in the template region.

[0356] It should be understood that the value of the flip identifier is equal to the third value, indicating a vertical flip. For example, as shown in the following formula, the second prediction block of the template region is vertically flipped to obtain the first prediction block of the template region:

[0357] p′ top (x,y)=p top (x,htop -1-y)

[0358] p′ left (x,y)=p left (x,h left -1-y)

[0359] The parameters in this formula are explained above and will not be repeated here.

[0360] In this embodiment, the second value is not limited in any way; it can be any value, as long as it differs from both the first and third values. For example, the second value is 1. Similarly, the third value is not limited in any way; it can be any value, as long as it differs from both the first and second values. For example, the third value is 2.

[0361] For step 2603, the first generation value corresponding to the candidate vector information of the p-th block is determined based on the first predicted block of the template region and the reconstructed value of the template region.

[0362] In this application embodiment, the method for determining the first-generation value is not limited and can be various. For example, evaluation criteria such as Sum of Absolute Errors (SAD), Sum of Transformed Absolute Errors (SATD), Sum of Squared Differences (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Rate Distortion Function (RDO) can be selected to determine the first-generation value. Taking the SAD evaluation criterion as an example, the calculation formula is as follows:

[0363] Here, T p,m T represents the value of the m-th sample in the first predicted block of the template region determined based on the candidate vector information of the p-th block. m M represents the reconstructed value of the m-th sample in the template region; M represents the value of the sample participating in SAD(T). p The number of samples calculated.

[0364] For step 2403, the block vector of the current block is determined based on the first generation value corresponding to the one or more block vector information candidates.

[0365] In some embodiments, step 2403 may further include: determining the block vector of the current block based on one or more block vector information candidates corresponding to the minimum first-generation value. For example, the block vector of the current block includes block vectors from one or more block vector information candidates corresponding to the minimum first-generation value. Alternatively, the block vector of the current block may be further determined based on block vectors from one or more block vector information candidates corresponding to the minimum first-generation value. For example, in one possible implementation, the block vector of the current block can be obtained by searching based on the selected block vector information candidates according to a predefined search area and / or search step size, etc.

[0366] In some embodiments, the block vector information of the current block can inherit from or be equal to the block vector information candidate corresponding to the minimum first-generation value.

[0367] It is understood that, based on the above embodiments, one or more block vectors of the current block can be obtained, and then, based on the one or more block vectors of the current block, the predicted value of the current block can be determined. The following describes a further implementation method for determining the predicted value of the current block.

[0368] For step 2103, the predicted value of the current block is determined based on the block vector of the current block.

[0369] In some embodiments, step 2103 may further include: determining the predicted value of the current block based on the block vector of the current block and the block vector-related information of the current block.

[0370] It is understood that in the embodiments of this application, when determining the predicted value of the current block, not only the block vector of the current block is considered, but also the block vector-related information of the current block (i.e., the uncertainty of the meaning of the block vector of the current block, such as the block vector-related information including but not limited to flip flags and / or color information); thus, it is beneficial to improve the accuracy of the predicted value of the current block, thereby enhancing the video encoding and decoding performance.

[0371] In the embodiments of this application, there is no limitation on how the block vector related information of the current block is used to determine the predicted value of the current block. The block vector related information can be used to adjust the input or output information of one or more stages in the process of determining the predicted value of the current block. Examples include Embodiments 1, 2 and 3 described below.

[0372] In Embodiment 1, as shown in Figure 27, the step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block may further include the following steps 2701 to 2702:

[0373] Step 2701: Determine the first reference region of the current block based on the block vector of the current block and the relevant information of the block vector of the current block.

[0374] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block and / or the color information of the current block. It is understood that for further implementations of step 2701, different values ​​for the flip identifier can lead to different further implementations of step 2701. The following describes in detail the further implementations corresponding to different values ​​of the flip identifier.

[0375] That is, in some embodiments, step 2701 may further include: when the flip identifier of the current block is equal to a first value, the corresponding first reference region is the second reference region pointed to by the block vector of the current block. For example, Figure 33 mentioned below shows a schematic diagram of obtaining the reference region without flipping.

[0376] As mentioned above, the current block may have one or more block vectors; each block vector in the current block corresponds to block vector-related information (such as a flip flag). Therefore, "when the flip flag of the current block equals a first value" can be understood as "when the flip flag corresponding to the q-th block vector of the current block equals a first value." Thus, "the second reference region pointed to by the block vector of the current block" can be understood as the reference region pointed to by the q-th block vector of the current block. Here, q is greater than 0 and less than or equal to the number of block vectors in the current block.

[0377] It should be understood that the value of the flip flag corresponding to the q-th block vector of the current block is equal to the first value, indicating that no flipping is required, that is, the first reference region is the second reference region pointed to by the q-th block vector. In the embodiments of this application, there is no limitation on the first value; the first value can be any value, as long as it is different from the second and third values. For example, the first value is 0.

[0378] In other embodiments, step 2701 may further include: if the flip identifier of the current block is equal to a second value, horizontally flipping the second reference region pointed to by the block vector of the current block, or horizontally reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region. For example, Figure 34 mentioned below shows a schematic diagram of obtaining the reference region in the case of horizontal flipping.

[0379] Here, "when the flip identifier of the current block is equal to the second value" can be understood as when the flip identifier corresponding to the q-th block vector of the current block is equal to the second value; "the second reference area pointed to by the block vector of the current block" can be understood as the second reference area pointed to by the q-th block vector of the current block.

[0380] It should be understood that the value of the flip flag corresponding to the q-th block vector of the current block is equal to the second value, indicating a horizontal flip. In this embodiment, the second value is not limited in any way; it can be any value, as long as it is different from the first and third values. For example, the second value is 1.

[0381] In some other embodiments, step 2701 may further include: if the flip identifier of the current block is equal to a third value, vertically flipping the second reference region pointed to by the block vector of the current block, or vertically reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region. For example, Figure 35 mentioned below shows a schematic diagram of obtaining the reference region in the case of vertical flipping.

[0382] Here, "when the flip identifier of the current block is equal to the third value" can be understood as "when the flip identifier corresponding to the qth block vector of the current block is equal to the third value", and "the second reference area pointed to by the block vector of the current block" can be understood as "the second reference area pointed to by the qth block vector of the current block".

[0383] It should be understood that the value of the flip flag corresponding to the q-th block vector of the current block is equal to the third value, indicating a vertical flip. In this embodiment, there is no limitation on the third value; the third value can be any value, as long as it is different from the first and second values. For example, the third value is 2.

[0384] It can be understood that when there is only one block vector for the current block, the determined second reference region can be one, for example, as shown in Figure 10, where the second reference region is reference region 0 pointed to by BV0 of the coding unit. When there are multiple block vectors for the current block, the determined second reference regions can be multiple (two or more), for example, as shown in Figure 6, where the second reference region of the current block includes reference region 0 pointed to by BV0, reference region 1 pointed to by BV1, ..., reference region n pointed to by BVn; where BV0 to BVn are the block vectors of the coding unit (i.e., the current block).

[0385] As can be seen from the above embodiments, in a further implementation of step 2701, "determine the first reference region of the current block based on the block vector of the current block and the relevant information of the block vector of the current block," the method for obtaining the first reference region based on the second reference region pointed to by the block vector of the current block is determined based on the flip flags corresponding to the block vector of the current block. In one possible implementation, data can be directly read from the buffer into the cache space corresponding to the second reference region (ref block) pointed to by the block vector of the current block, according to the data reading order corresponding to the flip flags of the current block. For example, suppose the top-left sample position of the current block is (x0, y0), the flip flag of the current block is equal to the second value (corresponding to horizontal flip), and the reference sample (ref sample) corresponding to (x0, y0) pointed to by the BV of the current block is (xRef0, yRef0) (i.e. the top-right sample of the ref block), then refSample[x][y] = refPic[xRef0-x][yRef0+y], x = 0, ...currWidth-1, y = 0, ...currHeight-1.

[0386] Step 2702: Determine the predicted value of the current block based on the first reference region of the current block.

[0387] It is understood that when the block vector of the current block includes one, the first reference region of the current block obtained through step 2701 is one; when the block vector of the current block includes multiple, the first reference regions of the current block obtained through step 2701 are multiple. In this embodiment, the implementation of step 2702 is not limited, that is, the method of predicting the current block based on one or more second regions (such as intra-frame prediction) is not limited. In one possible implementation, the model parameters (i.e., filter coefficients) of the filtering model (i.e., prediction model or filter) can be determined based on the one or more first reference regions; then, based on the determined model parameters of the filtering model, the predicted value of the current block is determined; wherein, the filtering model can be an extrapolation filter (e.g., the 15-tap filter shown in Figure 11), or the filtering model can be the model shown in the following formula:

[0388] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B;

[0389] Among them, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 and c 10The 11 coefficients represent the convolution filter. C, N, S, W, and E represent the downsampled luminance values ​​at positions (x,y), (x,y-1), (x,y+1), (x-1,y), and (x+1,y) of the current chroma block. P(C), P(N), P(S), P(E), and P(W) represent nonlinear terms, and B represents the offset term. The specific derivation of the nonlinear and offset terms is shown below:

[0390] P(C)=(C×C+midVal)>>bitDepth

[0391] P(N)=(N×N+midVal)>>bitDepth

[0392] P(S)=(S×S+midVal)>>bitDepth

[0393] P(E)=(E×E+midVal)>>bitDepth

[0394] P(W)=(W×W+midVal)>>bitDepth

[0395] B = midval

[0396] Among them, the nonlinear term and the offset term are midval = 512 in a video with a bit depth of 10. Model parameters c0~c 10 The filter coefficients are obtained by minimizing the mean square error (MSE) between the chromaticity prediction samples and the chromaticity reconstruction samples in the reference region. Specifically, the autocorrelation matrix of the luminance downsampling input and the cross-correlation vector between the luminance downsampling input and the chromaticity output in the reference region are constructed, and the filter coefficients are obtained by LDL decomposition.

[0397] In another possible implementation of step 2702, one or more intra-frame prediction modes of the current block can be determined based on the one or more first reference regions; based on this, the prediction value of the current block is determined.

[0398] For example, in some embodiments, a gradient histogram can be determined based on the reconstructed or predicted values ​​of the one or more first reference regions, and R intra-prediction modes with the highest amplitudes can be selected to participate in the gradient histogram statistics. Based on these one or more intra-prediction modes, the corresponding current block prediction value (denoted as dimdPredr, r = 0.., R-1) is determined respectively. Then, according to the fusion weight (denoted as weightr, r = 0.., R-1), the final prediction value of the current block is generated. The formula for calculating the prediction value at the current block sample position (x, y) is as follows:

[0399] predSamples[x][y]=dimdPred0[x][y]*weight0+…+dimdPred R-1 [x][y]*weight R-1 ;

[0400] For example, in some embodiments, the predicted values ​​of one or more first reference regions can be calculated based on the modes in the established intra-frame candidate mode list, and the matching cost (e.g., SAD) between the predicted and reconstructed values ​​of the first reference regions can be determined. The mode with the lowest matching cost can be used as the predicted mode of the current block, and the final predicted value of the current block can be generated based on this.

[0401] In Embodiment 2, as shown in Figure 28, the step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block may further include the following steps 2801 to 2804:

[0402] Step 2801: Determine the second reference region of the current block based on the block vector of the current block.

[0403] It can be understood that when there is only one block vector for the current block, the determined second reference region can be one, for example, as shown in Figure 10, where the second reference region is reference region 0 pointed to by BV0 of the coding unit. When there are multiple block vectors for the current block, the determined second reference regions can be multiple (two or more), for example, as shown in Figure 6, where the second reference region of the current block includes reference region 0 pointed to by BV0, reference region 1 pointed to by BV1, ..., reference region n pointed to by BVn; where BV0 to BVn are the block vectors of the coding unit (i.e., the current block).

[0404] Step 2802: Adjust the first relevant data of the second reference region of the current block according to the block vector related information of the current block to obtain the second relevant data.

[0405] For example, the block vector related information of the current block includes the flip identifier and / or color information of the current block.

[0406] In this embodiment, the first relevant data of the second reference region described in step 2802 is not limited. In some embodiments, the first relevant data of the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region; based on this, the first derivation related information is determined (step 2803 as shown in FIG28), wherein the first derivation related information includes the filtering coefficients of the filtering model. For example, the filtering model can also be the model shown in the following formula:

[0407] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B;

[0408] For example, the filtering model can also be an extrapolation filter (such as the 15-tap filter shown in Figure 11).

[0409] For the first relevant data of the second reference region, which includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region, and the first derived relevant information including the filtering coefficients of the filtering model, the value of the flip flag of the current block is different, and the adjustment method of the first relevant data is different. The adjustment method corresponding to the flip flag with different values ​​is described below.

[0410] That is, further, in some embodiments, adjusting the first related data of the second reference region of the current block according to the block vector related information of the current block to obtain the second related data includes: when the flip identifier of the current block is equal to the first value, the second related data includes the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region.

[0411] It is understood that the first value indicates that no flipping is required. In this embodiment, there are no limitations on the first value; it can be any value, as long as it is different from the second and third values. For example, the first value is 0.

[0412] In other embodiments, adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: when the flip identifier of the current block is equal to the second value, horizontally flipping the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region to obtain the second relevant data.

[0413] It is understood that the second value represents a horizontal flip. In this embodiment, the second value is not limited in any way; it can be any value, as long as it is different from both the second and third values. For example, the second value is 1.

[0414] In some other embodiments, adjusting the first related data of the second reference region of the current block according to the block vector related information of the current block to obtain the second related data includes: when the flip identifier of the current block is equal to a third value, vertically flipping the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region to obtain the second related data.

[0415] It is understood that the third value represents vertical flipping. In this embodiment, there are no limitations on the third value; the third value can be any value, as long as it is different from the first and second values. For example, the third value is 2.

[0416] For example, in a scheme where the first relevant data for the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region, and the first derived relevant information includes the filter coefficients of the filter model, the predicted value of the current block is determined based on the first relevant data. This is applicable to prediction methods based on BVG-CCCM or prediction methods based on BVG-EIP mode.

[0417] In this embodiment, the first relevant data of the second reference region described in step 2802 is not limited. In other embodiments, the first relevant data of the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, the first index being used to identify intra-frame prediction modes; based on this, a first derivation-related information is determined (step 2803 as shown in Figure 28), wherein the first derivation-related information includes a gradient histogram. In this scheme, different values ​​of the flip flag of the current block result in different adjustment methods for the first relevant data, and the adjustment methods corresponding to different values ​​of the flip flag are described below.

[0418] That is, in some embodiments, adjusting the first relevant data of the second reference region of the current block according to the block vector related information of the current block to obtain the second relevant data includes: when the flip identifier of the current block is equal to the first value, the second relevant data includes the first index.

[0419] It is understood that the first value indicates that no flipping is required. In this embodiment, there are no limitations on the first value; it can be any value, as long as it is different from the second and third values. For example, the first value is 0.

[0420] In other embodiments, adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: when the flip identifier of the current block is equal to the second value, horizontally flipping the intra-prediction mode corresponding to the first index to determine the second index; the second relevant data includes the second index.

[0421] It is understood that the second value represents a horizontal flip. In this embodiment, the second value is not limited in any way; it can be any value, as long as it is different from both the second and third values. For example, the second value is 1.

[0422] In some other embodiments, adjusting the first relevant data of the second reference region of the current block based on the block vector information of the current block to obtain the second relevant data includes: when the flip identifier of the current block is equal to a third value, vertically flipping the intra-prediction mode corresponding to the first index to determine the third index; the second relevant data includes the third index.

[0423] It is understood that the third value represents vertical flipping. In this embodiment, there are no limitations on the third value; the third value can be any value, as long as it is different from the first and second values. For example, the third value is 2.

[0424] For example, the first relevant data for the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, and the first derived relevant information includes a gradient histogram. In this scheme, the predicted value of the current block is determined based on the first relevant data, which is applicable to prediction methods based on the BVG-DIMD mode.

[0425] Step 2803: Determine the first derivation related information based on the second related data.

[0426] As mentioned above, in the scheme where the first relevant data for the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region, the first derivation relevant information includes the filtering coefficients of the filtering model; in the scheme where the first relevant data for the second reference region includes the first index determined based on the gradient value of the samples in the second reference region, the first derivation relevant information includes the gradient histogram.

[0427] Step 2804: Determine the predicted value of the current block based on the first derived relevant information.

[0428] For example, in a scheme where the first derivation-related information includes the filter coefficients of the filter model, the predicted value of the current block can be determined based on the filter model. Similarly, in a scheme where the first derivation-related information includes the gradient histogram, one or more angle prediction modes corresponding to the maximum gradient magnitudes can be selected as the intra-frame prediction modes for the current block; the predicted value of the current block is then determined based on one or more intra-frame prediction modes for the current block.

[0429] In Embodiment 3, as shown in Figure 29, the step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block may further include the following steps 2901 to 2904:

[0430] Step 2901: Determine the second reference region of the current block based on the block vector of the current block.

[0431] It can be understood that when there is only one block vector for the current block, the determined second reference region can be one, for example, as shown in Figure 10, where the second reference region is reference region 0 pointed to by BV0 of the coding unit. When there are multiple block vectors for the current block, the determined second reference regions can be multiple (two or more), for example, as shown in Figure 6, where the second reference region of the current block includes reference region 0 pointed to by BV0, reference region 1 pointed to by BV1, ..., reference region n pointed to by BVn; where BV0 to BVn are the block vectors of the coding unit (i.e., the current block).

[0432] Step 2902: Determine the second derivation-related information based on the first relevant data of the second reference region of the current block; the second derivation-related information includes the filter coefficients of the first filter model;

[0433] In one example, the first filtering model can be the model shown below:

[0434] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B;

[0435] In another example, the first filtering model could also be an extrapolation filter (e.g., the 15-tap filter shown in Figure 11).

[0436] Step 2903: Adjust the first filtering model based on the block vector related information of the current block and the second derived related information to obtain the second filtering model.

[0437] In the embodiments of this application, adjusting the first filtering model includes, but is not limited to, adjusting the model parameters (i.e., the filtering coefficients) or the input information multiplied by the model parameters.

[0438] In some embodiments, the block vector related information of the current block includes the flip identifier and / or color information of the current block. In a further implementation of step 2903, different values ​​of the flip identifier of the current block result in different adjustment methods for the first filtering model. The adjustment methods corresponding to different values ​​of the flip identifier are described below.

[0439] That is, further, in some embodiments, for step 2903, adjusting the first filtering model according to the block vector related information of the current block and the second derivation related information to obtain the second filtering model includes: when the flip identifier of the current block is equal to the first value, the second filtering model is the first filtering model.

[0440] It is understood that the first value indicates that no flipping is required. In this embodiment, there are no limitations on the first value; it can be any value, as long as it is different from the second and third values. For example, the first value is 0.

[0441] In some other embodiments, step 2903, adjusting the first filtering model to obtain a second filtering model based on the block vector related information of the current block and the second derived related information, includes: when the flip identifier of the current block is equal to a second value, swapping the filtering coefficients of one or more first positions of the first filtering model with the filtering coefficients of one or more second positions of the first filtering model to obtain a second filtering model; wherein the vertical coordinates of the first position and the second position to be swapped are the same.

[0442] It is understood that the second value represents a horizontal flip. In this embodiment, the second value is not limited in any way; it can be any value, as long as it is different from both the second and third values. For example, the second value is 1.

[0443] In some other embodiments, for step 2903, adjusting the first filtering model to obtain a second filtering model based on the block vector related information of the current block and the second derived related information includes: when the flip identifier of the current block is equal to a third value, swapping the filtering coefficients of one or more third positions of the first filtering model with the filtering coefficients of one or more fourth positions of the first filtering model to obtain a second filtering model; wherein the horizontal coordinates of the swapped third positions and the fourth positions are the same.

[0444] It is understood that the third value represents vertical flipping. In this embodiment, there are no limitations on the third value; the third value can be any value, as long as it is different from the first and second values. For example, the third value is 2.

[0445] It should be noted that, in the embodiments of this application, the type and shape of the first filtering model are not limited, and can be of various kinds. For example, the first filtering model can be an extrapolation filter (such as the 15-tap filter shown in Figure 11), or the first filtering model can be the model shown in the following formula:

[0446] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B;

[0447] The following example illustrates the adjustment of the first filter model.

[0448] For example, in BVG-CCCM mode: adjusting model parameters or input information.

[0449] No need to flip

[0450] The adjusted BVG-CCCM model is as follows:

[0451] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B

[0452] · Horizontal flip

[0453] The adjusted BVG-CCCM model is as follows:

[0454] predC=c0C+c1N+c2S+c4E+c3W+c5P(C)+c6P(N)+c7P(S)+c9P(W)+c8P(E)+c10B

[0455] Vertical flip

[0456] The adjusted BVG-CCCM model is as follows:

[0457] predC=c0C+c2N+c1S+c3E+c4W+c5P(C)+c7P(N)+c6P(S)+c8P(W)+c9P(E)+c10B

[0458] Among them, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 and c 10 The 11 coefficients represent the convolution filter. C, N, S, W, and E represent the downsampled brightness values ​​at positions (x,y), (x,y-1), (x,y+1), (x-1,y), and (x+1,y) of the current block. P(C), P(N), P(S), P(E), and P(W) represent nonlinear terms, and B represents the offset term. The specific derivation methods for the nonlinear and offset terms are shown below:

[0459] P(C)=(C×C+midVal)>>bitDepth

[0460] P(N)=(N×N+midVal)>>bitDepth

[0461] P(S)=(S×S+midVal)>>bitDepth

[0462] P(E)=(E×E+midVal)>>bitDepth

[0463] P(W)=(W×W+midVal)>>bitDepth

[0464] B = midval

[0465] Among them, the nonlinear term and the offset term are midval = 512 in a video with a bit depth of 10. Model parameters c0~c 10 The filter coefficients are obtained by minimizing the mean square error (MSE) between the chromaticity prediction samples and the chromaticity reconstruction samples in the reference region. Specifically, the autocorrelation matrix of the luminance downsampling input and the cross-correlation vector between the luminance downsampling input and the chromaticity output in the reference region are constructed, and the filter coefficients are obtained by LDL decomposition.

[0466] Step 2904: Determine the predicted value of the current block according to the second filtering model.

[0467] In some embodiments, the method further includes: parsing the bitstream to determine the residual value of the current block; and determining the reconstructed value of the current block based on the predicted value of the current block and the residual value of the current block.

[0468] This application provides an encoding method applied to an encoder.

[0469] Figure 30 is a schematic diagram of the implementation flow of the encoding method provided in the embodiment of this application; as shown in Figure 30, the method includes the following steps 3001 to 3003:

[0470] Step 3001: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information.

[0471] It is understood that the further implementation of step 3001 is the same as that of the decoding end. Therefore, the further implementation of step 3001 on the encoding end can be understood by referring to the description and related details of the further implementation of step 2101 on the decoding end above. To save space, it will not be repeated here.

[0472] Step 3002: Determine the block vector of the current block based on the block vector information of the reference block.

[0473] It is understood that the further implementation of step 3002 is the same as that of the decoding end. Therefore, the further implementation of step 3001 on the encoding end can be understood by referring to the description and related details of the further implementation of step 2102 on the decoding end above. To save space, it will not be repeated here.

[0474] Step 3003: Determine the predicted value of the current block based on the block vector of the current block.

[0475] It is understood that the further implementation of step 3003 is the same as that of the decoding end. Therefore, the further implementation of step 3003 on the encoding end can be understood by referring to the description and related details of the further implementation of step 2103 on the decoding end above. To save space, it will not be repeated here.

[0476] It is understood that in the embodiments of this application, when predicting the current block, the block vector information of the reference block of the current block (such as the first block vector and / or block vector related information) is considered; thus, it is beneficial to improve the accuracy of the predicted value of the current block, thereby enhancing the performance of video encoding and decoding.

[0477] In some embodiments, the encoding method further includes: determining the residual value of the current block based on the predicted value of the current block and the initial value of the current block; and generating a bitstream based on the residual value of the current block.

[0478] The above descriptions of the encoding method embodiments are essentially the same as those of the decoding method embodiments, except for the two differences mentioned above, and have similar beneficial effects. For technical details not disclosed in the encoding method embodiments of this application, please refer to the descriptions of the decoding method embodiments of this application for understanding.

[0479] The following examples illustrate possible implementation schemes of the encoding and decoding methods described in one or more of the above embodiments.

[0480] The inventors of this application discovered in their research and analysis that in some block vector-guided prediction modes (e.g., BVG-EIP), the current block uses the block vectors of neighboring encoded CUs to participate in the prediction, but does not fully consider the uncertainty of the meaning of the BV of neighboring blocks. Under certain circumstances, this can lead to inaccurate information obtained when the BV participates in the prediction and the final prediction value, which has an adverse effect on coding efficiency.

[0481] In view of this, the following examples illustrate possible implementation schemes for the encoding and decoding methods.

[0482] In one possible implementation, during the decoding process, after obtaining the BV and related information (e.g., flip index / flip identifier) ​​of the reconstructed CU, the BV and related information for the current CU are determined based on the BV and related information of neighboring CUs and the current CU information. During the prediction process based on BV, the results obtained based on the current block BV are adjusted according to the relevant information of the current BV to obtain the final prediction value.

[0483] Specifically, the difference from related technologies lies in:

[0484] First, based on the BV and related information read from the reference block (such as a neighboring block), and combined with the width and height information of the current CU and the reference CU (such as a neighboring CU), it is necessary to calculate the BV and related information for the current block.

[0485] Secondly, when the template of the current block needs to be used, the BV and related information for the template are determined based on the BV of the current block and its related information. Furthermore, the relevant results obtained based on the BV of the template of the current block are adjusted using the related information corresponding to the BV of the template of the current block.

[0486] Finally, the relevant information corresponding to the current block BV is used to adjust the relevant results obtained based on the current block BV.

[0487] The following details the process of using BV information from neighboring regions in prediction:

[0488] The process of using BV information for prediction consists of two steps: S1, constructing a candidate list of BV; and S2, obtaining the predicted value based on the current BV information.

[0489] The following is a detailed introduction:

[0490] Step S1: Construct a candidate list of BVs. The possible implementations of step S1 are described below.

[0491] Including but not limited to the following methods:

[0492] (1) Obtain BV information of the reconstructed CU

[0493] Retrieve the CUs of the currently reconstructed region. The reconstructed CUs can be any reconstructed CU, including but not limited to reconstructed CUs in adjacent luma regions, and / or reconstructed CUs in co-position luma regions, and / or reconstructed CUs in adjacent chroma regions. If the reconstructed CU contains BV information (e.g., CUs encoded using IntraTMP, IBC, etc.), then retrieve the block vector information (e.g., BV value, flip identifier, etc.) of that reconstructed CU.

[0494] (2) Adjust BV information

[0495] Based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.), the obtained BV information of the reconstructed CU is adjusted to determine the BV information that can be used for the current block. The adjustment operations include, but are not limited to, the following methods:

[0496] ① Flip perception adjustment

[0497] Let the BV information obtained from the reconstructed CU be: BV value (let's say...). ), Flip flag (set to rribcFlipType) nbr ) and color information (set as compID); let the BV information after flip adjustment be: BV value (set as ) and the flip flag (set to rribcFlipType) cur Let the center coordinates (or top-left corner coordinates) of the neighboring block be (x...). nbr ,y nbr ).

[0498] No need to flip

[0499] For rribcFlipType nbr In the case where =0, no adjustment is needed; that is, the BV information after inversion adjustment is:

[0500] rribcFlipType cur =rribcFlipType nbr =0

[0501] · Horizontal flip

[0502] For rribcFlipType nbr In the case where BV = 1, it is necessary to adjust BV. nbr Perform a horizontal flip perception adjustment; the BV information after the flip adjustment is as follows:

[0503] rribcFlipType cur =rribcFlipType nbr =1

[0504] Where, x nbr The x-coordinate is the center position (or top-left corner position, etc.) of the neighboring block. If the current block is a chroma-coded block and the current BV originates from a reconstructed luma block, then x... cur The x-coordinate is the center position (or top-left corner position, etc.) of the current block's corresponding brightness region; otherwise, x... cur This is the X-coordinate of the center (or top-left corner, etc.) of the current block. (BV) nbr See Figure 3 for a schematic diagram of the horizontal flip perception adjustment.

[0505] Vertical flip

[0506] For rribcFlipType nbr =2 cases, BV needs to be adjusted. nbr Perform vertical flip perception adjustment; the BV information after flip adjustment is as follows:

[0507] rribcFlipType cur =rribcFlipType nbr =2

[0508] Among them, y nbr The Y-coordinate is the center position (or top-left corner position, etc.) of the neighboring blocks. If the current block is a chroma-coded block and the current BV originates from a reconstructed luma block, then y cur The Y-coordinate is the center position (or top left corner, etc.) of the current block's corresponding brightness region; otherwise, y... cur This is the Y-coordinate of the center (or top-left corner, etc.) of the current block. (BV) nbr See Figure 4 for a schematic diagram of the vertical flip perception adjustment.

[0509] ② Scaling adjustment

[0510] Furthermore, if the color components of the current block are inconsistent with the color components of the reconstructed coded block from which the current BV information originates, corresponding BV scaling processing is required. For example, if the current block is a chroma coded block, and the acquired BV information originates from a luma block, it needs to be scaled according to the chroma sampling format to obtain the chroma BV. Let the luma BV before scaling be BVL = (BVL... h BVL v The chromaticity BV obtained after scaling is BVC = (BVC) h BVC v ), as shown in the table below.

[0511] Table 3. Chromaticity BV after scaling adjustment according to chromaticity sampling format at full sample precision.

[0512] (3) Determine BV availability

[0513] It is necessary to check whether the current BV information is valid for the current block. An example of a method to check the validity of the current BV information for the current block is as follows:

[0514] If all of the following conditions are met, then the BV is valid for the current block:

[0515] • The entire reference template area has been rebuilt;

[0516] • The entire reference block area has been reconstructed;

[0517] • The obtained offset position does not exceed the picture boundary;

[0518] • The reference area corresponding to the obtained offset position does not cover the current block:

[0519] xCb+width+BVC hor<= xCb or yCb + height + BVC ver <=yCb

[0520] • Does the obtained offset position not exceed the available area?

[0521] • The current BV is not a duplicate of the BV in the existing BV candidate list of the current block.

[0522] (4) Decision BV

[0523] If the above-obtained list of available BV candidates contains only one BV candidate, then the final selected BV will be that BV.

[0524] If the above-obtained list of available BV candidates contains multiple BV candidates, then a decision can be made on these BV candidates to obtain the final BV. The decision-making methods include, but are not limited to, the following:

[0525] ① All BVs are used

[0526] ② Use templates for decision making

[0527] Templates can be used to sort the block vector candidate list. Specifically, using the reconstructed regions adjacent to the current CU as templates (e.g., the row above and column to the left of the current CU as templates), each BV in the BV candidate list is traversed. The predicted value of the current block template under each BV pattern is obtained, and the prediction cost (e.g., SAD) of the template reconstruction value and the predicted value is calculated. The blocks are then sorted in ascending order, and the first or top U predicted values ​​are used. The specific process of calculating the template prediction value and cost based on the current BV is as follows:

[0528] a. Define the template area

[0529] Based on the availability of samples in the neighboring regions of the current coding block, determine whether the samples at the template location are available, including reconstructing chromaticity information. This includes, but is not limited to, classifying templates into template types such as top template, left template, top-right template, bottom-left template, and top-left template based on their relative position to the current coding block, as shown in Figure 25.

[0530] The template sizes for different types of different coding blocks can be fixed or different. One example of template selection is using the top row and left column of the current CU as the template.

[0531] b. Obtain template BV information

[0532] Let the BV information used for the current block be: BV value (let's say...). ) and the flip flag (set to rribcFlipType) cur ); Let the BV information used for the upper template be: BV value (let it be tBV = (tBV)); h,tBV v )) and the flip flag (set as trribcFlipType); let the BV information used for the left template be: BV value (set as lBV = (lBV) h ,lBV v )) and the flip flag (set to lrribcFlipType).

[0533] No need to flip

[0534] For rribcFlipType cur In the case of =0, no adjustment is needed, and the BV information that can be used for the upper and left templates is as follows:

[0535] trribcFlipType=rribcFlipType cur =0

[0536] lrribcFlipType=rribcFlipType cur =0

[0537] The schematic diagrams of tBV and lBV are shown in Figure 16.

[0538] · Horizontal flip

[0539] For rribcFlipType cur In the case where BV = 1, it is necessary to adjust BV. cur After adjusting the horizontal flip perception, the BV information that can be used for the top and left templates is as follows:

[0540] trribcFlipType=rribcFlipType cur =1

[0541] lrribcFlipType=rribcFlipType cur =1

[0542] Where, x cur The x-coordinate of the current block's center position (or top-left corner, etc.). left This is the X-coordinate of the center position (or top-left corner position, etc.) of the current block's left template region. Figure 31 shows a schematic diagram of the horizontally flipped, sensor-adjusted tBV and lBV.

[0543] Vertical flip

[0544] For rribcFlipType nbr =2 cases, BV needs to be adjusted. curAfter adjusting the vertical flip perception, the BV information that can be used for the top and left templates is as follows:

[0545] trribcFlipType = ribcFlipType cur =2

[0546] lrribcFlipType=ribcFlipType cur =2

[0547] Among them, y cur The y-coordinate of the center position (or top left corner position, etc.) of the current block. top This is the Y-coordinate of the center position (or top left corner, etc.) of the template area on the current block. A schematic diagram of the vertically flipped, perceptually adjusted tBV and lBV is shown in Figure 32.

[0548] c. Calculate template predicted values

[0549] i. Determine the template prediction block based on the current block template BV.

[0550] Based on the current block template block vector, the prediction value P of the prediction block is obtained by block copying. top and P left .

[0551] ii. Adjust the template prediction block based on the template BV additional information.

[0552] Let w top h is the width of the template above. top w is the height of the upper template left h is the width of the left template. left p is the height of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before the flip-sensor adjustment, p′ top (x,y) represents the final template prediction value at position (x,y) of the upper template, p left (x,y) is the reference value of the left template before the flip-sensor adjustment of the (x,y) position, p′ left (x, y) represents the final template prediction value at position (x, y) of the left template. The specific flip-aware adjustment prediction process is explained based on the flip flag corresponding to the current BV:

[0553] No need to flip

[0554] For the case where rribcFlipType=0, no processing is required, as shown in the figure below. That is, the predicted value for each position in the final template prediction block is:

[0555] p′ top(x,y)=p top (x,y)

[0556] p′ left (x,y)=p left (x,y)

[0557] · Horizontal flip

[0558] For the case where rribcFlipType=1, horizontal flipping is required, as shown in the figure below. That is, the predicted value at each position in the final template prediction block is:

[0559] p′ top (x,y)=p top (w top -1-x,y)

[0560] p′ left (x,y)=p left (w left -1-x,y)

[0561] Vertical flip

[0562] For the case where rribcFlipType=2, vertical flipping is required, as shown in the figure below. That is, the predicted value at each position in the final template prediction block is:

[0563] p′ top (x,y)=p top (x,h top -1-y)

[0564] p left (x,y)=p left (x,h left -1-y)

[0565] d. Calculate the cost and consequences

[0566] The cost is calculated based on the predicted and reconstructed values ​​of the template. Several cost functions are available for calculating the cost of the template region, such as Sum of Absolute Errors (SAD), Sum of Transformed Absolute Errors (SATD), Sum of Squared Differences (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Rate Distortion Function (RDO).

[0567] Evaluation criteria, etc.

[0568] S2 obtains the predicted value based on the current BV information.

[0569] BV-based reference region determination refers to the process where the current prediction mode (e.g., BVG-CCCM, BVG-EIP, BVG-DIMD, BVG-TIMD modes, etc.) needs to determine the reference region using BV. The specific prediction process is as follows: First, the reference region is determined using one or more BV pointing regions determined in the S1 process. Then, the information determined based on the reference region is corrected according to the additional information of the current block's BV (such as the flip flag). The predicted value of the current block is then obtained using the corrected information. The implementation methods for correcting the information determined by the reference region may vary; one implementation method is illustrated below:

[0570] a. Determine the reference region based on the current block value (BV).

[0571] First, the reference region is determined using the reconstruction region pointed to by the BV. For example, see Figure 10 for an example of determining the reference region using a single BV.

[0572] Adjust the sample values ​​of the reference region based on the information corresponding to BV (e.g., the flip identifier rribcFlipType). Specific details are as follows:

[0573] • No need to flip:

[0574] For the case where rribcFlipType=0, no processing is required. As shown in Figure 33, the reference region can be determined directly using the reconstruction region pointed to by BV.

[0575] · Horizontal flip

[0576] For the case where rribcFlipType=1, as shown in Figure 34, the reference region is determined by horizontally flipping the reconstructed region pointed to by BV.

[0577] Vertical flip

[0578] For the case where rribcFlipType=2, as shown in Figure 35, the reference area is determined by vertically flipping the reconstructed area pointed to by BV.

[0579] b. Derive relevant information

[0580] Relevant information is derived using data from the reference area, and then adjusted based on additional information of the current block BV (such as the flip flag).

[0581] For example, in the BVG-CCCM mode: the BVG-CCCM model parameters are derived based on the luminance downsampling samples and chrominance samples from multiple reference regions, that is, the model parameters c0 to c in the following formula are determined based on the reference regions. 10 Value:

[0582] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B

[0583] For example, in BVG-EIP mode: the BVG-EIP model parameters are derived based on the luminance samples of the reference region, that is, the model parameters c0 to c in the following formula are determined based on the reference region. 14 Value:

[0584] For example, in the BVG-DIMD mode: gradient histograms are constructed for multiple reference regions, and the results of multiple gradient histograms are added together to determine the final gradient histogram corresponding to the entire reference region.

[0585] For example, in BVG-TIMD mode: an intra-frame candidate mode list is established, and then the modes in the list are used to calculate the predicted value of the reference region. The predicted and reconstructed values ​​of the reference region are sorted according to the cost (e.g., SAD) of the predicted and reconstructed values ​​to determine T intra-frame prediction modes.

[0586] c. Obtain the current block prediction value

[0587] The final predicted value for the current block is generated based on the model or pattern obtained through the reference region.

[0588] For example, in BVG-CCCM mode: acquire the relevant data required to calculate the predicted value of the current block (e.g., the co-sampling reconstructed block of the current block), and apply it to the BVG-CCCM model obtained based on the reference area to generate the final predicted value of the current block.

[0589] For example, in BVG-EIP mode: obtain the relevant data required to calculate the current block prediction value (the neighboring brightness reconstruction value of the current block and the current block prediction value), and apply it to the BVG-EIP model obtained based on the reference area to generate the final prediction value of the current block.

[0590] For example, in BVG-DIMD mode: based on the gradient histogram of the reference region, the R intra-prediction modes with the highest magnitudes are selected to participate in the gradient histogram statistics, and their prediction values ​​for the current block are obtained (denoted as dimdPred). r (r = 0, ..., R-1), then according to the fusion weights (denoted as weight) r For the current block (r = 0, ..., R-1), the final predicted value, i.e., the predicted value at the current block sample position (x, y), is calculated using the following formula:

[0591] predSamples[x][y]=dimdPred0[x][y]*weight0+…+dimdPred R-1 [x][y]*weight R-1 ;

[0592] For example, in BVG-TIMD mode: based on the gradient histograms of T intra-prediction modes obtained from the reference region cost, the T intra-prediction modes with the highest magnitudes are selected to participate in the gradient histogram statistics, and their prediction values ​​for the current block are obtained (denoted as timdPred). n (n = 0, ..., T-1), then according to the fusion weights (denoted as weight) n (n = 0, ..., T-1), generate the predicted value, that is, the predicted value at the current block (x, y) is calculated using the following formula;

[0593] predSamples[x][y]=timdPred0[x][y]*weight0+…+timdPred T-1 [x][y]*weight T-1

[0594] It is understandable that in the above scheme, when the current block uses the block vector information of the neighboring encoded CUs to participate in the prediction, the additional information corresponding to the BV of the neighboring blocks is comprehensively considered, and the method of BV participating in the prediction in the block vector guidance mode is proposed, which improves the accuracy of the final prediction to a certain extent and improves the coding efficiency.

[0595] In this embodiment of the application, in the block vector-guided mode, the additional information corresponding to the reference block BV is comprehensively considered. Based on the additional information and the current block information, the BV and corresponding additional information for the current block are determined. When participating in prediction based on the obtained BV, the relevant results are adjusted according to the additional information corresponding to the current block's BV. A specific embodiment is also provided.

[0596] Several extension schemes are described below.

[0597] Extended Solution 1:

[0598] BV-based reference region determination refers to the process where the current prediction mode (e.g., BVG-CCCM, BVG-EIP, BVG-DIMD, BVG-TIMD modes) needs to determine the reference region using BV. The specific prediction process is as follows: first, the reference region is determined using the region pointed to by the BV; then, the information determined based on the reference region is corrected according to the additional information of the current block's BV (such as the flip flag); and the predicted value of the current block is obtained using the corrected information. The implementation methods for correcting the information determined by the reference region may differ. Two other implementation methods are illustrated below:

[0599] Extended Solution 1.1:

[0600] After determining the reference region based on the corrected BV, the necessary data (e.g., reference region brightness reconstruction block) for ultimately obtaining the current block's prediction value is first acquired, including data for deriving the model, gradient histogram, and intra-frame prediction mode. Then, based on additional information from the current block's BV (e.g., flip markers), the relevant data is adjusted (e.g., horizontal or vertical flipping). Using this adjusted data, relevant information is derived (e.g., model derivation, gradient histogram derivation, intra-frame prediction mode derivation) and used to obtain the current block's prediction value. Specific details are as follows:

[0601] a. Determine the reference region based on the current block value (BV).

[0602] First, the reference region is determined using the reconstruction region pointed to by BV.

[0603] b. Derive relevant information

[0604] First, the relevant data required for deriving related information (e.g., CCCM model, EIP model parameter gradient histogram, prediction mode, etc.) is obtained using the current reference region. Then, the relevant data is adjusted according to the additional information of the current block BV (e.g., flip indicator). Finally, the relevant information is derived using the adjusted relevant data.

[0605] For example, in the BVG-CCCM mode: first, obtain the relevant data required to derive the BVG-CCCM model (such as the co-sampling block and chromaticity reconstruction block of the reference area), and then adjust the relevant data according to the additional information of the current block BV (such as the flip mark) (for example, horizontally / vertically flipping the co-sampling reconstruction block and chromaticity reconstruction block of the reference area), and use the adjusted relevant data to derive the BVG-CCCM model.

[0606] For example, in BVG-EIP mode: first, obtain the relevant data required to derive the BVG-EIP model (such as the brightness reconstruction block of the reference area), then adjust the relevant data according to the additional information of the current block BV (such as the flip mark) (for example, flip the brightness reconstruction block of the reference area horizontally / vertically), and use the adjusted relevant data to derive the BVG-EIP model.

[0607] For example, in BVG-DIMD mode: when calculating gradient information based on some or all sample points of the reference region, for each available sample point, the gradient information of that point is calculated first to determine the intra-frame mode index and magnitude. Then, the intra-frame mode index is adjusted according to the additional information of the current block BV (such as the flip flag) (for example, if the intra-frame mode index before adjustment is 66, under the horizontal flip sensing condition, the adjusted intra-frame mode index is 34). Finally, the adjusted intra-frame prediction mode and its magnitude corresponding to that point are accumulated into the gradient histogram of the reference region to determine the final gradient histogram of the entire reference region.

[0608] c. Obtain the current block prediction value

[0609] The final predicted value for the current block is generated based on the model or pattern obtained through the reference region.

[0610] Extended Scheme 1.2:

[0611] After determining the reference region based on the corrected BV, relevant information (e.g., derivation model, derivation gradient histogram, derivation intra-prediction mode, etc.) is then determined based on the reference region. Additional information of the current block BV (e.g., flip flag) is used to adjust the derivation information. The prediction value of the current block is then obtained based on the adjusted derivation information.

[0612] a. Determine the reference region based on the current block value (BV).

[0613] First, the reference region is determined using the reconstruction region pointed to by BV;

[0614] b. Derive relevant information

[0615] Relevant information (e.g., CCCM model parameters, EIP model parameters, gradient histogram, prediction mode, etc.) is derived using relevant data from the reference region.

[0616] Then, the obtained relevant information is adjusted based on the additional information of the current block value (BV), such as the flip identifier. The specific adjustment process is explained according to the flip identifier corresponding to the current BV:

[0617] For example, in BVG-CCCM mode: adjusting model parameters or input information.

[0618] No need to flip

[0619] The adjusted BVG-CCCM model is as follows:

[0620] predC=c0C+c1N+c2S+c3E+c4W+c5P(C)+c6P(N)+c7P(S)+c8P(W)+c9P(E)+c10B

[0621] · Horizontal flip

[0622] The adjusted BVG-CCCM model is as follows:

[0623] predC=c0C+c1N+c2S+c4E+c3W+c5P(C)+c6P(N)+c7P(S)+c9P(W)+c8P(E)+c10B

[0624] Vertical flip

[0625] The adjusted BVG-CCCM model is as follows:

[0626] predC=c0C+c2N+c1S+c3E+c4W+c5P(C)+c7P(N)+c6P(S)+c8P(W)+c9P(E)+c10B

[0627] c. Obtain the current block prediction value

[0628] The final predicted value for the current block is generated based on the model or pattern obtained through the reference region.

[0629] Extended Solution 2:

[0630] The BV-based prediction method described above can be applied to all prediction modes involving block vector determination of the reference region, including but not limited to: BVG-CCCM, BVG-EIP, BVG-DIMD, etc.

[0631] Extended Solution 3:

[0632] In S2, when determining the BV information for the current block, if the current CU is a chromaticity CU and the source of the BV information for the current block is the luminance CU of the reconstructed area, the BV information can be scaled first, and then the BV information of the reconstructed CU can be adjusted (e.g., flip perception adjustment) based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.).

[0633] Extended Option 4:

[0634] S1 can also construct the BV candidate list in the following way:

[0635] (1) Construct a coarse search list within the search area: Within each region of the surrounding rectangular search area (e.g., the search area shown in Figure 8), a coarse search is performed with a step size of 3, where pX is between bvXMinsregionId and bvXMaxsregionId, and pY is between bvYMinsregionId and bvYMaxsregionId. The cost of the first P optimal matches obtained by the coarse search with a step size of 3 is recorded as pDiff1_BEST[p], p = 0, ..., P-1, and the corresponding block vector BV is denoted as the best block vector BV1_BEST[p], p = 0, ..., P-1. Where P can be an integer value of 1 or greater than 1 as needed, and the search area where the best matching search point is located is bestRegionId[p], p = 0, ..., P-1.

[0636] (2) Obtaining the BV-Merge List: After finding P reference points in the search area, the BV information of the reconstructed CU is obtained using multiple predefined search locations. Based on the BV information of the reconstructed CU and the current block information, the BV information corresponding to the current block is obtained, and a candidate BV list for reference by the current block is constructed, which is called the BV-Merge list. The specific process is as follows:

[0637] ① Obtain BV information of the reconstructed CU

[0638] Retrieve the CUs in the reconstructed region of the current CU. The reconstructed CUs can be any reconstructed CU, including but not limited to reconstructed CUs in adjacent luma regions, reconstructed CUs in the same luma region, and reconstructed CUs in adjacent chroma regions. If the reconstructed CU contains BV information (e.g., CUs encoded using IntraTMP, IBC, or other modes), then retrieve the block vector information (e.g., BV value, flip identifier, etc.) of that reconstructed CU.

[0639] ② Adjust BV information

[0640] Based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.), the obtained BV information of the reconstructed CU is adjusted to determine the BV information that can be used for the current block. The adjustment operations include, but are not limited to, the following methods:

[0641] i. Flip perception adjustment

[0642] Let the BV information obtained from the reconstructed CU be: BV value (let's say...). ), Flip flag (set to rribcFlipType) nbr ) and color information (set as compID); let the BV information after flip adjustment be: BV value (set as ) and the flip flag (set to rribcFlipType) cur Let the center coordinates (or top-left corner coordinates) of the neighboring block be (x...). nbr ,y nbr ).

[0643] No need to flip

[0644] For rribcFlipType nbr In the case where =0, no adjustment is needed; that is, the BV information after inversion adjustment is:

[0645] rribcFlipType cur =rribcFlipType nbr =0

[0646] · Horizontal flip

[0647] For rribcFlipType nbr In the case where BV = 1, it is necessary to adjust BV. nbr Perform a horizontal flip perception adjustment; the BV information after the flip adjustment is as follows:

[0648] rribcFlipType cur =rribcFlipType nbr =1

[0649] Where, x nbr The x-coordinate is the center position (or top-left corner position, etc.) of the neighboring block. If the current block is a chroma-coded block and the current BV originates from a reconstructed luma block, then x... cur The x-coordinate is the center position (or top-left corner position, etc.) of the current block's corresponding brightness region; otherwise, x... cur This is the X-coordinate of the center (or top-left corner, etc.) of the current block. (BV) nbr See Figure 3 for a schematic diagram of the horizontal flip perception adjustment.

[0650] Vertical flip

[0651] For rribcFlipType nbr =2 cases, BV needs to be adjusted. nbr Perform vertical flip perception adjustment; the BV information after flip adjustment is as follows:

[0652] rribcFlipType cur =rribcFlipType nbr =2

[0653] Among them, y nbrThe Y-coordinate is the center position (or top-left corner position, etc.) of the neighboring blocks. If the current block is a chroma-coded block and the current BV originates from a reconstructed luma block, then y cur The Y-coordinate is the center position (or top left corner, etc.) of the current block's corresponding brightness region; otherwise, y... cur This is the Y-coordinate of the center (or top-left corner, etc.) of the current block. (BV) nbr See Figure 4 for a schematic diagram of the vertical flip perception adjustment.

[0654] ii. Scaling adjustment

[0655] Furthermore, if the color components of the current block are inconsistent with the color components of the reconstructed coded block from which the current BV information originates, corresponding BV scaling processing is required. For example, if the current block is a chroma coded block, and the BV information originates from the luminance CU of the reconstructed region, then scaling is needed to obtain the chroma BV according to the chroma sampling format. Let the luminance BV before scaling be BVL = (BVL... h BVL v The chromaticity BV obtained after scaling is BVC = (BVC) h BVC v As shown in the table.

[0656] Table 4. Chromaticity BV after scaling adjustment according to chromaticity sampling format at full sample precision.

[0657] ③ Determine BV availability

[0658] It is necessary to check whether the current BV information is valid (or available) for the current block. If it is valid (or available), the current BV information is added to the BV candidate list. An example of a method for checking whether the current BV information is valid for the current block is as follows:

[0659] If all of the following conditions are met, then the BV is valid for the current block:

[0660] The reference template area has been completely rebuilt.

[0661] • The entire reference block area has been reconstructed.

[0662] • The obtained offset position does not exceed the picture boundary.

[0663] • The reference area corresponding to the obtained offset position does not cover the current block:

[0664] x+width+BV hor <= x or y + height + BV ver <=y

[0665] • Does the obtained offset position not exceed the available area?

[0666] The current BV is not duplicated with any BV in the current block's existing BV candidate list.

[0667] (3) Update the coarse search list: After constructing the BV-Merge list, the coarse search list is updated. The specific update operation is as follows: sequentially access each item in the BV-Merge list, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the initial coarse search list, and if it is less than the maximum template matching cost in the coarse search list, replace the worse BV in the coarse search list with this BV. For example, the specific replacement operation is as follows: insert this BV into the coarse search list in order of cost size, and delete the item with the highest cost in the coarse search list. Among them, the process of calculating the template prediction value and cost of BV in the BV-Merge list is as follows:

[0668] a. Define the template area

[0669] The template region is the same as the template region used for template matching during the coarse search process.

[0670] b. Obtain template BV information

[0671] Let the BV information used for the current block be: BV value (let's say...). ) and the flip flag (set to rribcFlipType) cur ); Let the BV information used for the upper template be: BV value (let it be tBV = (tBV)); h ,tB V v )) and the flip flag (set as trribcFlipType); let the BV information used for the left template be: BV value (set as lBV = (lBV) h ,lBV v )) and the flip flag (set to lrribcFlipType).

[0672] No need to flip

[0673] For rribcFlipType cur In the case of =0, no adjustment is needed, and the BV information that can be used for the upper and left templates is as follows:

[0674] trribcFlipType=rribcFlipType cur =0

[0675] lrribcFlipType=rribcFlipType cur =0

[0676] The schematic diagrams of tBV and lBV are shown in Figure 16.

[0677] · Horizontal flip

[0678] For rribcFlipType cur In the case where BV = 1, it is necessary to adjust BV. cur After adjusting the horizontal flip perception, the BV information that can be used for the top and left templates is as follows:

[0679] trribcFlipType = ribcFlipType cur =1

[0680] lrribcFlipType=ribcFlipType cur =1

[0681] Where, x cur The x-coordinate of the current block's center position (or top-left corner, etc.). left This is the X-coordinate of the center position (or top left corner position, etc.) of the current block's left template region. See Figure 31 for a schematic diagram of the horizontally flipped sensor-adjusted tBV and lBV.

[0682] Vertical flip

[0683] For rribcFlipType nbr =2 cases, BV needs to be adjusted. cur After adjusting the vertical flip perception, the BV information that can be used for the top and left templates is as follows:

[0684] trribcFlipType=ribcFlipTypecur=2

[0685] lrribcFlipType=ribcFlipTypecur=2

[0686] Among them, y cur The y-coordinate of the center position (or top left corner position, etc.) of the current block. top This is the Y-coordinate of the center position (or top left corner, etc.) of the template area on the current block. See Figure 32 for a schematic diagram of the vertically flipped sensor-adjusted tBV and lBV.

[0687] c. Calculate template predicted values

[0688] i. Determine the template prediction block based on the current block template BV.

[0689] Based on the current block template block vector, the prediction value P of the prediction block is obtained by block copying. topand P left .

[0690] ii. Adjust the template prediction block based on the template BV additional information.

[0691] Let w top h is the width of the template above. top w is the height of the upper template left h is the width of the left template. left p is the height of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before the flip-sensor adjustment, p′ top (x,y) represents the final template prediction value at position (x,y) of the upper template, p left (x,y) is the reference value of the left template before the flip-sensor adjustment of the (x,y) position, p′ left (x, y) represents the final template prediction value at position (x, y) of the left template. The specific flip-aware adjustment prediction process is explained based on the flip flag corresponding to the current BV:

[0692] No need to flip

[0693] For the case where rribcFlipType=0, no processing is required, as shown in the figure below. That is, the predicted value for each position in the final template prediction block is:

[0694] p′ top (x,y)=p top (x,y)

[0695] p′ left (x,y)=p left (x,y)

[0696] · Horizontal flip

[0697] For the case where rribcFlipType=1, horizontal flipping is required, as shown in the figure below. That is, the predicted value at each position in the final template prediction block is:

[0698] p′ top (x,y)=p top (w top -1-x,y)

[0699] p′ left (x,y)=p left (w left -1-x,y)

[0700] Vertical flip

[0701] For the case where rribcFlipType=2, vertical flipping is required, as shown in the figure below. That is, the predicted value at each position in the final template prediction block is:

[0702] p′ top (x,y)=p top (x,h top -1-y)

[0703] p′ left (x,y)=p left (x,h left -1-y)

[0704] d. Calculate the cost of the template

[0705] The cost is calculated based on the predicted and reconstructed values ​​of the template. At this point, the cost criterion is consistent with the cost of the template used in the coarse search process.

[0706] (4) Determine the fine search list near the coarse search list BV with a step size of 1: Further search is performed near the fine search reference point BV1_BEST[p], p=0,…,M-1 obtained from the coarse search.

[0707] Specifically, for each fine search reference point, the position of the best matching reconstruction block obtained from the coarse search is first used as the reference position of the fine search region: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST. Then, the fine search ranges TmpRefineRangeHor and TmpRefineRangeVer are determined. The fine search range can be a fixed size or it can be related to the search region.

[0708] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps; or steps from different embodiments may be combined into a new technical solution.

[0709] Based on the same inventive concept as the foregoing embodiments, this application provides an encoder; Figure 36 is a schematic diagram of the composition structure of the encoder provided in this application. As shown in Figure 36, the encoder 360 may include a first acquisition unit 3601, a first determination unit 3602, and a first prediction unit 3603, wherein:

[0710] The first acquisition unit 3601 is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information;

[0711] The first determining unit 3602 is configured to determine the block vector of the current block based on the block vector information of the reference block;

[0712] The first prediction unit 3603 is configured to determine the predicted value of the current block based on the block vector of the current block.

[0713] In some embodiments, the first determining unit 3602 is configured to: adjust a first block vector of the reference block according to block vector related information of the reference block, and determine a second block vector of the reference block; and determine the block vector of the current block according to the second block vector of the reference block.

[0714] For example, in some embodiments, the block vector-related information of the reference block includes a flip identifier.

[0715] Furthermore, in some embodiments, the first determining unit 3602 is configured to: when the value of the flip identifier of the reference block is equal to the first value, the second block vector of the reference block is equal to the first block vector of the reference block.

[0716] Furthermore, in some other embodiments, the first determining unit 3602 is configured to: adjust the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to the second value.

[0717] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of a first color component; the first determining unit 3602 is configured to: determine the co-position region of the second color component corresponding to the current block when the color information includes that the first block vector of the reference block belongs to a second color component; adjust the horizontal component of the first block vector of the reference block according to the horizontal coordinate of the first position of the reference block and the horizontal coordinate of the first position of the co-position region, and determine the second block vector of the reference block.

[0718] Furthermore, in some other embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the first determining unit 3602 is configured to: when the color information includes that the first block vector of the reference block belongs to the first color component, adjust the horizontal component of the first block vector of the reference block according to the horizontal coordinate of the first position of the reference block and the horizontal coordinate of the first position of the current block, and determine the second block vector of the reference block.

[0719] Furthermore, in some other embodiments, the first determining unit 3602 is configured to: adjust the vertical component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to a third value.

[0720] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of a first color component; the first determining unit 3602 is configured to: when the color information includes that the first block vector of the reference block belongs to a second color component, determine the co-position region of the second color component corresponding to the current block; adjust the vertical component of the first block vector of the reference block according to the vertical coordinate of the first position of the reference block and the vertical coordinate of the first position of the co-position region, and determine the second block vector of the reference block.

[0721] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the first determining unit 3602 is configured to: when the color information includes that the first block vector of the reference block belongs to the first color component, adjust the vertical component of the first block vector of the reference block according to the vertical coordinate of the first position of the reference block and the vertical coordinate of the first position of the current block, and determine the second block vector of the reference block.

[0722] In some embodiments, the first determining unit 3602 is configured to: determine a first candidate list of the current block based on the second block vector of the reference block and the block vector related information of the reference block; and determine the block vector of the current block based on the first candidate list of the current block.

[0723] Further, in some embodiments, the first determining unit 3602 is configured to: determine the template region of the current block; determine the first generation value of one or more block vector information candidates in the first candidate list of the current block based on the template region of the current block; and determine the block vector of the current block based on the first generation value corresponding to the one or more block vector information candidates respectively.

[0724] Furthermore, in some embodiments, the first determining unit 3602 is configured to: determine the first generation value obtained by predicting one or more block vector information candidates in the first candidate list of the current block on the template region of the current block respectively.

[0725] For example, in some embodiments, the first determining unit 3602 is configured to: determine the block vector information of the template region based on the p-th block vector information candidate; wherein the block vector information of the template region includes the block vector of the template region and / or the block vector related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block; determine the first predicted block of the template region based on the block vector information of the template region; and determine the first generation value corresponding to the p-th block vector information candidate based on the first predicted block of the template region and the reconstructed value of the template region.

[0726] Furthermore, in some embodiments, the first determining unit 3602 is configured to: when the value of the flip identifier of the p-th block vector information candidate is equal to a first value, the block vector of the template region includes the block vector in the p-th block vector information candidate.

[0727] Furthermore, in some other embodiments, the first determining unit 3602 is configured to: adjust the horizontal component of the block vector of the p-th block vector information candidate when the value of the flip identifier of the p-th block vector information candidate is equal to the second value, and determine the block vector of the left template of the template region; and / or, the block vector of the upper template of the template region includes the block vector in the p-th block vector information candidate.

[0728] Furthermore, in some embodiments, the first determining unit 3602 is configured to: adjust the horizontal component of the block vector of the p-th block vector information candidate based on the horizontal coordinate of the first position of the current block and the horizontal coordinate of the first position of the left template of the template region, and determine the block vector of the left template of the template region.

[0729] Furthermore, in some other embodiments, the first determining unit 3602 is configured to: when the value of the flip identifier of the p-th block vector information candidate is equal to a third value, adjust the vertical component of the block vector of the p-th block vector information candidate to determine the block vector of the upper template of the template region; and / or, the block vector of the left template of the template region includes the block vector in the p-th block vector information candidate.

[0730] Furthermore, in some embodiments, the first determining unit 3602 is configured to: adjust the vertical component of the block vector of the p-th block vector information candidate based on the vertical coordinate of the first position of the current block and the vertical coordinate of the first position of the upper template of the template region, and determine the block vector of the upper template of the template region.

[0731] In some embodiments, the first determining unit 3602 is configured to: determine a second predicted block of the template region based on the block vector of the template region; adjust the second predicted block of the template region based on the block vector related information of the template region, and determine a first predicted block of the template region.

[0732] For example, in some embodiments, the block vector related information of the template region includes the flip identifier of the template region.

[0733] In some embodiments, the first determining unit 3602 is configured to: when the value of the flipping identifier of the template region is equal to a first value, the first prediction block of the template region is equal to the second prediction block of the template region.

[0734] In some other embodiments, the first determining unit 3602 is configured to: when the value of the flipping identifier of the template region is equal to the second value, horizontally flip the second prediction block of the template region to obtain the first prediction block of the template region.

[0735] In some other embodiments, the first determining unit 3602 is configured to: vertically flip the second prediction block of the template region when the value of the flipping identifier of the template region is equal to a third value, to obtain the first prediction block of the template region.

[0736] In some embodiments, the first prediction unit 3603 is configured to: determine the predicted value of the current block based on the block vector of the current block and the block vector-related information of the current block.

[0737] Furthermore, in some embodiments, the first prediction unit 3603 is configured to: determine a first reference region based on the block vector of the current block and the block vector-related information of the current block; and determine the predicted value of the current block based on the first reference region of the current block.

[0738] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0739] Furthermore, in some embodiments, the first prediction unit 3603 is configured such that, when the flip identifier of the current block is equal to a first value, the corresponding first reference region is the second reference region pointed to by the block vector of the current block.

[0740] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: horizontally flip the second reference region pointed to by the block vector of the current block when the flip identifier of the current block is equal to the second value, or horizontally reverse read the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region.

[0741] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: vertically flip the second reference region pointed to by the block vector of the current block when the flip identifier of the current block is equal to the third value, or vertically reverse read the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region.

[0742] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: determine a second reference region of the current block based on the block vector of the current block; adjust the first relevant data of the second reference region of the current block based on the block vector-related information of the current block to obtain second relevant data; determine a first derivation-related information based on the second relevant data; and determine the predicted value of the current block based on the first derivation-related information.

[0743] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0744] For example, in some embodiments, the first relevant data of the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region; the first derived relevant information includes the filtering coefficients of the filtering model.

[0745] Furthermore, in some embodiments, the first prediction unit 3603 is configured such that, when the flip identifier of the current block is equal to a first value, the second related data includes the chromaticity reconstruction block of the second reference region and the downsampled luminance reconstruction block.

[0746] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: when the flip identifier of the current block is equal to a second value, horizontally flip the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region to obtain the second correlation data.

[0747] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: vertically flip the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region when the flip identifier of the current block is equal to a third value, to obtain the second related data.

[0748] For example, in other embodiments, the first relevant data of the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, the first index being used to identify intra-frame prediction modes; the first derivation-related information includes a gradient histogram.

[0749] Furthermore, in some embodiments, the first prediction unit 3603 is configured such that, when the flip identifier of the current block is equal to a first value, the second related data includes the first index.

[0750] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: when the flip identifier of the current block is equal to the second value, horizontally flip the intra-prediction mode corresponding to the first index to determine the second index; the second related data includes the second index.

[0751] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: vertically flip the intra-prediction mode corresponding to the first index to determine the third index when the flip identifier of the current block is equal to the third value; the second related data includes the third index.

[0752] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: determine a second reference region of the current block based on the block vector of the current block; determine a second derivation-related information based on first relevant data of the second reference region of the current block; the second derivation-related information includes the filter coefficients of a first filter model; adjust the first filter model based on the block vector-related information of the current block and the second derivation-related information to obtain a second filter model; and determine the predicted value of the current block based on the second filter model.

[0753] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0754] Furthermore, in some embodiments, the first prediction unit 3603 is configured such that, when the flip identifier of the current block is equal to a first value, the second filtering model is the first filtering model.

[0755] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: when the flip identifier of the current block is equal to a second value, swap the filter coefficients of one or more first positions of the first filter model with the filter coefficients of one or more second positions of the first filter model to obtain a second filter model; wherein the vertical coordinates of the first position and the second position to be swapped are the same.

[0756] Furthermore, in some other embodiments, the first prediction unit 3603 is configured to: when the flip identifier of the current block is equal to a third value, swap the filter coefficients of one or more third positions of the first filter model with the filter coefficients of one or more fourth positions of the first filter model to obtain a second filter model; wherein the horizontal coordinates of the swapped third positions and the fourth positions are the same.

[0757] In some embodiments, encoder 360 further includes encoding unit 3604; wherein, first determining unit 3602 is further configured to determine residual value of current block based on predicted value of current block and initial value of current block; encoding unit 3604 is configured to generate bitstream based on residual value of current block.

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

[0759] Figure 37 is a schematic diagram of the hardware structure of the encoder provided in an embodiment of this application. As shown in Figure 37, the encoder 370 may include: a first communication interface 3701, a first memory 3702, and a first processor 3703; the various components are coupled together through a first bus system 3704. It can be understood that the first bus system 3704 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 3704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 3704 in Figure 37.

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

[0761] The first memory 3702 is used to store computer programs that can run on the first processor 3703;

[0762] The first processor 3703 is configured to, when running the computer program, perform:

[0763] Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information;

[0764] The block vector of the current block is determined based on the block vector information of the reference block;

[0765] The predicted value of the current block is determined based on the block vector of the current block.

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

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

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

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

[0770] Based on the same inventive concept as the foregoing embodiments, FIG38 is a schematic diagram of the composition structure of the decoder provided in the embodiment of this application. As shown in FIG38, the decoder 380 may include a second acquisition unit 3801, a second determination unit 3802, and a second prediction unit 3803, wherein:

[0771] The second acquisition unit 3801 is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information;

[0772] The second determining unit 3802 is configured to determine the block vector of the current block based on the block vector information of the reference block;

[0773] The second prediction unit 3803 is configured to determine the predicted value of the current block based on the block vector of the current block.

[0774] For example, in some embodiments, the block vector-related information of the reference block includes a flip identifier.

[0775] Furthermore, in some embodiments, the second determining unit 3802 is configured to: when the value of the flip identifier of the reference block is equal to the first value, the second block vector of the reference block is equal to the first block vector of the reference block.

[0776] Furthermore, in some other embodiments, the second determining unit 3802 is configured to: adjust the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to the second value.

[0777] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the second determining unit 3802 is configured to: when the color information includes that the first block vector of the reference block belongs to the second color component, determine the co-position region of the second color component corresponding to the current block; adjust the horizontal component of the first block vector of the reference block according to the horizontal coordinate of the first position of the reference block and the horizontal coordinate of the first position of the co-position region, and determine the second block vector of the reference block.

[0778] Furthermore, in some other embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the second determining unit 3802 is configured to: when the color information includes that the first block vector of the reference block belongs to the first color component, adjust the horizontal component of the first block vector of the reference block according to the horizontal coordinate of the first position of the reference block and the horizontal coordinate of the first position of the current block, and determine the second block vector of the reference block.

[0779] Furthermore, in some other embodiments, the second determining unit 3802 is configured to: adjust the vertical component of the first block vector of the reference block to determine the second block vector of the reference block when the value of the flip identifier of the reference block is equal to a third value.

[0780] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the second determining unit 3802 is configured to: determine the co-position region of the second color component corresponding to the current block when the color information includes that the first block vector of the reference block belongs to the second color component; adjust the vertical component of the first block vector of the reference block according to the vertical coordinate of the first position of the reference block and the vertical coordinate of the first position of the co-position region, and determine the second block vector of the reference block.

[0781] Furthermore, in some embodiments, the block vector related information of the reference block also includes color information; the current block is a block of the first color component; the second determining unit 3802 is configured to: when the color information includes that the first block vector of the reference block belongs to the first color component, adjust the vertical component of the first block vector of the reference block according to the vertical coordinate of the first position of the reference block and the vertical coordinate of the first position of the current block, and determine the second block vector of the reference block.

[0782] In some embodiments, the second determining unit 3802 is configured to: determine a first candidate list of the current block based on the second block vector of the reference block and the block vector related information of the reference block; and determine the block vector of the current block based on the first candidate list of the current block.

[0783] Further, in some embodiments, the second determining unit 3802 is configured to: determine the template region of the current block; determine the first generation value of one or more block vector information candidates in the first candidate list of the current block based on the template region of the current block; and determine the block vector of the current block based on the first generation value corresponding to the one or more block vector information candidates respectively.

[0784] Furthermore, in some embodiments, the second determining unit 3802 is configured to: determine the first generation value obtained by predicting one or more block vector information candidates in the first candidate list of the current block on the template region of the current block respectively.

[0785] For example, in some embodiments, the second determining unit 3802 is configured to: determine the block vector information of the template region based on the p-th block vector information candidate; wherein the block vector information of the template region includes the block vector of the template region and / or the block vector related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block; determine the first predicted block of the template region based on the block vector information of the template region; and determine the first generation value corresponding to the p-th block vector information candidate based on the first predicted block of the template region and the reconstructed value of the template region.

[0786] Furthermore, in some embodiments, the second determining unit 3802 is configured to: when the value of the flip identifier of the p-th block vector information candidate is equal to a first value, the block vector of the template region includes the block vector in the p-th block vector information candidate.

[0787] Furthermore, in some other embodiments, the second determining unit 3802 is configured to: adjust the horizontal component of the block vector of the p-th block vector information candidate when the value of the flip identifier of the p-th block vector information candidate is equal to the second value, and determine the block vector of the left template of the template region; and / or, the block vector of the upper template of the template region includes the block vector in the p-th block vector information candidate.

[0788] Furthermore, in some embodiments, the second determining unit 3802 is configured to: adjust the horizontal component of the block vector of the p-th block vector information candidate based on the horizontal coordinate of the first position of the current block and the horizontal coordinate of the first position of the left template of the template region, and determine the block vector of the left template of the template region.

[0789] Furthermore, in some other embodiments, the second determining unit 3802 is configured to: adjust the vertical component of the block vector of the p-th block vector information candidate when the value of the flip identifier of the p-th block vector information candidate is equal to a third value, and determine the block vector of the upper template of the template region; and / or, the block vector of the left template of the template region includes the block vector in the p-th block vector information candidate.

[0790] Furthermore, in some embodiments, the second determining unit 3802 is configured to: adjust the vertical component of the block vector of the p-th block vector information candidate based on the vertical coordinate of the first position of the current block and the vertical coordinate of the first position of the upper template of the template region, and determine the block vector of the upper template of the template region.

[0791] In some embodiments, the second determining unit 3802 is configured to: determine a second prediction block of the template region based on the block vector of the template region; adjust the second prediction block of the template region based on the block vector related information of the template region, and determine a first prediction block of the template region.

[0792] For example, in some embodiments, the block vector related information of the template region includes the flip identifier of the template region.

[0793] In some embodiments, the second determining unit 3802 is configured to: when the value of the flip identifier of the template region is equal to the first value, the first prediction block of the template region is equal to the second prediction block of the template region.

[0794] In other embodiments, the second determining unit 3802 is configured to: when the value of the flipping identifier of the template region is equal to a second value, horizontally flip the second prediction block of the template region to obtain the first prediction block of the template region.

[0795] In some other embodiments, the second determining unit 3802 is configured to: vertically flip the second prediction block of the template region when the value of the flipping identifier of the template region is equal to a third value, to obtain the first prediction block of the template region.

[0796] In some embodiments, the second prediction unit 3803 is configured to: determine the predicted value of the current block based on the block vector of the current block and the block vector-related information of the current block.

[0797] Furthermore, in some embodiments, the second prediction unit 3803 is configured to: determine a first reference region based on the block vector of the current block and the block vector-related information of the current block; and determine the predicted value of the current block based on the first reference region of the current block.

[0798] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0799] Furthermore, in some embodiments, the second prediction unit 3803 is configured such that, when the flip identifier of the current block is equal to a first value, the corresponding first reference region is the second reference region pointed to by the block vector of the current block.

[0800] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: horizontally flip the second reference region pointed to by the block vector of the current block when the flip identifier of the current block is equal to the second value, or horizontally reverse read the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region.

[0801] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: vertically flip the second reference region pointed to by the block vector of the current block when the flip identifier of the current block is equal to a third value, or vertically reverse read the coordinate parameters of the second reference region pointed to by the block vector of the current block to obtain the first reference region.

[0802] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: determine a second reference region of the current block based on the block vector of the current block; adjust the first relevant data of the second reference region of the current block based on the block vector-related information of the current block to obtain second relevant data; determine a first derivation-related information based on the second relevant data; and determine the predicted value of the current block based on the first derivation-related information.

[0803] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0804] For example, in some embodiments, the first relevant data of the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region; the first derived relevant information includes the filtering coefficients of the filtering model.

[0805] Furthermore, in some embodiments, the second prediction unit 3803 is configured such that, when the flip identifier of the current block is equal to a first value, the second related data includes the chromaticity reconstruction block of the second reference region and the downsampled luminance reconstruction block.

[0806] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: when the flip identifier of the current block is equal to a second value, horizontally flip the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region to obtain the second correlation data.

[0807] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: vertically flip the chroma reconstruction block and the downsampled luminance reconstruction block of the second reference region when the flip identifier of the current block is equal to a third value, to obtain the second related data.

[0808] For example, in other embodiments, the first relevant data of the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, the first index being used to identify intra-frame prediction modes; the first derivation-related information includes a gradient histogram.

[0809] Furthermore, in some embodiments, the second prediction unit 3803 is configured to include the first index in the second related data when the flip identifier of the current block is equal to the first value.

[0810] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: when the flip identifier of the current block is equal to the second value, horizontally flip the intra-prediction mode corresponding to the first index to determine the second index; the second related data includes the second index.

[0811] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: vertically flip the intra-prediction mode corresponding to the first index to determine the third index when the flip identifier of the current block is equal to the third value; the second related data includes the third index.

[0812] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: determine a second reference region of the current block based on the block vector of the current block; determine a second derivation-related information based on first relevant data of the second reference region of the current block; the second derivation-related information includes the filtering coefficients of a first filtering model; adjust the first filtering model based on the block vector-related information of the current block and the second derivation-related information to obtain a second filtering model; and determine the predicted value of the current block based on the second filtering model.

[0813] For example, in some embodiments, the block vector related information of the current block includes the flip identifier of the current block.

[0814] Furthermore, in some embodiments, the second prediction unit 3803 is configured such that, when the flip identifier of the current block is equal to a first value, the second filtering model is the first filtering model.

[0815] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: when the flip identifier of the current block is equal to a second value, swap the filter coefficients of one or more first positions of the first filter model with the filter coefficients of one or more second positions of the first filter model to obtain a second filter model; wherein the vertical coordinates of the first position and the second position to be swapped are the same.

[0816] Furthermore, in some other embodiments, the second prediction unit 3803 is configured to: when the flip flag of the current block is equal to a third value, swap the filter coefficients of one or more third positions of the first filter model with the filter coefficients of one or more fourth positions of the first filter model to obtain a second filter model; wherein the horizontal coordinates of the swapped third positions and the fourth positions are the same.

[0817] In some embodiments, the decoder 380 further includes a decoding unit 3804; the decoding unit 3804 is configured to: parse the bitstream, determine the residual value of the current block; and determine the reconstructed value of the current block based on the predicted value of the current block and the residual value of the current block.

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

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

[0820] Figure 39 is a schematic diagram of the hardware structure of the decoder provided in an embodiment of this application. As shown in Figure 39, the decoder 390 may include: a second communication interface 3801, a second memory 3902, and a second processor 3903; the various components are coupled together through a second bus system 3804. It is understood that the second bus system 3804 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 3804 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 3804 in Figure 39.

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

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

[0823] The second processor 3903 is configured to perform the following when running the computer program:

[0824] Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information;

[0825] The block vector of the current block is determined based on the block vector information of the reference block;

[0826] The predicted value of the current block is determined based on the block vector of the current block.

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

[0828] It is understood that the second memory 3902 has similar hardware functions to the first memory 3702, and the second processor 3903 has similar hardware functions to the first processor 3903; details will not be elaborated here.

[0829] Figure 40 is a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application. As shown in Figure 40, the encoding / decoding system 400 may include an encoder 4001 and a decoder 4002.

[0830] In this embodiment, encoder 4001 can be any of the encoders described in the foregoing embodiments, and decoder 4002 can be any of the decoders described in the foregoing embodiments.

[0831] In some embodiments, this application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the method as described in any of the foregoing embodiments. Specifically, when executed by a first processor, the computer program implements the encoding method as described in any of the foregoing embodiments, or when executed by a second processor, it implements the decoding method as described in any of the foregoing embodiments.

[0832] In some embodiments, this application also provides a computer program product, including a computer program or instructions. When executed by a processor, the computer program or instructions implement the method as described in any of the foregoing embodiments. Specifically, when executed by a first processor, the computer program or instructions implement the encoding method as described in any of the foregoing embodiments, or when executed by a second processor, they implement the decoding method as described in any of the foregoing embodiments.

[0833] In some embodiments, this application also provides a computer program that, when executed by a processor, implements the method as described in any of the foregoing embodiments. Specifically, when executed by a first processor, the computer program or instructions implement the encoding method as described in any of the foregoing embodiments, or when executed by a second processor, implement the decoding method as described in any of the foregoing embodiments.

[0834] In some embodiments, this application also provides a computer-readable storage medium storing a bitstream thereon. The bitstream is generated by performing the steps of the encoding method as described in any of the foregoing embodiments.

[0835] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0836] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0837] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0838] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0839] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

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

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

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

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

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

Claims

A decoding method, applied to a decoder, the method comprising: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information; The block vector of the current block is determined based on the block vector information of the reference block; The predicted value of the current block is determined based on the block vector of the current block. The method according to claim 1, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: Based on the block vector information of the reference block, the first block vector of the reference block is adjusted to determine the second block vector of the reference block; The block vector of the current block is determined based on the second block vector of the reference block. The method according to claim 2, wherein, The block vector information of the reference block includes a flip identifier. The method according to claim 3, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the first value, the second block vector of the reference block is equal to the first block vector of the reference block. The method according to claim 3, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the second value, the horizontal component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 5, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block includes: If the color information includes a first block vector of the reference block belonging to a second color component, determine the co-position region of the second color component corresponding to the current block; Based on the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the corresponding region, the horizontal component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. According to the method of claim 5, the block vector related information of the reference block further includes color information; the current block is a block of the first color component; The step of adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block includes: When the color information includes the first block vector of the reference block belonging to the first color component, the horizontal component of the first block vector of the reference block is adjusted according to the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the current block to determine the second block vector of the reference block. The method according to claim 3, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the third value, the vertical component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 8, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: If the color information includes a first block vector of the reference block belonging to a second color component, determine the co-position region of the second color component corresponding to the current block; Based on the vertical coordinates of the first position of the reference block and the vertical coordinates of the first position of the co-located region, the vertical component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 8, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: When the color information includes the first block vector of the reference block belonging to the first color component, the vertical component of the first block vector of the reference block is adjusted according to the vertical coordinates of the first position of the reference block and the vertical coordinates of the first position of the current block to determine the second block vector of the reference block. The method according to any one of claims 2-10, wherein, Determining the block vector of the current block based on the second block vector of the reference block includes: Based on the second block vector of the reference block and the block vector related information of the reference block, determine the first candidate list of the current block; The block vector of the current block is determined based on the first candidate list of the current block. The method according to claim 11, wherein, Determining the block vector of the current block based on the first candidate list of the current block includes: Determine the template region of the current block; Based on the template region of the current block, determine the first generation value of one or more block vector information candidates in the first candidate list of the current block; The block vector of the current block is determined based on the first-generation values ​​corresponding to the one or more block vector information candidates. The method according to claim 12, wherein, The step of determining the first-generation value of one or more block vector information candidates in the first candidate list of the current block based on the template region of the current block includes: The first generation value is obtained by predicting one or more block vector information candidates in the first candidate list of the current block on the template region of the current block. The method according to claim 13, wherein, The first generation value obtained by predicting one or more block vector information candidates from the first candidate list of the current block on the template region of the current block includes: Based on the p-th block vector information candidate, the block vector information of the template region is determined; wherein, the block vector information of the template region includes the block vector of the template region and / or the block vector related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block; Based on the block vector information of the template region, determine the first predicted block of the template region; Based on the first predicted block of the template region and the reconstructed value of the template region, the first generation value corresponding to the candidate vector information of the p-th block is determined. The method according to claim 14, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip identifier of the p-th block vector information candidate is equal to the first value, the block vector of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 14, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip flag of the p-th block vector information candidate is equal to the second value, the horizontal component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the left template of the template region; And / or, the block vector of the upper template of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 16, wherein, The step of adjusting the horizontal component of the block vector of the p-th block vector candidate to determine the block vector of the left template of the template region includes: Based on the horizontal coordinates of the first position of the current block and the horizontal coordinates of the first position of the left template of the template region, the horizontal component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the left template of the template region. The method according to claim 14, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip identifier of the p-th block vector information candidate is equal to the third value, the vertical component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the upper template of the template region; And / or, the block vector of the left template of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 18, wherein, The step of adjusting the vertical component of the block vector of the p-th block vector information candidate to determine the block vector of the upper template of the template region includes: Based on the vertical coordinates of the first position of the current block and the vertical coordinates of the first position of the upper template of the template region, the vertical component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the upper template of the template region. The method according to any one of claims 14-19, wherein, The step of determining the first predicted block of the template region based on the block vector information of the template region includes: Based on the block vector of the template region, determine the second predicted block of the template region; Based on the block vector information of the template region, the second prediction block of the template region is adjusted to determine the first prediction block of the template region. The method according to claim 20, wherein, The block vector information related to the template region includes the flip identifier of the template region. The method according to claim 21, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier in the template region is equal to the first value, the first prediction block of the template region is equal to the second prediction block of the template region. The method according to claim 21, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier of the template region is equal to the second value, the second prediction block of the template region is horizontally flipped to obtain the first prediction block of the template region. The method according to claim 21, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier in the template region is equal to the third value, the second prediction block of the template region is vertically flipped to obtain the first prediction block of the template region. The method according to any one of claims 1-24, wherein, Determining the predicted value of the current block based on the block vector of the current block includes: The predicted value of the current block is determined based on the block vector of the current block and the relevant information of the block vector of the current block. The method according to claim 25, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: A first reference region is determined based on the block vector of the current block and the relevant information of the block vector of the current block; The predicted value of the current block is determined based on the first reference region of the current block. The method according to claim 26, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 27, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: When the flip identifier of the current block is equal to the first value, the corresponding first reference region is the second reference region pointed to by the block vector of the current block. The method according to claim 27, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: If the flip flag of the current block is equal to the second value, the second reference region pointed to by the block vector of the current block is horizontally flipped, or the first reference region is obtained by horizontally reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block. The method according to claim 27, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: If the flip flag of the current block is equal to the third value, the second reference region pointed to by the block vector of the current block is vertically flipped, or the first reference region is obtained by vertically reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block. The method according to claim 25, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: Based on the block vector of the current block, determine the second reference region of the current block; Based on the block vector related information of the current block, the first related data of the second reference region of the current block is adjusted to obtain the second related data; Based on the second relevant data, determine the first derivation relevant information; Based on the first derivation of relevant information, the predicted value of the current block is determined. The method according to claim 31, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 32, wherein, The first relevant data of the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region; the first derived relevant information includes the filtering coefficients of the filtering model. The method according to claim 33, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip identifier of the current block is equal to the first value, the second related data includes the chromaticity reconstruction block of the second reference area and the downsampled luminance reconstruction block. The method according to claim 33, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip flag of the current block is equal to the second value, the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference area are horizontally flipped to obtain the second related data. The method according to claim 33, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip flag of the current block is equal to the third value, the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference area are vertically flipped to obtain the second related data. The method according to claim 32, wherein, The first relevant data for the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, the first index being used to identify intra-frame prediction modes; the first derivation-related information includes a gradient histogram. The method according to claim 37, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the first value, the second related data includes the first index. The method according to claim 37, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the second value, the intra-prediction mode corresponding to the first index is horizontally flipped to determine the second index; the second related data includes the second index. The method according to claim 37, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the third value, the intra-prediction mode corresponding to the first index is vertically flipped to determine the third index; the second related data includes the third index. The method according to claim 25, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: Based on the block vector of the current block, determine the second reference region of the current block; Based on the first relevant data of the second reference region of the current block, a second derivation-related information is determined; the second derivation-related information includes the filter coefficients of the first filter model; Based on the block vector related information of the current block and the second derived related information, the first filtering model is adjusted to obtain the second filtering model; The predicted value of the current block is determined based on the second filtering model. The method according to claim 41, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 42, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the first value, the second filtering model is the first filtering model. The method according to claim 42, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the second value, the filter coefficients of one or more first positions of the first filter model and the filter coefficients of one or more second positions of the first filter model are swapped to obtain the second filter model; wherein the vertical coordinates of the first position and the second position to be swapped are the same. The method according to claim 42, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the third value, the filter coefficients of one or more third positions of the first filter model and the filter coefficients of one or more fourth positions of the first filter model are swapped to obtain the second filter model; wherein the horizontal coordinates of the swapped third positions and the fourth positions are the same. An encoding method applied to an encoder, the method comprising: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the first block vector and / or block vector related information; The block vector of the current block is determined based on the block vector information of the reference block; The predicted value of the current block is determined based on the block vector of the current block. The method according to claim 46, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: Based on the block vector information of the reference block, the first block vector of the reference block is adjusted to determine the second block vector of the reference block; The block vector of the current block is determined based on the second block vector of the reference block. The method according to claim 47, wherein, The block vector information of the reference block includes a flip identifier. The method according to claim 47, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the first value, the second block vector of the reference block is equal to the first block vector of the reference block. The method according to claim 48, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the second value, the horizontal component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 50, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block includes: If the color information includes a first block vector of the reference block belonging to a second color component, determine the co-position region of the second color component corresponding to the current block; Based on the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the corresponding region, the horizontal component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. According to the method of claim 50, the block vector related information of the reference block further includes color information; the current block is a block of the first color component; The step of adjusting the horizontal component of the first block vector of the reference block to determine the second block vector of the reference block includes: When the color information includes the first block vector of the reference block belonging to the first color component, the horizontal component of the first block vector of the reference block is adjusted according to the horizontal coordinates of the first position of the reference block and the horizontal coordinates of the first position of the current block to determine the second block vector of the reference block. The method according to claim 48, wherein, The step of adjusting the first block vector of the reference block based on the block vector information of the reference block to determine the second block vector of the reference block includes: When the value of the flip identifier of the reference block is equal to the third value, the vertical component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 53, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: If the color information includes a first block vector of the reference block belonging to a second color component, determine the co-position region of the second color component corresponding to the current block; Based on the vertical coordinates of the first position of the reference block and the vertical coordinates of the first position of the co-located region, the vertical component of the first block vector of the reference block is adjusted to determine the second block vector of the reference block. The method according to claim 53, wherein, The block vector related information of the reference block also includes color information; the current block is a block of the first color component; The step of adjusting the vertical component of the first block vector of the reference block to determine the second block vector of the reference block includes: When the color information includes the first block vector of the reference block belonging to the first color component, the vertical component of the first block vector of the reference block is adjusted according to the vertical coordinates of the first position of the reference block and the vertical coordinates of the first position of the current block to determine the second block vector of the reference block. The method according to any one of claims 47-55, wherein, Determining the block vector of the current block based on the second block vector of the reference block includes: Based on the second block vector of the reference block and the block vector related information of the reference block, determine the first candidate list of the current block; The block vector of the current block is determined based on the first candidate list of the current block. The method according to claim 56, wherein, Determining the block vector of the current block based on the first candidate list of the current block includes: Determine the template region of the current block; Based on the template region of the current block, determine the first generation value of one or more block vector information candidates in the first candidate list of the current block; The block vector of the current block is determined based on the first-generation values ​​corresponding to the one or more block vector information candidates. The method according to claim 57, wherein, The step of determining the first-generation value of one or more block vector information candidates in the first candidate list of the current block based on the template region of the current block includes: The first generation value is obtained by predicting one or more block vector information candidates in the first candidate list of the current block on the template region of the current block. The method according to claim 58, wherein, The first generation value obtained by predicting one or more block vector information candidates from the first candidate list of the current block on the template region of the current block includes: Based on the p-th block vector information candidate, the block vector information of the template region is determined; wherein, the block vector information of the template region includes the block vector of the template region and / or the block vector related information of the template region; p is greater than 0 and less than or equal to the number of block vector information candidates in the first candidate list of the current block; Based on the block vector information of the template region, determine the first predicted block of the template region; Based on the first predicted block of the template region and the reconstructed value of the template region, the first generation value corresponding to the candidate vector information of the p-th block is determined. The method according to claim 59, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip identifier of the p-th block vector information candidate is equal to the first value, the block vector of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 59, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip flag of the p-th block vector information candidate is equal to the second value, the horizontal component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the left template of the template region; And / or, the block vector of the upper template of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 61, wherein, The step of adjusting the horizontal component of the block vector of the p-th block vector candidate to determine the block vector of the left template of the template region includes: Based on the horizontal coordinates of the first position of the current block and the horizontal coordinates of the first position of the left template of the template region, the horizontal component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the left template of the template region. The method according to claim 59, wherein, The step of determining the block vector of the template region based on the candidate p-th block vector information includes: When the value of the flip identifier of the p-th block vector information candidate is equal to the third value, the vertical component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the upper template of the template region; And / or, the block vector of the left template of the template region includes the block vector in the p-th block vector information candidate. The method according to claim 63, wherein, The step of adjusting the vertical component of the block vector of the p-th block vector information candidate to determine the block vector of the upper template of the template region includes: Based on the vertical coordinates of the first position of the current block and the vertical coordinates of the first position of the upper template of the template region, the vertical component of the block vector of the p-th block vector information candidate is adjusted to determine the block vector of the upper template of the template region. The method according to any one of claims 59-64, wherein, The step of determining the first predicted block of the template region based on the block vector information of the template region includes: Based on the block vector of the template region, determine the second predicted block of the template region; Based on the block vector information of the template region, the second prediction block of the template region is adjusted to determine the first prediction block of the template region. The method according to claim 65, wherein, The block vector information related to the template region includes the flip identifier of the template region. The method according to claim 66, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier in the template region is equal to the first value, the first prediction block of the template region is equal to the second prediction block of the template region. The method according to claim 66, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier of the template region is equal to the second value, the second prediction block of the template region is horizontally flipped to obtain the first prediction block of the template region. The method according to claim 66, wherein, The step of adjusting the second prediction block of the template region based on the block vector information of the template region to determine the first prediction block of the template region includes: When the value of the flip identifier in the template region is equal to the third value, the second prediction block of the template region is vertically flipped to obtain the first prediction block of the template region. The method according to any one of claims 46-69, wherein, Determining the predicted value of the current block based on the block vector of the current block includes: The predicted value of the current block is determined based on the block vector of the current block and the relevant information of the block vector of the current block. The method according to claim 70, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: A first reference region is determined based on the block vector of the current block and the relevant information of the block vector of the current block; The predicted value of the current block is determined based on the first reference region of the current block. The method according to claim 71, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 72, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: When the flip identifier of the current block is equal to the first value, the corresponding first reference region is the second reference region pointed to by the block vector of the current block. The method according to claim 72, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: If the flip flag of the current block is equal to the second value, the second reference region pointed to by the block vector of the current block is horizontally flipped, or the first reference region is obtained by horizontally reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block. The method according to claim 72, wherein, Determining the first reference region based on the block vector of the current block and the relevant information of the block vector of the current block includes: If the flip flag of the current block is equal to the third value, the second reference region pointed to by the block vector of the current block is vertically flipped, or the first reference region is obtained by vertically reversing the reading based on the coordinate parameters of the second reference region pointed to by the block vector of the current block. The method according to claim 70, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: Based on the block vector of the current block, determine the second reference region of the current block; Based on the block vector related information of the current block, the first related data of the second reference region of the current block is adjusted to obtain the second related data; Based on the second relevant data, determine the first derivation relevant information; Based on the first derivation of relevant information, the predicted value of the current block is determined. The method according to claim 76, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 77, wherein, The first relevant data of the second reference region includes the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference region; the first derived relevant information includes the filtering coefficients of the filtering model. The method according to claim 78, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip identifier of the current block is equal to the first value, the second related data includes the chromaticity reconstruction block of the second reference area and the downsampled luminance reconstruction block. The method according to claim 78, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip flag of the current block is equal to the second value, the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference area are horizontally flipped to obtain the second related data. The method according to claim 78, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: When the flip flag of the current block is equal to the third value, the chromaticity reconstruction block and the downsampled luminance reconstruction block of the second reference area are vertically flipped to obtain the second related data. The method according to claim 77, wherein, The first relevant data for the second reference region includes a first index determined based on the gradient values ​​of samples in the second reference region, the first index being used to identify intra-frame prediction modes; the first derivation-related information includes a gradient histogram. The method according to claim 82, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the first value, the second related data includes the first index. The method according to claim 82, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the second value, the intra-prediction mode corresponding to the first index is horizontally flipped to determine the second index; the second related data includes the second index. The method according to claim 82, wherein, The step of adjusting the first relevant data of the second reference region of the current block according to the block vector information of the current block to obtain the second relevant data includes: If the flip identifier of the current block is equal to the third value, the intra-prediction mode corresponding to the first index is vertically flipped to determine the third index; the second related data includes the third index. The method according to claim 70, wherein, The step of determining the predicted value of the current block based on the block vector of the current block and the relevant information of the block vector of the current block includes: Based on the block vector of the current block, determine the second reference region of the current block; Based on the first relevant data of the second reference region of the current block, a second derivation-related information is determined; the second derivation-related information includes the filter coefficients of the first filter model; Based on the block vector related information of the current block and the second derived related information, the first filtering model is adjusted to obtain the second filtering model; The predicted value of the current block is determined based on the second filtering model. The method according to claim 86, wherein, The block vector information of the current block includes the flip identifier of the current block. The method according to claim 87, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the first value, the second filtering model is the first filtering model. The method according to claim 87, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the second value, the filter coefficients of one or more first positions of the first filter model and the filter coefficients of one or more second positions of the first filter model are swapped to obtain the second filter model; wherein the vertical coordinates of the first position and the second position to be swapped are the same. The method according to claim 87, wherein, The step of adjusting the first filtering model based on the block vector information of the current block and the second derived information to obtain the second filtering model includes: When the flip flag of the current block is equal to the third value, the filter coefficients of one or more third positions of the first filter model and the filter coefficients of one or more fourth positions of the first filter model are swapped to obtain the second filter model; wherein the horizontal coordinates of the swapped third positions and the fourth positions are the same. The method according to any one of claims 46-90, wherein, The method further includes: The residual value of the current block is determined based on the predicted value of the current block and the initial value of the current block; A bitstream is generated based on the residual value of the current block. An encoder, comprising a first acquisition unit, a first determination unit, and a first prediction unit, wherein: The first acquisition unit is configured to acquire block vector information of a reference block of the current block, wherein the block vector information includes a first block vector and / or block vector related information; The first determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block; The first prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block. An encoder, the encoder comprising a first memory and a first processor, wherein: The first memory is used to store computer programs that can run on the first processor; The first processor is configured to perform the method as described in any one of claims 46 to 91 when running the computer program. A decoder, the decoder comprising a second acquisition unit, a second determination unit, and a second prediction unit, wherein: The second acquisition unit is configured to acquire block vector information of a reference block of the current block, wherein the block vector information includes a first block vector and / or block vector related information; The second determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block; The second prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block. A decoder, the decoder comprising a second memory and a second processor, wherein: The second memory is used to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 1 to 45 when running the computer program. A computer-readable storage medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 45, or the method as described in any one of claims 46 to 91. A computer-readable storage medium having a bitstream stored thereon, wherein, The bitstream is generated by performing the steps of the encoding method as described in claim 91.