Coding method, code stream, encoder, decoder and storage medium

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

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2024-01-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

In the prior art, the search strategy of intra template matching prediction (Intra TMP) is not ideal, resulting in low prediction accuracy and reducing the encoding and decoding efficiency.

Method used

By determining the candidate list of the current block, using spatially adjacent and non-adjacent reconstructed information, expanding the candidate vector parameters, updating the candidate list, and improving prediction accuracy.

Benefits of technology

On the premise of ensuring coding complexity, the coverage of Intra TMP search list is increased, the accuracy of prediction is improved, the bit rate is saved, and the encoding and decoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122536142A_ABST
    Figure CN122536142A_ABST
Patent Text Reader

Abstract

The application discloses a coding method, a code stream, an encoder, a decoder and a storage medium. The method comprises the following steps: determining a first candidate list of a current block (S1501); wherein the first candidate list comprises one or more candidate vector parameters; determining a second position block according to the candidate vector parameters in the first candidate list and / or vector parameters of a first position block of the current block (S1502); when the decoding parameters of the second position block contain vector parameters, determining whether the vector parameters of the second position block satisfy a second condition according to the vector parameters of the second position block (S1503); when the vector parameters of the second position block satisfy the second condition, updating the first candidate list according to the vector parameters of the second position block (S1504); and determining a prediction value of the current block according to the first candidate list (S1505). In this way, the prediction accuracy is improved, and the coding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

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

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

[0002] Intra Template Matching Prediction (Intra TMP) technology uses the template of the coding block to search for the matching template with the minimum cost according to a preset cost function within a predefined search range in the current image, and uses the best matching reconstructed block corresponding to the matching template as the prediction block of the current coding block.

[0003] However, in the prediction process based on Intra TMP, considering that the search strategy in actual implementation is not ideal, the accuracy of the prediction cannot be guaranteed, which reduces the encoding and decoding efficiency.

[0004] Summary of the Invention

[0005] The present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can improve the accuracy of prediction and thus improve the coding and decoding efficiency.

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

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

[0008] Determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0009] Determine a second position block according to candidate vector parameters in the first candidate list and / or vector parameters of the first position block of the current block;

[0010] When the decoding parameters of the second position block include vector parameters, determining whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block;

[0011] When the vector parameter of the second position block meets the second condition, updating the first candidate list according to the vector parameter of the second position block;

[0012] According to the first candidate list, a prediction value of the current block is determined.

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

[0014] Determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0015] Determine a second position block according to candidate vector parameters in the first candidate list and / or vector parameters of the first position block of the current block;

[0016] When the coding parameters of the second position block include vector parameters, determining whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block;

[0017] When the vector parameter of the second position block meets the second condition, updating the first candidate list according to the vector parameter of the second position block;

[0018] According to the first candidate list, a prediction value of the current block is determined.

[0019] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: a prediction difference value of a current block, a value of a first syntax element, and a value of a second syntax element;

[0020] Among them, the value of the first syntax element is used to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list, and the value of the second syntax element is used to indicate whether the current block uses the intra-frame template matching prediction mode.

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

[0022] A first determining unit is configured to determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0023] a first updating unit configured to determine a second position block based on candidate vector parameters in the first candidate list and / or vector parameters of the first position block of the current block; and, when the coding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; and, when the vector parameters of the second position block meet the second condition, update the first candidate list based on the vector parameters of the second position block;

[0024] The first prediction unit is configured to determine a prediction value of the current block according to the first candidate list.

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

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

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

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

[0029] A second determining unit is configured to determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0030] a second updating unit configured to determine a second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; and when the decoding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; and when the vector parameters of the second position block meet the second condition, update the first candidate list based on the vector parameters of the second position block;

[0031] The second prediction unit is configured to determine a prediction value of the current block according to the first candidate list.

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

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

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

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

[0036] An embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. Regardless of whether it is an encoding end or a decoding end, a first candidate list of a current block is first determined, and the first candidate list includes one or more candidate vector parameters; then, a second position block is determined based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the encoding / decoding parameters of the second position block include vector parameters, whether the vector parameters of the second position block meet a second condition is determined based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, the first candidate list is updated based on the vector parameters of the second position block; finally, a prediction value of the current block is determined based on the first candidate list. That is to say, when updating the first candidate list, some vector information of the second position block can be expanded based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then the first candidate list can be supplemented based on the expanded vector information; thereby, the spatially adjacent and non-adjacent reconstructed information can be effectively utilized, and the candidate vector information can be derived based on the vector information of these reconstructed blocks while ensuring the coding complexity, thereby increasing the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a schematic diagram of the prediction of Intra TMP;

[0038] FIG2 is a schematic diagram of the prediction process based on the IntraTMP technology;

[0039] FIG3 is a schematic diagram of template types for the Intra TMP technology;

[0040] FIG4 is a schematic diagram of a search process based on the IntraTMP technology;

[0041] FIG5 is a schematic diagram of parameter definition of the current block and its template;

[0042] FIG6 is a schematic diagram of a template search area;

[0043] FIG7 is a schematic diagram of a flow chart of a search process;

[0044] FIG8 is a schematic diagram of the process of constructing a rough search list;

[0045] FIG9 is a schematic diagram of spatially adjacent and non-adjacent positions of a current block;

[0046] FIG10 is a schematic diagram of a process for generating a prediction value;

[0047] FIG11A is a schematic diagram showing the distribution of filter coefficients;

[0048] FIG11B is a schematic diagram showing the distribution of predicted pixels;

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

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

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

[0052] FIG15 is a flowchart diagram of a decoding method provided in an embodiment of the present application;

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

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

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

[0056] FIG19 is a flowchart of a search process according to an embodiment of the present application;

[0057] FIG20 is a second flow chart of a search process according to an embodiment of the present application;

[0058] FIG21 is a third flow chart of a search process according to an embodiment of the present application;

[0059] FIG22 is a fourth flow chart of a search process according to an embodiment of the present application;

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

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

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

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

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

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

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

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

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

[0069] Coding Block (CB);

[0070] Block Maching (BM);

[0071] Coding Unit (CU);

[0072] Prediction Unit (PU);

[0073] Block Vector (BV);

[0074] Motion Vector (MV);

[0075] Sum of Absolute Difference (SAD);

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

[0077] Mean Square Error (MSE);

[0078] Sum of Squared Errors (SSE);

[0079] Sum of Squared Differences (SSD);

[0080] Mean Absolute Deviation (MAD);

[0081] Mean Absolute Error (MAE);

[0082] Mean Square Differences (MSD);

[0083] Normalized Correlation Coefficient (NCC);

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

[0085] VVC Test Model (VTM), a reference software testing platform for VVC;

[0086] Intra Template Matching Prediction (Intra TMP);

[0087] Beyond VVC's reference software testing platform (Enhanced Compression Model, ECM).

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

[0089] It can also be understood that Intra TMP is a special intra-frame prediction mode. Both the encoder and decoder use the template (T) of the coding block to search for the matching template (T_BEST) with the minimum cost within a predefined search range in the current image according to a preset cost function. The offset of the best matching template relative to the current coding block template is the best block vector (BEST Block Vector, BV_BEST). The reconstructed block (Ref Block) corresponding to the matching template is then used as the prediction block for the current coding block (Cur Block). The template of the coding block is usually selected from the adjacent reconstructed area of ​​the current coding block.

[0090] For example, taking the adjacent reconstructed area of ​​the current block as an example, FIG1 is a prediction diagram of an Intra TMP. As shown in FIG1 , the area filled with oblique lines represents the reconstructed area, the block filled with a grid is the current block, and the adjacent area of ​​the current block is the first template (T); the block filled with vertical lines is the reference block, and the adjacent area of ​​the reference block is the second template (i.e., the best matching template, T_BEST); wherein, the offset of the second template relative to the first template is the best block vector (BV_BEST). At this time, the reference block can be block-copied as the prediction block of the current block.

[0091] In an embodiment of the present application, the preset cost function can be the sum of absolute error SAD, the sum of absolute transformation difference SATD, the mean square error MSE, the sum of squared errors SSD, the mean absolute difference MAD, the mean sum of squared errors MSD, the normalized correlation coefficient NCC, etc., which is not specifically limited here.

[0092] For example, taking absolute error and SAD as examples, the cost function at this time is as follows:

[0093] Among them, T i is the template in the search process, and M represents the number of pixels in the template.

[0094] The following is a detailed introduction to the prediction process of the Intra TMP technology in the related art.

[0095] Input of IntraTMP: the position of the current block (xTbCmp, yTbCmp), the width of the current block nTbW, and the height of the current block nTbH.

[0096] Output of IntraTMP: predicted value predSamples[x][y] of the current block, where x = 0..nTbW-1, y = 0..nTbH–1.

[0097] Specifically, the IntraTMP prediction process can be divided into four steps: determining the current template type, obtaining the reconstructed pixels of the current template, determining the block vector (or "block vector") within a predefined search range, and generating the predicted value. This process yields the predicted value for the current block. It's important to note that the IntraTMP technique can be used to predict both luma and chroma components, and this is not specifically limited here.

[0098] In one possible implementation, FIG2 is a schematic diagram of a prediction process based on the IntraTMP technology. As shown in FIG2 , the process may include:

[0099] S201: Determine the current template type.

[0100] It should be noted that the Intra TMP technology uses the adjacent reconstructed pixels of the current block as templates to search for matching templates within a predefined search area, where the adjacent reconstructed pixels can be the upper reference pixel, upper left reference pixel, upper right reference pixel, left reference pixel, lower left reference pixel, etc. of the current block. Therefore, the template type can be classified and the corresponding template type can be determined based on the availability of the adjacent reconstructed pixels.

[0101] It should also be noted that refTemplateType represents the template type. Figure 3 is a schematic diagram of template types for the Intra TMP technology. As shown in Figure 3, the block filled with a grid is the current block, and the adjacent area of ​​the current block is the template T. Six template types are shown here.

[0102] For example, the six template types are as follows:

[0103] When the upper left reference pixel, the upper reference pixel, and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is as shown in (a) of Figure 3. It should be noted that when the value of refTemplateType is 1, for an L-shaped template, in some cases there may be no upper left adjacent reference pixel.

[0104] When only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is shown in (b) in Figure 3;

[0105] When only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is shown in (c) in Figure 3;

[0106] When only the left reference pixel and the upper left reference pixel are available, the value of refTemplateType is 4, and the template shape is shown in (d) in Figure 3;

[0107] When only the left reference pixel and the lower left reference pixel are available, the value of refTemplateType is 5, and the template shape is shown in (e) of Figure 3;

[0108] When only the upper reference pixel and the upper right reference pixel are available, the value of refTemplateType is 6, and the template shape is shown in (f) in Figure 3.

[0109] S202, obtaining the current template pixel.

[0110] It should be noted that the Intra TMP template can be composed of reconstructed pixels from one or more of the following regions: the top, upper right, left, lower left, or upper left of the current block. Furthermore, the template size can be pre-set. For example, when obtaining the left template, the template width (templateW_size) can be set to 4, and when obtaining the top template, the template height (templateH_size) can be set to 4.

[0111] It should also be noted that the portion of the reconstructed pixels to be obtained can be determined by the value of refTemplateType. For example, when the value of refTemplateType is 1, the reconstructed pixels of the left, upper-left, and upper sides of the current block are obtained; or, when the value of refTemplateType is 2, only the reconstructed pixels of the four left columns of the current block are obtained; or, when the value of refTemplateType is 3, only the reconstructed pixels of the four upper rows of the current block are obtained.

[0112] S203: Determine a block vector.

[0113] It should be noted that the search process of the Intra TMP technology is mainly divided into an initialization process, determining a search area of ​​the template in the current frame, and searching and determining the best block vector in the search area.

[0114] It should also be noted that when searching for the best matching template in the search area, a search strategy of coarse search first and then fine search may be adopted, or only fine search or only coarse search may be performed, which is not specifically limited here.

[0115] In an embodiment of the present application, the coarse search here can specifically be: determining the best coarse matching template in the search area with a first preset step size (for example, 3), or using a downsampled template (for example, a downsampling factor of 3) to determine the best coarse matching template in the search area.

[0116] In an embodiment of the present application, the fine search here can specifically be: determining the best fine matching template in the search area with a second preset step size (for example, 1, if sub-pixel accuracy is encountered, sub-pixel interpolation is required for the reconstructed pixels, which is not expanded here), or determining the best fine matching template near the best coarse matching template after completing the coarse search.

[0117] In one possible implementation, FIG4 is a schematic diagram of a search process based on the IntraTMP technology. As shown in FIG4 , the process may include:

[0118] S401, initialization parameters.

[0119] It should be noted that, taking the L-shaped template as an example, uiPatchWidth is initialized to nTbW + templateW_size, and uiPatchHeight is initialized to nTbH + templateH_size. Among them, templateW_size and templateH_size can be fixed constants, or they can be dynamically adjusted according to the size of the current block; in addition, templateW_size and templateH_size can be equal or unequal. For example, templateW_size = 4, templateH_size = 4; or, when the width of the current block is greater than 8, set templateW_size = 4; when the width of the current block is less than or equal to 8, set templateW_size = 2; when the height of the current block is greater than 8, set templateH_size = 4; when the height of the current block is less than or equal to 8, set templateH_size = 2.

[0120] For example, Figure 5 shows a parameter definition diagram for a current block and its template. As shown in Figure 5, the parameters are as follows: nTbW and nTbH represent the width and height of the current block, templateW_size and templateH_size represent the width and height of the template, and uiPatchWidth and uiPatchHeight represent the overall height and width of the current block and template.

[0121] Furthermore, the cost threshold between the initialization templates is represented by diffThreshold. For example, when the cost function is SAD, the threshold can be: diffThreshold = ((1 <<bitDepth)> >2)×(uiPatchHeight×uiPatchWidth-nTbH×nTbW). When the image bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold of each pixel in the template area is 256.

[0122] Furthermore, the position of the coding tree block CTB where the current block CB is located is initialized: ctbRsX, ctbRsY.

[0123] Furthermore, the position offset of the current block CB in the current CTB is initialized: offsetLCBY=yTbCmp−ctbRsY, offsetLCBX=xTbCmp−ctbRsX.

[0124] Furthermore, initialize iTemplateSizeH=templateH_size and iTemplateSizeW=templateW_size.

[0125] Furthermore, iBvShift is initialized, where iBvShift is the precision of the block vector BV. For example, the precision of BV can be integer pixel precision, in which case iBvShift is 0; the precision of BV can also be sub-pixel precision, for example, iBvShift of 1 indicates 1 / 2 pixel precision, and iBvShift of 2 indicates 1 / 4 pixel precision. This is not specifically limited here.

[0126] Furthermore, the preset search range of the template is initialized. The preset search range of the template can be set to a fixed size or dynamically adjusted according to the encoding block size. For example: searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR × nTbW; searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR × nTbH;

[0127] The value of TMP_SEARCH_RANGE_MULT_FACTOR may be a preset value, for example, 5.

[0128] S402: Determine a search area of ​​the template in the current frame.

[0129] It should be noted that the frame here can also be called an image, so the current frame can also be called the current image. The search area of ​​the Intra TMP technology is the reconstructed part of the current image and is limited by the size of the search range. For example, Figure 6 is a schematic diagram of the template search area of ​​the current block. As shown in Figure 6, R1, R2, R3, R4, R5 and R6 represent six different search areas. Among them, picHeight represents the height of the current image, picWidth represents the width of the current image, searchRangeHeight represents the height of the search area, searchRangeWidth represents the width of the search area, CtbSizeH represents the height of the coding tree block, nTbH represents the height of the current block, and nTbW represents the width of the current block.

[0130] The search areas can be divided into two types:

[0131] One is the surrounding rectangular search area. This area is also divided into two types: one is the area where all sampling points have been reconstructed (called the fully reconstructed area), such as the four areas R1 to R4 in Figure 6; the other is the area where it is uncertain whether all sampling points have been reconstructed (called the pending reconstruction area), such as the two areas R5 to R6 in Figure 6.

[0132] One is to extend the search area, which is defined as the area pointed to by the BVs corresponding to the spatially adjacent and non-adjacent PUs. In the embodiment corresponding to FIG6 , this area can be considered as R7.

[0133] For the search points in the search area, all search points in the specified search area can be traversed, or different schemes can be used to limit the search range to a local search range, so as to balance the computational complexity and coding efficiency. For example, for the undetermined reconstruction area (corresponding to the two areas R5 to R6 in Figure 6) or the full reconstruction area (for example, corresponding to the four areas R1 to R4 in Figure 6), the width of the search range can be limited to the original 1 / wIndex, and the height can be limited to the original 1 / hIndex, where wIndex and hIndex are both any positive integers greater than or equal to 1. The limited search range takes the area closer to the unit to be encoded. For another example, when narrowing the search range of the R5 area, the width of the R5 search area can be reduced to 1 / 2 of the original width, and the width can be reduced to 1 / 2 of the original width. The final search range can take the upper right 1 / 4 area of ​​the R5 area.

[0134] S403: Search and determine the best block vector BV in the search area.

[0135] It should be noted that bvXMins and bvXMaxs represent the minimum offset and maximum offset of the block vector in the horizontal direction respectively; bvYMins and bvYMaxs represent the minimum offset and maximum offset of the block vector in the vertical direction respectively.

[0136] bvXMins regionId 、bvXMaxs regionId 、bvYMins regionId 、bvYMaxs regionId iVerMin determined in step S402 regionId 、iVerMax regionId 、iHorMin regionId 、iHorMax regionId Calculated: bvXMins regionId =iHorMin regionId –xTbCmp; bvXMaxs regionId =iHorMax regionId –xTbCmp; bvYMins regionId =iVerMin regionId –yTbCmp; bvYMaxs regionId =iVerMax regionId –yTbCmp;

[0137] Among them, bvXMins regionId 、bvXMaxs regionId 、bvYMins regionId and bvYMaxs regionId The horizontal and vertical offset ranges of the search point relative to the current block, ie, the range of the block vector BV, are determined.

[0138] For the entire reconstruction area (e.g., corresponding to the four regions R1 to R4 in Figure 6), a matching reconstructed block for the current block can be found in the reconstruction area through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor - xTbCmp, pY = iPosVer - yTbCmp, pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs). The adjacent reconstructed pixels of the matching reconstructed block are the matching template. This allows the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block to be calculated, denoted as pDiff.

[0139] For the area to be reconstructed (e.g., corresponding to the two areas R5 to R6 in FIG6 ), the availability is judged by the search points (iPosHor, iPoxVer) in each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor-xTbCmp, pY = iPosVer-yTbCmp, then pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs):

[0140] If available, a matching reconstructed block for the current block can be found in the reconstructed area. The adjacent reconstructed pixels of the matching reconstructed block are the matching template. From this, the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block can be calculated, also recorded as pDiff.

[0141] If not available, no template matching cost calculation is performed.

[0142] Availability judgment includes but is not limited to one or more of the following conditions being met simultaneously:

[0143] ● Each sampling point in the template does not exceed the valid coordinate range limited by the image sampling point boundary;

[0144] ● Each sampling point in the template's corresponding reconstruction block does not exceed the valid coordinate range limited by the image sampling point boundary;

[0145] ● Each sampling point in the template and each sampling point in the corresponding reconstructed block does not exceed the specified range of the search window;

[0146] ●Whether each sampling point in the template is in the same tile as the current encoding area;

[0147] ●Whether the sampling points in the reconstructed block corresponding to the template are in the same tile as the current coding area;

[0148] ●All sampling points in the template have been reconstructed;

[0149] ● Each sampling point in the reconstructed block corresponding to the template is not in the current coding area;

[0150] ●All sampling points in the reconstruction block corresponding to the template have been reconstructed;

[0151] Traverse all available search points in all search ranges (regionId = 0, 1, 2, 3, 4, 5), and compare to obtain the 30 search points with the smallest matching cost pDiff. The corresponding matching cost is recorded as pDiff_BEST[n], n = 0, ..., 29, and the corresponding block vector BV is recorded as the best block vector BV_BEST[n]. Each item is a coordinate pair (pX_BEST, pY_BEST), n = 0, ..., 29, and the corresponding matching template is the best matching template T_BEST[n], n = 0, ..., 29.

[0152] If the search strategy is: only perform a rough search, the specific implementation is as follows:

[0153] In each region at pX within bvXMins regionId with bvXMaxs regionId Between, pY is in bvYMins regionId with bvYMaxs regionId In the search range between , a coarse search is performed with a step size greater than 1, for example, a coarse search is performed with a step size of 2. The best matching cost obtained by recording template matching is pDiff_BEST, and its corresponding block vector BV is recorded as the best block vector BV_BEST (pX_BEST, pY_BEST).

[0154] If the search strategy is: only perform detailed search, the specific implementation is as follows:

[0155] In each region at pX within bvXMins regionId with bvXMaxs regionId Between, pY is in bvYMins regionId with bvYMaxs regionId Within the search range between, for example, the best matching cost obtained by performing a fine search with a step size of 1 and recording the template matching is pDiff_BEST, and its corresponding block vector BV is recorded as the best block vector BV_BEST (pX_BEST, pY_BEST).

[0156] If the search strategy is: perform a coarse search first and then a fine search, as shown in Figure 7, the specific implementation is as follows:

[0157] S701: Construct a rough search list in the search area.

[0158] S702, determining a detailed search list near the rough search list BV with a step size of 1.

[0159] It should be noted that, for step S701, when constructing a rough search list within the search area, as shown in FIG8 , the implementation steps may include:

[0160] S801: Construct an initial rough search list in the search area with a step size of 3.

[0161] In each region at pX within bvXMins regionId with bvXMaxs regionId Between, pY is in bvYMins regionId with bvYMaxs regionId Within the search range between , a coarse search is performed with a step size of 3. The first P optimal matching costs obtained from the template matching are recorded as pDiff1_BEST[p], where p = 0, ..., P-1, and the corresponding block vector BV is recorded as the best block vector BV1_BEST[p], where p = 0, ..., P-1. P can be an integer value of 1 or greater as needed, and the search region where the best matching search point is located is bestRegionId[p], where p = 0, ..., P-1.

[0162] S802: Construct an IntraTMP_Merge list to update the rough search list.

[0163] After P reference points are found in the search area, a candidate BV list for reference by the current block is constructed using multiple predefined search positions, which is called the IntraTMP_Merge list.

[0164] Exemplarily, the predefined search position set may include: positions adjacent to and non-adjacent to the current block space. For example, the five positions adjacent to the current block space are: left (xTbCmp-1, yTbCmp+nTbH-1), top (xTbCmp+nTbW-1, yTbCmp-1), top right (xTbCmp+nTbW, yTbCmp-1), bottom left (xTbCmp-1, yTbCmp+nTbH), top left (xTbCmp-1, yTbCmp-1), and 18 non-adjacent positions in space (as shown in FIG9 ). Among them, the positions numbered 1-5 in FIG9 are called spatially adjacent positions, and the remaining positions are called non-adjacent positions.

[0165] An embodiment of the construction process: Check whether the PUs corresponding to these positions use the IntraTMP / IBC technology. If they do, store the BV of this PU in the IntraTMP_Merge list. After constructing the IntraTMP_Merge list, update the coarse search list. The specific operation process of the update is: access each item in this list in turn, 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 this BV with the worse BV in the coarse search list. For example, a specific replacement operation is: insert this BV into the coarse search list in order of cost, and delete the item with the highest cost in the coarse search list. And set the bestRegionId of the search area where it is located to 6. It should be noted that this process is actually a list merging process, but first constructs a search list of the results corresponding to R1 to R6, and then inserts the results of R7 into the appropriate position in the list. In addition, there can also be other search orders and merging strategies, which are not specifically limited here.

[0166] In the embodiment of the present application, according to the algorithm requirements, the coarse search stage will provide one or more (here denoted as M, 1<=M<=P) fine search reference points and send them to the next step. For example, M=1.

[0167] It should also be noted that, for step S702, the best block vector BV1_BEST[p], p=0, ..., M-1, obtained by the coarse search may be used as a reference point for fine search and search may be performed nearby.

[0168] Specifically, for each fine search reference point, the refined search range TmpRefineRangeHor and TmpRefineRangeVer are first determined. The refined search range can be fixed or dependent on the search area. For example, for reference points with a search area of ​​0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 1, while for reference points with a search area of ​​6, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 2. The position of the best matching reconstructed block obtained from the coarse search is then calculated as the reference position of the fine search area: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.

[0169] In a possible implementation, the search window is directly used, and the fine search area is regarded as an entire pending reconstruction area and directly traversed.

[0170] First, the new search range is obtained based on the optimal matching block position obtained by the rough search, which is: iHorMax refine=min(picWidth-nTbW,BestPosX+TmpRefineRangeHor); iHorMin refine =max(iTemplateSizeW,BestPosX-TmpRefineRangeHor); iVerMax refine =min(picHeight-nTbH,BestPosY+TmpRefineRangeVer); iVerMin refine =max(iTemplateSizeH,BestPosY-TmpRefineRangeVer);

[0171] Then, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs can be obtained by iVerMin refine 、iVerMax refine 、iHorMin refine 、iHorMax refine Calculation: bvXMins = iHorMin refine –xTbCmp; bvXMaxs=iHorMax refine –xTbCmp; bvYMins=iVerMin refine –yTbCmp; bvYMaxs=iVerMax refine –yTbCmp;

[0172] Fine search in pX is bvXMins refine with bvXMaxs refine Between, pY is in bvYMins refine with bvYMaxs refine This is done within the block vector range between , that is, all search positions within the fine search window are directly traversed, and availability judgments are made one by one. For example, a search is performed with a step size of 1. The top T best matching costs obtained from the available point template matching are recorded as pDiff_BEST[t], t = 0, ..., T-1, and the corresponding block vector BV is recorded as the best block vector BV_BEST[t], t = 0, ..., T-1. Where T is an integer of 1 or greater. For example, T = 1.

[0173] After completing the above operations, the results of the coarse selection and fine selection processes (where the fine selection process includes one or more reference point searches) are combined to obtain one or more optimal block vectors BV_BEST[n] for different algorithm requirements, where n = 0, ..., N-1, and each item is a coordinate pair (pX_BEST, pY_BEST). pX_BEST and pY_BEST are the horizontal and vertical offsets of the best matching template relative to the current coding block template, respectively, and are also the horizontal and vertical offsets of the best matching reconstructed block relative to the current coding block.

[0174] S204: Generate a predicted value.

[0175] In IntraTMP mode, in addition to the basic copying method to obtain prediction values, there is also a method of obtaining prediction values ​​by fusing the corresponding positions of multiple BVs, a method of filtering the reference block corresponding to the BV and then copying it, and a method of pixel-by-pixel interpolation of the corresponding reference block of the BV and then copying it.

[0176] In one possible implementation, after obtaining a BV candidate list using template matching during the decoding end region search process, the first N items (eg, N=3) are selected for weighted fusion. This method may be referred to as the IntraTMP Fusion mode.

[0177] Alternatively, in another possible implementation, after obtaining an optimal BV, multiple points are taken around the BV, and the corresponding predicted values ​​of the multiple points are weighted and fused to obtain the predicted value. This method can be called the IntraTMP FLM mode.

[0178] Alternatively, in another possible implementation, after obtaining an optimal BV, the templates are sorted using sub-pixel precision, the optimal direction and precision are selected, and the prediction value is calculated using an interpolation filter. This method may be referred to as the IntraTMP SubPel mode.

[0179] The implementation process of some of the above methods is described in detail below.

[0180] In the IntraTMP technology, different prediction methods are used depending on the prediction mode. For example, in the IntraTMP Fusion technology, after obtaining the block vectors BV corresponding to N candidate templates, N candidate reconstructed blocks are obtained through BV, and then the N candidate reconstructed blocks are weighted and fused to obtain the predicted block of the current coding block. Specifically, the final prediction value is generated through the following steps: obtaining N candidate reconstructed blocks, determining the weighted fusion weights, and then generating the prediction value through weighted fusion. As shown in Figure 10, this process may include:

[0181] S1001: Obtain N candidate reconstruction blocks.

[0182] After obtaining the block vector BV corresponding to N candidate templates, directly according to BV n Get the candidate reconstruction block RefBlock in the current image n , of which BV n The horizontal offset is pX n , the vertical offset is pY n , where n=0,1…,N-1.

[0183] It is realized by simple translation copy. For x=0…nTbW-1,y=0…nTbH-1, the specific operation is: RefBlock n [x][y]=recSamples[x+pX n ][y+pY n ] (2)

[0184] Among them, recSamples represents the reconstructed pixels of the current frame.

[0185] S1002, determining weighted fusion weights.

[0186] After obtaining N candidate reconstructed blocks RefBlock, it is necessary to calculate the weight W of the weighted fusion of the N candidate reconstructed blocks. The weight can be a predefined value or a value adaptively calculated using a cost value, pixel value, etc.

[0187] In the embodiment of the present application, the candidate template refT is used in the embodiment of the IntraTMP Fusion technology. n The reconstruction value and the template to be predicted refpredT n The weighted fusion weights are derived by minimizing the MSE of the pixel values.

[0188] Specifically, the MSE minimization process takes as input the autocorrelation matrix of the first N matching reference samples refT, the cross-correlation vector of the first N matching reference samples refT and the adjacent template samples curT of the current coding block, and outputs the weight of each matching reference item corresponding to the reconstructed block.

[0189] S1003: Generate a prediction value through weighted fusion.

[0190] The prediction block is calculated based on each candidate reconstructed block and its corresponding weighted fusion weight. Specifically, the value of each candidate reconstructed block and its corresponding weight are multiplied and accumulated to obtain the current prediction block (i.e., weighted prediction). The calculation formula is as follows:

[0191] For x = 0 ... nTbW-1, y = 0 ... nTbH-1, the predicted value is calculated as follows:

[0192] Finally, each predicted value predSamples x,y The spatial storage is the output prediction block of IntraTMP Fusion.

[0193] In IntraTMP FLM mode, the linear filter model is established using the best matching template found in the previous step and the current coding block template. This mainly involves the following two steps: determining the reconstruction area for calculating the filter coefficients and calculating the filter coefficients. The specific prediction value calculation process is as follows:

[0194] Assuming that the number of filter taps nTap is 5, the shape of the filter is shown in FIG11A , where c0 to c4 are the tap coefficients of the filter, and the dot filled in the grid corresponding to the tap coefficient C0 is the current pixel to be predicted Y pred [i][j] is the reconstructed pixel ref[i][j] at the corresponding position in the best matching block; the other white-filled dots are the reconstructed pixels adjacent to the current spatial position in the best matching reconstructed block. In this way, according to the filter in Figure 11A, the final predicted pixel Y pred [i][j] are shown as black filled dots in Figure 11B.

[0195] The specific prediction value calculation process is as follows:

[0196] For each current pixel to be predicted (i, j), the pixel position in the filter template is defined as (k, l), then the corresponding reconstructed pixel in the best matching block during filtering is defined as ref[i+k][j+l], and each filter coefficient at the position (k, l) in the filter template is defined as c k,l : c k,l =c n (4)

[0197] Where n=0,…,nTap-1, k and l are between -1 and 1.

[0198] For i = 0, ..., nTbW-1, j = 0, ..., nTbH-1: Y pred [i][j]=∑ k ∑ l ref[i+k][j+l]×C ,k,l (5)

[0199] The final predicted pixel is: predSamples[i][j]=Clip3(0,(1<<BitDepth)-1,Y pred [i][j]) (6)

[0200] in,

[0201] In IntraTMP SubPel mode, for the optimal BV, traverse the eight directions of 1 / 4, 1 / 2, 3 / 4, up, down, left, right, upper left, upper right, lower left, and lower right, sort them according to the template cost, and use the interpolation filter to calculate the prediction value for the reference block corresponding to the BV with the smallest template cost.

[0202] Simply put, IntraTMP technology uses a coding block template to search for a matching template with the lowest cost within a predefined search range in the current image according to a preset cost function. The best matching reconstructed block (Ref Block) corresponding to the matching template is used as the prediction block for the current coding block (Cur Block). The coding block template is typically selected from the reconstructed area adjacent to the current coding block. However, in actual implementations, the search strategies often fail to fully utilize the reconstructed information of adjacent sampling points, thus failing to guarantee prediction accuracy and thus affecting coding efficiency.

[0203] Based on this, an embodiment of the present application provides a coding and decoding method, which first determines a first candidate list of the current block, and the first candidate list includes one or more candidate vector parameters; then determines the second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the encoding / decoding parameters of the second position block include vector parameters, determines whether the vector parameters of the second position block meet the second condition based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, updates the first candidate list based on the vector parameters of the second position block; finally, determines the prediction value of the current block based on the first candidate list.

[0204] It can be seen that when updating the first candidate list, the embodiment of the present application can expand some vector information of the second position block based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then supplement the first candidate list based on the expanded vector information; thereby, the spatially adjacent and non-adjacent reconstructed information can be effectively utilized, and the candidate vector information can be derived based on the vector information of these reconstructed blocks while ensuring the coding complexity, thereby increasing the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, and thereby improving the encoding and decoding efficiency and encoding and decoding performance.

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

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

[0207] FIG13 is a schematic diagram of the composition structure of a decoder provided by an embodiment of the present application. As shown in FIG13 , the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206, among others. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process of FIG12 , a code stream of the video signal is output; the code stream is input to the decoder 200, and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 is to determine the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and use The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

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

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

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

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

[0212] S1501: Determine the first candidate list of the current block.

[0213] It should be noted that the decoding method of the embodiments of the present application is applied to a decoder. Furthermore, the decoding method may specifically refer to an intra-frame prediction method, more specifically, an intra-frame prediction method based on an intra TMP extended block vector list. Here, by fully utilizing reconstructed information from spatially adjacent and non-adjacent locations, the coverage of the first candidate list is increased, thereby improving prediction accuracy.

[0214] It should also be noted that, in the embodiment of the present application, a video image can be divided into multiple decoding blocks, each of which can include a first color component, a second color component, and a third color component. The current block in the embodiment of the present application refers to the decoding block in the video image that is currently to be intra-frame predicted. If the current block predicts the first color component, and the first color component is a luminance component, then the current block can also be called a luminance block; or if the current block predicts the second color component, and the second color component is a chrominance component, then the current block can also be called a chrominance block.

[0215] It should also be noted that, in this embodiment of the present application, the first candidate list may include one or more candidate vector parameters. The vector parameters may include block vector parameters and / or motion vector parameters. In other words, the first candidate list may include a list of multiple candidate BVs or a list of multiple candidate MVs.

[0216] Exemplarily, the block vector parameter may also be referred to as a block vector parameter, which may be specifically used to indicate the position of the reference block relative to the current block, that is, the offset between the current block and the reference block is the block vector parameter.

[0217] In some embodiments, for determining a first candidate list for the current block, the method may include: determining a first search area for the current block; and determining the first candidate list for the current block according to the first search area.

[0218] It should be noted that, in the embodiment of the present application, determining the first search area of ​​the current block may include: determining a first template of the current block; and determining the first search area of ​​the current block based on the first template.

[0219] In an embodiment of the present application, the template type of the current block may be determined first, and then the first template of the current block may be determined based on the template type. Determining the template type of the current block may include: determining the template type of the current block based on reference pixels of the current block; or determining the template type of the current block based on indication information in a bitstream; or determining the template type of the current block based on a size parameter of the current block.

[0220] In an embodiment of the present application, the reference pixels of the current block include at least one of the following: a left adjacent reference pixel of the current block, an upper adjacent reference pixel of the current block, and an upper-left adjacent reference pixel of the current block.

[0221] It is understood that in the embodiments of the present application, the reference pixel (Reference Sample) of the current block may refer to a reference pixel point adjacent to the current block; wherein, adjacent here may be spatially adjacent, but is not limited to this. For example, adjacent may also mean temporal adjacent, spatially and temporally adjacent, or even the reference pixel of the current block may be a reference pixel obtained by performing some processing on spatially adjacent, temporally adjacent, or spatially and temporally adjacent reference pixels, etc., and the embodiments of the present application do not specifically limit this.

[0222] It is also understood that, in the embodiment of the present application, the reference pixels of the current block may include the adjacent reconstructed pixels of the current block, that is, the adjacent reconstructed pixels of the current block may be selected as a template to search for a matching template within the first search area. It should be noted that, in the embodiment of the present application, the reference pixels of the current block, that is, the adjacent reconstructed pixels of the current block may include the upper reference pixel, the upper left reference pixel, the upper right reference pixel, the left reference pixel, and the lower left reference pixel of the current block.

[0223] It can also be understood that in the embodiment of the present application, when using the reference pixels of the current block to determine the template type of the current block, the template type can be classified and determined according to the availability of adjacent reference pixels.

[0224] In some embodiments, when determining the template type of the current block based on the reference pixels of the current block, if the left adjacent reference pixels of the current block, the upper adjacent reference pixels of the current block and the upper-left adjacent reference pixels of the current block are all available, the template type of the current block is determined to be a first value; if the left adjacent reference pixels of the current block are available, the template type of the current block is determined to be a second value; if the upper adjacent reference pixels of the current block are available, the template type of the current block is determined to be a third value; if the left adjacent reference pixels of the current block and the upper-left adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a fourth value; if the left adjacent reference pixels of the current block and the lower-left adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a fifth value; if the upper adjacent reference pixels of the current block and the upper-right adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a sixth value.

[0225] It should be noted that in the embodiments of the present application, in some cases, if both the left adjacent reference pixels of the current block and the upper adjacent reference pixels of the current block are available, the template type of the current block is determined to be the first value. In other words, for an L-type template, in some cases there may be no upper left adjacent reference pixels.

[0226] It should be noted that in the embodiments of the present application, the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value can be any values ​​and are not specifically limited in this application. For example, the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value can be 1, 2, 3, 4, 5, and 6, respectively.

[0227] For example, in an embodiment of the present application, refTemplateType can be used to represent the template type. Accordingly, as shown in FIG3 above, the block filled with the grid is the current block, and the adjacent area of ​​the current block is the template T. Six template types are shown here.

[0228] Exemplarily, these six template types are as follows: when the upper left reference pixel, the upper reference pixel and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is shown in (a) in Figure 3; when only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is shown in (b) in Figure 3; when only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is shown in (c) in Figure 3; when only the left reference pixel and the upper left reference pixel are available, the value of refTemplateType is 4, and the template shape is shown in (d) in Figure 3; when only the left reference pixel and the lower left reference pixel are available, the value of refTemplateType is 5, and the template shape is shown in (e) in Figure 3; when only the upper reference pixel and the upper right reference pixel are available, the value of refTemplateType is 6, and the template shape is shown in (f) in Figure 3.

[0229] In some embodiments, the template type of IntraTMP can also be selected in combination with the availability information of the reference pixels described above and according to the indication in the code stream. For example, the serial number of each template type is agreed upon, and the serial number information of the template actually used is transmitted in the code stream, so that the template type can be determined at the decoding end. That is to say, in the embodiments of the present application, it is possible to determine the template type based on the availability information of the reference pixels of the current block, or to determine the template type based on the information indicated in the code stream, or to determine the template type based on the availability information of the reference pixels and the information indicated in the code stream. This application does not make any specific limitations.

[0230] Furthermore, in an embodiment of the present application, when determining the first template corresponding to the current block based on the template type, it can also include: determining the template reference pixels of the current block based on the template type and the template size corresponding to the template type; and then determining the first template of the current block based on the template reference pixels.

[0231] It should be noted that, in the embodiment of the present application, the first template of the current block may include template reference pixels of the current block, wherein the template reference pixels of the current block may be determined by the template type of the current block and the template size corresponding to the template type.

[0232] It should also be noted that, in an embodiment of the present application, the first template of the current block can be composed of reconstructed pixels of one or more areas above, upper right, left, lower left, and upper left of the current block, that is, it can be composed of reference pixels of the current block.

[0233] It should also be noted that in the embodiments of the present application, the template size corresponding to the template type can be pre-set, can be indicated by a bitstream syntax element, or can be adaptively selected based on the block size or other information. For example, when obtaining the left template, the template width templateW_size can be set to 4, and when obtaining the upper template, the template height templateH_size can be set to 4.

[0234] Accordingly, in the embodiment of the present application, the value of the template type refTemplateType of the current block and the template size corresponding to the refTemplateType are combined to determine which portion of the reconstructed pixels to obtain as the template reference pixels of the current block, and thus the corresponding first template can be determined. For example, when the value of refTemplateType is 1, the left, upper left, and upper reconstructed pixels of the current block can be obtained; when the value of refTemplateType is 2, only the left four columns of reconstructed pixels of the current block are obtained; when the value of refTemplateType is 3, only the upper four rows of reconstructed pixels of the current coding block are obtained.

[0235] Of course, the value of the preset template size can be any integer greater than 0 and is not limited to 4, and is not specifically limited here.

[0236] That is to say, in the embodiment of the present application, in combination with the template type and the corresponding template size of the current block, the template reference pixels of the current block determined from the reference pixels of the current block may be the first template corresponding to the current block.

[0237] It can be understood that in an embodiment of the present application, the search process of the vector parameters may include an initialization process, determining the search area of ​​the first template in the current frame (first search area), searching and determining one or a pair of optimal vector parameters in the first search area. Therefore, when performing the search process, the initialization operation needs to be completed first.

[0238] Exemplarily, as shown in FIG5 , nTbW and nTbH represent the size of the current block, templateW_size and templateH_size represent the template size, and uiPatchWidth and uiPatchHeight represent the block size including the current block and its template.

[0239] Accordingly, during initialization, uiPatchWidth can be initialized to nTbW + templateW_size, and uiPatchHeight can be initialized to nTbH + templateH_size, where templateW_size and templateH_size can be fixed constants, or indicated by codestream syntax elements, or dynamically adjusted according to the current block size or other information. TemplateW_size and templateH_size can be equal or unequal. For example, templateW_size = 4, templateH_size = 4; or, when the width of the current block is greater than 8, templateW_size = 4; when the width of the current block is less than or equal to 8, templateW_size = 2; when the height of the current block is greater than 8, templateH_size = 4; when the height of the current block is less than or equal to 8, templateH_size = 2.

[0240] Furthermore, the cost threshold between the initialization templates is represented by diffThreshold. For example, when the cost function is SAD, the threshold can be: diffThreshold = ((1 <<bitDepth)> >2)×(uiPatchHeight×uiPatchWidth-nTbH×nTbW). When the image bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold of each pixel in the template area is 256.

[0241] Furthermore, the position of the coding tree block CTB where the current block CB is located is initialized: ctbRsX, ctbRsY.

[0242] Furthermore, the position offset of the current block CB in the current CTB is initialized: offsetLCBY=yTbCmp−ctbRsY, offsetLCBX=xTbCmp−ctbRsX.

[0243] Furthermore, initialize iTemplateSizeH=templateH_size and iTemplateSizeW=templateW_size.

[0244] Furthermore, iBvShift is initialized, where iBvShift is the precision of the vector parameter BV. For example, BV can have integer pixel precision, in which case iBvShift is 0. BV can also have sub-pixel precision, such as iBvShift of 1 for 1 / 2 pixel precision and iBvShift of 2 for 1 / 4 pixel precision. This is not specifically limited here.

[0245] Furthermore, the preset search range of the template is initialized. The preset search range of the template can be set to a fixed size or dynamically adjusted based on the size of the current block. For example, searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR × nTbW, searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR × nTbH. The value of TMP_SEARCH_RANGE_MULT_FACTOR can be a preset value, can be indicated by a bitstream syntax element, or can be adaptively adjusted based on information such as the size of the current block, for example, set to 5.

[0246] It is also understandable that in the embodiment of the present application, the first search area may include a first-type search area and / or a second-type search area. The first-type search area is a rectangular search area surrounding the current block; the second-type search area is an area pointed to by the vector parameter corresponding to the preset search position of the current block and an area pointed to by automatic relocation.

[0247] Here, the first type of search area includes a full reconstruction area and / or a pending reconstruction area, wherein all sampling points in the full reconstruction area are reconstructed sampling points, and sampling points in the pending reconstruction area include reconstructed sampling points and / or unreconstructed sampling points.

[0248] That is to say, in the embodiment of the present application, the first search area can be divided into two types:

[0249] One is the surrounding rectangular search area, which can also be divided into two types: one is the area where all sampling points have been reconstructed (called the full reconstruction area), for example, including the four areas R1 to 4 in Figure 6; the other is the area where it is uncertain whether all sampling points have been reconstructed (called the pending reconstruction area), for example, including the two areas R5 to R6 in Figure 6.

[0250] One is an extended search area: defined as the area pointed to by the BV corresponding to spatially adjacent and non-adjacent PUs. In the embodiment corresponding to Figure 6, this area can be considered R7; and the area pointed to by the automatic relocation, which can be considered R8. Since search points in R7 and / or R8 are not necessarily adjacent to each other, the search of R7 and / or R8 areas is performed point by point according to the list.

[0251] In some embodiments, determining a first candidate list for the current block based on the first search area may include: searching within the first search area based on a first search step to determine one or more first candidate vector parameters; and adding the one or more first candidate vector parameters to the first candidate list for the current block.

[0252] In a specific embodiment, searching within a first search area according to a first search step size to determine one or more first candidate vector parameters may include: traversing search points in the first search area according to the first search step size, and determining a first matching cost value between a matching template corresponding to the search point in the first search area and the first template according to a preset matching criterion; determining one or more matching search points according to the first matching cost value, and determining one or more first candidate vector parameters based on the one or more matching search points.

[0253] It should be noted that, in the embodiment of the present application, the first search step can be set to 3, and the first candidate list obtained at this time can be called an initial rough search list.

[0254] It should also be noted that in the embodiment of the present application, the preset matching criteria may include any one of the absolute error sum SAD, the transformed absolute error sum SATD, the difference square sum SSE, the mean absolute difference MAD, the mean absolute error MAE, the mean square error MSE, and the normalized correlation coefficient NCC.

[0255] In a possible implementation, when traversing the search points in the first search area, the following steps may be specifically included:

[0256] For the entire reconstruction area (e.g., corresponding to the four regions R1 to R4 in Figure 6), a matching reconstructed block for the current block can be found in the reconstruction area through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor - xTbCmp, pY = iPosVer - yTbCmp, pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs). The adjacent reconstructed pixels of the matching reconstructed block are the matching template. This allows the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block to be calculated, denoted as pDiff.

[0257] For the area to be reconstructed (e.g., corresponding to the two areas R5 to R6 in FIG6 ), the availability is judged by the search points (iPosHor, iPoxVer) in each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor-xTbCmp, pY = iPosVer-yTbCmp, then pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs):

[0258] If available, a matching reconstructed block for the current block can be found in the reconstructed area. The adjacent reconstructed pixels of the matching reconstructed block are the matching template. From this, the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block can be calculated, also recorded as pDiff.

[0259] If not available, no template matching cost calculation is performed.

[0260] Availability judgment includes but is not limited to one or more of the following conditions being met simultaneously:

[0261] ● Each sampling point in the template does not exceed the valid coordinate range limited by the image sampling point boundary;

[0262] ● Each sampling point in the template's corresponding reconstruction block does not exceed the valid coordinate range limited by the image sampling point boundary;

[0263] ● Each sampling point in the template and each sampling point in the corresponding reconstructed block does not exceed the specified range of the search window;

[0264] ●Whether each sampling point in the template is in the same tile as the current encoding area;

[0265] ●Whether the sampling points in the reconstructed block corresponding to the template are in the same tile as the current coding area;

[0266] ●All sampling points in the template have been reconstructed;

[0267] ● Each sampling point in the reconstructed block corresponding to the template is not in the current coding area;

[0268] ●All sampling points in the reconstruction block corresponding to the template have been reconstructed;

[0269] Traverse all available search points in all search ranges (regionId = 0, 1, 2, 3, 4, 5), and compare to obtain the 30 search points with the smallest matching cost pDiff. The corresponding matching cost is recorded as pDiff_BEST[n], n = 0, ..., 29, and the corresponding block vector BV is recorded as the best block vector BV_BEST[n]. Each item is a coordinate pair (pX_BEST, pY_BEST), n = 0, ..., 29, and the corresponding matching template is the best matching template T_BEST[n], n = 0, ..., 29.

[0270] Thus, in the embodiment of the present application, assuming that the first search step is 3, a search is performed within the first search area with a step size of 3. For example, within each region, when pX is between bvXMinsregionId and bvXMaxsregionId, and pY is within the search range between bvYMinsregionId and bvYMaxsregionId, a coarse search is performed with a step size of 3, and then the first P best matching costs obtained by template matching are recorded as pDiff1_BEST[p], p=0,…,P-1, and the corresponding block vector BV is recorded 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. In this way, a first candidate list can be constructed based on the P best block vectors BV1_BEST[p].

[0271] S1502: Determine a second position block according to candidate vector parameters in the first candidate list and / or vector parameters of the first position block of the current block.

[0272] S1503 : When the decoding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block.

[0273] It should be noted that, in the embodiment of the present application, the first position block of the current block may include blocks in spatially adjacent positions and / or non-adjacent positions. In addition, the number of the first position blocks may be one or more.

[0274] Exemplarily, for the predefined one or more first position blocks, the predefined search positions may be, for example, five positions spatially adjacent to the current block: left (xTbCmp-1, yTbCmp+nTbH-1), upper left (xTbCmp-1, yTbCmp-1), upper (xTbCmp+nTbW-1, yTbCmp-1), upper right (xTbCmp+nTbW, yTbCmp-1), lower left (xTbCmp-1, yTbCmp+nTbH) and 18 spatially non-adjacent positions (as specifically shown in FIG9 ).

[0275] It should also be noted that, in an embodiment of the present application, determining the second position block may include: determining the second position block based on the candidate vector parameters in the first candidate list; and / or determining the second position block based on the vector parameters of the first position block of the current block.

[0276] That is to say, in an embodiment of the present application, the second position block can be determined based on the candidate vector parameters in the first candidate list, or the second position block can be determined based on the vector parameters of the first position block, or the second position block can be determined based on the candidate vector parameters in the first candidate list and the vector parameters of the first position block, without specific limitation here.

[0277] In some embodiments, when determining the second position block based on the vector parameters of the first position block of the current block, the method may further include: when the decoding parameters of the first position block of the current block include vector parameters, determining whether the vector parameters of the first position block meet the first condition based on the vector parameters of the first position block; when the vector parameters of the first position block meet the first condition, determining the second position block based on the vector parameters of the first position block.

[0278] It should be noted that in an embodiment of the present application, when the vector parameter is BV, if the first position block of the current block uses a BV-based prediction technology (ie, IBC / IntraTMP), then it can be determined that the decoding parameters of the first position block of the current block include vector parameters.

[0279] It should also be noted that, in the embodiment of the present application, the first condition may include: the cost value corresponding to the vector parameter of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list. In other words, if the cost value corresponding to the vector parameter of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list, then the vector parameter of the first position block is determined to meet the first condition.

[0280] In some embodiments, for determining that the vector parameters of the first position block meet the first condition, the method also includes: determining the cost value corresponding to the vector parameters of the first position block based on the matching cost value between the matching template corresponding to the vector parameters of the first position block and the first template; determining the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; when the cost value corresponding to the vector parameters of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameters of the first position block meet the first condition.

[0281] It should also be noted that, in the embodiment of the present application, the method further includes: when the vector parameter of the first position block meets the first condition, updating the first candidate list according to the vector parameter of the first position block.

[0282] In a specific embodiment, updating the first candidate list according to the vector parameter of the first position block may include: adding the vector parameter of the first position block to the first candidate list.

[0283] That is, when the vector parameters of the first position block meet the first condition, the first candidate list can be updated using the vector parameters of the first position block. For example, the vector parameters of the first position block can be added to the first candidate list according to the size of the cost value, and the item with the largest cost value in the first candidate list can be deleted to obtain an updated first candidate list.

[0284] It should also be noted that, in the embodiment of the present application, the method further includes: determining the search region where the vector parameter of the first position block is located as R6, that is, the value of bestRegionId is set to 6.

[0285] It should also be noted that in an embodiment of the present application, during the update process, it is first checked whether the PUs corresponding to these predefined search positions use the IntraTMP / IBC technology, that is, whether the decoding parameters of the PUs corresponding to these predefined search positions contain vector parameters. If they contain vector parameters, the BV of this PU is determined, and then the first candidate list is updated using this BV. The specific operation of the update is: access each item in the first candidate list in turn, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the first candidate list, and if it is less than the largest cost value in the first candidate list, replace this BV with the worse BV in the first candidate list. For example, the specific operation can be: insert this BV into the first candidate list in order of cost size, and delete the item with the largest cost in the first candidate list. And set the value of the bestRegionId of the search area where it is located to 6.

[0286] It can be understood that, in the embodiment of the present application, the number of the second location blocks can be one or more.

[0287] It should also be noted that, in the embodiment of the present application, the second position block represents the reference block pointed to by the vector parameter of the first position block, or the second position block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first position block.

[0288] It should also be noted that in the embodiment of the present application, still taking the vector parameter as BV as an example, if the second position block uses the BV-based prediction technology (ie IBC / IntraTMP), then it can be determined that the decoding parameters of the second position block include vector parameters.

[0289] Exemplarily, for the second position block, the vector parameters of the first position block are used as the current BV. First, several candidate positions of the current block are determined, for example, five candidate positions: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), upper left (xTbCmp, yTbCmp), upper right (xTbCmp+nTbW-1, yTbCmp), lower left (xTbCmp, yTbCmp+nTbH-1), and lower right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). Then, it is checked whether the corresponding PU after adding the coordinates of these five candidate positions to the current BV uses a BV-based prediction mode (i.e., IBC / IntraTMP). If used, the newly obtained BV is regarded as the current BV, and the above operation is repeated to determine the vector parameters of the second position block (also referred to as "extended BV"). In other words, in the embodiment of the present application, the extended BV can be the BV stored in the block pointed to by the current BV, or the BV stored in the block pointed to by the BV of the block pointed to by the current BV, and so on.

[0290] In some embodiments, the second condition may include: a cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list. In other words, if the cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list, then the vector parameter of the second position block is determined to meet the second condition.

[0291] It should also be noted that, in an embodiment of the present application, the method further includes: determining a cost value corresponding to the vector parameters of the second position block based on a matching cost value between the matching template corresponding to the vector parameters of the second position block and the first template; determining a cost value corresponding to at least one candidate vector parameter in the first candidate list based on a matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; when the cost value corresponding to the vector parameters of the second position block is less than a cost value corresponding to at least one candidate vector parameter in the first candidate list, determining that the vector parameters of the second position block meet the second condition.

[0292] S1504: When the vector parameter of the second position block meets the second condition, update the first candidate list according to the vector parameter of the second position block.

[0293] It should be noted that, in the embodiment of the present application, the vector parameters of the second position block may be one or more vector parameters of the second position block. Determination of the vector parameters of the second position block may cease when all vector parameters of the first position block are traversed or the number of vector parameters of the second position block obtained is greater than a first threshold.

[0294] It should also be noted that, in the embodiment of the present application, the first threshold value can be represented by V. For example, the value of V can be 15, but it can also be other values, such as 1, 2, 5, 10, etc., which are not specifically limited here.

[0295] In some embodiments, updating the first candidate list according to the vector parameters of the second position block may include: adding the vector parameters of the second position block to the first candidate list.

[0296] That is, when the vector parameters of the second position block meet the second condition, the first candidate list can be updated using the vector parameters of the second position block. For example, the vector parameters of the second position block can be added to the first candidate list according to the cost value, and the item with the largest cost value in the first candidate list can be deleted to obtain an updated first candidate list.

[0297] In some embodiments, the method further includes: determining the search region where the vector parameter of the second position block is located as R7, that is, setting the value of bestRegionId to 7.

[0298] It should be noted that in the embodiment of the present application, for the vector parameters of the obtained first position block, first, for each current BV, the five positions of the current block are determined: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), upper left (xTbCmp, yTbCmp), upper right (xTbCmp+nTbW-1, yTbCmp), lower left (xTbCmp, yTbCmp+nTbH-1), and lower right (xTbCmp+nTbW-1, yTbCmp+nTbH-1), and it is checked whether the corresponding PU after adding the current BV to these five position coordinates uses the BV-based prediction technology (ie, IBC / IntraTMP). If it is used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., the horizontal and vertical components are added separately) is recorded as BV', and BV' is then regarded as the current BV. The above operation is repeated for this BV' to continue to determine the available options for the extended BV. If it is not used, the next position is checked. Repeat the above operation until all five positions are checked or the number of extended BVs determined is greater than V, then stop determining the vector parameters of the second position block.

[0299] It should also be noted that after obtaining multiple extended BVs, the first candidate list is further updated. The specific operation of the update is: for multiple extended BVs, calculate the corresponding template matching cost, compare this cost with the template matching cost of the BV in the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. Specific replacement operations include: inserting this BV into the first candidate list in order of cost size, and deleting the item with the highest cost in the first candidate list. Set the value of bestRegionId of the search area where the BV newly inserted into the first candidate list is located to 7.

[0300] That is, in an embodiment of the present application, when the BV of the first position block (the spatially adjacent position and / or non-adjacent position of the current block) is better than at least one BV in the first candidate list (the first condition), then the block pointed to by the BV of the first position block is checked. If the block pointed to by the BV of the first position block also has a BV, a determination is made (the second condition) whether to add the BV to the first candidate list. At the same time, another feature of the embodiment of the present application is that the first position block can contribute two candidate BVs to the first candidate list (one BV is added when the first condition is met, and another BV is added when the second condition is met) to obtain an updated first candidate list (i.e., the final rough search list).

[0301] S1505: Determine a prediction value of the current block according to the first candidate list.

[0302] It should be noted that, in the embodiment of the present application, after obtaining the final rough search list, a fine search can be performed on the rough search list. In other words, the search process of the embodiment of the present application can be: first perform a rough search, then perform a fine search.

[0303] In some embodiments, determining the prediction value of the current block according to the first candidate list may include: determining vector parameters of the current block based on the first candidate list; and determining the prediction value of the current block according to the vector parameters of the current block.

[0304] In a specific embodiment, determining the vector parameters of the current block based on the first candidate list may include: determining a second search area indicated by the candidate vector parameters in the first candidate list; searching within the second search area according to a second search step to determine the vector parameters of the current block; wherein the value of the second search step is smaller than the value of the first search step.

[0305] It should be noted that, in the embodiment of the present application, the second search step size can be 1, but can also be other values. Here, the second search step size needs to be smaller than the value of the first search step size in the coarse search phase.

[0306] Exemplarily, the best block vector BV1_BEST[p] obtained in the first candidate list, p=0, ..., M-1, is used as a search reference point for performing a search near the fine search reference point.

[0307] For each fine search reference point, first determine the refined search range TmpRefineRangeHor and TmpRefineRangeVer. The refined search range (second search area) can be a fixed size and is also related to the search area. For example, for reference points with search areas of 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 1; while for reference points with a search area of ​​6, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 2. Then, the position of the best matching reconstructed block obtained from the coarse search is calculated as the reference position of the fine search area: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.

[0308] Directly use the search window, treat the fine search area as a whole undetermined reconstruction area, and traverse directly:

[0309] According to the optimal matching block position obtained by the rough search, a new search range is obtained: iHorMax refine=min(picWidth-nTbW,BestPosX+TmpRefineRangeHor); iHorMin refine =max(iTemplateSizeW,BestPosX-TmpRefineRangeHor); iVerMax refine =min(picHeight-nTbH,BestPosY+TmpRefineRangeVer); iVerMin refine =max(iTemplateSizeH,BestPosY-TmpRefineRangeVer);

[0310] Then, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs can be obtained by iVerMin refine 、iVerMax refine 、iHorMin refine 、iHorMax refine Calculation: bvXMins = iHorMin refine –xTbCmp; bvXMaxs=iHorMax refine –xTbCmp; bvYMins=iVerMin refine –yTbCmp; bvYMaxs=iVerMax refine –yTbCmp;

[0311] Fine search in pX is bvXMins refine with bvXMaxs refine Between, pY is in bvYMins refine with bvYMaxs refine This is done within the block vector range between , that is, all search positions within the fine search window are directly traversed, and availability judgments are made in sequence. For example, a search is performed with a second search step size of 1. The top T best matching costs obtained from the available point template matching are recorded as pDiff_BEST[t], t = 0, ..., T-1, and the corresponding block vector BV is recorded as the best block vector BV_BEST[t], t = 0, ..., T-1. Where T is an integer of 1 or greater. For example, T = 1.

[0312] After completing the above operations, by combining the results of the coarse search and fine search process (where the fine search process includes one or more reference point searches), one or more optimal block vectors BV_BEST[n] for different algorithm requirements can be obtained, where n=0,…,N-1, and each item is a coordinate pair (pX_BEST, pY_BEST). Among them, pX_BEST and pY_BEST are the horizontal and vertical offsets of the best matching template relative to the current block template, and also the horizontal and vertical offsets of the best matching reconstructed block relative to the current block. Thus, the vector parameters of the current block can be obtained.

[0313] In some embodiments, searching within the second search area according to the second search step size to determine the vector parameters of the current block may include performing a sub-pixel search within the second search area according to the second search step size to determine the vector parameters of the current block. In other words, a sub-pixel search may be performed during the detailed search phase.

[0314] It should also be noted that, in the embodiment of the present application, the vector parameter of the current block may be one or more. Here, if there are multiple vector parameters of the current block, weighted fusion can be performed using the corresponding positions of multiple BVs to obtain the predicted value of the current block.

[0315] In some embodiments, when the vector parameter of the current block is one, determining the prediction value of the current block based on the vector parameter of the current block may include: determining a reference block of the current block based on the vector parameter of the current block; and determining the prediction value of the current block based on the reference block.

[0316] For example, in the embodiment of the present application, when determining the reference block of the current block, a simple translation copy can be used to achieve it. The specific operation is: for x=0...nTbW-1, y=0...nTbH-1, through RefBlock n [x][y]=recSamples[x+pX n ][y+pY n ]Determine the reconstructed pixels recSamples of the current frame (i.e., the reference block of the current block).

[0317] It should be noted that in the embodiments of the present application, when determining the reference block of the current block based on the vector parameters of the current block, the initial reconstructed block of the current block can be first determined based on the vector parameters of the current block; then, the initial reconstructed block is corrected to determine the reference block of the current block. Alternatively, the reference block can be filtered to determine a filtered reference block; and the prediction value of the current block can be determined based on the filtered reference block.

[0318] It should also be noted that, in the embodiment of the present application, the prediction value determined by the vector parameters of the current block can be used as the final prediction value, or can be further corrected (eg, a clip operation) to determine the final prediction value of the current block.

[0319] In some embodiments, when determining a prediction value of a current block based on a reference block, the method may include: determining a first prediction block of the current block based on the reference block; predicting the current block based on a first prediction mode to determine a second prediction block of the current block; wherein the first prediction mode is a non-intra-frame template matching prediction mode; and determining a prediction value of the current block based on the first prediction block and the second prediction block.

[0320] It should be noted that, in the embodiment of the present application, the first prediction mode may be a prediction mode different from the intra-frame template matching prediction mode used by the current block, such as a PLANAR mode, a CCLM mode, an angular prediction mode, etc. Here, the first prediction block and the second prediction block may be weightedly fused to determine the prediction value of the current block.

[0321] That is to say, in the embodiment of the present application, when determining the prediction value of the current block, the prediction value can be corrected by local filtering, or the prediction value can be corrected by weighting multiple prediction values, etc.

[0322] In some embodiments, when there are multiple vector parameters of the current block, determining the prediction value of the current block based on the vector parameters of the current block may include: determining multiple reference blocks of the current block based on the multiple vector parameters of the current block; and determining the prediction value of the current block based on the multiple reference blocks.

[0323] It should also be noted that, in an embodiment of the present application, determining the prediction value of the current block based on multiple reference blocks may include: determining multiple prediction blocks of the current block based on multiple reference blocks; and performing weighted fusion on the multiple prediction blocks to determine the prediction value of the current block.

[0324] It can be understood that in the IntraTMP mode, in addition to the basic copying method to obtain the prediction value, there is also a method of obtaining the prediction value by filtering and fusing the corresponding positions of multiple BVs, as well as a method of fusion prediction with the ordinary Intra mode.

[0325] In some embodiments, the prediction value of the current block is determined based on the vector parameters of the current block. The method may also include: decoding the code stream to determine the value of the first syntax element; determining the method for constructing the prediction value of the current block based on the value of the first syntax element and the candidate list of constructed prediction values ​​of the current block; determining the prediction value of the current block based on the vector parameters of the current block and the method for constructing the prediction value.

[0326] That is to say, when determining the prediction value of the current block, a candidate list of prediction values ​​can be constructed by using multiple single prediction values, filtered prediction values, weighted prediction values, and / or a method of constructing prediction values ​​of these prediction values, and the decoding end can determine which item in the candidate list of prediction values ​​to use to obtain the actual prediction value through the syntax elements transmitted in the code stream.

[0327] In some embodiments, the method further includes: decoding the code stream, determining the value of the second syntax element; and when the second syntax element indicates that the current block uses the intra template matching prediction mode, executing the step of determining the first candidate list of the current block.

[0328] It should be noted that, in the embodiment of the present application, the value of the first syntax element is used to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list, and the value of the second syntax element is used to indicate whether the current block uses the intra-frame template matching prediction mode.

[0329] It should be noted that, in an embodiment of the present application, if the value of the second syntax element is a first preset value, it is determined that the current block uses the intra template matching prediction mode; if the value of the second syntax element is a second preset value, it is determined that the current block does not use the intra template matching prediction mode.

[0330] In an embodiment of the present application, the first preset value is different from the second preset value. The first preset value may be set to 1 and the second preset value may be set to 0; or the first preset value may be set to 0 and the second preset value may be set to 1; or the first preset value may be set to true and the second preset value may be set to false; or the first preset value may be set to false and the second preset value may be set to true.

[0331] In a specific embodiment, the first preset value is set to 1, and the second preset value is set to 0. For example, if the value of the second syntax element is 1, it indicates that the second syntax element indicates that the current block uses the intra template matching prediction mode, and the decoding method shown in Figure 15 is executed. That is, the method of the embodiment of the present application is applied to the intra template matching prediction mode.

[0332] Furthermore, in the embodiment of the present application, after the prediction value of the current block is determined according to the vector parameters of the current block, the reconstructed value of the current block can be further determined according to the prediction value of the current block.

[0333] In some embodiments, the method further includes: decoding the code stream to determine a prediction residual of the current block; and determining a reconstructed value of the current block according to the prediction residual and the prediction value of the current block.

[0334] It should also be noted that, in the embodiment of the present application, by adding the prediction difference and the prediction value of the current block, the reconstruction value of the current block can be determined, thereby realizing the reconstruction of the current block.

[0335] It should also be noted that in the embodiment of the present application, there is no need to divide the steps into coarse search and fine search. Only a one-time search can be performed, and then the BV option can be expanded based on the one-time search results to obtain the final vector parameters; then, based on the final vector parameters, the predicted value of the current block can be determined.

[0336] It should also be noted that in the IntraTMP mode, in addition to the basic copying method to obtain the prediction value, there is also a method of fusing the corresponding positions of multiple BVs to obtain the prediction value, a method of filtering the reference block corresponding to the BV and then copying it, and a method of pixel-by-pixel interpolation of the BV and then copying its corresponding reference block. For example, after obtaining the BV candidate list by template matching during the decoding end area search process, the first N items (for example, N=3) are selected for weighted fusion. This method can be called the IntraTMP Fusion mode. Alternatively, after obtaining an optimal BV, multiple points are taken around the BV, and the corresponding prediction values ​​of the multiple points are weightedly fused to obtain the prediction value. This method can be called the IntraTMP FLM mode. Alternatively, after obtaining an optimal BV, the templates are sorted by pixel-by-pixel accuracy, the optimal direction and accuracy are selected, and the prediction value is calculated using an interpolation filter. This method can be called the IntraTMP SubPel mode. No specific limitation is made here.

[0337] An embodiment of the present application provides a decoding method, specifically a method for expanding the coverage of an Intra TMP search list. First, a first candidate list of a current block is determined, the first candidate list including one or more candidate vector parameters; then, a second position block is determined based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the decoding parameters of the second position block include vector parameters, whether the vector parameters of the second position block meet a second condition is determined based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, the first candidate list is updated based on the vector parameters of the second position block; finally, a prediction value of the current block is determined based on the first candidate list. In this way, when updating the first candidate list, some vector information of the second position block can be expanded based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then the first candidate list can be supplemented based on the expanded vector information; thereby, the spatially adjacent and non-adjacent reconstructed information can be effectively utilized, and the candidate vector information can be derived based on the vector information of these reconstructed blocks while ensuring the coding complexity, thereby increasing the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance.

[0338] In another embodiment of the present application, based on the decoding method of the aforementioned embodiment, FIG16 is a second flow chart of a decoding method provided by the embodiment of the present application. As shown in FIG16 , the method may include:

[0339] S1601: Determine the first candidate list of the current block.

[0340] It should be noted that in the embodiment of the present application, a first template of the current block is first determined; then, based on the first template, a first search area of ​​the current block is determined; and then, a search is performed within the first search area with a step size of 3 to construct an initial coarse search list (i.e., a first candidate list). The first candidate list may include one or more candidate vector parameters.

[0341] S1602: When the decoding parameters of the first position block of the current block include vector parameters, determine whether the vector parameters of the first position block meet a first condition according to the vector parameters of the first position block.

[0342] S1603: When the vector parameter of the first position block meets the first condition, determine a first candidate set of the current block according to the vector parameter of the first position block, and update the first candidate list according to the first candidate set.

[0343] It should also be noted that, in the embodiment of the present application, the first position block of the current block may include blocks in spatially adjacent positions and / or non-adjacent positions. In addition, the number of the first position blocks may be one or more.

[0344] Exemplarily, for the predefined one or more first position blocks, the predefined search positions may be, for example, five positions spatially adjacent to the current block: left (xTbCmp-1, yTbCmp+nTbH-1), upper left (xTbCmp-1, yTbCmp-1), upper (xTbCmp+nTbW-1, yTbCmp-1), upper right (xTbCmp+nTbW, yTbCmp-1), lower left (xTbCmp-1, yTbCmp+nTbH) and 18 spatially non-adjacent positions (as specifically shown in FIG9 ).

[0345] It should also be noted that in embodiments of the present application, the first candidate set can be represented by IntraTMP_Merge. In some embodiments, updating the first candidate list based on the first candidate set may include: determining a cost value corresponding to a second candidate vector parameter in the first candidate set, and determining a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; when the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter to update the first candidate list. The second candidate vector parameter is any vector parameter in the first candidate set.

[0346] In a specific embodiment, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter may include: adding the second candidate vector parameter to the first candidate list, and deleting the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0347] Exemplarily, in an embodiment of the present application, the construction process of the IntraTMP_Merge set (or IntraTMP_Merge list) can be specifically: check whether the PUs corresponding to these positions use the IntraTMP / IBC technology. If they do, the BV of this PU is stored in the IntraTMP_Merge set. After constructing the IntraTMP_Merge set, the first candidate list is updated according to the IntraTMP_Merge set. The specific operation of the update is: access each item of the IntraTMP_Merge set in turn, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. Specific operations, for example: insert this BV into the first candidate list in order of cost size, and delete the item with the highest cost in the first candidate list. And set the search area bestRegionId where it is located to 6.

[0348] S1604: When the vector parameter of the second position block meets the second condition, determine a second candidate set of the current block according to the vector parameter of the second position block, and update the first candidate list according to the second candidate set.

[0349] It should be noted that, in this embodiment of the present application, after the first candidate list is updated based on the first candidate set, the second position block can be determined based on at least some of the candidate vector parameters in the updated first candidate list. Furthermore, when the vector parameters of the second position block meet a second condition, a second candidate set for the current block is constructed based on the vector parameters of the second position block.

[0350] In one possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be one or more second candidate vector parameters updated from the first candidate set to the first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: determining one or more second candidate vector parameters updated from the first candidate set to the first candidate list; determining a second position block based on the one or more second candidate vector parameters; and determining the second candidate set for the current block based on the vector parameters of the second position block.

[0351] In another possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be all of the candidate vector parameters in the updated first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: after updating the first candidate list based on the first candidate set, determining a second position block based on all of the candidate vector parameters in the first candidate list, and determining the second candidate set for the current block based on the vector parameters of the second position block.

[0352] In another possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be a preset number of candidate vector parameters in the updated first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: after updating the first candidate list based on the first candidate set, determining the first N candidate vector parameters in the first candidate list; determining a second position block based on the N candidate vector parameters, and determining a second candidate set for the current block based on the vector parameters of the second position block; wherein N is a positive integer.

[0353] It should be noted that in this embodiment of the present application, the method further includes: determining the value of N based on the size parameter of the current block. In other words, the number of checks can be limited based on the size of the current block. For example, for a current block with a size less than or equal to 16x16, the first 5 blocks are checked, and for other sizes, the first 10 blocks are checked.

[0354] In another possible implementation, determining the second candidate set of the current block may include: after updating the first candidate list based on the first candidate set, clustering the first candidate list to determine M candidate vector parameters at the cluster center; determining the second position block based on the M candidate vector parameters, and determining the second candidate set of the current block based on the vector parameters of the second position block; wherein M is a positive integer.

[0355] It should also be noted that in this embodiment of the present application, the second candidate set can be represented by IntraTMP_EBVP. When constructing the IntraTMP_EBVP set (or IntraTMP_EBVP list), only all BVs replaced by the IntraTMP_Merge set in the first candidate list can be checked. Alternatively, all options in the updated first candidate list can be updated based on the EBVP.

[0356] In addition, in an embodiment of the present application, the BV objects and their number checked by the IntraTMP_EBVP set can also be adjusted. For example, the first 5 of the corresponding BV set can be used for inspection, or the first 10 of the corresponding BV set can be used for inspection. Or the number of inspections can be limited according to the size of the current block, for example, the first 5 CUs with a size less than or equal to 16x16 are inspected, and the first 10 CUs with other sizes are inspected. Or the updated first candidate list can be clustered, and the clustering rule is the geometric distance to the cluster center. The number of cluster centers is 2 to 5, for example, only the cluster center is subjected to EBVP operation.

[0357] In another possible implementation, the second candidate set may not be constructed. The method further includes: when the first candidate set of the current block is not full, filling the first candidate set with vector parameters of the second position block until the first candidate set is full; and updating the first candidate list based on the full first candidate set.

[0358] That is to say, in the embodiment of the present application, the BV of EBVP can be added after the IntraTMP_Merge set until the IntraTMP_Merge set is filled, and then the first candidate list is updated with this IntraTMP_Merge set, that is, the number is limited to the number of unfilled items in the IntraTMP_Merge set.

[0359] For example, in an embodiment of the present application, after the first candidate list is updated according to the IntraTMP_Merge set, for each BV replaced by the IntraTMP_Merge set into the first candidate list, an IntraTMP_EBVP set is constructed and the first candidate list is updated again according to the set:

[0360] First, for each current BV, build its corresponding IntraTMP_EBVP set from scratch. Determine the five positions of the current CU: center (xTbCmp+nTbW / 2,yTbCmp+nTbH / 2), top left (xTbCmp,yTbCmp), top right (xTbCmp+nTbW-1,yTbCmp), bottom left (xTbCmp,yTbCmp+nTbH-1), bottom right (xTbCmp+nTbW-1,yTbCmp+nTbH-1), and check whether the corresponding PU after adding the current BV to these five position coordinates uses BV-based prediction technology (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., the horizontal and vertical components are added separately) is recorded as BV' and added to the TMP_EBVP set. Then BV' is regarded as the current BV and the above operation is repeated for this BV' to continue to construct the available options in the TMP_EBVP set; if not used, check the next position.

[0361] In some embodiments, the method further includes: when all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold, determining that the construction of the third candidate set is completed.

[0362] It should be noted that in the embodiment of the present application, the first threshold can be represented by V, or the length of the second candidate set is V. For example, the value of V can be 15. Alternatively, the length V of the IntraTMP_EBVP set can be changed to another value, for example, the value of V can be limited to 1, 2, 5, or 10.

[0363] In this way, the above operation is repeated until all five positions are checked or the number of IntraTMP_EBVP sets being constructed is greater than V, thereby completing the construction of the current IntraTMP_EBVP set.

[0364] In some embodiments, after constructing the second candidate set, the method further includes: determining a second matching cost between a matching template corresponding to a third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; and when the second matching cost is greater than a second threshold, deleting the third candidate vector parameter from the second candidate set to update the second candidate set. The third candidate vector parameter is any vector parameter in the second candidate set.

[0365] That is to say, in an embodiment of the present application, restrictions can be imposed based on the template cost corresponding to the BV (such as SAD, SATD, etc.), and the template cost of each BV in the second candidate set is first calculated, and a cost threshold is defined. BVs that do not exceed the threshold are then added to the IntraTMP_EBVP set to obtain the final second candidate set.

[0366] In some embodiments, updating the first candidate list based on the second candidate set may include: determining a cost value corresponding to a third candidate vector parameter in the second candidate set, and determining a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; and when the cost value corresponding to the third candidate vector parameter is less than the maximum cost value in the first candidate list, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the third candidate vector parameter to update the first candidate list. The third candidate vector parameter is any vector parameter in the first candidate set.

[0367] In a specific embodiment, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter may include: adding the third candidate vector parameter to the first candidate list, and deleting the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0368] For example, in an embodiment of the present application, after the current IntraTMP_EBVP set is constructed, the first candidate list is updated. The specific operation of the update is: loop through each BV in this IntraTMP_EBVP set, calculate its corresponding template matching cost, compare this cost with the template matching cost of the BV in the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. A specific replacement operation is, for example: insert this BV into the first candidate list in order of cost, and delete the item with the highest cost in the first candidate list. And set the search area bestRegionId where the BV newly inserted into the first candidate list is located to 7.

[0369] It should also be noted that, in the embodiment of the present application, it is also not necessary to share with the IntraTMP_Merge set, that is, the expansion is only performed based on the BV directly searched by IntraTMP in the search window.

[0370] It should also be noted that in the embodiment of the present application, there is no need to divide the steps into rough search and fine search. Only a one-time search can be performed, and then the BV options can be expanded based on the one-time search results to obtain the final BV results.

[0371] In some embodiments, for updating the first candidate list, the method further includes: determining first K candidate vector parameters in the first candidate set; updating the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.

[0372] That is, in the embodiment of the present application, the IntraTMP_Merge set only takes the first K (for example, K can be 5) to update the rough search list, and only expands based on the BVs of the IntraTMP_Merge set.

[0373] In some embodiments, for updating the first candidate list, the method also includes: determining the first P candidate vector parameters in the first candidate set; determining the second position block based on the P candidate vector parameters, and determining the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, constructing the fourth candidate set of the current block based on the vector parameters of the second position block, and determining that the construction of the fourth candidate set is completed when all P candidate vector parameters are traversed or the fourth candidate set is filled; determining the cost values ​​corresponding to one or more candidate vector parameters in the fourth candidate set, and determining Q candidate vector parameters from the fourth candidate set based on the cost values ​​corresponding to one or more candidate vector parameters; updating the first candidate list based on the Q candidate vector parameters; wherein P and Q are positive integers.

[0374] That is to say, in the embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP can also be used to jointly maintain a Merge set or list. For example, the first P items (for example, P can be 5) BVs of the IntraTMP_Merge set are first taken, and the IntraTMP_EBVP is expanded based on these P BVs to construct a new Merge set with a length of L (for example, L can be 28). When the expanded BV fills the new Merge set or the expansion of P BVs is completed, the cost of each BV in the new Merge set is calculated and sorted, and then the first Q items (for example, Q can be 5) of the sorted list are taken to update the first candidate list.

[0375] S1605: Determine a prediction value of the current block according to the first candidate list.

[0376] It should be noted that, in the embodiment of the present application, after obtaining the final coarse search list, a fine search can be performed on the coarse search list. That is to say, the search process of the embodiment of the present application can be: first perform a coarse search, and then perform a fine search. Among them, after obtaining the first candidate list, the best block vector BV1_BEST[p] obtained in the first candidate list, p=0,…,M-1, is used as the search reference point for the fine search to be searched near. Specifically, the second search area indicated by the candidate vector parameters in the first candidate list is determined; the vector parameters of the current block are determined by searching within the second search area according to the second search step; wherein the value of the second search step is smaller than the value of the first search step in the coarse search stage. Exemplarily, assuming that the second search step is 1, a fine search is performed near the first search list with a step size of 1 to determine the vector parameters of the current block.

[0377] It should also be noted that in the embodiments of the present application, multiple reference blocks for the current block may be determined based on the vector parameters of the current block; and a prediction value for the current block may be determined based on the multiple reference blocks. Specifically, multiple prediction blocks for the current block may be determined based on the multiple reference blocks; and the multiple prediction blocks may be weightedly combined to determine the prediction value for the current block.

[0378] This embodiment of the present application provides a decoding method, specifically a method for expanding the coverage of the Intra TMP search list. By utilizing information from spatially adjacent and non-adjacent reconstructed blocks, the Intra TMP search area is expanded without significantly increasing coding complexity. This improves prediction accuracy, further reduces bitrate, and increases encoding and decoding efficiency, thereby enhancing encoding and decoding performance.

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

[0380] S1701: Determine the first candidate list of the current block.

[0381] It should be noted that the encoding method of the embodiments of the present application is applied to an encoder. Furthermore, the encoding method may specifically refer to an intra-frame prediction method, more specifically, an intra-frame prediction method based on an intra TMP extended block vector list. Here, by fully utilizing reconstructed information from spatially adjacent and non-adjacent locations, the coverage of the first candidate list is increased, thereby improving prediction accuracy.

[0382] It should also be noted that, in the embodiment of the present application, a video image can be divided into multiple coding blocks, each of which can include a first color component, a second color component, and a third color component, and the current block in the embodiment of the present application refers to the coding block in the video image that is currently to be intra-frame predicted. If the current block predicts the first color component, and the first color component is a luminance component, then the current block can also be called a luminance block; or if the current block predicts the second color component, and the second color component is a chrominance component, then the current block can also be called a chrominance block.

[0383] It should also be noted that, in this embodiment of the present application, the first candidate list may include one or more candidate vector parameters. The vector parameters may include block vector parameters and / or motion vector parameters. In other words, the first candidate list may include a list of multiple candidate BVs or a list of multiple candidate MVs.

[0384] Exemplarily, the block vector parameter may also be referred to as a block vector parameter, which may be specifically used to indicate the position of the reference block relative to the current block, that is, the offset between the current block and the reference block is the block vector parameter.

[0385] In some embodiments, for determining a first candidate list for the current block, the method may include: determining a first search area for the current block; and determining the first candidate list for the current block according to the first search area.

[0386] It should be noted that, in the embodiment of the present application, determining the first search area of ​​the current block may include: determining a first template of the current block; and determining the first search area of ​​the current block based on the first template.

[0387] In an embodiment of the present application, the template type of the current block may be determined first, and then the first template of the current block may be determined based on the template type. Determining the template type of the current block may include: determining the template type of the current block based on reference pixels of the current block; or determining the template type of the current block based on indication information in a bitstream; or determining the template type of the current block based on a size parameter of the current block.

[0388] In an embodiment of the present application, the reference pixels of the current block include at least one of the following: a left adjacent reference pixel of the current block, an upper adjacent reference pixel of the current block, and an upper-left adjacent reference pixel of the current block.

[0389] It is understood that in the embodiments of the present application, the reference pixel (Reference Sample) of the current block may refer to a reference pixel point adjacent to the current block; wherein, adjacent here may be spatially adjacent, but is not limited to this. For example, adjacent may also mean temporal adjacent, spatially and temporally adjacent, or even the reference pixel of the current block may be a reference pixel obtained by performing some processing on spatially adjacent, temporally adjacent, or spatially and temporally adjacent reference pixels, etc., and the embodiments of the present application do not specifically limit this.

[0390] It is also understood that, in the embodiment of the present application, the reference pixels of the current block may include the adjacent reconstructed pixels of the current block, that is, the adjacent reconstructed pixels of the current block may be selected as a template to search for a matching template within the first search area. It should be noted that, in the embodiment of the present application, the reference pixels of the current block, that is, the adjacent reconstructed pixels of the current block may include the upper reference pixel, the upper left reference pixel, the upper right reference pixel, the left reference pixel, and the lower left reference pixel of the current block.

[0391] It can also be understood that in the embodiment of the present application, when using the reference pixels of the current block to determine the template type of the current block, the template type can be classified and determined according to the availability of adjacent reference pixels.

[0392] In some embodiments, when determining the template type of the current block based on the reference pixels of the current block, if the left adjacent reference pixels of the current block, the upper adjacent reference pixels of the current block and the upper-left adjacent reference pixels of the current block are all available, the template type of the current block is determined to be a first value; if the left adjacent reference pixels of the current block are available, the template type of the current block is determined to be a second value; if the upper adjacent reference pixels of the current block are available, the template type of the current block is determined to be a third value; if the left adjacent reference pixels of the current block and the upper-left adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a fourth value; if the left adjacent reference pixels of the current block and the lower-left adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a fifth value; if the upper adjacent reference pixels of the current block and the upper-right adjacent reference pixels of the current block are both available, the template type of the current block is determined to be a sixth value.

[0393] It should be noted that in the embodiments of the present application, in some cases, if both the left adjacent reference pixels of the current block and the upper adjacent reference pixels of the current block are available, the template type of the current block is determined to be the first value. In other words, for an L-type template, in some cases there may be no upper left adjacent reference pixels.

[0394] It should be noted that in the embodiments of the present application, the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value can be any values ​​and are not specifically limited in this application. For example, the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value can be 1, 2, 3, 4, 5, and 6, respectively.

[0395] For example, in an embodiment of the present application, refTemplateType can be used to represent the template type. Accordingly, as shown in FIG3 above, the block filled with the grid is the current block, and the adjacent area of ​​the current block is the template T. Six template types are shown here.

[0396] Exemplarily, these six template types are as follows: when the upper left reference pixel, the upper reference pixel and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is shown in (a) in Figure 3; when only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is shown in (b) in Figure 3; when only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is shown in (c) in Figure 3; when only the left reference pixel and the upper left reference pixel are available, the value of refTemplateType is 4, and the template shape is shown in (d) in Figure 3; when only the left reference pixel and the lower left reference pixel are available, the value of refTemplateType is 5, and the template shape is shown in (e) in Figure 3; when only the upper reference pixel and the upper right reference pixel are available, the value of refTemplateType is 6, and the template shape is shown in (f) in Figure 3.

[0397] In some embodiments, the template type of IntraTMP can also be selected in combination with the availability information of the reference pixels described above and according to the indication in the code stream. For example, the serial number of each template type is agreed upon, and the serial number information of the template actually used is transmitted in the code stream, so that the template type can be determined at the decoding end. That is to say, in the embodiments of the present application, it is possible to determine the template type based on the availability information of the reference pixels of the current block, or to determine the template type based on the information indicated in the code stream, or to determine the template type based on the availability information of the reference pixels and the information indicated in the code stream. This application does not make any specific limitations.

[0398] Furthermore, in an embodiment of the present application, when determining the first template corresponding to the current block based on the template type, it can also include: determining the template reference pixels of the current block based on the template type and the template size corresponding to the template type; and then determining the first template of the current block based on the template reference pixels.

[0399] It should be noted that, in the embodiment of the present application, the first template of the current block may include template reference pixels of the current block, wherein the template reference pixels of the current block may be determined by the template type of the current block and the template size corresponding to the template type.

[0400] It should also be noted that, in an embodiment of the present application, the first template of the current block can be composed of reconstructed pixels of one or more areas above, upper right, left, lower left, and upper left of the current block, that is, it can be composed of reference pixels of the current block.

[0401] It should also be noted that in the embodiments of the present application, the template size corresponding to the template type can be pre-set, can be indicated by a bitstream syntax element, or can be adaptively selected based on the block size or other information. For example, when obtaining the left template, the template width templateW_size can be set to 4, and when obtaining the upper template, the template height templateH_size can be set to 4.

[0402] Accordingly, in the embodiment of the present application, the value of the template type refTemplateType of the current block and the template size corresponding to the refTemplateType are combined to determine which portion of the reconstructed pixels to obtain as the template reference pixels of the current block, and thus the corresponding first template can be determined. For example, when the value of refTemplateType is 1, the left, upper left, and upper reconstructed pixels of the current block can be obtained; when the value of refTemplateType is 2, only the left four columns of reconstructed pixels of the current block are obtained; when the value of refTemplateType is 3, only the upper four rows of reconstructed pixels of the current coding block are obtained.

[0403] Of course, the value of the preset template size can be any integer greater than 0 and is not limited to 4, and is not specifically limited here.

[0404] That is to say, in the embodiment of the present application, in combination with the template type and the corresponding template size of the current block, the template reference pixels of the current block determined from the reference pixels of the current block may be the first template corresponding to the current block.

[0405] It can be understood that in an embodiment of the present application, the search process of the vector parameters may include an initialization process, determining the search area of ​​the first template in the current frame (first search area), searching and determining one or a pair of optimal vector parameters in the first search area. Therefore, when performing the search process, the initialization operation needs to be completed first.

[0406] Exemplarily, as shown in FIG5 , nTbW and nTbH represent the size of the current block, templateW_size and templateH_size represent the template size, and uiPatchWidth and uiPatchHeight represent the block size including the current block and its template.

[0407] Accordingly, during initialization, uiPatchWidth can be initialized to nTbW + templateW_size, and uiPatchHeight can be initialized to nTbH + templateH_size, where templateW_size and templateH_size can be fixed constants, or indicated by codestream syntax elements, or dynamically adjusted according to the current block size or other information. TemplateW_size and templateH_size can be equal or unequal. For example, templateW_size = 4, templateH_size = 4; or, when the width of the current block is greater than 8, templateW_size = 4; when the width of the current block is less than or equal to 8, templateW_size = 2; when the height of the current block is greater than 8, templateH_size = 4; when the height of the current block is less than or equal to 8, templateH_size = 2.

[0408] Furthermore, the cost threshold between the initialization templates is represented by diffThreshold. For example, when the cost function is SAD, the threshold can be: diffThreshold = ((1 <<bitDepth)> >2)×(uiPatchHeight×uiPatchWidth-nTbH×nTbW). When the image bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold of each pixel in the template area is 256.

[0409] Furthermore, the position of the coding tree block CTB where the current block CB is located is initialized: ctbRsX, ctbRsY.

[0410] Furthermore, the position offset of the current block CB in the current CTB is initialized: offsetLCBY=yTbCmp–ctbRsY,

[0411] offsetLCBX=xTbCmp-ctbRsX.

[0412] Furthermore, initialize iTemplateSizeH=templateH_size and iTemplateSizeW=templateW_size.

[0413] Furthermore, iBvShift is initialized, where iBvShift is the precision of the vector parameter BV. For example, the precision of BV can be integer pixel precision, in which case iBvShift is 0; BV precision can also be sub-pixel precision, for example, iBvShift of 1 indicates 1 / 2 pixel precision, and iBvShift of 2 indicates 1 / 4 pixel precision. This is not specifically limited here.

[0414] Furthermore, the preset search range of the template is initialized. The preset search range of the template can be set to a fixed size or dynamically adjusted based on the size of the current block. For example, searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR × nTbW, searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR × nTbH. The value of TMP_SEARCH_RANGE_MULT_FACTOR can be a preset value, can be indicated by a bitstream syntax element, or can be adaptively adjusted based on information such as the size of the current block, for example, set to 5.

[0415] It is also understandable that in the embodiment of the present application, the first search area may include a first-type search area and / or a second-type search area. The first-type search area is a rectangular search area surrounding the current block; the second-type search area is an area pointed to by the vector parameter corresponding to the preset search position of the current block and an area pointed to by automatic relocation.

[0416] Here, the first type of search area includes a full reconstruction area and / or a pending reconstruction area, wherein all sampling points in the full reconstruction area are reconstructed sampling points, and sampling points in the pending reconstruction area include reconstructed sampling points and / or unreconstructed sampling points.

[0417] That is to say, in the embodiment of the present application, the first search area can be divided into two types:

[0418] One is the surrounding rectangular search area, which can also be divided into two types: one is the area where all sampling points have been reconstructed (called the full reconstruction area), for example, including the four areas R1 to 4 in Figure 6; the other is the area where it is uncertain whether all sampling points have been reconstructed (called the pending reconstruction area), for example, including the two areas R5 to R6 in Figure 6.

[0419] One is an extended search area: defined as the area pointed to by the BV corresponding to spatially adjacent and non-adjacent PUs. In the embodiment corresponding to Figure 6, this area can be considered R7; and the area pointed to by the automatic relocation, which can be considered R8. Since search points in R7 and / or R8 are not necessarily adjacent to each other, the search of R7 and / or R8 areas is performed point by point according to the list.

[0420] In some embodiments, determining a first candidate list for the current block based on the first search area may include: searching within the first search area based on a first search step to determine one or more first candidate vector parameters; and adding the one or more first candidate vector parameters to the first candidate list for the current block.

[0421] In a specific embodiment, searching within a first search area according to a first search step size to determine one or more first candidate vector parameters may include: traversing search points in the first search area according to the first search step size, and determining a first matching cost value between a matching template corresponding to the search point in the first search area and the first template according to a preset matching criterion; determining one or more matching search points according to the first matching cost value, and determining one or more first candidate vector parameters based on the one or more matching search points.

[0422] It should be noted that, in the embodiment of the present application, the first search step can be set to 3, and the first candidate list obtained at this time can be called an initial rough search list.

[0423] It should also be noted that in the embodiment of the present application, the preset matching criteria may include any one of the absolute error sum SAD, the transformed absolute error sum SATD, the difference square sum SSE, the mean absolute difference MAD, the mean absolute error MAE, the mean square error MSE, and the normalized correlation coefficient NCC.

[0424] In a possible implementation, when traversing the search points in the first search area, the following steps may be specifically included:

[0425] For the entire reconstruction area (e.g., corresponding to the four regions R1 to R4 in Figure 6), a matching reconstructed block for the current block can be found in the reconstruction area through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor - xTbCmp, pY = iPosVer - yTbCmp, pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs). The adjacent reconstructed pixels of the matching reconstructed block are the matching template. This allows the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block to be calculated, denoted as pDiff.

[0426] For the area to be reconstructed (e.g., corresponding to the two areas R5 to R6 in FIG6 ), the availability is judged by the search points (iPosHor, iPoxVer) in each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor-xTbCmp, pY = iPosVer-yTbCmp, then pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs):

[0427] If available, a matching reconstructed block for the current block can be found in the reconstructed area. The adjacent reconstructed pixels of the matching reconstructed block are the matching template. From this, the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block can be calculated, also recorded as pDiff.

[0428] If not available, no template matching cost calculation is performed.

[0429] Availability judgment includes but is not limited to one or more of the following conditions being met simultaneously:

[0430] ● Each sampling point in the template does not exceed the valid coordinate range limited by the image sampling point boundary;

[0431] ● Each sampling point in the template's corresponding reconstruction block does not exceed the valid coordinate range limited by the image sampling point boundary;

[0432] ● Each sampling point in the template and each sampling point in the corresponding reconstructed block does not exceed the specified range of the search window;

[0433] ●Whether each sampling point in the template is in the same tile as the current encoding area;

[0434] ●Whether the sampling points in the reconstructed block corresponding to the template are in the same tile as the current coding area;

[0435] ●All sampling points in the template have been reconstructed;

[0436] ● Each sampling point in the reconstructed block corresponding to the template is not in the current coding area;

[0437] ●All sampling points in the reconstruction block corresponding to the template have been reconstructed;

[0438] Traverse all available search points in all search ranges (regionId = 0, 1, 2, 3, 4, 5), and compare to obtain the 30 search points with the smallest matching cost pDiff. The corresponding matching cost is recorded as pDiff_BEST[n], n = 0, ..., 29, and the corresponding block vector BV is recorded as the best block vector BV_BEST[n]. Each item is a coordinate pair (pX_BEST, pY_BEST), n = 0, ..., 29, and the corresponding matching template is the best matching template T_BEST[n], n = 0, ..., 29.

[0439] Thus, in the embodiment of the present application, assuming that the first search step is 3, a search is performed within the first search area with a step size of 3. For example, within each region, when pX is between bvXMinsregionId and bvXMaxsregionId, and pY is within the search range between bvYMinsregionId and bvYMaxsregionId, a coarse search is performed with a step size of 3, and then the first P best matching costs obtained by template matching are recorded as pDiff1_BEST[p], p=0,…,P-1, and the corresponding block vector BV is recorded 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. In this way, a first candidate list can be constructed based on the P best block vectors BV1_BEST[p].

[0440] S1702: Determine a second position block according to candidate vector parameters in the first candidate list and / or vector parameters of the first position block of the current block.

[0441] S1703: When the coding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block.

[0442] It should be noted that, in the embodiment of the present application, the first position block of the current block may include blocks in spatially adjacent positions and / or non-adjacent positions. In addition, the number of the first position blocks may be one or more.

[0443] Exemplarily, for the predefined one or more first position blocks, the predefined search positions may be, for example, five positions spatially adjacent to the current block: left (xTbCmp-1, yTbCmp+nTbH-1), upper left (xTbCmp-1, yTbCmp-1), upper (xTbCmp+nTbW-1, yTbCmp-1), upper right (xTbCmp+nTbW, yTbCmp-1), lower left (xTbCmp-1, yTbCmp+nTbH) and 18 spatially non-adjacent positions (as specifically shown in FIG9 ).

[0444] It should also be noted that, in an embodiment of the present application, determining the second position block may include: determining the second position block based on the candidate vector parameters in the first candidate list; and / or determining the second position block based on the vector parameters of the first position block of the current block.

[0445] That is to say, in an embodiment of the present application, the second position block can be determined based on the candidate vector parameters in the first candidate list, or the second position block can be determined based on the vector parameters of the first position block, or the second position block can be determined based on the candidate vector parameters in the first candidate list and the vector parameters of the first position block, without specific limitation here.

[0446] In some embodiments, when determining the second position block based on the vector parameters of the first position block of the current block, the method may further include: when the encoding parameters of the first position block of the current block include vector parameters, determining whether the vector parameters of the first position block meet the first condition based on the vector parameters of the first position block; when the vector parameters of the first position block meet the first condition, determining the second position block based on the vector parameters of the first position block.

[0447] It should be noted that in an embodiment of the present application, when the vector parameter is BV, if the first position block of the current block uses a BV-based prediction technology (ie, IBC / IntraTMP), then it can be determined that the encoding parameters of the first position block of the current block include vector parameters.

[0448] It should also be noted that, in the embodiment of the present application, the first condition may include: the cost value corresponding to the vector parameter of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list. In other words, if the cost value corresponding to the vector parameter of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list, then the vector parameter of the first position block is determined to meet the first condition.

[0449] In some embodiments, for determining that the vector parameters of the first position block meet the first condition, the method also includes: determining the cost value corresponding to the vector parameters of the first position block based on the matching cost value between the matching template corresponding to the vector parameters of the first position block and the first template; determining the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; when the cost value corresponding to the vector parameters of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameters of the first position block meet the first condition.

[0450] It should also be noted that, in the embodiment of the present application, the method further includes: when the vector parameter of the first position block meets the first condition, updating the first candidate list according to the vector parameter of the first position block.

[0451] In a specific embodiment, updating the first candidate list according to the vector parameter of the first position block may include: adding the vector parameter of the first position block to the first candidate list.

[0452] That is, when the vector parameters of the first position block meet the first condition, the first candidate list can be updated using the vector parameters of the first position block. For example, the vector parameters of the first position block can be added to the first candidate list according to the size of the cost value, and the item with the largest cost value in the first candidate list can be deleted to obtain an updated first candidate list.

[0453] It should also be noted that, in the embodiment of the present application, the method further includes: determining the search region where the vector parameter of the first position block is located as R6, that is, the value of bestRegionId is set to 6.

[0454] It should also be noted that in an embodiment of the present application, during the update process, it is first checked whether the PUs corresponding to these predefined search positions use the IntraTMP / IBC technology, that is, whether the encoding parameters of the PUs corresponding to these predefined search positions contain vector parameters. If they contain vector parameters, the BV of this PU is determined, and then the first candidate list is updated using this BV. The specific operation of the update is: access each item in the first candidate list in turn, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the first candidate list, and if it is less than the largest cost value in the first candidate list, replace this BV with the worse BV in the first candidate list. For example, the specific operation can be: insert this BV into the first candidate list in order of cost size, and delete the item with the largest cost in the first candidate list. And set the value of the bestRegionId of the search area where it is located to 6.

[0455] It can be understood that, in the embodiment of the present application, the number of the second location blocks can be one or more.

[0456] It should also be noted that, in the embodiment of the present application, the second position block represents the reference block pointed to by the vector parameter of the first position block, or the second position block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first position block.

[0457] It should also be noted that in the embodiment of the present application, still taking the vector parameter as BV as an example, if the second position block uses the BV-based prediction technology (ie IBC / IntraTMP), then it can be determined that the encoding parameters of the second position block include vector parameters.

[0458] Exemplarily, for the second position block, the vector parameters of the first position block are used as the current BV. First, several candidate positions of the current block are determined, for example, five candidate positions: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), upper left (xTbCmp, yTbCmp), upper right (xTbCmp+nTbW-1, yTbCmp), lower left (xTbCmp, yTbCmp+nTbH-1), and lower right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). Then, it is checked whether the corresponding PU after adding the coordinates of these five candidate positions to the current BV uses a BV-based prediction mode (i.e., IBC / IntraTMP). If used, the newly obtained BV is regarded as the current BV, and the above operation is repeated to determine the vector parameters of the second position block (also referred to as "extended BV"). In other words, in the embodiment of the present application, the extended BV can be the BV stored in the block pointed to by the current BV, or the BV stored in the block pointed to by the BV of the block pointed to by the current BV, and so on.

[0459] In some embodiments, the second condition may include: a cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list. In other words, if the cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list, then the vector parameter of the second position block is determined to meet the second condition.

[0460] It should also be noted that, in an embodiment of the present application, the method further includes: determining a cost value corresponding to the vector parameters of the second position block based on a matching cost value between the matching template corresponding to the vector parameters of the second position block and the first template; determining a cost value corresponding to at least one candidate vector parameter in the first candidate list based on a matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; when the cost value corresponding to the vector parameters of the second position block is less than a cost value corresponding to at least one candidate vector parameter in the first candidate list, determining that the vector parameters of the second position block meet the second condition.

[0461] S1704: When the vector parameter of the second position block meets the second condition, update the first candidate list according to the vector parameter of the second position block.

[0462] It should be noted that, in the embodiment of the present application, the vector parameters of the second position block may be one or more vector parameters of the second position block. Determination of the vector parameters of the second position block may cease when all vector parameters of the first position block are traversed or the number of vector parameters of the second position block obtained is greater than a first threshold.

[0463] It should also be noted that, in the embodiment of the present application, the first threshold value can be represented by V. For example, the value of V can be 15, but it can also be other values, such as 1, 2, 5, 10, etc., which are not specifically limited here.

[0464] In some embodiments, updating the first candidate list according to the vector parameters of the second position block may include: adding the vector parameters of the second position block to the first candidate list.

[0465] That is, when the vector parameters of the second position block meet the second condition, the first candidate list can be updated using the vector parameters of the second position block. For example, the vector parameters of the second position block can be added to the first candidate list according to the cost value, and the item with the largest cost value in the first candidate list can be deleted to obtain an updated first candidate list.

[0466] In some embodiments, the method further includes: determining the search region where the vector parameter of the second position block is located as R7, that is, setting the value of bestRegionId to 7.

[0467] It should be noted that in the embodiment of the present application, for the vector parameters of the obtained first position block, first, for each current BV, the five positions of the current block are determined: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), upper left (xTbCmp, yTbCmp), upper right (xTbCmp+nTbW-1, yTbCmp), lower left (xTbCmp, yTbCmp+nTbH-1), and lower right (xTbCmp+nTbW-1, yTbCmp+nTbH-1), and it is checked whether the corresponding PU after adding the current BV to these five position coordinates uses the BV-based prediction technology (ie, IBC / IntraTMP). If it is used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., the horizontal and vertical components are added separately) is recorded as BV', and BV' is then regarded as the current BV. The above operation is repeated for this BV' to continue to determine the available options for the extended BV. If it is not used, the next position is checked. Repeat the above operation until all five positions are checked or the number of extended BVs determined is greater than V, then stop determining the vector parameters of the second position block.

[0468] It should also be noted that after obtaining multiple extended BVs, the first candidate list is further updated. The specific operation of the update is: for multiple extended BVs, calculate the corresponding template matching cost, compare this cost with the template matching cost of the BV in the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. Specific replacement operations include: inserting this BV into the first candidate list in order of cost size, and deleting the item with the highest cost in the first candidate list. Set the value of bestRegionId of the search area where the BV newly inserted into the first candidate list is located to 7.

[0469] That is, in an embodiment of the present application, when the BV of the first position block (the spatially adjacent position and / or non-adjacent position of the current block) is better than at least one BV in the first candidate list (the first condition), then the block pointed to by the BV of the first position block is checked. If the block pointed to by the BV of the first position block also has a BV, a determination is made (the second condition) whether to add the BV to the first candidate list. At the same time, another feature of the embodiment of the present application is that the first position block can contribute two candidate BVs to the first candidate list (one BV is added when the first condition is met, and another BV is added when the second condition is met) to obtain an updated first candidate list (i.e., the final rough search list).

[0470] In some embodiments, for updating the first candidate list, the method may also include: when the vector parameters of the first position block meet the first condition, determining the first candidate set of the current block according to the vector parameters of the first position block, and updating the first candidate list according to the first candidate set; when the vector parameters of the second position block meet the second condition, determining the second candidate set of the current block according to the vector parameters of the second position block, and updating the first candidate list according to the second candidate set.

[0471] It should be noted that, in the embodiment of the present application, the first candidate set can be represented by IntraTMP_Merge, and the second candidate set can be represented by IntraTMP_EBVP.

[0472] It should also be noted that, in some embodiments, updating the first candidate list based on the first candidate set may include: determining a cost value corresponding to a second candidate vector parameter in the first candidate set, and determining a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; and when the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter to update the first candidate list. The second candidate vector parameter is any vector parameter in the first candidate set.

[0473] In a specific embodiment, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter may include: adding the second candidate vector parameter to the first candidate list, and deleting the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0474] Exemplarily, in an embodiment of the present application, the construction process of the IntraTMP_Merge set (or IntraTMP_Merge list) can be specifically: check whether the PUs corresponding to these positions use the IntraTMP / IBC technology. If they do, the BV of this PU is stored in the IntraTMP_Merge set. After constructing the IntraTMP_Merge set, the first candidate list is updated according to the IntraTMP_Merge set. The specific operation of the update is: access each item of the IntraTMP_Merge set in turn, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. Specific operations, for example: insert this BV into the first candidate list in order of cost size, and delete the item with the highest cost in the first candidate list. And set the search area bestRegionId where it is located to 6.

[0475] It should also be noted that, in this embodiment of the present application, after the first candidate list is updated based on the first candidate set, the second position block can be determined based on at least some of the candidate vector parameters in the updated first candidate list. Furthermore, when the vector parameters of the second position block meet a second condition, the second candidate set for the current block is constructed based on the vector parameters of the second position block.

[0476] In one possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be one or more second candidate vector parameters updated from the first candidate set to the first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: determining one or more second candidate vector parameters updated from the first candidate set to the first candidate list; determining a second position block based on the one or more second candidate vector parameters; and determining the second candidate set for the current block based on the vector parameters of the second position block.

[0477] In another possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be all of the candidate vector parameters in the updated first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: after updating the first candidate list based on the first candidate set, determining a second position block based on all of the candidate vector parameters in the first candidate list, and determining the second candidate set for the current block based on the vector parameters of the second position block.

[0478] In another possible implementation, at least some of the candidate vector parameters in the updated first candidate list may be a preset number of candidate vector parameters in the updated first candidate list. Therefore, in some embodiments, determining the second candidate set for the current block may include: after updating the first candidate list based on the first candidate set, determining the first N candidate vector parameters in the first candidate list; determining a second position block based on the N candidate vector parameters, and determining a second candidate set for the current block based on the vector parameters of the second position block; wherein N is a positive integer.

[0479] It should be noted that in this embodiment of the present application, the method further includes: determining the value of N based on the size parameter of the current block. In other words, the number of checks can be limited based on the size of the current block. For example, for a current block with a size less than or equal to 16x16, the first 5 blocks are checked, and for other sizes, the first 10 blocks are checked.

[0480] In another possible implementation, determining the second candidate set of the current block may include: after updating the first candidate list based on the first candidate set, clustering the first candidate list to determine M candidate vector parameters at the cluster center; determining the second position block based on the M candidate vector parameters, and determining the second candidate set of the current block based on the vector parameters of the second position block; wherein M is a positive integer.

[0481] It should also be noted that, in the embodiment of the present application, when constructing the IntraTMP_EBVP set (or IntraTMP_EBVP list), only all BVs replaced by the IntraTMP_Merge set in the first candidate list may be checked, or all options in the updated first candidate list may be updated based on EBVP.

[0482] In addition, in an embodiment of the present application, the BV objects and their number checked in the IntraTMP_EBVP list can also be adjusted. For example, the first 5 of the corresponding BV set can be used for inspection, or the first 10 of the corresponding BV set can be used for inspection. Or the number of inspections can be limited according to the size of the current block, for example, the first 5 CUs with a size less than or equal to 16x16 are inspected, and the first 10 CUs with other sizes are inspected. Or the updated first candidate list can be clustered, and the clustering rule is the geometric distance to the cluster center. The number of cluster centers is 2 to 5, for example, EBVP operations are performed only on the cluster centers.

[0483] In another possible implementation, the second candidate set may not be constructed. The method further includes: when the first candidate set of the current block is not full, filling the first candidate set with vector parameters of the second position block until the first candidate set is full; and updating the first candidate list based on the full first candidate set.

[0484] That is to say, in the embodiment of the present application, the BV of EBVP can be added after the IntraTMP_Merge set until the IntraTMP_Merge set is filled, and then the first candidate list is updated with this IntraTMP_Merge set, that is, the number is limited to the number of unfilled items in the IntraTMP_Merge set.

[0485] For example, in an embodiment of the present application, after the first candidate list is updated according to the IntraTMP_Merge set, for each BV replaced by the IntraTMP_Merge set into the first candidate list, an IntraTMP_EBVP set is constructed and the first candidate list is updated again according to the set:

[0486] First, for each current BV, build its corresponding IntraTMP_EBVP set from scratch. Determine the five positions of the current CU: center (xTbCmp+nTbW / 2,yTbCmp+nTbH / 2), top left (xTbCmp,yTbCmp), top right (xTbCmp+nTbW-1,yTbCmp), bottom left (xTbCmp,yTbCmp+nTbH-1), bottom right (xTbCmp+nTbW-1,yTbCmp+nTbH-1), and check whether the corresponding PU after adding the current BV to these five position coordinates uses BV-based prediction technology (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, that is, the horizontal and vertical components are added separately) is recorded as BV' and added to the TMP_EBVP list. Then BV' is regarded as the current BV and the above operation is repeated for this BV' to continue to build the available options in the TMP_EBVP list; if not used, check the next position.

[0487] In some embodiments, the method further includes: when all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold, determining that the construction of the third candidate set is completed.

[0488] It should be noted that in the embodiment of the present application, the first threshold can be represented by V, or the length of the second candidate set is V. For example, the value of V can be 15. Alternatively, the length V of the IntraTMP_EBVP set can be changed to another value, for example, the value of V can be limited to 1, 2, 5, or 10.

[0489] In this way, the above operation is repeated until all five positions are checked or the number of IntraTMP_EBVP sets being constructed is greater than V, thereby completing the construction of the current IntraTMP_EBVP set.

[0490] In some embodiments, after constructing the second candidate set, the method further includes: determining a second matching cost between a matching template corresponding to a third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; and when the second matching cost is greater than a second threshold, deleting the third candidate vector parameter from the second candidate set to update the second candidate set. The third candidate vector parameter is any vector parameter in the second candidate set.

[0491] In the embodiment of the present application, the preset matching criteria may include any one of the following: Sum of Absolute Error (SAD), Sum of Transformed Absolute Error (SATD), Sum of Squared Difference (SSE), Mean Absolute Difference (MAD), Mean Absolute Error (MAE), Mean Squared Error (MSE), and Normalized Correlation Coefficient (NCC). In other words, restrictions may be imposed based on the template cost (e.g., SAD, SATD, etc.) corresponding to the BV. The template cost is first calculated for each BV in the second candidate set, and a cost threshold is defined. BVs that do not exceed the threshold are then added to the IntraTMP_EBVP set to obtain the final second candidate set.

[0492] In some embodiments, updating the first candidate list based on the second candidate set may include: determining a cost value corresponding to a third candidate vector parameter in the second candidate set, and determining a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; and when the cost value corresponding to the third candidate vector parameter is less than the maximum cost value in the first candidate list, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the third candidate vector parameter to update the first candidate list. The third candidate vector parameter is any vector parameter in the first candidate set.

[0493] In a specific embodiment, replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter may include: adding the third candidate vector parameter to the first candidate list, and deleting the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0494] For example, in an embodiment of the present application, after the current IntraTMP_EBVP set is constructed, the first candidate list is updated. The specific operation of the update is: loop through each BV in this IntraTMP_EBVP set, calculate its corresponding template matching cost, compare this cost with the template matching cost of the BV in the first candidate list, and if it is less than the maximum template matching cost in the first candidate list, replace this BV with the worse BV in the first candidate list. A specific replacement operation is, for example: insert this BV into the first candidate list in order of cost, and delete the item with the highest cost in the first candidate list. And set the search area bestRegionId where the BV newly inserted into the first candidate list is located to 7.

[0495] It should also be noted that, in the embodiment of the present application, it is also not necessary to share with the IntraTMP_Merge set, that is, the expansion is only performed based on the BV directly searched by IntraTMP in the search window.

[0496] It should also be noted that in the embodiment of the present application, there is no need to divide the steps into rough search and fine search. Only a one-time search can be performed, and then the BV options can be expanded based on the one-time search results to obtain the final BV results.

[0497] In some embodiments, for updating the first candidate list, the method further includes: determining first K candidate vector parameters in the first candidate set; updating the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.

[0498] That is, in the embodiment of the present application, the IntraTMP_Merge set only takes the first K (for example, K can be 5) to update the rough search list, and only expands based on the BVs of the IntraTMP_Merge set.

[0499] In some embodiments, for updating the first candidate list, the method also includes: determining the first P candidate vector parameters in the first candidate set; determining the second position block based on the P candidate vector parameters, and determining the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, constructing the fourth candidate set of the current block based on the vector parameters of the second position block, and determining that the construction of the fourth candidate set is completed when all P candidate vector parameters are traversed or the fourth candidate set is filled; determining the cost values ​​corresponding to one or more candidate vector parameters in the fourth candidate set, and determining Q candidate vector parameters from the fourth candidate set based on the cost values ​​corresponding to one or more candidate vector parameters; updating the first candidate list based on the Q candidate vector parameters; wherein P and Q are positive integers.

[0500] That is to say, in the embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP can also be used to jointly maintain a Merge set or list. For example, the first P items (for example, P can be 5) BVs of the IntraTMP_Merge set are first taken, and the IntraTMP_EBVP is expanded based on these P BVs to construct a new Merge set with a length of L (for example, L can be 28). When the expanded BV fills the new Merge set or the expansion of P BVs is completed, the cost of each BV in the new Merge set is calculated and sorted, and then the first Q items (for example, Q can be 5) of the sorted list are taken to update the first candidate list.

[0501] S1705: Determine a prediction value of the current block according to the first candidate list.

[0502] It should be noted that, in the embodiment of the present application, after obtaining the final rough search list, a fine search can be performed on the rough search list. In other words, the search process of the embodiment of the present application can be: first perform a rough search, then perform a fine search.

[0503] In some embodiments, determining the prediction value of the current block according to the first candidate list may include: determining vector parameters of the current block based on the first candidate list; and determining the prediction value of the current block according to the vector parameters of the current block.

[0504] In a specific embodiment, determining the vector parameters of the current block based on the first candidate list may include: determining a second search area indicated by the candidate vector parameters in the first candidate list; searching within the second search area according to a second search step to determine the vector parameters of the current block; wherein the value of the second search step is smaller than the value of the first search step.

[0505] It should be noted that, in the embodiment of the present application, the second search step size can be 1, but can also be other values. Here, the second search step size needs to be smaller than the value of the first search step size in the coarse search phase.

[0506] Exemplarily, the best block vector BV1_BEST[p] obtained in the first candidate list, p=0, ..., M-1, is used as a search reference point for performing a search near the fine search reference point.

[0507] For each fine search reference point, first determine the refined search range TmpRefineRangeHor and TmpRefineRangeVer. The refined search range (second search area) can be a fixed size and is also related to the search area. For example, for reference points with search areas of 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 1; while for reference points with a search area of ​​6, both TmpRefineRangeHor and TmpRefineRangeVer can be set to 2. Then, the position of the best matching reconstructed block obtained from the coarse search is calculated as the reference position of the fine search area: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.

[0508] Directly use the search window, treat the fine search area as a whole undetermined reconstruction area, and traverse directly:

[0509] According to the optimal matching block position obtained by the rough search, a new search range is obtained: iHorMax refine=min(picWidth-nTbW,BestPosX+TmpRefineRangeHor); iHorMin refine =max(iTemplateSizeW,BestPosX-TmpRefineRangeHor); iVerMax refine =min(picHeight-nTbH,BestPosY+TmpRefineRangeVer); iVerMin refine =max(iTemplateSizeH,BestPosY-TmpRefineRangeVer);

[0510] Then, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs can be obtained by iVerMin refine 、iVerMax refine 、iHorMin refine 、iHorMax refine Calculation: bvXMins = iHorMin refine –xTbCmp; bvXMaxs=iHorMax refine –xTbCmp; bvYMins=iVerMin refine –yTbCmp; bvYMaxs=iVerMax refine –yTbCmp;

[0511] Fine search in pX is bvXMins refine with bvXMaxs refine Between, pY is in bvYMins refine with bvYMaxs refine This is done within the block vector range between , that is, all search positions within the fine search window are directly traversed, and availability judgments are made in sequence. For example, a search is performed with a second search step size of 1. The top T best matching costs obtained from the available point template matching are recorded as pDiff_BEST[t], t = 0, ..., T-1, and the corresponding block vector BV is recorded as the best block vector BV_BEST[t], t = 0, ..., T-1. Where T is an integer of 1 or greater. For example, T = 1.

[0512] After completing the above operations, by combining the results of the coarse search and fine search process (where the fine search process includes one or more reference point searches), one or more optimal block vectors BV_BEST[n] for different algorithm requirements can be obtained, where n=0,…,N-1, and each item is a coordinate pair (pX_BEST, pY_BEST). Among them, pX_BEST and pY_BEST are the horizontal and vertical offsets of the best matching template relative to the current block template, and also the horizontal and vertical offsets of the best matching reconstructed block relative to the current block. Thus, the vector parameters of the current block can be obtained.

[0513] In some embodiments, searching within the second search area according to the second search step size to determine the vector parameters of the current block may include performing a sub-pixel search within the second search area according to the second search step size to determine the vector parameters of the current block. In other words, a sub-pixel search may be performed during the detailed search phase.

[0514] It should also be noted that, in the embodiment of the present application, the vector parameter of the current block may be one or more. Here, if there are multiple vector parameters of the current block, weighted fusion can be performed using the corresponding positions of multiple BVs to obtain the predicted value of the current block.

[0515] In some embodiments, when the vector parameter of the current block is one, determining the prediction value of the current block based on the vector parameter of the current block may include: determining a reference block of the current block based on the vector parameter of the current block; and determining the prediction value of the current block based on the reference block.

[0516] For example, in the embodiment of the present application, when determining the reference block of the current block, a simple translation copy can be used to achieve it. The specific operation is: for x=0...nTbW-1, y=0...nTbH-1, through RefBlock n [x][y]=recSamples[x+pX n ][y+pY n ]Determine the reconstructed pixels recSamples of the current frame (i.e., the reference block of the current block).

[0517] It should be noted that in the embodiments of the present application, when determining the reference block of the current block based on the vector parameters of the current block, the initial reconstructed block of the current block can be first determined based on the vector parameters of the current block; then, the initial reconstructed block is corrected to determine the reference block of the current block. Alternatively, the reference block can be filtered to determine a filtered reference block; and the prediction value of the current block can be determined based on the filtered reference block.

[0518] It should also be noted that, in the embodiment of the present application, the prediction value determined by the vector parameters of the current block can be used as the final prediction value, or can be further corrected (eg, a clip operation) to determine the final prediction value of the current block.

[0519] In some embodiments, when determining a prediction value of a current block based on a reference block, the method may include: determining a first prediction block of the current block based on the reference block; predicting the current block based on a first prediction mode to determine a second prediction block of the current block; wherein the first prediction mode is a non-intra-frame template matching prediction mode; and determining a prediction value of the current block based on the first prediction block and the second prediction block.

[0520] It should be noted that, in the embodiment of the present application, the first prediction mode may be a prediction mode different from the intra-frame template matching prediction mode used by the current block, such as a PLANAR mode, a CCLM mode, an angular prediction mode, etc. Here, the first prediction block and the second prediction block may be weightedly fused to determine the prediction value of the current block.

[0521] That is to say, in the embodiment of the present application, when determining the prediction value of the current block, the prediction value can be corrected by local filtering, or the prediction value can be corrected by weighting multiple prediction values, etc.

[0522] In some embodiments, when there are multiple vector parameters of the current block, determining the prediction value of the current block based on the vector parameters of the current block may include: determining multiple reference blocks of the current block based on the multiple vector parameters of the current block; and determining the prediction value of the current block based on the multiple reference blocks.

[0523] It should also be noted that, in an embodiment of the present application, determining the prediction value of the current block based on multiple reference blocks may include: determining multiple prediction blocks of the current block based on multiple reference blocks; and performing weighted fusion on the multiple prediction blocks to determine the prediction value of the current block.

[0524] It can be understood that in the IntraTMP mode, in addition to the basic copying method to obtain the prediction value, there is also a method of obtaining the prediction value by filtering and fusing the corresponding positions of multiple BVs, as well as a method of fusion prediction with the ordinary Intra mode.

[0525] In some embodiments, the prediction value of the current block is determined based on the vector parameters of the current block. The method may also include: determining a method for constructing a prediction value of the current block; and determining the prediction value of the current block based on the vector parameters of the current block and the method for constructing a prediction value.

[0526] In a specific embodiment, determining a construction prediction value method for the current block may include: determining a candidate construction prediction value list for the current block; wherein the candidate construction prediction value list includes at least one candidate construction prediction value method; performing cost calculation on at least one candidate construction prediction value method respectively to determine at least one cost result; determining a minimum cost result from at least one cost result, and determining the candidate construction prediction value method corresponding to the minimum cost result as the construction prediction value method for the current block.

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

[0528] In some embodiments, the method further includes: determining a value of a first syntax element; wherein the value of the first syntax element is used to indicate an index number of a method for constructing a prediction value of the current block in a candidate list of constructed prediction values; encoding the value of the first syntax element, and writing the obtained coded bits into a bitstream.

[0529] That is to say, when determining the prediction value of the current block, a candidate list of prediction values ​​can be constructed by using multiple single prediction values, filtered prediction values, weighted prediction values, and / or a method of constructing prediction values ​​of these prediction values, and the syntax elements transmitted through the code stream are transmitted to the decoding end, so that the decoding end can determine which item in the candidate list of prediction values ​​to use to obtain the actual prediction value by decoding the code stream.

[0530] In some embodiments, the method further includes: determining a value of a second syntax element; encoding the value of the second syntax element, and writing the obtained coded bits into a bitstream.

[0531] It should be noted that, in the embodiment of the present application, the value of the second syntax element is used to indicate whether the current block uses the intra template matching prediction mode. If the current block uses the intra template matching prediction mode, the value of the second syntax element is determined to be the first preset value; if the current block does not use the intra template matching prediction mode, the value of the second syntax element is determined to be the second preset value.

[0532] In an embodiment of the present application, the first preset value is different from the second preset value. The first preset value may be set to 1, and the second preset value may be set to 0; or, the first preset value may be set to 0, and the second preset value may be set to 1; or, the first preset value may be set to true, and the second preset value may be set to false; or, the first preset value may be set to false, and the second preset value may be set to true. For example, here, the first preset value is set to 1, and the second preset value is set to 0.

[0533] It should also be noted that in the embodiment of the present application, when the current block uses the intra-frame template matching prediction mode, the step of determining the first candidate list for the current block is performed, that is, the encoding method shown in Figure 17 is performed. In other words, the method of the embodiment of the present application is applied to the intra-frame template matching prediction mode.

[0534] That is to say, in the IntraTMP mode, in addition to the basic copying method to obtain the prediction value, there is also a method of obtaining the prediction value by fusing the corresponding positions of multiple BVs, a method of filtering the reference block corresponding to the BV and then copying it, and a method of pixel-by-pixel interpolation of the BV and then copying its corresponding reference block. For example, after obtaining the BV candidate list by template matching during the decoding end area search process, the first N items (for example, N=3) are selected for weighted fusion. This method can be called the IntraTMP Fusion mode. Alternatively, after obtaining an optimal BV, multiple points are taken around the BV, and the corresponding prediction values ​​of the multiple points are weightedly fused to obtain the prediction value. This method can be called the IntraTMP FLM mode. Alternatively, after obtaining an optimal BV, the templates are sorted by pixel-by-pixel accuracy, the optimal direction and accuracy are selected, and the prediction value is calculated using an interpolation filter. This method can be called the IntraTMP SubPel mode. No specific limitation is given here.

[0535] In some embodiments, after step S1705, referring to FIG18 , the method further includes:

[0536] S1801: Determine a prediction difference value of the current block according to a prediction value of the current block.

[0537] S1802: Encode the prediction difference of the current block and write the obtained coded bits into the bitstream.

[0538] It should be noted that in the embodiments of the present application, after determining the predicted value of the current block based on the vector parameters of the current block, a predicted residual value of the current block can be further determined based on the predicted value of the current block. Specifically, the initial value of the current block can be determined, and a subtraction operation can be performed on the initial value of the current block and the predicted value to obtain a predicted residual value of the current block. In this way, the predicted residual value of the current block is written into the bitstream and transmitted to the decoder. The decoder obtains the predicted residual value of the current block by decoding the bitstream, and further determines the reconstructed value of the current block, thereby achieving reconstruction of the current block.

[0539] In some embodiments, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: a prediction difference value of the current block, a value of a first syntax element, and a value of a second syntax element.

[0540] In an embodiment of the present application, the value of the first syntax element is used to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list, and the value of the second syntax element is used to indicate whether the current block uses the intra-frame template matching prediction mode.

[0541] An embodiment of the present application provides a coding method, specifically a method for extending the coverage of an Intra TMP search list. First, a first candidate list of a current block is determined, the first candidate list including one or more candidate vector parameters; then, a second position block is determined based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the coding parameters of the second position block include vector parameters, whether the vector parameters of the second position block meet a second condition is determined based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, the first candidate list is updated based on the vector parameters of the second position block; finally, a prediction value of the current block is determined based on the first candidate list. In this way, when updating the first candidate list, some vector information of the second position block can be expanded based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then the first candidate list can be supplemented based on the expanded vector information; thereby, the spatially adjacent and non-adjacent reconstructed information can be effectively utilized, and the candidate vector information can be derived based on the vector information of these reconstructed blocks while ensuring the coding complexity, thereby increasing the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance.

[0542] In another embodiment of the present application, based on the encoding and decoding method of the aforementioned embodiment, in the prediction process of IntraTMP, it is proposed to establish an adaptive repositioning BV list to fully utilize the information of all adjacent reconstructed sampling points, and adopt different schemes to narrow the search range for search areas with different relative positions to the current block to take into account the complexity.

[0543] The following is a detailed introduction to the prediction process of the embodiment of the present application.

[0544] Input of IntraTMP: the position of the current block (xTbCmp, yTbCmp), the width of the current block nTbW, and the height of the current block nTbH.

[0545] Output of IntraTMP: predicted value predSamples[x][y] of the current block, where x = 0..nTbW–1, y = 0..nTbH–1.

[0546] Specifically, the IntraTMP prediction process can be divided into four steps: determining the current template type, obtaining the reconstructed pixels of the current template, determining the block vector (or "block vector") within a predefined search range, and generating the predicted value. This process yields the predicted value for the current block. It's important to note that the IntraTMP technique can be used to predict both luma and chroma components, and this is not specifically limited here.

[0547] The IntraTMP search process for determining block vectors consists of initialization, determining the search area for the template within the current frame, and searching and determining the optimal block vector within the search area, as shown in Figure 4. A coarse search followed by a fine search strategy can be employed to search for the optimal matching template within the search area.

[0548] The coarse search here may specifically be: determining the best coarse matching template in the search area with a first search step size (eg, 3), or determining the best coarse matching template in the search area using a downsampled template (eg, a downsampling factor of 3).

[0549] The fine search here can specifically be: determining the best fine matching template in the search area with a second search step size (for example, 1. If sub-pixel accuracy is encountered, sub-pixel interpolation of the reconstructed pixels is required, which is not expanded here), or determining the best fine matching template near the best coarse matching template after completing the coarse search.

[0550] Step 1, initialization.

[0551] Among them, initialize uiPatchWidth to nTbW+templateW_size, and uiPatchHeight to nTbH+templateH_size, where templateW_size and templateH_size can be fixed constants or dynamically adjusted according to the size of the coding block. TemplateW_size and templateH_size can be equal or unequal. For example, templateW_size=4, templateH_size=4; or when the width of the coding block is greater than 8, set templateW_size=4, when the width of the coding block is less than or equal to 8, set templateW_size=2, when the height of the coding block is greater than 8, set templateH_size=4, when the height of the coding block is less than or equal to 8, set templateH_size=2. The specific meaning of the parameters is shown in Figure 5 above.

[0552] Initialize the cost threshold diffThreshold between templates. For example, when the cost function is SAD, the threshold can be: diffThreshold = ((1 <<bitDepth)> >2)*(uiPatchHeight*uiPatchWidth-nTbH*nTbW), when the image bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold of each pixel in the template area is 256.

[0553] Initialize the position of the coding tree block CTB where the current coding block CB is located: ctbRsX, ctbRsY.

[0554] Initialize the position offset of the current CB in the current CTB: offsetLCBY=yTbCmp–ctbRsY, offsetLCBX=xTbCmp–ctbRsX.

[0555] Initialize iTemplateSizeH=templateH_size, iTemplateSizeW=templateW_size.

[0556] Initialize iBvShift, which is the precision of the block vector BV. The BV precision can be integer pixel precision, in which case iBvShift is 0; the BV precision can also be sub-pixel precision, for example, when iBvShift is 1, it indicates 1 / 2 pixel precision, and when iBvShift is 2, it indicates 1 / 4 pixel precision.

[0557] Initialize the preset search range of the template. The preset search range of the template can be set to a fixed size or dynamically adjusted according to the encoding block size, such as: searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR * nTbW; searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR * nTbH;

[0558] The value of TMP_SEARCH_RANGE_MULT_FACTOR is a preset value, for example, a fixed value of 5.

[0559] Step 2: Determine the search area of ​​the template in the current frame.

[0560] The search areas described here are divided into two types:

[0561] One is the surrounding rectangular search area. This area is divided into two types: one is where all sampling points in the area are confirmed to have been reconstructed (called the fully reconstructed area), for example, the four areas R1 to R4 in Figure 6; the other is where it is uncertain whether all sampling points in the area have been reconstructed (called the pending reconstruction area), for example, the two areas R5 to R6 in Figure 6.

[0562] One is an extended search area. This is defined as the area pointed to by the BV corresponding to spatially adjacent and non-adjacent PUs. In the embodiment corresponding to Figure 6, this area can be considered R7; and the area pointed to by the automatic relocation, which can be considered R8. Since search points in R7 and / or R8 are not necessarily adjacent to each other, the search of the R7 and / or R8 areas is performed point by point according to the list.

[0563] For the search points in the search area, all search points in the specified search area can be traversed, or different schemes can be used to limit the search range to a local search range, so as to balance the computational complexity and coding efficiency. For example, for the undetermined reconstruction area (corresponding to the two areas R5 to R6 in Figure 6) or the full reconstruction area (e.g., corresponding to the four areas R1 to R4 in Figure 6), the width of the search range can be limited to the original 1 / wIndex, and the height can be limited to the original 1 / hIndex, where wIndex and hIndex are both any positive integers greater than or equal to 1. The limited search range takes the area closer to the unit to be encoded. For another example, when narrowing the search range of the R5 area, the width of the R5 search area can be reduced to 1 / 2 of the original width, and the width can be reduced to 1 / 2 of the original width. The final search range can take the upper right 1 / 4 area of ​​the R5 area.

[0564] Step 3: Search and determine the best block vector BV in the search area.

[0565] bvXMins and bvXMaxs represent the minimum offset and maximum offset of the block vector in the horizontal direction respectively; bvYMins and bvYMaxs represent the minimum offset and maximum offset of the block vector in the vertical direction respectively.

[0566] bvXMins regionId 、bvXMaxs regionId 、bvYMins regionId 、bvYMaxs regionId iVerMin can be determined by step 2 regionId 、iVerMax regionId 、iHorMin regionId 、iHorMax regionId Calculated: bvXMins regionId =iHorMin regionId –xTbCmp; bvXMaxs regionId =iHorMax regionId –xTbCmp; bvYMins regionId =iVerMin regionId –yTbCmp; bvYMaxs regionId =iVerMax regionId –yTbCmp;

[0567] Among them, bvXMins regionId 、bvXMaxs regionId 、bvYMins regionId and bvYMaxs regionId The horizontal and vertical offset ranges of the search point relative to the current block, ie, the range of the block vector BV, are determined.

[0568] For the entire reconstruction area (e.g., corresponding to the four regions R1 to R4 in Figure 6), a matching reconstructed block for the current block can be found in the reconstruction area through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor - xTbCmp, pY = iPosVer - yTbCmp, pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs). The adjacent reconstructed pixels of the matching reconstructed block are the matching template. This allows the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block to be calculated, denoted as pDiff.

[0569] For the area to be reconstructed (e.g., corresponding to the two areas R5 to R6 in FIG6 ), the availability is judged by the search points (iPosHor, iPoxVer) in each search area, that is, each block vector BV (composed of horizontal and vertical components: (pX, pY), where pX = iPosHor-xTbCmp, pY = iPosVer-yTbCmp, then pX is between bvXMins and bvXMaxs, and pY is between bvYMins and bvYMaxs):

[0570] If available, a matching reconstructed block for the current block can be found in the reconstructed area. The adjacent reconstructed pixels of the matching reconstructed block are the matching template. From this, the matching cost between the adjacent template of the current block and the adjacent template of the reconstructed block can be calculated, also recorded as pDiff.

[0571] If not available, no template matching cost calculation is performed.

[0572] Availability judgment includes but is not limited to one or more of the following conditions being met simultaneously:

[0573] ● Each sampling point in the template does not exceed the valid coordinate range limited by the image sampling point boundary;

[0574] ● Each sampling point in the template's corresponding reconstruction block does not exceed the valid coordinate range limited by the image sampling point boundary;

[0575] ● Each sampling point in the template and each sampling point in the corresponding reconstructed block does not exceed the specified range of the search window;

[0576] ●Whether each sampling point in the template is in the same tile as the current encoding area;

[0577] ●Whether the sampling points in the reconstructed block corresponding to the template are in the same tile as the current coding area;

[0578] ●All sampling points in the template have been reconstructed;

[0579] ● Each sampling point in the reconstructed block corresponding to the template is not in the current coding area;

[0580] ●All sampling points in the reconstruction block corresponding to the template have been reconstructed;

[0581] Traverse all available search points in all search ranges (regionId = 0, 1, 2, 3, 4, 5), and compare to obtain the 30 search points with the smallest matching cost pDiff. The corresponding matching cost is recorded as pDiff_BEST[n], n = 0, ..., 29, and the corresponding block vector BV is recorded as the best block vector BV_BEST[n]. Each item is a coordinate pair (pX_BEST, pY_BEST), n = 0, ..., 29, and the corresponding matching template is the best matching template T_BEST[n], n = 0, ..., 29.

[0582] In a possible implementation, if the search strategy is: perform a coarse search first and then a fine search, it can be as shown in Figure 7. The specific implementation is as follows: construct a coarse search list in the search area, and determine a fine search list near the coarse search list BV with a step size of 1.

[0583] In a possible implementation, for the coarse search phase, referring to FIG19 , the specific implementation is as follows:

[0584] S1901: Construct an initial rough search list in the search area with a step size of 3.

[0585] It should be noted that in each region, pX is in bvXMins regionId with bvXMaxs regionId Between, pY is in bvYMins regionId with bvYMaxs regionId Within the search range between , a coarse search is performed with a step size of 3. The first P optimal matching costs obtained from the template matching are recorded as pDiff1_BEST[p], where p = 0, ..., P-1, and the corresponding block vector BV is recorded as the best block vector BV1_BEST[p], where p = 0, ..., P-1. P can be an integer value of 1 or greater as needed, and the search region where the best matching search point is located is bestRegionId[p], where p = 0, ..., P-1.

[0586] S1902: Build an Intra TMP_Merge list to update the rough search list.

[0587] After P reference points are found in the search area, multiple predefined search positions are used to construct a candidate BV list for reference by the current block, which is called the IntraTMP_Merge list.

[0588] The predefined search position set, for example, uses five spatially adjacent positions of the current block: left (xTbCmp-1, yTbCmp+nTbH-1), upper left (xTbCmp-1, yTbCmp-1), upper (xTbCmp+nTbW-1, yTbCmp-1), upper right (xTbCmp+nTbW, yTbCmp-1), lower left (xTbCmp-1, yTbCmp+nTbH) and 18 spatially non-adjacent positions (as shown in Figure 9).

[0589] In an embodiment of the present application, an embodiment of the construction process is as follows: check whether the PUs corresponding to these positions use the IntraTMP / IBC technology. If they do, store the BV of this PU in the IntraTMP_Merge list. After constructing the IntraTMP_Merge list, update the coarse search list. The specific operation of the update is: access each item in this list in turn, 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 this BV with the worse BV in the coarse search list. Specific operations are, for example: insert this BV into the coarse search list in order of cost, and delete the item with the highest cost in the coarse search list. And set the search area bestRegionId where it is located to 6. It should also be noted that the construction process is actually a list merging process, but first constructs a list of corresponding results of R1 to R6, and then inserts the result of R7 into the appropriate position in the list. In practice, there can also be other search orders and merging strategies.

[0590] In the embodiment of the present application, according to the algorithm requirements, the coarse search stage will provide one or more (here denoted as M, 1<=M<=P) fine search reference points and send them to the next step. For example, M=1.

[0591] S1903: Construct an Intra TMP_EBVP list to update the rough search list.

[0592] After updating the rough search list according to the IntraTMP_Merge list, for each BV replaced by the Merge list into the rough search list, build an IntraTMP_EBVP list and update the rough search list according to the list:

[0593] First, for each current BV, build its corresponding IntraTMP_EBVP list from scratch. Determine the five positions of the current block: center (xTbCmp+nTbW / 2,yTbCmp+nTbH / 2), top left (xTbCmp,yTbCmp), top right (xTbCmp+nTbW-1,yTbCmp), bottom left (xTbCmp,yTbCmp+nTbH-1), bottom right (xTbCmp+nTbW-1,yTbCmp+nTbH-1), and check whether the corresponding PU after adding the current BV to these five positions uses BV-based prediction technology (i.e., IBC / IntraTMP).

[0594] If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, that is, the horizontal and vertical components are added separately) is recorded as BV' and added to the TMP_EBVP list. Then BV' is regarded as the current BV and the above operation is repeated for this BV' to continue to build the available options in the TMP_EBVP list; if not used, check the next position.

[0595] The above steps are repeated until all five locations have been checked or the number of IntraTMP_EBVPs in the IntraTMP_EBVP list being constructed is greater than T (for example, T can be 15), completing the construction of the current IntraTMP_EBVP list. Alternatively, the number can be limited to smaller values ​​such as 1, 2, 5, or 10; or, the SAD can be limited to stop the operation if it exceeds a certain threshold; or, the total number of extensions can be limited (similar to the IBC-ARBVP method, where regions are optionally added to the end of the merge list of a limited length until the list is full, at which point R7 and the new R7 can be considered the same candidate region); or, both the number and the SAD can be limited, etc.

[0596] In an embodiment of the present application, after the current IntraTMP_EBVP list is constructed, the coarse search list is updated. The specific operation of the update is: cyclically access each BV in this IntraTMP_EBVP list, calculate its corresponding template matching cost, compare this cost with the template matching cost of the BV in the coarse search list to be updated, and if it is less than the maximum template matching cost in the coarse search list, replace this BV with the worse BV in the coarse search list. A specific replacement operation is, for example: 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. Set the search area bestRegionId where the BV newly inserted into the coarse search list is located to 7. It should be noted that the role of the search area bestRegionId here is originally to provide a basis for accessing surrounding pixels during fine search and filtering.

[0597] It should also be noted that the so-called "update" in steps S1902 and S1903 refers solely to the process of merging the result lists, and does not necessarily follow a specific update order. Furthermore, it should be noted that three tables exist in memory: the rough search list, the intra TMP-Merge list, and the intra TMP-EBVP list. The rough search list is mandatory, while the other two lists do not need to be constructed. Instead, they serve as a check sequence, and if a suitable option is found, the rough search list is updated.

[0598] Furthermore, after the coarse search is completed, a fine search list can be determined near the coarse search list BV with a step size of 1. Specifically, the search is performed near the best block vector BV1_BEST[p] obtained from the coarse search, where p=0, ..., M-1, serves as a fine search reference point.

[0599] In a specific embodiment, for each fine search reference point, the refined search range TmpRefineRangeHor and TmpRefineRangeVer are first determined. The refined search range can be a fixed size and is also related to the search area. For example, for reference points with a search area of ​​0 to 5, the above TmpRefineRangeHor and TmpRefineRangeVer can be set to 1, and for reference points with a search area of ​​6, the above TmpRefineRangeHor and TmpRefineRangeVer can be set to 2. Then, the position of the best matching reconstructed block obtained by the coarse search is calculated as the reference position of the fine search area: BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.

[0600] Directly use the search window, treat the fine search area as a whole undetermined reconstruction area, and traverse directly:

[0601] According to the optimal matching block position obtained by the rough search, a new search range is obtained: iHorMax refine =min(picWidth-nTbW,BestPosX+TmpRefineRangeHor); iHorMin refine =max(iTemplateSizeW,BestPosX-TmpRefineRangeHor); iVerMax refine =min(picHeight-nTbH,BestPosY+TmpRefineRangeVer); iVerMin refine=max(iTemplateSizeH,BestPosY-TmpRefineRangeVer);

[0602] Then, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs can be obtained by iVerMin refine 、iVerMax refine 、iHorMin refine 、iHorMax refine Calculation: bvXMins = iHorMin refine –xTbCmp; bvXMaxs=iHorMax refine –xTbCmp; bvYMins=iVerMin refine –yTbCmp; bvYMaxs=iVerMax refine –yTbCmp;

[0603] Fine search in pX is bvXMins refine with bvXMaxs refine Between, pY is in bvYMins refine with bvYMaxs refine This is done within the block vector range between , that is, all search positions within the fine search window are directly traversed, and availability judgments are made one by one. For example, a search is performed with a step size of 1. The top T best matching costs obtained from the available point template matching are recorded as pDiff_BEST[t], t = 0, ..., T-1, and the corresponding block vector BV is recorded as the best block vector BV_BEST[t], t = 0, ..., T-1. Where T is an integer of 1 or greater. For example, T = 1.

[0604] Thus, after completing the above operations, by combining the results of the coarse selection and fine selection processes (where the fine selection process includes one or more reference point searches), one or more optimal block vectors BV_BEST[n], where n = 0, ..., N-1, are obtained for different algorithm requirements, where each item is a coordinate pair (pX_BEST, pY_BEST). Here, pX_BEST and pY_BEST are the horizontal and vertical offsets of the best matching template relative to the current coding block template, and are also the horizontal and vertical offsets of the best matching reconstructed block relative to the current coding block.

[0605] It should also be noted that, in the embodiments of the present application, the aforementioned search scheme may be adjusted.

[0606] In one possible implementation, the BV list after the Intra TMP_Merge list is updated by the Intra TMP_EBVP and the list of the original rectangular search area can be merged into a new coarse search list, and then a fine search is performed. Referring to FIG20 , the specific implementation is as follows:

[0607] S2001, build the Intra TMP_Merge list to update the rough search list.

[0608] S2002: Construct an Intra TMP_EBVP list to update the rough search list.

[0609] S2003, constructing an initial rough search list in the search area with a step size of 3.

[0610] S2004, determine a new rough search list.

[0611] S2005, determining a detailed search list near the rough search list BV with a step size of 1.

[0612] In another possible implementation, the original rectangular search area list can be updated with EBVP, and then merged with the Intra TMP_Merge list to form a new coarse search list, and then a fine search can be performed. Referring to FIG21 , the specific implementation is as follows:

[0613] S2101, constructing an initial rough search list in the search area with a step size of 3.

[0614] S2102: Construct an Intra TMP_EBVP list to update the rough search list.

[0615] S2103: Build an Intra TMP_Merge list to update the rough search list.

[0616] S2104, determine a new rough search list.

[0617] S2105, determine a detailed search list near the rough search list BV with a step size of 1.

[0618] In another possible implementation, the original rectangular search area list can be updated using the Intra TMP_Merge list, and then the modified list can be updated using the EBVP list. During the second update, all options in the updated coarse search list can be constructed based on the Intra TMP_EBVP list, and the final list is used as the new coarse search list for the fine search. Referring to Figure 22, the specific implementation is as follows:

[0619] S2201: Construct an initial rough search list in the search area with a step size of 3.

[0620] S2202: Build an Intra TMP_Merge list to update the rough search list.

[0621] S2203: Construct an Intra TMP_EBVP list to update the rough search list.

[0622] S2204, determining a detailed search list near the rough search list BV with a step size of 1.

[0623] It should also be noted that in the embodiment of the present application, not only can all BVs replaced by the IntraTMP_Merge list in the rough selection list be checked, but the BV objects and their number checked in the IntraTMP_EBVP list can also be adjusted:

[0624] Exemplarily, the first 5 of the corresponding BV set can be used for checking, or the first 10 of the corresponding BV set can be used for checking. Alternatively, the number of checks can be limited according to the size of the current block, for example, the first 5 blocks with a size less than or equal to 16x16 are checked, and the first 10 blocks with other sizes are checked. Alternatively, the rough selection list can be clustered, and the clustering rule is the geometric distance to the cluster center. The number of cluster centers is 2 to 5, and the EBVP operation is only performed on the cluster centers. Alternatively, the BV of EBVP can be added after the IntraTMP_Merge list until the IntraTMP_Merge list is filled, and then the initial rough search list is updated with this IntraTMP_Merge list, that is, the number is limited to the number of unfilled items in the IntraTMP_Merge list.

[0625] It should also be noted that, in the embodiment of the present application, the length of the IntraTMP_EBVP list can be modified to other values. For example, the list length can be limited to 1, 2, 5, or 10 items.

[0626] It should also be noted that in the embodiment of the present application, restrictions can be made based on the template cost corresponding to the BV (such as SAD, SATD, etc.). The template cost is first calculated for each BV of the EBVP, and a cost threshold is defined. BVs that do not exceed the threshold are then added to the EBVP list.

[0627] It should also be noted that, in the embodiment of the present application, sub-pixel search can be implemented in the fine search stage.

[0628] It should also be noted that, in the embodiment of the present application, when constructing the prediction value of the current block, the prediction value can be corrected by a local filtering method. Alternatively, when constructing the prediction value of the current block, the prediction value can be corrected by weighting multiple prediction values. Alternatively, when constructing the prediction value, a candidate list of prediction values ​​can be constructed by using multiple single prediction values, filtered prediction values, weighted prediction values, and / or construction schemes of these prediction values, and the syntax elements transmitted in the bitstream are used to determine at the decoding end which item in the candidate list to use to obtain the actual prediction value.

[0629] It should also be noted that, in the embodiment of the present application, it may not be shared with the IntraTMP_Merge list, that is, it is only expanded based on the BV directly searched by IntraTMP in the search window.

[0630] It should also be noted that in the embodiment of the present application, it is not necessary to divide the steps into rough search and detailed search. Only a one-time search can be performed, and then the BV options can be expanded based on the one-time search results to obtain the final BV results.

[0631] It should also be noted that, in the embodiment of the present application, the IntraTMP_Merge list only takes the first K (for example, K can be 5) to update the rough search list, and is only expanded based on the BVs of each item in the IntraTMP_Merge list.

[0632] It should also be noted that in the embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP are used to jointly maintain a Merge list. The first P BVs (for example, P can be 5) in the IntraTMP_Merge list are first taken. Based on these P BVs, IntraTMP_EBVP is expanded to construct a new Merge list of length L (for example, L can be 28). When the expanded BVs fill the new Merge list or the expansion of all P BVs is completed, the cost of each BV in the new Merge list is calculated and sorted. Then, the first Q BVs (for example, Q can be 5) in the sorted list are taken to update the rough selection list.

[0633] In the embodiments of this application, the specific implementation of the aforementioned embodiments is described in detail through the above-mentioned embodiments. It can be seen that, according to the technical solutions of the aforementioned embodiments, a method for expanding the coverage of the IntraTMP search list is proposed, which increases the BV candidate positions derived from the BV information of the reconstructed blocks, effectively improving encoding accuracy. In other words, this technical solution can effectively utilize the information of spatially adjacent and non-adjacent reconstructed blocks, and expand the search area of ​​IntraTMP without significantly increasing the encoding complexity, thereby improving prediction accuracy and thus improving encoding and decoding efficiency and performance.

[0634] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG23 is a schematic diagram of the composition structure of an encoder provided in an embodiment of the present application. As shown in FIG23 , the encoder 230 may include a first determination unit 2301, a first update unit 2302, and a first prediction unit 2303, wherein:

[0635] A first determining unit 2301 is configured to determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0636] The first updating unit 2302 is configured to determine a second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; and when the coding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; and when the vector parameters of the second position block meet the second condition, update the first candidate list based on the vector parameters of the second position block;

[0637] The first prediction unit 2303 is configured to determine a prediction value of the current block according to the first candidate list.

[0638] In some embodiments, the first determination unit 2301 is further configured to determine whether the vector parameters of the first position block meet the first condition based on the vector parameters of the first position block when the encoding parameters of the first position block of the current block include vector parameters; and determine the second position block based on the vector parameters of the first position block when the vector parameters of the first position block meet the first condition.

[0639] In some embodiments, the vector parameters include block vector parameters and / or motion vector parameters.

[0640] In some embodiments, the first determining unit 2301 is further configured to determine a first search area of ​​the current block; and determine a first candidate list of the current block according to the first search area.

[0641] In some embodiments, the first determining unit 2301 is further configured to determine a first template of the current block; and determine a first search area of ​​the current block according to the first template.

[0642] In some embodiments, the first determining unit 2301 is further configured to search in the first search area according to the first search step to determine one or more first candidate vector parameters; and add the one or more first candidate vector parameters to the first candidate list of the current block.

[0643] In some embodiments, the first determination unit 2301 is further configured to traverse the search points in the first search area according to the first search step size, and determine the first matching cost value between the matching template corresponding to the search point in the first search area and the first template according to a preset matching criterion; and determine one or more matching search points based on the first matching cost value, and determine one or more first candidate vector parameters based on the one or more matching search points.

[0644] In some embodiments, the first condition includes: a cost value corresponding to the vector parameter of the first position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list.

[0645] In some embodiments, the first determination unit 2301 is further configured to determine the cost value corresponding to the vector parameters of the first position block based on the matching cost value between the matching template corresponding to the vector parameters of the first position block and the first template; determine the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; and when the cost value corresponding to the vector parameters of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, determine that the vector parameters of the first position block meet the first condition.

[0646] In some embodiments, the first updating unit 2302 is further configured to update the first candidate list according to the vector parameters of the first position block when the vector parameters of the first position block meet the first condition.

[0647] In some embodiments, the first updating unit 2302 is further configured to add the vector parameters of the first position block to the first candidate list.

[0648] In some embodiments, the second position block represents a reference block to which the vector parameter of the first position block points.

[0649] In some embodiments, the second location block represents a block pointed to by a vector parameter of a reference block pointed to by a vector parameter of the first location block.

[0650] In some embodiments, the number of the second location blocks is one or more.

[0651] In some embodiments, the second condition includes: a cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list.

[0652] In some embodiments, the first determination unit 2301 is further configured to determine the cost value corresponding to the vector parameters of the second position block based on the matching cost value between the matching template corresponding to the vector parameters of the second position block and the first template; determine the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; and when the cost value corresponding to the vector parameters of the second position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, determine that the vector parameters of the second position block meet the second condition.

[0653] In some embodiments, the first updating unit 2302 is further configured to add the vector parameters of the second position block to the first candidate list.

[0654] In some embodiments, the first update unit 2302 is further configured to determine a first candidate set of the current block based on the vector parameters of the first position block when the vector parameters of the first position block meet the first condition, and update the first candidate list based on the first candidate set; and to determine a second candidate set of the current block based on the vector parameters of the second position block when the vector parameters of the second position block meet the second condition, and update the first candidate list based on the second candidate set; the first prediction unit 2303 is further configured to determine a prediction value of the current block based on the first candidate list.

[0655] In some embodiments, the first update unit 2302 is further configured to determine a cost value corresponding to a second candidate vector parameter in the first candidate set, and to determine a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; and when the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter to update the first candidate list; wherein the second candidate vector parameter is any vector parameter in the first candidate set.

[0656] In some embodiments, the first updating unit 2302 is further configured to add the second candidate vector parameter to the first candidate list, and delete the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0657] In some embodiments, the first determination unit 2301 is further configured to determine one or more second candidate vector parameters updated from the first candidate set to the first candidate list; and determine the second position block based on the one or more second candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block.

[0658] In some embodiments, the first determination unit 2301 is further configured to determine the second position block based on all candidate vector parameters in the first candidate list after updating the first candidate list based on the first candidate set, and determine the second candidate set of the current block based on the vector parameters of the second position block.

[0659] In some embodiments, the first determination unit 2301 is further configured to determine the first N candidate vector parameters in the first candidate list after updating the first candidate list according to the first candidate set; and determine the second position block based on the N candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block; wherein N is a positive integer.

[0660] In some embodiments, the first determining unit 2301 is further configured to determine the value of N according to a size parameter of the current block.

[0661] In some embodiments, the first determination unit 2301 is further configured to cluster the first candidate list after updating the first candidate list according to the first candidate set, and determine M candidate vector parameters at the cluster center; and determine the second position block based on the M candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block; wherein M is a positive integer.

[0662] In some embodiments, the first determining unit 2301 is further configured to determine that the construction of the third candidate set is completed when all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold.

[0663] In some embodiments, the first update unit 2302 is further configured to determine a second matching cost value between the matching template corresponding to the third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; and when the second matching cost value is greater than a second threshold, delete the third candidate vector parameter from the second candidate set to update the second candidate set; wherein the third candidate vector parameter is any vector parameter in the second candidate set.

[0664] In some embodiments, the first updating unit 2302 is further configured to fill the vector parameters of the second position block into the first candidate set when the first candidate set of the current block is not filled until the first candidate set is filled; and update the first candidate list according to the filled first candidate set.

[0665] In some embodiments, the first updating unit 2302 is further configured to determine the first K candidate vector parameters in the first candidate set; and update the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.

[0666] In some embodiments, the first update unit 2302 is further configured to determine the first P candidate vector parameters in the first candidate set; determine the second position block based on the P candidate vector parameters, and determine the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, construct the fourth candidate set of the current block based on the vector parameters of the second position block, and determine that the construction of the fourth candidate set is completed when all P candidate vector parameters are traversed or the fourth candidate set is filled; determine the cost values ​​corresponding to one or more candidate vector parameters in the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set based on the cost values ​​corresponding to one or more candidate vector parameters; and update the first candidate list based on the Q candidate vector parameters; wherein P and Q are positive integers.

[0667] In some embodiments, the first prediction unit 2303 is further configured to determine a vector parameter of the current block based on the first candidate list; and determine a prediction value of the current block according to the vector parameter of the current block.

[0668] In some embodiments, the first determination unit 2301 is further configured to determine a second search area indicated by the candidate vector parameters in the first candidate list; and to search within the second search area according to the second search step to determine the vector parameters of the current block; wherein the value of the second search step is smaller than the value of the first search step.

[0669] In some embodiments, the first determining unit 2301 is further configured to perform a sub-pixel search in the second search area according to the second search step size to determine the vector parameters of the current block.

[0670] In some embodiments, the first prediction unit 2303 is further configured to determine a reference block of the current block according to the vector parameter of the current block when the vector parameter of the current block is one; and determine a prediction value of the current block according to the reference block.

[0671] In some embodiments, the first prediction unit 2303 is further configured to filter the reference block to determine a filtered reference block; and determine a prediction value of the current block according to the filtered reference block.

[0672] In some embodiments, the first prediction unit 2303 is further configured to determine a first prediction block of the current block based on the reference block; predict the current block according to the first prediction mode to determine a second prediction block of the current block; wherein the first prediction mode is a non-intra-frame template matching prediction mode; and determine a prediction value of the current block based on the first prediction block and the second prediction block.

[0673] In some embodiments, the first prediction unit 2303 is further configured to determine multiple reference blocks of the current block according to the multiple vector parameters of the current block when the vector parameters of the current block are multiple; and determine the prediction value of the current block according to the multiple reference blocks.

[0674] In some embodiments, the first prediction unit 2303 is further configured to determine multiple prediction blocks of the current block based on multiple reference blocks; and perform weighted fusion on the multiple prediction blocks to determine the prediction value of the current block.

[0675] In some embodiments, the first prediction unit 2303 is further configured to determine a method for constructing a prediction value of the current block; and determine a prediction value of the current block according to the vector parameters of the current block and the method for constructing the prediction value.

[0676] In some embodiments, the first determination unit 2301 is further configured to determine a candidate list of constructed prediction values ​​for the current block; wherein the candidate list of constructed prediction values ​​includes at least one candidate constructed prediction value method; cost calculation is performed on at least one candidate constructed prediction value method respectively to determine at least one cost result; and the minimum cost result is determined from at least one cost result, and the candidate constructed prediction value method corresponding to the minimum cost result is determined as the constructed prediction value method of the current block.

[0677] In some embodiments, referring to FIG. 23 , the encoder 230 may further include an encoding unit 2304, wherein: the first determination unit 2301 is further configured to determine a value of a first syntax element; wherein the value of the first syntax element is used to indicate an index number of a prediction value construction method for the current block in a candidate list of prediction value constructions; and the encoding unit 2304 is configured to perform encoding processing on the value of the first syntax element and write the obtained encoding bits into the bitstream.

[0678] In some embodiments, the first determination unit 2301 is further configured to determine a value of a second syntax element; wherein the value of the second syntax element is used to indicate whether the current block uses an intra template matching prediction mode; the encoding unit 2304 is further configured to encode the value of the second syntax element and write the obtained coded bits into the bitstream.

[0679] In some embodiments, the first determining unit 2301 is further configured to, when the current block uses the intra template matching prediction mode, perform the step of determining a first candidate list for the current block.

[0680] In some embodiments, the first determination unit 2301 is further configured to determine a prediction difference value of the current block based on a prediction value of the current block; the encoding unit 2304 is further configured to encode the prediction difference value of the current block and write the obtained encoding bits into the bitstream.

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

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

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

[0684] Based on the composition of the encoder 230 and the computer-readable storage medium, Figure 24 is a schematic diagram of the specific hardware structure of an encoder provided by an embodiment of the present application. As shown in Figure 24, the encoder 230 may include: a first communication interface 2401, a first memory 2402 and a first processor 2403; each component is coupled together through a first bus system 2404. It can be understood that the first bus system 2404 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 2404 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 2404 in Figure 24. Among them,

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

[0686] A first memory 2402 is used to store computer programs that can be run on the first processor 2403;

[0687] The first processor 2403 is configured to, when running the computer program, execute the following: determining a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters; determining a second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the encoding parameters of the second position block include vector parameters, determining whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, updating the first candidate list based on the vector parameters of the second position block; and determining a prediction value of the current block based on the first candidate list.

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

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

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

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

[0692] This embodiment provides an encoder. For this encoder, when updating the first candidate list, it can expand some vector information of the second position block based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then supplement the first candidate list based on the expanded vector information; thereby, it can effectively utilize the spatially adjacent and non-adjacent reconstructed information, derive the candidate vector information based on the vector information of these reconstructed blocks while ensuring the coding complexity, increase the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance.

[0693] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG25 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application. As shown in FIG25 , the decoder 250 may include a second determination unit 2501, a second update unit 2502, and a second prediction unit 2503, wherein:

[0694] The second determining unit 2501 is configured to determine a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters;

[0695] The second updating unit 2502 is configured to determine a second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; and when the decoding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; and when the vector parameters of the second position block meet the second condition, update the first candidate list based on the vector parameters of the second position block;

[0696] The second prediction unit 2503 is configured to determine a prediction value of the current block according to the first candidate list.

[0697] In some embodiments, the second determination unit 2501 is further configured to determine whether the vector parameters of the first position block meet the first condition based on the vector parameters of the first position block when the decoding parameters of the first position block of the current block include vector parameters; and determine the second position block based on the vector parameters of the first position block when the vector parameters of the first position block meet the first condition.

[0698] In some embodiments, the vector parameters include block vector parameters and / or motion vector parameters.

[0699] In some embodiments, the second determining unit 2501 is further configured to determine a first search area of ​​the current block; and determine a first candidate list of the current block according to the first search area.

[0700] In some embodiments, the second determining unit 2501 is further configured to determine a first template of the current block; and determine a first search area of ​​the current block according to the first template.

[0701] In some embodiments, the second determining unit 2501 is further configured to search in the first search area according to the first search step to determine one or more first candidate vector parameters; and add the one or more first candidate vector parameters to the first candidate list of the current block.

[0702] In some embodiments, the second determination unit 2501 is further configured to traverse the search points in the first search area according to the first search step size, determine the first matching cost value between the matching template corresponding to the search point in the first search area and the first template according to a preset matching criterion; and determine one or more matching search points based on the first matching cost value, and determine one or more first candidate vector parameters based on the one or more matching search points.

[0703] In some embodiments, the first condition includes: a cost value corresponding to the vector parameter of the first position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list.

[0704] In some embodiments, the second determination unit 2501 is further configured to determine the cost value corresponding to the vector parameters of the first position block based on the matching cost value between the matching template corresponding to the vector parameters of the first position block and the first template; determine the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; and when the cost value corresponding to the vector parameters of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, determine that the vector parameters of the first position block meet the first condition.

[0705] In some embodiments, the second updating unit 2502 is further configured to update the first candidate list according to the vector parameters of the first position block when the vector parameters of the first position block meet the first condition.

[0706] In some embodiments, the second updating unit 2502 is further configured to add the vector parameters of the first position block to the first candidate list.

[0707] In some embodiments, the second position block represents a reference block to which the vector parameter of the first position block points.

[0708] In some embodiments, the second location block represents a block pointed to by a vector parameter of a reference block pointed to by a vector parameter of the first location block.

[0709] In some embodiments, the number of the second location blocks is one or more.

[0710] In some embodiments, the second condition includes: a cost value corresponding to the vector parameter of the second position block is better than a cost value corresponding to at least one candidate vector parameter in the first candidate list.

[0711] In some embodiments, the second determination unit 2501 is further configured to determine the cost value corresponding to the vector parameters of the second position block based on the matching cost value between the matching template corresponding to the vector parameters of the second position block and the first template; determine the cost value corresponding to at least one candidate vector parameter in the first candidate list based on the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; and when the cost value corresponding to the vector parameters of the second position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, determine that the vector parameters of the second position block meet the second condition.

[0712] In some embodiments, the second updating unit 2502 is further configured to add the vector parameters of the second position block to the first candidate list.

[0713] In some embodiments, the second update unit 2502 is further configured to determine a first candidate set of the current block based on the vector parameters of the first position block when the vector parameters of the first position block meet the first condition, and update the first candidate list based on the first candidate set; and to determine a second candidate set of the current block based on the vector parameters of the second position block when the vector parameters of the second position block meet the second condition, and update the first candidate list based on the second candidate set; the second prediction unit 2503 is further configured to determine a prediction value of the current block based on the first candidate list.

[0714] In some embodiments, the second update unit 2502 is further configured to determine a cost value corresponding to a second candidate vector parameter in the first candidate set, and to determine a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; and when the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter to update the first candidate list; wherein the second candidate vector parameter is any vector parameter in the first candidate set.

[0715] In some embodiments, the second updating unit 2502 is further configured to add the second candidate vector parameter to the first candidate list, and delete the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

[0716] In some embodiments, the second determination unit 2501 is further configured to determine one or more second candidate vector parameters updated from the first candidate set to the first candidate list; and determine the second position block based on the one or more second candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block.

[0717] In some embodiments, the second determination unit 2501 is further configured to determine the second position block based on all candidate vector parameters in the first candidate list after updating the first candidate list based on the first candidate set, and determine the second candidate set of the current block based on the vector parameters of the second position block.

[0718] In some embodiments, the second determination unit 2501 is further configured to determine the first N candidate vector parameters in the first candidate list after updating the first candidate list according to the first candidate set; and determine the second position block based on the N candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block; wherein N is a positive integer.

[0719] In some embodiments, the second determining unit 2501 is further configured to determine the value of N according to a size parameter of the current block.

[0720] In some embodiments, the second determination unit 2501 is further configured to cluster the first candidate list after updating the first candidate list according to the first candidate set, and determine M candidate vector parameters at the cluster center; and determine the second position block based on the M candidate vector parameters, and determine the second candidate set of the current block based on the vector parameters of the second position block; wherein M is a positive integer.

[0721] In some embodiments, the second determining unit 2501 is further configured to determine that the construction of the third candidate set is completed when all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold.

[0722] In some embodiments, the second update unit 2502 is further configured to determine a second matching cost value between the matching template corresponding to the third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; and when the second matching cost value is greater than a second threshold, delete the third candidate vector parameter from the second candidate set to update the second candidate set; wherein the third candidate vector parameter is any vector parameter in the second candidate set.

[0723] In some embodiments, the second updating unit 2502 is further configured to fill the vector parameters of the second position block into the first candidate set when the first candidate set of the current block is not filled until the first candidate set is filled; and update the first candidate list according to the filled first candidate set.

[0724] In some embodiments, the second updating unit 2502 is further configured to determine the first K candidate vector parameters in the first candidate set; and update the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.

[0725] In some embodiments, the second update unit 2502 is further configured to determine the first P candidate vector parameters in the first candidate set; determine the second position block based on the P candidate vector parameters, and determine the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, construct a fourth candidate set of the current block based on the vector parameters of the second position block, and determine that the construction of the fourth candidate set is completed when all P candidate vector parameters are traversed or the fourth candidate set is filled; determine the cost values ​​corresponding to one or more candidate vector parameters in the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set based on the cost values ​​corresponding to one or more candidate vector parameters; and update the first candidate list based on the Q candidate vector parameters; wherein P and Q are positive integers.

[0726] In some embodiments, the second prediction unit 2503 is further configured to determine a vector parameter of the current block based on the first candidate list; and determine a prediction value of the current block according to the vector parameter of the current block.

[0727] In some embodiments, the second determination unit 2501 is further configured to determine a second search area indicated by the candidate vector parameters in the first candidate list; and to search within the second search area according to the second search step to determine the vector parameters of the current block; wherein the value of the second search step is smaller than the value of the first search step.

[0728] In some embodiments, the second determining unit 2501 is further configured to perform a sub-pixel search in the second search area according to the second search step size to determine the vector parameters of the current block.

[0729] In some embodiments, the second prediction unit 2503 is further configured to determine a reference block of the current block according to the vector parameter of the current block when the vector parameter of the current block is one; and determine a prediction value of the current block according to the reference block.

[0730] In some embodiments, the second prediction unit 2503 is further configured to filter the reference block to determine a filtered reference block; and determine a prediction value of the current block according to the filtered reference block.

[0731] In some embodiments, the second prediction unit 2503 is further configured to determine a first prediction block of the current block based on the reference block; predict the current block according to the first prediction mode to determine a second prediction block of the current block; wherein the first prediction mode is a non-intra-frame template matching prediction mode; and determine a prediction value of the current block based on the first prediction block and the second prediction block.

[0732] In some embodiments, the second prediction unit 2503 is further configured to determine multiple reference blocks of the current block according to the multiple vector parameters of the current block when there are multiple vector parameters of the current block; and determine the prediction value of the current block according to the multiple reference blocks.

[0733] In some embodiments, the second prediction unit 2503 is further configured to determine multiple prediction blocks of the current block based on multiple reference blocks; and perform weighted fusion on the multiple prediction blocks to determine the prediction value of the current block.

[0734] In some embodiments, referring to FIG. 25 , the decoder 250 may further include a decoding unit 2504 configured to decode the code stream and determine the value of the first syntax element; a second prediction unit 2503 further configured to determine a method for constructing a prediction value of the current block based on the value of the first syntax element and a candidate list of constructed prediction values ​​of the current block; and determine a prediction value of the current block based on the vector parameters of the current block and the method for constructing a prediction value.

[0735] In some embodiments, the decoding unit 2504 is further configured to decode the code stream and determine the value of the second syntax element; the second determination unit 2501 is further configured to execute the step of determining the first candidate list of the current block when the second syntax element indicates that the current block uses the intra template matching prediction mode.

[0736] In some embodiments, the decoding unit 2504 is further configured to decode the code stream and determine the prediction difference value of the current block; the second determination unit 2501 is further configured to determine the reconstructed value of the current block based on the prediction difference value and the prediction value of the current block.

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

[0738] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 250. The computer-readable storage medium stores a computer program that, when executed by a second processor, implements any of the methods described in the aforementioned embodiments.

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

[0740] The second communication interface 2601 is used to receive and send signals when sending and receiving information with other external network elements;

[0741] The second memory 2602 is used to store computer programs that can be run on the second processor 2603;

[0742] The second processor 2603 is configured to, when running the computer program, execute the following: determining a first candidate list for the current block; wherein the first candidate list includes one or more candidate vector parameters; determining a second position block based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the decoding parameters of the second position block include vector parameters, determining whether the vector parameters of the second position block meet a second condition based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, updating the first candidate list based on the vector parameters of the second position block; and determining a prediction value of the current block based on the first candidate list.

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

[0744] It can be understood that the hardware functions of the second memory 2602 are similar to those of the first memory 2402, and the hardware functions of the second processor 2603 are similar to those of the first processor 2403; they will not be described in detail here.

[0745] This embodiment provides a decoder. For this decoder, when updating the first candidate list, it can expand some vector information of the second position block based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then supplement the first candidate list based on the expanded vector information; thereby, it can effectively utilize the spatially adjacent and non-adjacent reconstructed information, derive the candidate vector information based on the vector information of these reconstructed blocks while ensuring the coding complexity, increase the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance.

[0746] In yet another embodiment of the present application, FIG27 is a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application. As shown in FIG27 , the coding and decoding system 270 may include an encoder 2701 and a decoder 2702 .

[0747] In the embodiment of the present application, the encoder 2701 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2702 may be the decoder described in any one of the aforementioned embodiments.

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

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

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

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

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

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

[0754] In an embodiment of the present application, whether it is the encoding end or the decoding end, the first candidate list of the current block is first determined, and the first candidate list includes one or more candidate vector parameters; then the second position block is determined based on the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; when the encoding / decoding parameters of the second position block include vector parameters, it is determined whether the vector parameters of the second position block meet the second condition based on the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, the first candidate list is updated based on the vector parameters of the second position block; finally, the prediction value of the current block is determined based on the first candidate list. That is to say, when updating the first candidate list, some vector information of the second position block can be expanded based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first position block (the spatially adjacent blocks and non-adjacent blocks of the current block), and then the first candidate list can be supplemented based on the expanded vector information; thereby, the spatially adjacent and non-adjacent reconstructed information can be effectively utilized, and the candidate vector information can be derived based on the vector information of these reconstructed blocks while ensuring the coding complexity, thereby increasing the coverage of the IntraTMP search list, thereby improving the accuracy of the prediction, further saving the bit rate, improving the encoding and decoding efficiency, and thus improving the encoding and decoding performance.

Claims

1. A decoding method, applied to a decoder, the method comprising: Determining a first candidate list for a current block; wherein the first candidate list includes one or more candidate vector parameters; Determining a second position block according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; When the decoding parameters of the second position block include vector parameters, determining whether the vector parameters of the second position block satisfy a second condition according to the vector parameters of the second position block; When the vector parameters of the second position block satisfy the second condition, updating the first candidate list according to the vector parameters of the second position block; Determining a predicted value of the current block according to the first candidate list.

2. The method according to claim 1, wherein, When determining the second position block according to the vector parameters of the first position block of the current block, the method further comprises: When the decoding parameters of the first position block of the current block include vector parameters, determining whether the vector parameters of the first position block satisfy a first condition according to the vector parameters of the first position block; When the vector parameters of the first position block satisfy the first condition, determining the second position block according to the vector parameters of the first position block.

3. The method according to claim 1, wherein, The vector parameters include block vector parameters and / or motion vector parameters.

4. The method according to claim 1, wherein The determining the first candidate list for the current block includes: Determining a first search region for the current block; Determining the first candidate list for the current block according to the first search region.

5. The method according to claim 4, wherein The determining the first search region for the current block includes: Determining a first template for the current block; Determining the first search region for the current block according to the first template.

6. The method according to claim 4, wherein The determining the first candidate list for the current block according to the first search region includes: Searching within the first search region according to a first search step to determine one or more first candidate vector parameters; Adding the one or more first candidate vector parameters to the first candidate list of the current block.

7. The method according to claim 6, wherein, The searching within the first search region according to a first search step to determine one or more first candidate vector parameters includes: Traversing the search points in the first search region according to the first search step, and determining a first matching cost value between the matching template corresponding to the search point in the first search region and the first template according to a preset matching criterion; Determining one or more matching search points according to the first matching cost value, and determining the one or more first candidate vector parameters according to the one or more matching search points.

8. The method according to claim 2, wherein The first condition includes: the cost value corresponding to the vector parameters of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list.

9. The method according to claim 8, wherein, The method further comprises: Determining the cost value corresponding to the vector parameters of the first position block according to the matching cost value between the matching template corresponding to the vector parameters of the first position block and the first template; Determining the cost value corresponding to at least one candidate vector parameter in the first candidate list according to the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; When the cost value corresponding to the vector parameter of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameter of the first position block satisfies the first condition.

10. The method according to claim 2, wherein, The method further includes: When the vector parameter of the first position block satisfies the first condition, update the first candidate list according to the vector parameter of the first position block.

11. The method according to claim 10, wherein, The updating the first candidate list according to the vector parameter of the first position block includes: Adding the vector parameter of the first position block to the first candidate list.

12. The method according to claim 1, wherein The second position block represents a reference block pointed to by the vector parameter of the first position block.

13. The method according to claim 1, wherein, The second position block represents a block pointed to by the vector parameter of a reference block pointed to by the vector parameter of the first position block.

14. The method according to claim 1, wherein, The second condition includes: the cost value corresponding to the vector parameter of the second position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list.

15. The method according to claim 14, wherein, The method further includes: Determine the cost value corresponding to the vector parameter of the second position block according to the matching cost value between the matching template corresponding to the vector parameter of the second position block and the first template; Determine the cost value corresponding to at least one candidate vector parameter in the first candidate list according to the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; When the cost value corresponding to the vector parameter of the second position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameter of the second position block satisfies the second condition.

16. The method according to claim 1, wherein The updating the first candidate list according to the vector parameter of the second position block includes: Adding the vector parameter of the second position block to the first candidate list.

17. The method according to claim 1, wherein, The method further includes: When the vector parameter of the first position block satisfies the first condition, determine the first candidate set of the current block according to the vector parameter of the first position block, and update the first candidate list according to the first candidate set; When the vector parameter of the second position block satisfies the second condition, determine the second candidate set of the current block according to the vector parameter of the second position block, and update the first candidate list according to the second candidate set; Determine the predicted value of the current block according to the first candidate list.

18. The method according to claim 17, wherein, The updating the first candidate list according to the first candidate set includes: Determine the cost value corresponding to the second candidate vector parameter in the first candidate set, and determine the maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; When the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, use the second candidate vector parameter to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list to update the first candidate list; Wherein, the second candidate vector parameter is any vector parameter in the first candidate set.

19. The method according to claim 18, wherein, The using the second candidate vector parameter to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list includes: Add the second candidate vector parameter to the first candidate list, and delete the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

20. The method according to claim 18, wherein The determining the second candidate set of the current block includes: Determine one or more second candidate vector parameters updated from the first candidate set to the first candidate list; Determine the second position block according to the one or more second candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block.

21. The method according to claim 18, wherein, The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, determine the second position block according to all candidate vector parameters in the first candidate list, and determine the second candidate set of the current block according to the vector parameter of the second position block.

22. The method according to claim 17, wherein The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, determine the first N candidate vector parameters in the first candidate list; Determine the second position block according to the N candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block; where N is a positive integer.

23. The method according to claim 22, wherein, The method further includes: Determine the value of N according to the size parameter of the current block.

24. The method according to claim 17, wherein, The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, cluster the first candidate list to determine M candidate vector parameters at the cluster center; Determine the second position block according to the M candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block; where M is a positive integer.

25. The method according to claim 17, wherein The method further includes: When all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold, determine that the construction of the third candidate set is completed.

26. The method according to claim 25, wherein, The method further includes: Determine a second matching cost value between a matching template corresponding to a third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; When the second matching cost value is greater than a second threshold, delete the third candidate vector parameter from the second candidate set to update the second candidate set; Wherein, the third candidate vector parameter is any one vector parameter in the second candidate set.

27. The method according to claim 17, wherein The method further includes: When the first candidate set of the current block is not full, fill the vector parameter of the second position block into the first candidate set until the first candidate set is full; Update the first candidate list according to the filled first candidate set.

28. The method according to claim 17, wherein The updating the first candidate list according to the first candidate set includes: Determine the first K candidate vector parameters in the first candidate set; Update the first candidate list according to the first K candidate vector parameters; where K is a positive integer.

29. The method according to claim 17, wherein The method further includes: Determine the first P candidate vector parameters in the first candidate set; Determine the second position block according to the P candidate vector parameters, and determine the vector parameters of the second position block; When the vector parameters of the second position block satisfy the second condition, construct a fourth candidate set for the current block according to the vector parameters of the second position block, and determine that the construction of the fourth candidate set is completed when all the P candidate vector parameters are traversed or the fourth candidate set is filled; Determine the cost values corresponding to one or more candidate vector parameters in the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set according to the cost values corresponding to the one or more candidate vector parameters; Update the first candidate list according to the Q candidate vector parameters; where P and Q are positive integers.

30. The method according to any one of claims 1 to 29, wherein, The determining the predicted value of the current block according to the first candidate list includes: Determine the vector parameters of the current block based on the first candidate list; Determine the predicted value of the current block according to the vector parameters of the current block.

31. The method according to claim 30, wherein, The determining the vector parameters of the current block based on the first candidate list includes: Determine a second search region indicated by the candidate vector parameters in the first candidate list; Search within the second search region according to a second search step size to determine the vector parameters of the current block; Wherein, the value of the second search step size is less than the value of the first search step size.

32. The method according to claim 31, wherein, The searching within the second search region according to the second search step size to determine the vector parameters of the current block includes: Perform sub-pixel search within the second search region according to the second search step size to determine the vector parameters of the current block.

33. The method according to claim 30, wherein, When there is one vector parameter of the current block, the determining the predicted value of the current block according to the vector parameters of the current block includes: Determine the reference block of the current block according to the vector parameters of the current block; Determine the predicted value of the current block according to the reference block.

34. The method according to claim 33, wherein, The determining the predicted value of the current block according to the reference block includes: Filter the reference block to determine the filtered reference block; Determine the predicted value of the current block according to the filtered reference block.

35. The method according to claim 33, wherein, The determining the predicted value of the current block according to the reference block includes: Determine the first prediction block of the current block according to the reference block; Perform prediction on the current block according to a first prediction mode to determine the second prediction block of the current block; wherein, the first prediction mode is a non-intra-frame template matching prediction mode; Determine the predicted value of the current block according to the first prediction block and the second prediction block.

36. The method according to claim 30, wherein, When there are multiple vector parameters of the current block, the determining the predicted value of the current block according to the vector parameters of the current block includes: Determine multiple reference blocks of the current block according to the multiple vector parameters of the current block; Determine the predicted value of the current block according to the multiple reference blocks.

37. The method according to claim 36, wherein, The determining the predicted value of the current block according to the multiple reference blocks includes: Determine multiple prediction blocks of the current block according to the multiple reference blocks; Perform weighted fusion on the multiple prediction blocks to determine the predicted value of the current block.

38. The method according to claim 30, wherein, Determining a predicted value of the current block according to the vector parameter of the current block includes: Decoding a bitstream to determine a value of a first syntax element; Determining a method for constructing a predicted value of the current block according to the value of the first syntax element and a candidate list for constructing a predicted value of the current block; Determining a predicted value of the current block according to the vector parameter of the current block and the method for constructing a predicted value.

39. The method according to any one of claims 1 to 38, wherein, The method further includes: Decoding a bitstream to determine a value of a second syntax element; When the second syntax element indicates that the current block uses an intra-template matching prediction mode, performing the step of determining a first candidate list of the current block.

40. The method according to any one of claims 1 to 38, wherein The method further includes: Decoding a bitstream to determine a prediction difference of the current block; Determining a reconstructed value of the current block according to the prediction difference and the predicted value of the current block.

41. An encoding method applied to an encoder, the method includes: Determining a first candidate list of a current block; wherein, the first candidate list includes one or more candidate vector parameters; Determining a second position block according to the candidate vector parameters in the first candidate list and / or the vector parameter of a first position block of the current block; When the encoding parameter of the second position block includes a vector parameter, determining whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block; When the vector parameter of the second position block satisfies the second condition, updating the first candidate list according to the vector parameter of the second position block; Determining a predicted value of the current block according to the first candidate list.

42. The method according to claim 41, wherein When determining a second position block according to the vector parameter of the first position block of the current block, the method further includes: When the decoding parameter of the first position block of the current block includes a vector parameter, determining whether the vector parameter of the first position block satisfies a first condition according to the vector parameter of the first position block; When the vector parameter of the first position block satisfies the first condition, determining a second position block according to the vector parameter of the first position block.

43. The method according to claim 41, wherein, The vector parameter includes a block vector parameter and / or a motion vector parameter.

44. The method according to claim 41, wherein, The determining the first candidate list of the current block includes: Determining a first search area of the current block; Determining the first candidate list of the current block according to the first search area.

45. The method according to claim 44, wherein, The determining the first search area of the current block includes: Determining a first template of the current block; Determining the first search area of the current block according to the first template.

46. The method according to claim 44, wherein The determining the first candidate list of the current block according to the first search area includes: Searching within the first search area according to a first search step to determine one or more first candidate vector parameters; Adding the one or more first candidate vector parameters to the first candidate list of the current block.

47. The method according to claim 46, wherein, The searching within the first search area according to a first search step to determine one or more first candidate vector parameters includes: Traverse the search points in the first search area according to the first search step size, and determine the first matching cost value between the matching template corresponding to the search point in the first search area and the first template according to a preset matching criterion; Determine one or more matching search points according to the first matching cost value, and determine the one or more first candidate vector parameters according to the one or more matching search points.

48. The method according to claim 42, wherein, The first condition includes: the cost value corresponding to the vector parameter of the first position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list.

49. The method according to claim 48, wherein The method further includes: Determine the cost value corresponding to the vector parameter of the first position block according to the matching cost value between the matching template corresponding to the vector parameter of the first position block and the first template; Determine the cost value corresponding to at least one candidate vector parameter in the first candidate list according to the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; When the cost value corresponding to the vector parameter of the first position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameter of the first position block satisfies the first condition.

50. The method according to claim 42, wherein The method further includes: When the vector parameter of the first position block satisfies the first condition, update the first candidate list according to the vector parameter of the first position block.

51. The method according to claim 50, wherein, The updating the first candidate list according to the vector parameter of the first position block includes: Adding the vector parameter of the first position block to the first candidate list.

52. The method according to claim 41, wherein The second position block represents the reference block pointed to by the vector parameter of the first position block.

53. The method according to claim 41, wherein The second position block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first position block.

54. The method according to claim 41, wherein, The second condition includes: the cost value corresponding to the vector parameter of the second position block is better than the cost value corresponding to at least one candidate vector parameter in the first candidate list.

55. The method according to claim 54, wherein, The method further includes: Determine the cost value corresponding to the vector parameter of the second position block according to the matching cost value between the matching template corresponding to the vector parameter of the second position block and the first template; Determine the cost value corresponding to at least one candidate vector parameter in the first candidate list according to the matching cost value between the matching template corresponding to at least one candidate vector parameter in the first candidate list and the first template; When the cost value corresponding to the vector parameter of the second position block is less than the cost value corresponding to at least one candidate vector parameter in the first candidate list, it is determined that the vector parameter of the second position block satisfies the second condition.

56. The method according to claim 41, wherein, The updating the first candidate list according to the vector parameter of the second position block includes: Adding the vector parameter of the second position block to the first candidate list.

57. The method according to claim 41, wherein, The method further includes: When the vector parameter of the first position block satisfies the first condition, determine the first candidate set of the current block according to the vector parameter of the first position block, and update the first candidate list according to the first candidate set; When the vector parameter of the second position block satisfies the second condition, determine a second candidate set of the current block according to the vector parameter of the second position block, and update the first candidate list according to the second candidate set; Determine a predicted value of the current block according to the first candidate list.

58. The method according to claim 57, wherein, The updating the first candidate list according to the first candidate set includes: Determine a cost value corresponding to a second candidate vector parameter in the first candidate set, and determine a maximum cost value corresponding to one or more candidate vector parameters in the first candidate list; When the cost value corresponding to the second candidate vector parameter is less than the maximum cost value in the first candidate list, use the second candidate vector parameter to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list to update the first candidate list; Wherein, the second candidate vector parameter is any one vector parameter in the first candidate set.

59. The method according to claim 58, wherein, The using the second candidate vector parameter to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list includes: Add the second candidate vector parameter to the first candidate list, and delete the candidate vector parameter corresponding to the maximum cost value from the first candidate list.

60. The method according to claim 58, wherein, The determining the second candidate set of the current block includes: Determine one or more second candidate vector parameters updated from the first candidate set to the first candidate list; Determine the second position block according to the one or more second candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block.

61. The method according to claim 58, wherein, The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, determine the second position block according to all candidate vector parameters in the first candidate list, and determine the second candidate set of the current block according to the vector parameter of the second position block.

62. The method according to claim 57, wherein, The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, determine the first N candidate vectors parameters in the first candidate list; Determine the second position block according to the N candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block; wherein, N is a positive integer.

63. The method according to claim 62, wherein, The method further includes: Determine a value of N according to the size parameter of the current block.

64. The method according to claim 57, wherein, The determining the second candidate set of the current block includes: After updating the first candidate list according to the first candidate set, cluster the first candidate list to determine M candidate vector parameters at a cluster center; Determine the second position block according to the M candidate vector parameters, and determine the second candidate set of the current block according to the vector parameter of the second position block; wherein, M is a positive integer.

65. The method according to claim 57, wherein The method further includes: When all vector parameters of the second position block are traversed or the number of candidate vector parameters in the second candidate set is greater than a first threshold, determine that the construction of the third candidate set is completed.

66. The method according to claim 65, wherein, The method further includes: Determine a second matching cost value between the matching template corresponding to the third candidate vector parameter in the second candidate set and the first template according to a preset matching criterion; When the second matching cost value is greater than a second threshold, delete the third candidate vector parameter from the second candidate set to update the second candidate set; Wherein, the third candidate vector parameter is any one vector parameter in the second candidate set.

67. The method according to claim 57, wherein, The method further includes: When the first candidate set of the current block is not full, fill the vector parameters of the second position block into the first candidate set until the first candidate set is full; Update the first candidate list according to the filled first candidate set.

68. The method according to claim 57, wherein The updating the first candidate list according to the first candidate set includes: Determine the first K candidate vector parameters in the first candidate set; Update the first candidate list according to the first K candidate vector parameters; wherein, K is a positive integer.

69. The method according to claim 57, wherein, The method further includes: Determine the first P candidate vector parameters in the first candidate set; Determine the second position block according to the P candidate vector parameters, and determine the vector parameters of the second position block; When the vector parameters of the second position block meet a second condition, construct a fourth candidate set of the current block according to the vector parameters of the second position block, and when all the P candidate vector parameters are traversed or the fourth candidate set is full, determine that the construction of the fourth candidate set is completed; Determine the cost values corresponding to one or more candidate vector parameters in the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set according to the cost values corresponding to the one or more candidate vector parameters; Update the first candidate list according to the Q candidate vector parameters; wherein, P and Q are positive integers.

70. The method according to any one of claims 41 to 69, wherein The determining the predicted value of the current block according to the first candidate list includes: Based on the first candidate list, determine the vector parameters of the current block; Determine the predicted value of the current block according to the vector parameters of the current block.

71. The method according to claim 70, wherein, The determining the vector parameters of the current block based on the first candidate list includes: Determine a second search area indicated by the candidate vector parameters in the first candidate list; Search within the second search area according to a second search step size to determine the vector parameters of the current block; Wherein, the value of the second search step size is less than the value of the first search step size.

72. The method according to claim 71, wherein The searching within the second search area according to the second search step size to determine the vector parameters of the current block includes: Perform sub-pixel search within the second search area according to the second search step size to determine the vector parameters of the current block.

73. The method according to claim 70, wherein, When there is one vector parameter of the current block, the determining the predicted value of the current block according to the vector parameters of the current block includes: Determine a reference block of the current block according to the vector parameters of the current block; Determine the predicted value of the current block according to the reference block.

74. The method according to claim 73, wherein, The determining the predicted value of the current block according to the reference block includes: Filter the reference block to determine the filtered reference block; Determine the predicted value of the current block according to the filtered reference block.

75. The method according to claim 73, wherein The determining the predicted value of the current block according to the reference block includes: Determine a first predicted block of the current block according to the reference block; Perform prediction on the current block according to a first prediction mode to determine a second predicted block of the current block; wherein, the first prediction mode is a non-intra template matching prediction mode; Determine the predicted value of the current block according to the first predicted block and the second predicted block.

76. The method according to claim 70, wherein, When there are multiple vector parameters of the current block, the determining the predicted value of the current block according to the vector parameters of the current block includes: Determine multiple reference blocks of the current block according to the multiple vector parameters of the current block; Determine the predicted value of the current block according to the multiple reference blocks.

77. The method according to claim 76, wherein The determining the predicted value of the current block according to the multiple reference blocks includes: Determine multiple predicted blocks of the current block according to the multiple reference blocks; Perform weighted fusion on the multiple predicted blocks to determine the predicted value of the current block.

78. The method according to claim 70, wherein, The determining the predicted value of the current block according to the vector parameters of the current block includes: Determine the way to construct the predicted value of the current block; Determine the predicted value of the current block according to the vector parameters of the current block and the way to construct the predicted value.

79. The method according to claim 78, wherein, The determining the way to construct the predicted value of the current block includes: Determine a candidate list for constructing the predicted value of the current block; wherein, the candidate list for constructing the predicted value includes at least one candidate way to construct the predicted value; Calculate costs for each of the at least one candidate way to construct the predicted value respectively to determine at least one cost result; Determine the minimum cost result from the at least one cost result, and determine the candidate way to construct the predicted value corresponding to the minimum cost result as the way to construct the predicted value of the current block.

80. The method according to claim 79, wherein, The method further includes: Determine the value of a first syntax element; wherein, the value of the first syntax element is used to indicate the index number of the way to construct the predicted value of the current block in the candidate list for constructing the predicted value; Perform encoding processing on the value of the first syntax element, and write the obtained encoded bits into the bitstream.

81. The method according to any one of claims 41 to 80, wherein, The method further includes: Determine the value of a second syntax element; wherein, the value of the second syntax element is used to indicate whether the current block uses the intra template matching prediction mode; Perform encoding processing on the value of the second syntax element, and write the obtained encoded bits into the bitstream.

82. The method according to claim 81, wherein, The method further includes: When the current block uses the intra template matching prediction mode, execute the step of determining the first candidate list of the current block.

83. The method according to any one of claims 41 to 80, wherein The method further includes: Determine the prediction difference of the current block according to the predicted value of the current block; Perform encoding processing on the prediction difference of the current block, and write the obtained encoded bits into the bitstream.

84. A bitstream, wherein, The bitstream is generated by performing bit encoding on the information to be encoded; wherein, the information to be encoded includes at least one of the following: the prediction difference of the current block, the value of the first syntax element, and the value of the second syntax element; Among them, the value of the first syntax element is used to indicate the index number of the current block's construction prediction value method in the construction prediction value candidate list, and the value of the second syntax element is used to indicate whether the current block uses the intra-frame template matching prediction mode.

85. An encoder, comprising a first determination unit, a first update unit, and a first prediction unit, wherein: The first determination unit is configured to determine a first candidate list of a current block; wherein, the first candidate list includes one or more candidate vector parameters; The first update unit is configured to determine a second position block according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; and when the coding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, update the first candidate list according to the vector parameters of the second position block; The first prediction unit is configured to determine the prediction value of the current block according to the first candidate list.

86. An encoder, comprising 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; The first processor is configured to execute the method according to any one of claims 41 to 83 when running the computer program.

87. A decoder, comprising a second determination unit, a second update unit, and a second prediction unit, wherein: The second determination unit is configured to determine a first candidate list of a current block; wherein, the first candidate list includes one or more candidate vector parameters; The second update unit is configured to determine a second position block according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first position block of the current block; and when the decoding parameters of the second position block include vector parameters, determine whether the vector parameters of the second position block meet a second condition according to the vector parameters of the second position block; when the vector parameters of the second position block meet the second condition, update the first candidate list according to the vector parameters of the second position block; The second prediction unit is configured to determine the prediction value of the current block according to the first candidate list.

88. A decoder, the decoder comprising 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; The second processor is configured to execute the method according to any one of claims 1 to 40 when running the computer program.

89. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 40, or implements the method according to any one of claims 41 to 83.