Encoding and decoding methods, bitstreams, encoders, decoders, and storage media
Patent Information
- Application Number
- KR1020267025412
- Authority / Receiving Office
- KR · KR
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2026-09-18
Smart Images

Figure PCT00031_ABST
Abstract
Description
Technology Field
[0001] This application relates to the field of video encoding and decoding technology, and in particular to encoding and decoding methods, bit streams, encoders, decoders, and storage media. Background Technology
[0002] Intra Template Matching Prediction (Intra TMP) technology searches for the matching template with the smallest cost within a predefined search range in the current picture using a template of a coding block, based on a preset cost function, and uses the optimal matching reconstruction block corresponding to the matching template as the prediction block of the current coding block.
[0003] However, in the Intra TMP-based prediction process, the search strategy during actual implementation is not ideal and therefore the accuracy of the prediction cannot be guaranteed, resulting in reduced encoding and decoding efficiency. The problem to be solved
[0004] The present application provides an encoding and decoding method, a bit stream, an encoder, a decoder, and a storage medium, and can improve encoding and decoding efficiency by improving the accuracy of the prediction. means of solving the problem
[0005] The technical solution of the present application can be implemented as follows.
[0006] In a first aspect, an embodiment of the present application provides a decoding method applied to a decoder, and said decoding method, said decoding method
[0007] Step of determining the first candidate list of the current block - the first candidate list includes one or more candidate vector parameters - ;
[0008] A step of determining a second position block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first position block of the current block;
[0009] A step of 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 decoding parameter of the second position block includes a vector parameter;
[0010] When the vector parameter of the second position block satisfies the second condition, a step of updating the first candidate list according to the vector parameter of the second position block; and
[0011] It includes a step of determining the predicted value of the current block according to the first candidate list after updating.
[0012] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, and said encoding method,
[0013] Step of determining the first candidate list of the current block - the first candidate list includes one or more candidate vector parameters - ;
[0014] A step of determining a second position block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first position block of the current block;
[0015] A step of 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 encoding parameter of the second position block includes a vector parameter;
[0016] When the vector parameter of the second position block satisfies the second condition, a step of updating the first candidate list according to the vector parameter of the second position block; and
[0017] It includes a step of determining the predicted value of the current block according to the first candidate list after updating.
[0018] In a third aspect, an embodiment of the present application provides a bit stream, said bit stream is generated by performing bit encoding on information to be encoded; wherein the information to be encoded includes at least one of a predicted difference value of a current block, a value of a first syntax element, and a value of a second syntax element, and
[0019] The value of the first syntax element is intended to indicate the index number of the prediction construction method of the current block in the prediction construction candidate list, and the value of the second syntax element is intended to indicate whether the current block uses the intra-template matching prediction mode.
[0020] In a fourth aspect, an embodiment of the present application provides an encoder comprising a first determination unit, a first update unit and a first prediction unit, and
[0021] The first decision unit is configured to determine a first candidate list of the current block, and the first candidate list includes one or more candidate vector parameters, and
[0022] The first update unit is configured to determine a second position block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first position block of the current block, and when the encoding parameter of the second position block includes the vector parameter, determine whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block, and when the vector parameter of the second position block satisfies the second condition, update the first candidate list according to the vector parameter of the second position block.
[0023] The first prediction unit is configured to determine the predicted value of the current block based on the first candidate list after the update.
[0024] In a fifth aspect, an embodiment of the present application provides an encoder comprising a first memory and a first processor, and
[0025] The first memory is for storing a computer program that can be operated on a first processor;
[0026] The first processor is intended to execute an encoding method according to the second aspect when a computer program is operated.
[0027] In a sixth aspect, an embodiment of the present application provides a decoder comprising a second determination unit, a second update unit and a second prediction unit, and
[0028] The second decision unit is configured to determine a first candidate list of the current block, and the first candidate list includes one or more candidate vector parameters, and
[0029] The second update unit is configured to determine a second location block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first location block of the current block, and when the decoding parameter of the second location block includes the vector parameter, determine whether the vector parameter of the second location block satisfies a second condition according to the vector parameter of the second location block, and when the vector parameter of the second location block satisfies the second condition, update the first candidate list according to the vector parameter of the second location block.
[0030] The second prediction unit is configured to determine the predicted value of the current block based on the first candidate list after the update.
[0031] In a seventh aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor, and
[0032] The second memory is for storing a computer program that can be operated on the second memory;
[0033] The second processor is intended to execute a decoding method according to the first aspect when a computer program is operated.
[0034] In the eighth aspect, an embodiment of the present application provides a computer-readable storage medium, said computer-readable storage medium has a computer program stored therein, and when said computer program is executed, a decoding method according to the first aspect or an encoding method according to the second aspect is implemented.
[0035] Embodiments of the present application provide an encoding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Both the encoding end and the decoding end first determine a first candidate list of a current block, wherein the first candidate list includes one or more candidate vector parameters. Next, a second location block is determined according to at least one of the candidate vector parameters in the first candidate list and the vector parameters of the first location block of the current block. When the encoding / decoding parameters of the second location block include the vector parameters, whether the vector parameters of the second location block satisfy a second condition is determined according to the vector parameters of the second location block. When the vector parameters of the second location block satisfy the second condition, the first candidate list is updated according to the vector parameters of the second location block. Finally, the predicted value of the current block is determined according to the first candidate list after the update. That is, when updating the first candidate list, the vector information of some second location blocks can be expanded based on the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first location block (spatially adjacent and non-adjacent blocks of the current block), and the first candidate list can be supplemented based on the expanded vector information, thereby effectively utilizing the reconstructed information of spatially adjacent and non-adjacent blocks. Furthermore, under the premise of guaranteeing encoding complexity, candidate vector information can be inferred based on the vector information of these reconstructed blocks, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, saving additional bit rates, and enhancing encoding and decoding performance by increasing encoding and decoding efficiency. Brief explanation of the drawing
[0036] A brief explanation of Figure 1 is an example of a prediction of Intra TMP. Figure 2 is an example diagram of a prediction flow based on Intra TMP technology. Figure 3 is an example of a template type for Intra TMP technology. Figure 4 is an example diagram of a search flow based on Intra TMP technology. Figure 5 is an example of parameter definitions for the current block and its template. Figure 6 is an example of a template search area. Figure 7 is an example flowchart of the search process execution. Figure 8 is an example flowchart of a rough search list construction. Figure 9 is an example of spatially adjacent and non-adjacent locations of the current block. Figure 10 is an example flowchart of the generation of predicted values. Figure 11a is an example of the distribution of filter coefficients. Figure 11b is an example of the distribution of the predicted samples. FIG. 12 is an example diagram of the configuration structure of an encoder provided in an embodiment of the present application. FIG. 13 is an example diagram of the configuration structure of a decoder provided in an embodiment of the present application. FIG. 14 is an example diagram of the network architecture of an encoding and decoding system provided in an embodiment of the present application. FIG. 15 is a flowchart 1 of a decoding method provided in an embodiment of the present application. FIG. 16 is a flowchart 2 of the decoding method provided in an embodiment of the present application. FIG. 17 is a flowchart 1 of an encoding method provided in an embodiment of the present application. FIG. 18 is a flowchart 2 of the encoding method provided in an embodiment of the present application. FIG. 19 is an example flowchart 1 of the execution of a search process provided in an embodiment of the present application. FIG. 20 is an example flowchart 2 of the execution of a search process provided in an embodiment of the present application. FIG. 21 is a flowchart 3 of the execution of a search process provided in an embodiment of the present application. FIG. 22 is a flowchart 4 of the search process execution flow provided in an embodiment of the present application. FIG. 23 is an example diagram of the configuration structure of an encoder provided in an embodiment of the present application. FIG. 24 is an example diagram of a specific hardware structure of an encoder provided in an embodiment of the present application. FIG. 25 is an example diagram of the configuration structure of a decoder provided in an embodiment of the present application. FIG. 26 is an example diagram of a specific hardware structure of a decoder provided in an embodiment of the present application. FIG. 27 is an example diagram of the configuration structure of an encoding and decoding system provided in an embodiment of the present application. Specific details for implementing the invention
[0037] To further understand the features and technical content of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the attached drawings. The attached drawings are for reference only and are not intended to limit the embodiments of the present application.
[0038] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as generally understood by a person skilled in the art to which this application applies. The terms used in this application are intended only to describe the purpose of the embodiments of this application and are not intended to limit this application.
[0039] In the description below, “some embodiments” are referred to and describe subgroups of all possible embodiments; however, it should be understood that “some embodiments” may be the same or different subgroups of all possible embodiments and may be combined with one another without contradiction. The terms “first / second / third” mentioned in the embodiments of this application are merely for distinguishing similar objects and do not indicate a specific order of objects; it should be understood that “first / second / third” may be interchanged with a specified order or sequence where permitted, so that the embodiments of this application described herein may be carried out in an order other than that shown or described herein.
[0040] Before describing the embodiments of the present application in further detail, the nouns and terms mentioned in the embodiments of the present application are first explained, and the nouns and terms mentioned in the embodiments of the present application are subject to the following interpretations.
[0041] Coding Block (Coding Block, CB);
[0042] Block Matching (BM);
[0043] Coding Unit (Coding Unit, CU);
[0044] Prediction Unit (PU);
[0045] Block Vector(Block Vector, BV);
[0046] Motion Vector (Motion Vector, MV);
[0047] Sum of Absolute Difference (SAD);
[0048] Sum of Absolute Transformed Difference (SATD);
[0049] Mean Square Error (MSE);
[0050] Sum of Squared Errors (SSE);
[0051] Sum of Squared Differences (SSD);
[0052] Mean Absolute Deviation (MAD);
[0053] Mean Absolute Error (MeanAbsoluteError, MAE);
[0054] Mean Square Differences (MSD);
[0055] Normalized Correlation Coefficient (NCC);
[0056] H.266 / Versatile Video Coding (VVC);
[0057] VVC Reference Software Test Model (VVC Test Model, VTM);
[0058] Intra Template Matching Prediction (Intra TMP);
[0059] Beyond VVC's reference software test model (Enhanced Compression Model, ECM).
[0060] It can be understood that in a video picture, a coding block is generally represented by adopting a first color component, a second color component, and a third color component. Here, these three color components each consist of a luminance component, a blue chroma component, and a red chroma component; specifically, the luminance component is typically represented by the symbol Y, the blue chroma component is typically represented by the symbol Cb or U, and the red chroma component is typically represented by the symbol Cr or V; thus, the video picture can be represented in the YCbCr format and can also be represented in the YUV format.
[0061] To be more understandable, Intra TMP is a special intra prediction mode in which both the encoder and decoder search for the matching template (T_BEST) with the smallest cost according to a preset cost function within a predefined search range in the current picture using the coding block template (T). Here, the offset of the optimal matching template relative to the current coding block template is the optimal block vector (BEST Block Vector, BV_BEST), and the reconstruction block (Ref Block) corresponding to the next matching template is used as the prediction block for the current coding block (Cur Block). Here, the coding block template generally selects an adjacent reconstruction region of the current coding block.
[0062] For example, taking the adjacent reconstruction area of the current block as an example, FIG. 1 is a prediction example of Intra TMP, and as shown in FIG. 1, the area filled with diagonal lines represents the reconstruction area, the block filled with grids is the current block, 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 optimal matching template, T_BEST), where the offset of the second template with respect to the first template is the optimal block vector (BV_BEST), and the reference block can be copied and used as the prediction block of the current block.
[0063] In an embodiment of the present application, the preset cost function may be the sum of absolute errors SAD, the sum of absolute transformation differences SATD, mean squared error MSE, sum of squared errors SSD, mean absolute deviation MAD, mean sum of squared errors MSD, normalized correlation coefficient NCC, etc., but is not specifically limited thereto.
[0064] For example, let's take the sum of absolute errors (SAD) as an example, where the cost function is as follows.
[0065] (1)
[0066] Here, is a template during the search process, and M represents the number of samples in the template.
[0067] The prediction process of Intra TMP technology among related technologies is explained in detail below.
[0068] In the input of IntraTMP, the current block position (xTbCmp, yTbCmp), the current block width nTbW, and the current block height nTbH.
[0069] In the output of IntraTMP, the predicted value of the current block is predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1.
[0070] Specifically, the prediction process of IntraTMP technology can be divided into four stages: determining the current template type, acquiring samples for reconstructing the current template, determining block vectors within a predefined search range, and generating predicted values. In this way, the predicted value of the current block can be obtained through the above process. It should be noted that IntraTMP technology can be applied to the prediction of the luminance component and the chroma component, and is not specifically limited thereto.
[0071] In terms of possible implementation methods, FIG. 2 is an example of a prediction flow based on IntraTMP technology. As illustrated in FIG. 2, the flow may include the following steps.
[0072] In step S201, the current template type is determined.
[0073] It needs to be explained that the Intra TMP technology searches for matching templates within a predefined search area using adjacent reconstructed samples of the current block as templates, wherein the adjacent reconstructed samples may be the upper reference sample, upper-left reference sample, upper-right reference sample, left reference sample, and lower-left reference sample of the current block, and thus the corresponding template type can be determined by performing classification on the template type based on the availability of the adjacent reconstructed samples.
[0074] Further explanation is that the template type is represented by refTemplateType, and Fig. 3 is an example of a template type for Intra TMP technology. As shown in Fig. 3, a grid-filled block is used as the current block, and the adjacent area of the current block is the template T, and here six template types are illustrated.
[0075] For example, these six template types are as follows.
[0076] When the upper-left reference sample, the upper reference sample, and the left reference sample are all available, the value of refTemplateType is 1, and the template form is as illustrated in (a) of FIG. 3. It should be noted that when the value of refTemplateType is 1, for an L-shaped template, in some specific cases, there may be no upper-left adjacent reference sample.
[0077] If only the left reference sample is available, the value of refTemplateType is 2, and the template form is as shown in (b) of FIG. 3, and
[0078] When only the upper reference sample is available, the value of refTemplateType is 3, and the template form is as shown in (c) of FIG. 3, and
[0079] When only the left reference sample and the upper-left reference sample are available, the value of refTemplateType is 4, and the template form is as shown in (d) of FIG. 3, and
[0080] When only the left reference sample and the bottom-left reference sample are available, the value of refTemplateType is 5, and the template form is as shown in (e) of FIG. 3, and
[0081] When only the upper reference sample and the upper right reference sample are available, the value of refTemplateType is 6, and the template form is as shown in (f) of FIG. 3.
[0082] In step S202, obtain the current template sample.
[0083] It should be explained that the template of the Intra TMP technique may consist of reconstruction samples of one or more areas among the upper, upper-right, left, lower-left, and upper-left sides of the current block. Additionally, the template size may be pre-set, for example, when acquiring the left template, the template width templateW_size may be set to 4, and when acquiring the upper template, the template height templateH_size may be set to 4.
[0084] It is further explained that depending on the value of refTemplateType, it can be determined which part of the reconstruction sample to obtain. For example, when the value of refTemplateType is 1, the reconstruction samples of the left, upper-left, and upper sides of the current block are obtained, or when the value of refTemplateType is 2, only the reconstruction samples of the left 4 columns of the current block are obtained, or when the value of refTemplateType is 3, only the reconstruction samples of the upper 4 rows of the current block are obtained.
[0085] In step S203, the block vector is determined.
[0086] It needs to be explained that the search process of Intra TMP technology is mainly divided into an initialization process, determining the search area of the template within the current frame, searching within the search area, and determining the optimal block vector.
[0087] To further explain, when searching for the optimal matching template in the search area, a search strategy can be adopted that performs a rough search followed by a detailed search, or it can perform only a detailed search or only a rough search, and is not specifically limited here.
[0088] In an embodiment of the present application, the approximate search may specifically determine an optimal approximate matching template in the search area with a first preset step length (e.g., 3) or determine an optimal approximate matching template in the search area with a downsampled template (e.g., the downsampling factor is 3).
[0089] In an embodiment of the present application, the fine search may specifically determine an optimal fine matching template in a search area with a second preset step length (e.g., 1, in the case of subsample precision, subsample interpolation must be performed on the reconstructed sample, which is not described in detail herein) or determine an optimal fine matching template around an optimal approximate matching template after completing a rough search.
[0090] In terms of possible implementation methods, FIG. 4 is an example diagram of a search flow based on IntraTMP technology. As illustrated in FIG. 4, the flow may include the following steps.
[0091] In step S401, parameter initialization is performed.
[0092] What needs to be explained is that, taking an L-shaped template as an example, uiPatchWidth is initialized to nTbW + templateW_size and uiPatchHeight to nTbH + templateH_size. Here, templateW_size and templateH_size can be fixed constants or can be dynamically adjusted according to the size of the current block, and also, templateW_size and templateH_size can be the same or different. For example, templateW_size=4 and templateH_size=4, or, when the width of the current block is greater than 8, templateW_size is set to 4, and when the width of the current block is less than or equal to 8, templateW_size is set to 2; when the height of the current block is greater than 8, templateH_size is set to 4, and when the height of the current block is less than or equal to 8, templateH_size is set to 2.
[0093] For example, FIG. 5 is an example of parameter definitions for the current block and its template. As illustrated in FIG. 5, regarding the specific implications of the parameters, 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 total height and total width including the current block and template.
[0094] Furthermore, the cost threshold between templates is initialized and denoted as diffThreshold, for example, when the cost function is SAD, the threshold can be diffThreshold = ((1 << bitDepth) >> 2) × (uiPatchHeight × uiPatchWidth - nTbH × nTbW). Here, when the picture bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold for each sample point in the template region is 256.
[0095] Furthermore, initialize the location of the coding tree block CTB where the current block CB is located, ctbRsX, ctbRsY.
[0096] Furthermore, initialize the position offset of the current block CB within the current CTB. offsetLCBY = yTbCmp - ctbRsY, offsetLCBX = xTbCmp - ctbRsX.
[0097] Furthermore, initialize iTemplateSizeH= templateH_size and iTemplateSizeW= templateW_size.
[0098] Furthermore, iBvShift is initialized, iBvShift is the precision of the block vector BV. For example, the precision of BV may be an integer sample precision, where iBvShift is 0, and the precision of BV may be a subsample precision, for example, when iBvShift is 1, it represents 1 / 2 sample precision, and when iBvShift is 2, it represents 1 / 4 sample precision, but is not specifically limited thereto.
[0099] Furthermore, the pre-configured search range of the template is initialized, and the pre-configured search range of the template can be set to a fixed size or can be dynamically adjusted according to the coding block size. For example,
[0100] searchRangeWidth = TMP_SEARCH_ RANGE_MULT_FACTOR× nTbW;
[0101] searchRangeHeight = TMP_SEARCH_RANGE_MULT_ FACTOR×nTbH;
[0102] Here, the value of TMP_SEARCH_RANGE_MULT_FACTOR can be a preset value, for example, set to 5.
[0103] In step S402, the search area of the template within the current frame is determined.
[0104] It should be explained that since the frame here may also be referred to as a picture, the current frame may also be referred to as the current picture. The search area of the Intra TMP technology is a reconstructed part of the current picture and is limited by the size of the search range. For example, FIG. 6 is an example of a template search area of the current block. As shown in FIG. 6, R1, R2, R3, R4, R5, and R6 represent six different search areas. Here, picHeight represents the height of the current picture, picWidth represents the width of the current picture, 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.
[0105] The above search area can be divided into two types.
[0106] One is a surrounding rectangular search area. Here, it is also divided into two types: one where all sampling points within the area have been reconstructed (referred to as the total reconstructed area), for example, including four areas R1 to R4 in Fig. 6; and one where it is uncertain whether all sampling points within the area have been reconstructed (referred to as the pending reconstructed area), for example, including two areas R5 to R6 in Fig. 6.
[0107] One is an extended search area. Here, it is defined as an area pointed to by a BV corresponding to spatially adjacent and non-adjacent location PUs, and in the embodiment corresponding to FIG. 6, the area can be considered as R7.
[0108] For search points within a search area, all search points within the specified search area may be traversed, or different methods may be adopted to limit the search range to a local scope, taking into account computational complexity and coding efficiency. For example, for a pending reconstruction area (corresponding to the two areas R5–R6 in FIG. 6) or a whole reconstruction area (corresponding to the four areas R1–R4 in FIG. 6), the width of the search range may be limited to the original 1 / wIndex and the height to the original 1 / hIndex, where wIndex and hIndex are both arbitrary positive integers greater than or equal to 1. The limited search range takes the area closer to the unit to be encoded. Also, for example, when reducing the search range of the R5 area, the width of the R5 search area may be reduced to half of the original, and the final search range may take the upper-right quarter of the R5 area.
[0109] In step S403, the optimal block vector BV is determined by searching in the search area.
[0110] It needs to be explained that bvXMins and bvXMaxs represent the minimum and maximum offsets of the block vector in the horizontal direction, respectively, and bvYMins and bvYMaxs represent the minimum and maximum offsets of the block vector in the vertical direction, respectively.
[0111] bvXMins regionId , bvXMaxs regionId , bvYMins regionId , bvYMaxs regionId is iVerMin determined in step S402 regionId , iVerMax regionId , iHorMin regionId , iHorMax regionId It can be calculated through,
[0112] bvXMins regionId = iHorMin regionId - xTbCmp;
[0113] bvXMaxs regionId = iHorMax regionId - xTbCmp;
[0114] bvYMins regionId = iVerMin regionId - yTbCmp;
[0115] bvYMaxs regionId = iVerMax regionId - yTbCmp;
[0116] Here, bvXMins regionId , bvXMaxs regionId , bvYMins regionId and bvYMaxs regionId It determines the horizontal and vertical offset range for the current block of the search point, that is, the range of the block vector BV.
[0117] For the entire reconstruction area (e.g., corresponding to the four areas R1 to R4 in Fig. 6), a matching reconstruction block of one current block in the reconstruction area can be found through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0118] For pending reconstruction areas (e.g., corresponding to the two areas R5–R6 in Fig. 6), availability is determined through search points (iPosHor, iPoxVer) within each search area, i.e., each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and
[0119] If available, a matching reconstruction block for a single current block can be found in the reconstruction area, and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0120] If unavailable, template matching cost calculation is not performed.
[0121] Here, the determination of availability includes, but is not limited to, the simultaneous satisfaction of one or more of the following conditions, and
[0122] ● Each sampling point within the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0123] ● Each sampling point within the reconstruction block corresponding to the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0124] ● Each sampling point within the template and each sampling point within the corresponding reconstruction block do not exceed the defined range of the search window;
[0125] ● Whether each sampling point within the template is on the same Tile as the current encoding area;
[0126] ● Whether each sampling point within the reconstruction block corresponding to the template is on the same Tile as the current encoding area;
[0127] ● All sampling points within the template are reconstructed;
[0128] ● Each sampling point within the reconstruction block corresponding to the template is not located in the current encoding area;
[0129] ● All sampling points within the reconstruction block corresponding to the template are reconstructed;
[0130] All available search points in all search ranges (regionId=0, 1, 2, 3, 4, 5) are iterated through to obtain the 30 search points with the smallest matching cost pDiff, the corresponding matching cost is denoted as pDiff_BEST[n], where n=0,…,29, the corresponding block vector BV is denoted as the optimal block vector BV_BEST[n], where each item is a single coordinate pair (pX_BEST, pY_BEST), where n=0,…,29, and the corresponding matching template is the optimal matching template T_BEST[n], where n=0,…,29.
[0131] If the search strategy is to perform only a rough search, the specific implementation is as follows.
[0132] pX within each region is bvXMins regionId and bvXMaxs regionId Located between, and pY is bvYMins regionId wa bvYMaxs regionId Within the search range located between, an approximate search is performed with a step length greater than 1, for example, an approximate search is performed with a step length of 2, and the optimal matching cost obtained through template matching is recorded as pDiff_BEST, and the corresponding block vector BV is marked as the optimal block vector BV_BEST(pX_BEST, pY_BEST).
[0133] If the search strategy performs only fine-grained searches, the specific implementation is as follows.
[0134] pX within each region is bvXMins regionId and bvXMaxs regionId Located between, and pY is bvYMins regionId wa bvYMaxs regionIdWithin the search range located between, for example, a fine search with a step length of 1 is performed to record the optimal matching cost obtained through template matching as pDiff_BEST, and the corresponding block vector BV is marked as the optimal block vector BV_BEST(pX_BEST, pY_BEST).
[0135] If the search strategy involves first performing a rough search and then performing a detailed search, it is as illustrated in FIG. 7. A specific implementation is as follows.
[0136] In step S701, an approximate search list is constructed within the search area.
[0137] In step S702, a detailed search list is determined around the approximate search list BV with a step length of 1.
[0138] What needs to be explained is that for step S701, when constructing an approximate search list within the search area, as illustrated in FIG. 8, the above-mentioned implementation step may include the following steps.
[0139] In step S801, an initial approximate search list is constructed within the search area with a step length of 3.
[0140] pX within each region is bvXMins regionId and bvXMaxs regionId Located between, and pY is bvYMins regionId wa bvYMaxs regionIdWithin the search range located between, an approximate search is performed with a step length of 3. The preceding P optimal matching costs obtained by template matching through the approximate search with a step length of 3 are recorded as pDiff1_BEST[p], where p=0,…,P-1, and the corresponding block vector BV is recorded as the optimal block vector BV1_BEST[p], where p=0,…,P-1. Here, P can be 1 or an integer value greater than 1 depending on demand, and the search region where the optimal matching search point is located is bestRegionId[p], where p=0,…,P-1.
[0141] In step S802, the IntraTMP_Merge list is constructed to update the approximate search list.
[0142] After searching for P reference points in the search area, a list of candidate BVs that the current block can reference is constructed using multiple predefined search locations, referred to as the IntraTMP_Merge list.
[0143] For example, a predefined set of search locations may include spatially adjacent and non-adjacent locations of the current block. For instance, the five spatially adjacent locations of the current block are left (xTbCmp-1, yTbCmp+nTbH-1), top (xTbCmp+nTbW-1, yTbCmp-1), upper right (xTbCmp+nTbW, yTbCmp-1), lower left (xTbCmp-1, yTbCmp+nTbH), upper left (xTbCmp-1, yTbCmp-1), and 18 spatially non-adjacent locations (as illustrated in FIG. 9). Here, numbers 1-5 in FIG. 9 are referred to as spatially adjacent locations, and the remaining numbers are referred to as non-adjacent locations.
[0144] In an example of the construction process, it is checked whether the PU corresponding to these locations uses IntraTMP / IBC technology, and if it does, the BV of this PU is stored in the IntraTMP_Merge list. After constructing the IntraTMP_Merge list, an update is performed on the approximate search list. The specific operation process of the update involves sequentially accessing each item in this list to calculate the template matching cost corresponding to each BV, comparing this cost with the template matching cost of the initial approximate search list, and if it is smaller than the maximum template matching cost of the approximate search list, replacing this BV with the lowest BV in the approximate search list. The specific replacement operation involves, for example, inserting this BV into the approximate search list in order of cost size and deleting the item with the largest cost in the approximate search list. Then, the search region bestRegionId is set to 6. It should be noted that the above process is actually a list merging process, but first, a search list of results corresponding to R1 to R6 is constructed, and then the result of R7 is inserted into the appropriate location in the above list. In addition, other search orders and merging strategies may exist, and are not specifically limited here.
[0145] In an embodiment of the present application, depending on the requirements of the algorithm, one or more fine search reference points (indicated here as M, where 1 <= M <= P) are provided in the approximate search step and passed to the next step. For example, M=1.
[0146] What needs to be further explained is that for step S702, the optimal block vector BV1_BEST[p], p=0,…,M-1 obtained by approximate search is used as a fine-finish search reference point to perform a search in the surrounding area.
[0147] Specifically, for each fine search reference point, the fine search ranges TmpRefineRangeHor and TmpRefineRangeVer are determined first, and the fine search ranges may be of a fixed size or may be related to the search area. For example, for a reference point with a search area of 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 1, and for a reference point with a search area of 6, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 2, and then the location of the optimal matching reconstruction block obtained by the approximate search is calculated and used as the reference location for the fine search area, BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.
[0148] In a possible implementation method, a direct search window is used to directly traverse the fine-grained search area, treating it as a single entire pending reconstruction area.
[0149] First, a new search range is obtained based on the optimal matching block location obtained through approximate search, and
[0150] iHorMax refine = min(picWidth - nTbW, BestPosX + TmpRefineRangeHor);
[0151] iHorMin refine = max( iTemplateSizeW, BestPosX - TmpRefineRangeHor);
[0152] iVerMax refine = min(picHeight - nTbH, BestPosY + TmpRefineRangeVer);
[0153] iVerMin refine = max( iTemplateSizeH, BestPosY - TmpRefineRangeVer ); exists, and
[0154] Next, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs are iVerMin refine , iVerMax refine , iHorMin refine , iHorMax refine It can be calculated through,
[0155] bvXMins = iHorMin refine - xTbCmp;
[0156] bvXMaxs = iHorMax refine - xTbCmp;
[0157] bvYMins = iVerMin refine - yTbCmp;
[0158] bvYMaxs = iVerMax refine - yTbCmp;
[0159] Fine-grained search is pX bvXMins refine and bvXMaxs refine Located between, and pY is bvYMins refine and bvYMaxs refine It is performed within the range of block vectors located between them; that is, it traverses all search locations within the direct fine-grained search window and sequentially determines availability. For example, a search is performed with a step length of 1, and the preceding T optimal matching costs obtained by template matching of available points are recorded as pDiff_BEST[t], where t=0,…,T-1, and the corresponding block vector BV is represented as the optimal block vector BV_BEST[t], where t=0,…,T-1. Here, T is 1 or an integer greater than 1. For example, T=1.
[0160] After completing the above operation, the results of the approximate search and fine-grained search processes (wherein the fine-grained selection process includes one or more reference point searches) can be 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). Here, pX_BEST and pY_BEST are the horizontal offset and vertical offset of the current coding block template of the optimal matching template, respectively, and are also the horizontal offset and vertical offset of the current coding block of the optimal matching reconstruction block.
[0161] In step S204, a predicted value is generated.
[0162] In IntraTMP mode, in addition to obtaining predicted values using a basic copying method, there are methods for obtaining predicted values by fusing locations corresponding to multiple BVs, methods for performing filtering on reference blocks corresponding to BVs and then copying, and methods for using BVs as subsamples to interpolate corresponding reference blocks and then copying.
[0163] In a possible implementation method, a list of BV candidates is obtained using template matching during the decoding end region search process, and then the first N items among them (e.g., N=3) are selected to perform weighted fusion. The above method may be referred to as the IntraTMP Fusion mode.
[0164] Alternatively, in another possible implementation, after obtaining a single optimal BV, multiple points are taken around the BV, and weighted fusion is performed on the prediction values corresponding to the multiple points to obtain a prediction value. The above method may be referred to as the IntraTMP FLM mode.
[0165] Alternatively, in another possible implementation, after obtaining one optimal BV, a sequence arrangement is performed on the template with subsample precision to select the optimal direction and precision, and a prediction value is calculated using an interpolation filter, and the method may be referred to as the IntraTMP SubPel mode.
[0166] The implementation process of some of the above methods is explained in detail below.
[0167] In IntraTMP technology, different prediction methods exist depending on the difference in the prediction mode. For example, in IntraTMP Fusion technology, after obtaining block vectors (BV) corresponding to N candidate templates, N candidate reconstructed blocks are obtained through the BVs, and weighted fusion is performed on the next N candidate reconstructed blocks to obtain the prediction block of the current coding block. Specifically, a final prediction value is generated through the following steps, N candidate reconstructed blocks are obtained, weighted fusion weights are determined, and then a prediction value is generated through weighted fusion. Specifically, as illustrated in FIG. 10, the flow may include the following steps.
[0168] In step S1001, N candidate reconstruction blocks are obtained.
[0169] After obtaining the block vector BV corresponding to N candidate templates, BV n Candidate reconstruction block RefBlock in the current picture according to n directly obtains, where BV n The horizontal offset of is pX n and the vertical offset is pY n and, here am.
[0170] It is implemented using simple translational copying. For x=0…nTbW⁻¹ and y=0…nTbH⁻¹, the specific operation is as follows.
[0171] RefBlock n[x][y] = recSamples[x + pX n ][y + pY n ] (2)
[0172] Here, recSamples represents the reconstructed samples of the current frame.
[0173] In step S1002, the weighted fusion weights are determined.
[0174] After obtaining N candidate reconstruction blocks RefBlocks, the weights W of the weighted fusion of the N candidate reconstruction blocks must be calculated. The weights can be predefined determined values, or they can be adaptively calculated values using cost values, sample values, etc.
[0175] In an embodiment of the present application, an embodiment of IntraTMP Fusion technology is a candidate template refT n The rebuild value of and the template to be predicted refpredT n Weighted fusion weights are inferred by minimizing the MSE of the sample values.
[0176] Specifically, the MSE minimization process uses the autocorrelation matrix of the preceding N matching reference samples refT and the cross-correlation vector of the preceding N matching reference samples refT and the adjacent template sample curT of the current coding block as inputs to output the weight of the reconstruction block corresponding to each matching reference item.
[0177] In step S1003, a predicted value is generated through weighted fusion.
[0178] The prediction block is calculated based on each candidate reconstruction block and its corresponding weighted fusion weight. Specifically, the value of each candidate reconstruction block is multiplied by its corresponding weight and accumulated to obtain the current prediction block (i.e., weighted prediction). The calculation formula is as follows.
[0179] For x=0…nTbW-1 and y = 0…nTbH-1, the calculation of the predicted value is as follows.
[0180] (3)
[0181] Finally, each predicted value If stored in space, it is the output prediction block of IntraTMP Fusion.
[0182] In IntraTMP FLM mode, a linear filtering model is constructed using the optimal matching template found in the previous step and the current coding block template. This primarily involves two processes: determining the reconstruction region for calculating filter coefficients and calculating the filter coefficients. The specific process for calculating predicted values is as follows.
[0183] Assuming the number of filter taps nTap is 5, the shape of the filter is as shown in FIG. 11a, and inside ε₀ and ε₀ are each tap coefficient of the above filter, where the grid-packed origin corresponding to tap coefficient C0 is the currently predicted sample Reconstructed sample at the corresponding location in this optimal matching block And; the remaining white-packed origin is a reconstruction sample adjacent to the current spatial location of the reference block. As such, according to the filter of Fig. 11a, the finally obtained prediction sample It is the same as the black-packed origin shown in Fig. 11b.
[0184] The specific process for calculating the predicted value is as follows.
[0185] For each currently predicted sample (i, j), if the sample position in the filter template is defined as (k, l), the corresponding reconstructed sample in the optimal matching block during filtering is defined as ref[i + k][j + l], and for each filter coefficient at position (k, l) of the filter template It is defined as.
[0186] (4)
[0187] Here, n=0,… ,nTap-1, and k and l exist between -1 and 1.
[0188] i= 0,… ,nTbW-1, j= For 0,… ,nTbH-1,
[0189] (5)
[0190] The final prediction sample is,
[0191] (6)
[0192] Here,
[0193] (7)
[0194] In IntraTMP SubPel mode, for the optimal BV, the eight directions of 1 / 4, 1 / 2, 3 / 4 and up, down, left, right, upper right, lower left, and lower right are traversed, and an array is performed according to the template cost, and the predicted value is calculated using an interpolation filter for the reference block corresponding to the BV with the smallest template cost.
[0195] Simply put, IntraTMP technology searches for the matching template with the lowest cost based on a preset cost function within a predefined search range of the current picture using a coding block template, and uses the optimal matching reconstruction block (Ref Block) corresponding to that template as the prediction block for the current coding block (Cur Block). Here, the coding block template generally selects an adjacent reconstruction area of the current coding block. However, the search strategy in actual implementation cannot fully utilize information from the reconstructed adjacent sampling points, and thus cannot guarantee prediction accuracy, which affects encoding efficiency.
[0196] Based on this, an embodiment of the present application provides an encoding and decoding method, first determining a first candidate list of a current block, wherein the first candidate list includes one or more candidate vector parameters, and then determining a second location block according to at least one of the candidate vector parameters in the first candidate list and the vector parameters of a first location block of the current block, wherein when the encoding / decoding parameters of the second location block include vector parameters, determining whether the vector parameters of the second location block satisfy a second condition according to the vector parameters of the second location block, and when the vector parameters of the second location block satisfy the second condition, updating the first candidate list according to the vector parameters of the second location block, and finally determining a predicted value of the current block according to the first candidate list after the update.
[0197] Thus, the embodiment of the present application can effectively utilize reconstructed information of spatially adjacent and non-adjacent blocks by expanding the vector information of some second position blocks according to the candidate vector parameters of the initial first candidate list and / or the vector parameters of the first position block (spatially adjacent and non-adjacent blocks of the current block) when updating the first candidate list, and by supplementing the first candidate list according to the expanded vector information, and can infer candidate vector information based on the vector information of the already reconstructed blocks under the premise of guaranteeing encoding complexity, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, and further saving bit rates, thereby improving encoding and decoding efficiency and encoding and decoding performance.
[0198] Each embodiment of the present application is described below by combining the drawings.
[0199] FIG. 12 is an example diagram of the configuration structure of an encoder provided in an embodiment of the present application. As shown in FIG. 12, the encoder (100) may include a transformation and quantization unit (101), an intra-estimation unit (102), an intra-prediction unit (103), a motion compensation unit (104), a motion estimation unit (105), an inverse transformation and inverse quantization unit (106), a filter control analysis unit (107), a filtering unit (108), a coding unit (109), and a decoding picture buffer unit (110), wherein the filtering unit (108) may implement deblocking filtering and Sample Adaptive Offset (SAO) filtering, and the coding unit (109) may implement head information encoding and context-based Adaptive Binary Arithmetic Coding (CABAC). For an input raw video signal, a video coding block can be obtained through a section of a Coding Tree Unit (CTU), and a transformation is performed on the video coding block through a transformation and quantization unit (101) on residual sample information obtained after undergoing the next intra or inter prediction, the residual information is transformed from a sample area to a transformation area, and quantization is performed on the obtained transformation coefficients to further reduce the bit rate; the intra estimation unit (102) and the intra prediction unit (103) are for performing intra prediction on the video coding block; to be precise, the intra estimation unit (102) and the intra prediction unit (103) determine an intra prediction mode for encoding the video coding block; and the motion compensation unit (104) and the motion estimation unit (105) are for providing time prediction information by performing inter prediction encoding on one or multiple blocks in one or multiple reference frames of the received video coding block.The motion estimation performed by the motion estimation unit (105) may be a process of generating a motion vector, and the motion vector may estimate the motion of the video coding block, and the next motion compensation unit (104) performs motion compensation based on the motion vector determined by the motion estimation unit (105); after determining the intra prediction mode, the intra prediction unit (103) is also intended to provide selected intra prediction data to the coding unit (109), and the motion estimation unit (105) also transmits the motion vector data determined by calculation to the coding unit (109); In addition, the inverse transform and inverse quantization unit (106) reconstructs a residual block in a sample area for the reconstruction of the video coding block, and the reconstructed residual block removes block effect artifacts through the filter control analysis unit (107) and the filtering unit (108), and then adds the reconstructed residual block to one prediction block in a frame of the decoding picture buffer unit (110) to generate a reconstructed video coding block; the coding unit (109) is for encoding each encoding parameter and quantized transform coefficient, and in a CABAC-based encoding algorithm, the context content may be for encoding information indicating an encoding intra-prediction mode determined based on adjacent coding blocks and for outputting a bit stream of the video signal; the decoding picture buffer unit (110) is for storing the reconstructed video coding block and for prediction reference. As video picture encoding is performed, new reconstructed video coding blocks will be continuously generated, and all of these reconstructed video coding blocks are stored in the decoding picture buffer unit (110).
[0200] FIG. 13 is an example diagram of the configuration structure of a decoder provided in an embodiment of the present application. As shown in FIG. 13, the decoder (200) includes a decoding unit (201), an inverse transform and inverse quantization unit (202), an intra prediction unit (203), a motion compensation unit (204), a filtering unit (205), and a decoding picture buffer unit (206), etc., wherein the decoding unit (201) can implement head 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 FIG. 12, a bit stream of the video signal is output; the bit stream is input to a decoder (200), passes through a decoding unit (201) to obtain a conversion coefficient after decoding, and then performs processing on the conversion coefficient through an inverse conversion and inverse quantization unit (202) to generate a residual block in the sample area; the intra prediction unit (203) may be for generating prediction data for the current video decoding block based on the determined intra prediction mode and the data of the previous decoded block of the current frame or picture; the motion compensation unit (204) determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and generates a prediction block of the video decoding block being decoded using the prediction information; A decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit (202) and the corresponding prediction block generated by the intra prediction unit (203) or the motion compensation unit (204); the decoded video signal can have block effect artifacts removed through the filtering unit (205) to improve video quality; the decoded video block is then stored in the decoding picture buffer unit (206), which is intended to store a reference picture for future intra prediction or motion compensation and is also intended for outputting the video signal, that is, to obtain the restored raw video signal.
[0201] Furthermore, embodiments of the present application further provide a network architecture of an encoding and decoding system including an encoder and a decoder, and FIG. 14 is an example diagram of the network architecture of the encoding and decoding system provided in the embodiments of the present application. As shown in FIG. 14, 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). The electronic devices may be devices equipped with various types of video encoding and decoding functions during implementation, for example, the electronic devices may be smartphones, tablet computers, personal computers, personal portable information terminals, navigators, digital telephones, video telephones, televisions, sensing devices, servers, etc., and the embodiments of the present application are not specifically limited.
[0202] It should be explained that the decoder or encoder in the embodiments of the present application may be the electronic device. Here, the encoder may be referred to as a “video encoder” or a “picture encoder,” and the decoder may be referred to as a “video decoder” or a “picture decoder.”
[0203] It should be explained that the method of the embodiment of the present application is mainly applied to a part of the intra prediction unit (103) shown in FIG. 12 and a part of the intra prediction unit (203) shown in FIG. 13. That is, the embodiment of the present application may be applied not only to an encoder, but also to a decoder, and even to both an encoder and a decoder simultaneously, but the embodiment of the present application is not specifically limited.
[0204] In one embodiment of the present application, FIG. 15 is a flowchart 1 of a decoding method provided in an embodiment of the present application. As illustrated in FIG. 15, the decoding method may include the following steps.
[0205] In step S1501, the first candidate list of the current block is determined.
[0206] It should be explained that the decoding method of the embodiment of the present application is applied to a decoder. Furthermore, the decoding method may specifically refer to an intra prediction method, and more specifically, an intra prediction method based on an Intra TMP extended block vector list. Here, the accuracy of the prediction is improved by expanding the coverage range of the first candidate list by fully utilizing the reconstructed information of spatially adjacent and non-adjacent locations.
[0207] Further to be explained, in an embodiment of the present application, a video picture may be divided into a plurality of decoding blocks, and each decoding block may include a first color component, a second color component, and a third color component, and the current block in an embodiment of the present application refers to a decoding block that performs a current intra prediction of the video picture. Here, if the current block performs a prediction of the first color component and the first color component is a luminance component, the current block may be referred to as a luminance block; or, if the current block performs a prediction of the second color component and the second color component is a chroma component, the current block may be referred to as a chroma block.
[0208] Further explanation is that, in an embodiment of the present application, the first candidate list may include one or more candidate vector parameters. Here, the vector parameters may include block vector parameters and / or motion vector parameters. That is, here, the first candidate list may be a list containing more than one candidate BV and may be a list containing more than one candidate MV.
[0209] For example, regarding the block vector parameter, it may specifically indicate the location 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.
[0210] In some embodiments, regarding the step of determining a first candidate list of a current block, the method may include: a step of determining a first search area of a current block; and a step of determining a first candidate list of a current block according to the first search area.
[0211] What needs to be explained is that, in an embodiment of the present application, the step of determining a first search area of a current block may include: a step of determining a first template of a current block; and a step of determining a first search area of a current block according to the first template.
[0212] In an embodiment of the present application, a template type of the current block is determined first, and then a first template of the current block can be determined according to the template type. Here, the step of determining the template type of the current block may include: a step of determining the template type of the current block according to a reference sample of the current block; a step of determining the template type of the current block according to instruction information in a bit stream; or a step of determining the template type of the current block according to a size parameter of the current block.
[0213] In an embodiment of the present application, the reference sample of the current block includes at least one of the left adjacent reference sample of the current block, the upper adjacent reference sample of the current block, and the upper-left adjacent reference sample of the current block.
[0214] It is understandable that, in the embodiments of the present application, the reference sample of the current block may refer to a reference sample point adjacent to the current block, wherein "adjacent" may be spatially adjacent but is not limited thereto. For example, the adjacent may be temporally adjacent, spatially and temporally adjacent, and the reference sample of the current block may even be a reference sample obtained after performing specific processing on spatially adjacent, temporally adjacent, spatially and temporally adjacent reference sample points, etc., and the embodiments of the present application are not specifically limited thereto.
[0215] It is further understood that, in an embodiment of the present application, the reference sample of the current block may include an adjacent reconstructed sample of the current block, that is, an adjacent reconstructed sample of the current block may be selected as a template to search for a matching template within a first search area. It is to be explained that, in an embodiment of the present application, the reference sample of the current block, that is, the adjacent reconstructed sample of the current block, may include an upper reference sample, an upper-left reference sample, an upper-right reference sample, a left reference sample, and a lower-left reference sample of the current block.
[0216] It is further understood that in the embodiments of the present application, when determining the template type of the current block using a reference sample of the current block, the template type can be classified and determined based on the availability of an adjacent reference sample.
[0217] In some embodiments, when determining the template type of the current block according to the reference sample of the current block, if the left adjacent reference sample of the current block, the upper adjacent reference sample of the current block, and the upper-left adjacent reference sample of the current block are all available, the template type of the current block is determined as a first value; if the left adjacent reference sample of the current block is available, the template type of the current block is determined as a second value; if the upper adjacent reference sample of the current block is available, the template type of the current block is determined as a third value; if both the left adjacent reference sample of the current block and the upper-left adjacent reference sample of the current block are available, the template type of the current block is determined as a fourth value; if both the left adjacent reference sample of the current block and the lower-left adjacent reference sample of the current block are available, the template type of the current block is determined as a fifth value; and if both the upper adjacent reference sample of the current block and the upper-right adjacent reference sample of the current block are available, the template type of the current block is determined as a sixth value.
[0218] It must be explained that in the embodiments of the present application, if both the left-adjacent reference sample of the current block and the upper-adjacent reference sample of the current block are available in certain specific cases, the template type of the current block is determined as a first value. That is, for an L-shaped template, there may be no upper-left adjacent reference sample in certain specific cases.
[0219] 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 may be any numerical value, and the present application is not specifically limited thereto. For example, the values of the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value may be 1, 2, 3, 4, 5, and 6 in sequence.
[0220] For example, in an embodiment of the present application, a template type can be represented by refTemplateType, and correspondingly, as shown in FIG. 3, a grid-filled block is the current block, and an adjacent area of the current block is a template T, where six template types are illustrated.
[0221] For example, among these six template types, if the upper-left reference sample, the upper reference sample, and the left reference sample are all available, the value of refTemplateType is 1, and the template form is as illustrated in FIG. 3(a); however, if the left reference sample is available, the value of refTemplateType is 2, and the template form is as illustrated in FIG. 3(b); however, if the upper reference sample is available, the value of refTemplateType is 3, and the template form is as illustrated in FIG. 3(c); however, if the left reference sample and the upper-left reference sample are available, the value of refTemplateType is 4, and the template form is as illustrated in FIG. 3(d); however, if the left reference sample and the lower-left reference sample are available, the value of refTemplateType is 5, and the template form is as illustrated in FIG. 3(e); However, when the upper reference sample and the upper right reference sample are available, the value of refTemplateType is 6, and the template form is as shown in (f) of FIG. 3.
[0222] In some embodiments, the template type of IntraTMP may be selected in accordance with instructions in the bit stream while combining information on the availability of the reference sample. For example, the determination of the template type can be implemented at the decoding end by agreeing on a sequence number for each template type and transmitting information on the template sequence number actually used in the bit stream. That is, in the embodiments of the present application, not only can the template type be determined according to the information on the availability of the reference sample of the current block, but the template type may also be determined according to information indicated in the bit stream, or the template type may be determined by combining the information on the availability of the reference sample and the information indicated in the bit stream. The present application is not specifically limited.
[0223] Furthermore, in an embodiment of the present application, when determining a first template corresponding to a current block according to a template type, the step of determining a template reference sample of the current block according to the template type and the template size corresponding to the template type may be included; and the step of determining the first template of the current block according to the next template reference sample.
[0224] It should be explained that, in an embodiment of the present application, the first template of the current block may include a template reference sample of the current block. Here, the template reference sample of the current block may be determined by the template type of the current block and the template size corresponding to the template type.
[0225] It is further explained that, in an embodiment of the present application, the first template of the current block may be composed of a reconstruction sample of one or more of the upper, upper-right, left, lower-left, and upper-left regions of the current block, that is, it may be composed of a reference sample of the current block.
[0226] It should be further explained that, in the embodiments of the present application, the template size corresponding to the template type may be preset, may be indicated through bit stream syntax elements, or may be adaptively selected according to the block size or other information. For example, when acquiring the left template, the template width templateW_size may be set to 4, and when acquiring the upper template, the template height templateH_size may be set to 4.
[0227] Accordingly, in an embodiment of the present application, by combining the value of the template type refTemplateType of the current block and the template size corresponding to said refTemplateType, it is possible to determine which part of the reconstruction sample to obtain and use as a template reference sample of the current block, thereby determining the corresponding first template. For example, when the value of refTemplateType is 1, one may choose to obtain the left, upper-left, and upper reconstruction samples of the current block; when the value of refTemplateType is 2, only the left 4th column reconstruction sample of the current block is obtained; and when the value of refTemplateType is 3, only the upper 4th row reconstruction sample of the current coding block is obtained.
[0228] 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.
[0229] That is, in an embodiment of the present application, by combining the template type of the current block and the corresponding template size, the template reference sample of the current block determined from the reference sample of the current block may be a first template corresponding to the current block.
[0230] It is understandable that, in an embodiment of the present application, the search process for vector parameters may include an initialization process, determining a search area (first search area) within the current frame of a first template, and determining one or more optimal vector parameters by searching in the first search area; therefore, when executing the search process, the initialization operation must be completed first.
[0231] For example, as shown in FIG. 5 above, 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.
[0232] Correspondingly, during the initialization process, uiPatchWidth can be initialized to nTbW + templateW_size and uiPatchHeight to nTbH + templateH_size, where templateW_size and templateH_size may be fixed constants, may be indicated via bitstream syntax elements, or may be dynamically adjusted according to the current block size or other information, and templateW_size and templateH_size may be the same or different. For example, templateW_size=4, templateH_size=4; or when the current block width is greater than 8, templateW_size is set to 4, and when the current block width is less than or equal to 8, templateW_size is set to 2, and when the current block height is greater than 8, templateH_size is set to 4, and when the current block height is less than or equal to 8, templateH_size is set to 2.
[0233] Furthermore, the cost threshold between templates is initialized and denoted as diffThreshold, for example, when the cost function is SAD, the threshold can be diffThreshold = ((1 << bitDepth) >> 2) × (uiPatchHeight × uiPatchWidth - nTbH × nTbW). Here, when the picture bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold for each sample point in the template region is 256.
[0234] Furthermore, initialize the location of the coding tree block CTB where the current block CB is located, ctbRsX, ctbRsY.
[0235] Furthermore, initialize the position offset of the current block CB within the current CTB. offsetLCBY = yTbCmp - ctbRsY, offsetLCBX = xTbCmp - ctbRsX.
[0236] Furthermore, initialize iTemplateSizeH= templateH_size and iTemplateSizeW= templateW_size.
[0237] Furthermore, iBvShift is initialized, and iBvShift is the precision of the vector parameter BV. For example, the precision of BV may be an integer sample precision, where iBvShift is 0, and the precision of BV may be a subsample precision, for example, when iBvShift is 1, it represents 1 / 2 sample precision, and when iBvShift is 2, it represents 1 / 4 sample precision, but is not specifically limited thereto.
[0238] Furthermore, the pre-configured search range of the template is initialized, and the pre-configured search range of the template may be set to a fixed size, or the search range may be dynamically adjusted according to the size of the current block. For example, searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR ×nTbW, searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR ×nTbH; where the value of TMP_SEARCH_RANGE_MULT_FACTOR may be a pre-configured value, may be indicated by bit stream syntax elements, and may also be adaptively adjusted according to information such as the size of the current block, for example, set to 5.
[0239] It is further understandable that, in an embodiment of the present application, the first search area may include a first type of search area and / or a second type of search area. Here, the first type of search area is a rectangular search area around the current block; and the second type of search area is an area pointed to by a vector parameter corresponding to a preset search position where the current block is located and an area pointed to by automatic relocation.
[0240] Here, the search area of the first type includes a total reconstruction area and / or a pending reconstruction area. Here, the sampling points within the total reconstruction area are all reconstructed sampling points; and the sampling points within the pending reconstruction area include reconstructed sampling points and / or unreconstructed sampling points.
[0241] That is, in an embodiment of the present application, the first search area can be divided into two parts.
[0242] One is a surrounding rectangular search area, which can be divided into two types: one is determined to have all sampling points within the area reconstructed (referred to as the total reconstructed area), for example, including four areas R1 to R4 in FIG. 6; and the other is uncertain whether all sampling points within the area have been reconstructed (referred to as the pending reconstructed area), for example, including two areas R5 to R6 in FIG. 6.
[0243] One is an extended search area, defined as the area pointed to by the BV corresponding to spatially adjacent and non-adjacent location PUs, and in the embodiment corresponding to FIG. 6, said area may be considered as R7; and the area pointed to by automatic relocation may be considered as R8. Since search points in R7 and / or R8 may not necessarily be adjacent to each other, the search for the R7 and / or R8 areas is performed progressively along the list.
[0244] In some embodiments, the step of determining a first candidate list of the current block according to a first search area may include: a step of determining one or more first candidate vector parameters by performing a search within the first search area according to a first search step length; and a step of adding one or more first candidate vector parameters to the first candidate list of the current block.
[0245] In a specific embodiment, the step of performing a search within a first search area according to a first search step length to determine one or more first candidate vector parameters may include: a step of iterating through search points within the first search area according to a first search step length and determining a first matching cost value between a matching template corresponding to a search point within the first search area and a first template according to a preset matching criterion; and a step of determining one or more matching search points according to the first matching cost value and determining one or more first candidate vector parameters according to the one or more matching search points.
[0246] It needs to be explained that, in an embodiment of the present application, the first search step length may be set to 3, and the first candidate list obtained therefrom may be referred to as an initial approximate search list.
[0247] Further explanation is that, in the embodiments of the present application, the preset matching criteria may include any one of the sum of absolute errors SAD, sum of transformed absolute errors SATD, sum of squared differences SSE, mean absolute deviation value MAD, mean absolute error MAE, mean squared error MSE, and normalized correlation coefficient NCC.
[0248] In a possible implementation method, when iterating through search points in the first search area, specifically the following may be included.
[0249] For the entire reconstruction area (e.g., corresponding to the four areas R1 to R4 in Fig. 6), a matching reconstruction block of one current block in the reconstruction area can be found through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0250] For pending reconstruction areas (e.g., corresponding to the two areas R5–R6 in Fig. 6), availability is determined through search points (iPosHor, iPoxVer) within each search area, i.e., each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and
[0251] If available, a matching reconstruction block for a single current block can be found in the reconstruction area, and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0252] If unavailable, template matching cost calculation is not performed.
[0253] Here, the determination of availability includes, but is not limited to, the simultaneous satisfaction of one or more of the following conditions, and
[0254] ● Each sampling point within the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0255] ● Each sampling point within the reconstruction block corresponding to the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0256] ● Each sampling point within the template and each sampling point within the corresponding reconstruction block do not exceed the defined range of the search window;
[0257] ● Whether each sampling point within the template is on the same Tile as the current encoding area;
[0258] ● Whether each sampling point within the reconstruction block corresponding to the template is on the same Tile as the current encoding area;
[0259] ● All sampling points within the template are reconstructed;
[0260] ● Each sampling point within the reconstruction block corresponding to the template is not located in the current encoding area;
[0261] ● All sampling points within the reconstruction block corresponding to the template are reconstructed;
[0262] All available search points in all search ranges (regionId=0, 1, 2, 3, 4, 5) are iterated through to obtain the 30 search points with the smallest matching cost pDiff, the corresponding matching cost is denoted as pDiff_BEST[n], where n=0,…,29, the corresponding block vector BV is denoted as the optimal block vector BV_BEST[n], where each item is a single coordinate pair (pX_BEST, pY_BEST), where n=0,…,29, and the corresponding matching template is the optimal matching template T_BEST[n], where n=0,…,29.
[0263] Thus, in an embodiment of the present application, if the first search step length is 3, a search is performed within the first search area with a step length of 3. For example, within each area, pX is located between bvXMinsregionId and bvXMaxsregionId, and pY is located within the search range between bvYMinsregionId and bvYMaxsregionId. After performing an approximate search with a step length of 3, the preceding P optimal matching costs obtained by template matching are recorded as pDiff1_BEST[p], where p=0,…,P-1, and the corresponding block vector BV is represented as the optimal block vector BV1_BEST[p], where p=0,…,P-1. Here, P may be 1 or an integer value greater than 1 depending on demand, and the search area where the optimal matching search point is located is bestRegionId[p], where p=0,…,P-1. In this way, a first candidate list can be constructed according to P optimal block vectors BV1_BEST[p].
[0264] In step S1502, a second location block is determined according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first location block of the current block.
[0265] In step S1503, when the decoding parameter of the second position block includes a vector parameter, it is determined whether the vector parameter of the second position block satisfies the second condition according to the vector parameter of the second position block.
[0266] It should be explained that, in an embodiment of the present application, the first location block of the current block may include blocks of spatially adjacent locations and / or non-adjacent locations. Additionally, the number of first location blocks may be one or a plurality.
[0267] For example, for one or more predefined first location blocks, the predefined search locations may use, for instance, five spatially adjacent locations of the current block, left (xTbCmp-1, yTbCmp+nTbH-1), top-left (xTbCmp-1, yTbCmp-1), top (xTbCmp+nTbW-1, yTbCmp-1), top-right (xTbCmp+nTbW, yTbCmp-1), bottom-left (xTbCmp-1, yTbCmp+nTbH), and 18 spatially non-adjacent locations (specifically as shown in FIG. 9).
[0268] Further explanation is that, in an embodiment of the present application, the step of determining a second position block may include: determining a second position block according to a candidate vector parameter among a first candidate list; and / or determining a second position block according to a vector parameter of a first position block of the current block.
[0269] That is, in the embodiments of the present application, a second position block may be determined according to a candidate vector parameter in a first candidate list, or a second position block may be determined according to a vector parameter of a first position block, or a second position block may be determined according to the common vector parameter of a candidate vector parameter in a first candidate list and a vector parameter of a first position block, and is not specifically limited thereto.
[0270] In some embodiments, when determining a second position block according to a vector parameter of a first position block of a current block, the method may further include: a step of determining whether a vector parameter of a first position block satisfies a first condition according to a vector parameter of a first position block when a decoding parameter of a first position block of a current block includes a vector parameter; and a step of determining a second position block according to a vector parameter of a first position block when a vector parameter of a first position block satisfies the first condition.
[0271] It needs to be explained 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 technique (i.e., IBC / IntraTMP), it can be determined that the decoding parameter of the first position block of the current block includes the vector parameter.
[0272] Further to be explained, in an embodiment of the present application, the first condition may include that the cost value corresponding to the vector parameter of the first location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list. That is, if the cost value corresponding to the vector parameter of the first location block is superior to 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 location block satisfies the first condition.
[0273] In some embodiments, regarding the step of determining that a vector parameter of a first location block satisfies a first condition, the method may further include: a step of determining a cost value corresponding to a vector parameter of a first location block according to a matching cost value between a matching template corresponding to a vector parameter of a first location block and a first template; a step of determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and a first template; and a step of determining that a vector parameter of a first location block satisfies a first condition if the cost value corresponding to a vector parameter of a first location block is smaller than the cost value corresponding to at least one candidate vector parameter of a first candidate list.
[0274] What needs to be further explained is that in an embodiment of the present application, the method further includes the step of updating a first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition.
[0275] In a specific embodiment, the step of updating the first candidate list according to the vector parameter of the first position block may include the step of adding the vector parameter of the first position block to the first candidate list.
[0276] That is, if the vector parameter of the first position block satisfies the first condition, the first candidate list can be updated using the vector parameter of the first position block. For example, the vector parameter of the first position block is added to the first candidate list according to the magnitude of the cost value, and the item with the largest cost value among the first candidate list is deleted to obtain the first candidate list after the update.
[0277] To further explain, in an embodiment of the present application, the method further includes the step of determining the search region where the vector parameter of the first location block is located as R6, that is, setting the value of bestRegionId to 6.
[0278] Further explanation is that in an embodiment of the present application, during the update process, first, it is checked whether the PU corresponding to the predefined search location uses IntraTMP / IBC technology, that is, whether the decoding parameter of the PU corresponding to the predefined search location includes a vector parameter; if it includes a vector parameter, the BV of this PU is determined, and then an update is performed on the first candidate list using this BV. The specific operation of the update is to sequentially access each item of the first candidate list, 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 smaller than the maximum cost value of the first candidate list, replace this BV with the least inferior BV of the first candidate list. For example, the specific operation may be to insert this BV into the first candidate list in order of cost size and delete the item with the largest cost among the first candidate list. Then, the value of the search region bestRegionId is set to 6.
[0279] It can be understood that the number of second position blocks can be one or multiple.
[0280] To further explain, the second location block represents the reference block pointed to by the vector parameter of the first location block. Alternatively, the second location block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first location block.
[0281] Further explanation is that in the embodiments of the present application, vector parameters are still exemplified as BV, and if the second position block uses a BV-based prediction technique (i.e., IBC / IntraTMP), it can be determined that the decoding parameters of the second position block include vector parameters.
[0282] For example, for a second location block, the vector parameters of the first location block are used as the current BV, and first, multiple candidate locations of the current block are determined, for example, five locations, center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), top-left (xTbCmp, yTbCmp), top-right (xTbCmp+nTbW-1, yTbCmp), bottom-left (xTbCmp, yTbCmp+nTbH-1), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). Next, the current BV is added to the coordinates of these five candidate locations, and then the corresponding PU is checked whether it uses a BV-based prediction mode (i.e., IBC / IntraTMP). When used, the newly obtained BV is considered as the current BV, and the above operation is repeated to determine the vector parameter of the second location block (which may be referred to as the “extended BV”). In other words, in an embodiment of the present application, the extended BV may 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, etc.
[0283] In some embodiments, the second condition may include that the cost value corresponding to the vector parameter of the second location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list. That is, if the cost value corresponding to the vector parameter of the second location block is superior to 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 location block satisfies the second condition.
[0284] What needs to be further explained is that, in an embodiment of the present application, the method further comprises: a step of determining a cost value corresponding to a vector parameter of a second position block according to a matching cost value between a matching template corresponding to a vector parameter of a second position block and a first template; a step of determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and a first template; and a step of determining that the vector parameter of a second position block satisfies a second condition if the cost value corresponding to a vector parameter of a second position block is smaller than the cost value corresponding to at least one candidate vector parameter of a first candidate list.
[0285] In step S1504, when the vector parameter of the second position block satisfies the second condition, the first candidate list is updated according to the vector parameter of the second position block.
[0286] It should be explained that, in an embodiment of the present application, regarding the vector parameters of the second position block, the vector parameters of the second position block may be one or a plurality of. Here, determining the vector parameters of the second position block may be stopped when all vector parameters of the first position block have been completely traversed, or when the number of vector parameters of the second position block obtained is greater than a first threshold value.
[0287] Further explanation is that in the embodiments of the present application, the first threshold value may be represented as V. For example, the value of V may be 15, but may be other numeric values, such as 1, 2, 5, 10, etc., and is not specifically limited here.
[0288] In some embodiments, the step of updating the first candidate list according to the vector parameter of the second position block may include the step of adding the vector parameter of the second position block to the first candidate list.
[0289] That is, if the vector parameter of the second location block satisfies the second condition, the first candidate list can be updated using the vector parameter of the second location block. For example, the vector parameter of the second location block is added to the first candidate list according to the magnitude of the cost value, and the item with the largest cost value among the first candidate list is deleted to obtain the first candidate list after the update.
[0290] In some embodiments, the method further includes the step of determining the search region where the vector parameter of the second location block is located as R7, that is, setting the value of bestRegionId to 7.
[0291] What needs to be explained is that, in the embodiment of the present application, for the vector parameters of the first position block obtained, first, for each current BV, five positions of the current block are determined: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), top-left (xTbCmp, yTbCmp), top-right (xTbCmp+nTbW-1, yTbCmp), bottom-left (xTbCmp, yTbCmp+nTbH-1), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). After adding the current BV to these five position coordinates, the corresponding PU is checked whether it uses a BV-based prediction technique (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., adding the vertical and horizontal components respectively) is denoted as BV', and the next BV' is considered as the current BV, and the above operation is repeated for this BV' to continue determining available options for the extended BV; if not used, the next position is examined. The above operation is repeated until all 5 positions are examined or the number of determined extended BVs is greater than V, and the determination of the vector parameters of the second position block is stopped.
[0292] To further explain, after obtaining multiple extended BVs, an additional update is performed on the first candidate list. The specific operation of the update involves calculating the corresponding template matching cost for each of the multiple extended BVs, comparing this cost with the template matching cost of the BVs in the first candidate list, and if it is smaller than the maximum template matching cost in the first candidate list, replacing this BV with an inferior BV in the first candidate list. The specific replacement operation involves, for example, inserting this BV into the first candidate list in order of cost size and deleting the item with the largest cost in the first candidate list after the update. The value of the search region bestRegionId where the newly inserted BV in the first candidate list is located is set to 7.
[0293] That is, in an embodiment of the present application, if the BV of a first location block (a spatially adjacent location and / or non-adjacent location of the current block) is better than at least one BV of a first candidate list (first condition), the block pointed to by the BV of the first location block is examined, and if a BV exists in the block pointed to by the BV of the first location block, it is determined whether to add said BV to the first candidate list (second condition). At the same time, another feature of an embodiment of the present application is that the first location block contributes two candidate BVs to the first candidate list (adding one BV when the first condition is satisfied and adding another BV when the second condition is satisfied) to obtain the first candidate list after updating (i.e., the final approximate search list).
[0294] In step S1505, the predicted value of the current block is determined according to the first candidate list after the update.
[0295] It should be explained that, in the embodiments of the present application, after obtaining a final approximate search list, a detailed search can be performed on said approximate search list. That is, the search process of the embodiments of the present application may involve first performing an approximate search and then performing a detailed search.
[0296] In some embodiments, the step of determining the predicted value of the current block according to the first candidate list after updating may include the step of determining the vector parameters of the current block based on the first candidate list after updating; and the step of determining the predicted value of the current block according to the vector parameters of the current block.
[0297] In a specific embodiment, the step of determining the vector parameter of the current block based on the first candidate list after updating may include: determining a second search area indicated by the candidate vector parameter in the first candidate list after updating; and performing a search within the second search area according to the second search step length to determine the vector parameter of the current block, wherein the value of the second search step length is smaller than the value of the first search step length.
[0298] It should be explained that, in the embodiments of the present application, the second search step length may be 1, but may be another value. Here, the second search step length must be smaller than the value of the first search step length of the approximate search step.
[0299] For example, the optimal block vector BV1_BEST[p], p=0,…,M-1 obtained from the first candidate list after updating is used as a fine-grained search reference point to perform a search in the surrounding area.
[0300] For each fine search reference point, first, the fine search ranges TmpRefineRangeHor and TmpRefineRangeVer are determined, and the fine search range (second search area) may be of a fixed size and is related to the search area; for example, for a reference point with a search area of 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 1; for a reference point with a search area of 6, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 2. Next, the location of the optimal matching reconstruction block obtained by the approximate search is calculated and used as the reference location of the fine search area, BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.
[0301] Using a direct search window, the fine-grained search area is treated as a single entire pending reconstruction area and traversed directly.
[0302] A new search range is obtained based on the optimal matching block location obtained through approximate search, and
[0303] iHorMax refine = min(picWidth - nTbW, BestPosX + TmpRefineRangeHor);
[0304] iHorMin refine = max( iTemplateSizeW, BestPosX - TmpRefineRangeHor);
[0305] iVerMax refine = min(picHeight - nTbH, BestPosY + TmpRefineRangeVer);
[0306] iVerMin refine = max( iTemplateSizeH, BestPosY - TmpRefineRangeVer ); exists, and
[0307] Next, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs are iVerMin refine , iVerMax refine , iHorMin refine , iHorMax refine It can be calculated through,
[0308] bvXMins = iHorMin refine - xTbCmp;
[0309] bvXMaxs = iHorMax refine - xTbCmp;
[0310] bvYMins = iVerMin refine - yTbCmp;
[0311] bvYMaxs = iVerMax refine - yTbCmp;
[0312] Fine-grained search is pX bvXMins refine and bvXMaxs refine Located between, and pY is bvYMins refine and bvYMaxs refine It is performed within the range of block vectors located between them; that is, it traverses all search locations within the direct fine-grained search window and sequentially determines availability. For example, a search is performed with a second search step length of 1, and the preceding T optimal matching costs obtained by template matching of available points are recorded as pDiff_BEST[t], where t=0,…,T-1, and the corresponding block vector BV is represented as the optimal block vector BV_BEST[t], where t=0,…,T-1. Here, T is 1 or an integer greater than 1. For example, the value T=1.
[0313] After completing the above operations, the results of the approximate search and detailed search processes (where the detailed search 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). Here, pX_BEST and pY_BEST are the horizontal offset and vertical offset of the optimal matching template with respect to the current block template, respectively, and also the horizontal offset and vertical offset of the optimal matching reconstruction block with respect to the current block. In this way, the vector parameters of the current block can be obtained.
[0314] In some embodiments, the step of determining the vector parameters of the current block by performing a search within a second search area according to the second search step length may include the step of determining the vector parameters of the current block by performing a subsample search within the second search area according to the second search step length. That is, a subsample search can be implemented in a fine-grained search step.
[0315] It is further explained that in the embodiments of the present application, the vector parameters of the current block may be one or multiple. Here, if the vector parameters of the current block are multiple, a predicted value of the current block can be obtained by performing weighted fusion using the positions corresponding to the multiple BVs.
[0316] In some embodiments, when the vector parameter of the current block is one, the step of determining the predicted value of the current block according to the vector parameter of the current block may include: the step of determining the reference block of the current block according to the vector parameter of the current block; and the step of determining the predicted value of the current block according to the reference block.
[0317] For example, in an embodiment of the present application, when determining the reference block of the current block, it can be implemented using a simple translational copy. The specific operation is as follows: for x=0…nTbW-1, y=0…nTbH-1, RefBlock n [x][y] = recSamples[x + pX n ][y + pY n It is to determine the reconstruction samples recSamples of the current frame (i.e., the reference block of the current block) through ].
[0318] It should be explained that, in an embodiment of the present application, when determining the reference block of the current block according to the vector parameters of the current block, the initial reconstruction block of the current block may be determined first according to the vector parameters of the current block; and then a modification process may be performed on the initial reconstruction block to determine the reference block of the current block. Alternatively, filtering may be performed on the reference block to determine the reference block after filtering; and the predicted value of the current block may be determined according to the reference block after filtering.
[0319] It is further explained that in the embodiments of the present application, the predicted value determined through the vector parameters of the current block can be used as the final predicted value, and additionally, the final predicted value of the current block can be determined by performing a modification process (e.g., clip operation).
[0320] In some embodiments, when determining a predicted value of a current block according to a reference block, the method may include: a step of determining a first predicted block of the current block according to the reference block; a step of determining a second predicted block of the current block by performing a prediction on the current block according to a first prediction mode, wherein the first prediction mode is a non-intra template matching prediction mode; and a step of determining a predicted value of the current block according to the first predicted block and the second predicted block.
[0321] It should be explained that, in the embodiments of the present application, the first prediction mode may be a prediction mode different from the intra-template matching prediction mode used by the current block, for example, a PLANAR mode, a CCLM mode, an angle prediction mode, etc. Here, weighted fusion can be performed on the first prediction block and the second prediction block to determine the predicted value of the current block.
[0322] That is, in an embodiment of the present application, when determining the predicted value of the current block, modifications to the predicted value may be performed through a local filtering method, or modifications to the predicted value may be performed through weighting of multiple predicted values.
[0323] In some embodiments, when there are multiple vector parameters of the current block, the step of determining the predicted value of the current block according to the vector parameters of the current block may include: the step of determining multiple reference blocks of the current block according to the multiple vector parameters of the current block; and the step of determining the predicted value of the current block according to the multiple reference blocks.
[0324] Further to be explained, in an embodiment of the present application, the step of determining a predicted value of a current block according to a plurality of reference blocks may include: a step of determining a plurality of predicted blocks of a current block according to a plurality of reference blocks; and a step of determining a predicted value of a current block by performing weighted fusion on a plurality of predicted blocks.
[0325] It is understandable that in IntraTMP mode, in addition to obtaining predicted values using the basic copying method, there exist methods for obtaining predicted values by performing filtering fusion using locations corresponding to multiple BVs, as well as methods for fusion prediction with general Intra mode.
[0326] In some embodiments, the step of determining a predicted value of a current block according to a vector parameter of a current block may further include: a step of decoding a bit stream to determine the value of a first syntax element; a step of determining a method for constructing a predicted value of a current block according to the value of the first syntax element and a candidate list for constructing a predicted value of a current block; and a step of determining a predicted value of a current block according to a vector parameter of a current block and a method for constructing a predicted value.
[0327] That is, when determining the predicted value of the current block, a list of candidate prediction values is determined through various single predicted values, predicted values after filtering, predicted values after weighting, and / or methods for constructing these predicted values, and a syntax element transmitted through a bit stream can determine at the decoding end which of the candidate list of prediction values will be used to obtain the actual predicted value.
[0328] In some embodiments, the method further comprises the step of decoding a bit stream to determine the value of a second syntax element; and the step of determining a first candidate list of the current block when the second syntax element indicates that the current block uses an intra-template matching prediction mode.
[0329] It should be explained that, in an embodiment of the present application, the value of the first syntax element is to indicate the index number in the prediction value construction candidate list of the current block's prediction value construction method, and the value of the second syntax element is to indicate whether the current block uses an intra-template matching prediction mode.
[0330] What needs to be explained is 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 an intra-template matching prediction mode; and if the value of the second syntax element is a second preset value, it is determined that the current block does not use an intra-template matching prediction mode.
[0331] In an embodiment of the present application, the first preset value and the second preset value are different. Here, 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.
[0332] 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, the second syntax element indicates that the current block is using an intra-template matching prediction mode, and the decoding method illustrated in FIG. 15 is executed. That is, the method of the embodiment of the present application is applied to an intra-template matching prediction mode.
[0333] Furthermore, in an embodiment of the present application, after determining a predicted value of the current block based on the vector parameters of the current block, a reconstruction value of the current block can be additionally determined based on the predicted value of the current block.
[0334] In some embodiments, the method further comprises the steps of: decoding a bit stream to determine a predicted difference value (residual) of the current block; and determining a reconstruction value of the current block according to the predicted difference value and the predicted value of the current block.
[0335] Further explanation is that in an embodiment of the present application, reconstruction of the current block is implemented by determining the reconstruction value of the current block by adding the predicted difference value and the predicted value of the current block.
[0336] It is further explained that in the embodiments of the present application, the search is not distinguished into approximate and detailed search steps, but only a one-time search is performed, and then the BV option is expanded based on the one-time search results to obtain the final vector parameters; and the predicted value of the current block is determined according to the final vector parameters.
[0337] To further explain, in IntraTMP mode, in addition to obtaining predicted values using the basic copy method, there are methods to obtain predicted values by fusing locations corresponding to multiple BVs, methods to perform filtering on reference blocks corresponding to BVs and then copying, and methods to interpolate the corresponding reference blocks using BVs as subsamples and then copy. For example, during the decoding end region search process, a list of BV candidates is obtained using template matching, and then the first N items (e.g., N=3) are selected to perform weighted fusion. This method may be referred to as IntraTMP Fusion mode. Alternatively, after obtaining a single optimal BV, multiple points are taken around the BV, and weighted fusion is performed on the predicted values corresponding to the multiple points to obtain the predicted value. This method may be referred to as IntraTMP FLM mode. Alternatively, after obtaining a single optimal BV, a sequence arrangement is performed on the template with subsample precision to select the optimal direction and precision, and a predicted value is calculated using an interpolation filter; the above method may be referred to as the IntraTMP SubPel mode. It is not specifically limited thereto.
[0338] An embodiment of the present application provides a decoding method, specifically a method for expanding the coverage range of an Intra TMP search list. First, a first candidate list of the current block is determined, wherein the first candidate list includes one or more candidate vector parameters. Next, a second location block is determined according to at least one of the candidate vector parameters in the first candidate list and the vector parameters of the first location block of the current block. When the decoding parameter of the second location block includes the vector parameters, whether the vector parameters of the second location block satisfy a second condition is determined according to the vector parameters of the second location block. When the vector parameters of the second location block satisfy the second condition, the first candidate list is updated according to the vector parameters of the second location block. Finally, the predicted value of the current block is determined according to the first candidate list after the update. In this way, when updating the first candidate list, the vector information of some second location blocks can be expanded according to the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first location block (spatially adjacent and non-adjacent blocks of the current block), and the first candidate list can be supplemented according to the expanded vector information, thereby effectively utilizing the reconstructed information of spatially adjacent and non-adjacent blocks. Furthermore, under the premise of guaranteeing encoding complexity, candidate vector information can be inferred based on the vector information of these reconstructed blocks, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, and further saving bit rates, thereby enhancing encoding and decoding efficiency and improving encoding and decoding performance.
[0339] In another embodiment of the present application, based on the decoding method of the above-described embodiment, FIG. 16 is a flowchart 2 of the decoding method provided in an embodiment of the present application. As illustrated in FIG. 16, the decoding method may include the following steps.
[0340] In step S1601, the first candidate list of the current block is determined.
[0341] What needs to be explained is that in an embodiment of the present application, a first template of the current block is determined first, and then a first search area of the current block is determined according to the first template, and then a search is performed within the first search area according to the next step length 3 to construct an initial approximate search list (i.e., a first candidate list). Here, the first candidate list may include one or more candidate vector parameters.
[0342] In step S1602, if the decoding parameter of the first position block of the current block includes a vector parameter, it is determined whether the vector parameter of the first position block satisfies the first condition according to the vector parameter of the first position block.
[0343] In step S1603, if the vector parameter of the first position block satisfies the first condition, the first candidate set of the current block is determined according to the vector parameter of the first position block, and the first candidate list is updated according to the first candidate set.
[0344] It is further explained that, in an embodiment of the present application, the first location block of the current block may include blocks of spatially adjacent locations and / or non-adjacent locations. Additionally, the number of first location blocks may be one or a plurality.
[0345] For example, for one or more predefined first location blocks, the predefined search locations may use, for instance, five spatially adjacent locations of the current block, left (xTbCmp-1, yTbCmp+nTbH-1), top-left (xTbCmp-1, yTbCmp-1), top (xTbCmp+nTbW-1, yTbCmp-1), top-right (xTbCmp+nTbW, yTbCmp-1), bottom-left (xTbCmp-1, yTbCmp+nTbH), and 18 spatially non-adjacent locations (specifically as shown in FIG. 9).
[0346] It is further explained that, in an embodiment of the present application, the first candidate set may be represented as IntraTMP_Merge. In some embodiments, the step of updating the first candidate list according to 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, if the cost value corresponding to the second candidate vector parameter is smaller 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. Here, the second candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0347] In a specific embodiment, the step of replacing the candidate vector parameter corresponding to the maximum cost value among the first candidate list using the second candidate vector parameter may include the step of 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 after the update.
[0348] For example, in an embodiment of the present application, regarding the process of constructing the IntraTMP_Merge set (or IntraTMP_Merge list), specifically, it may involve checking whether the PU corresponding to such a location uses IntraTMP / IBC technology, and if it does, storing the BV of this PU in the IntraTMP_Merge set. After constructing the IntraTMP_Merge set, an update is performed on the first candidate list according to the IntraTMP_Merge set. The specific operation of the update is to sequentially access each item of the IntraTMP_Merge set, 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 smaller than the maximum template matching cost of the first candidate list, replace this BV with the least expensive BV of the first candidate list. The specific operation is, for example, to 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 after the update. Then, set the search area bestRegionId to 6.
[0349] In step S1604, if the vector parameter of the second location block satisfies the second condition, the second candidate set of the current block is determined according to the vector parameter of the second location block, and the first candidate list is updated according to the second candidate set.
[0350] It should be explained that, in an embodiment of the present application, after updating a first candidate list according to a first candidate set, a second location block can be determined according to at least some of the candidate vector parameters in the first candidate list after the update. Additionally, if the vector parameters of the second location block satisfy a second condition, a second candidate set of the current block is constructed according to the vector parameters of the second location block.
[0351] In a possible implementation, at least some of the candidate vector parameters in the first candidate list after the update may be one or more second candidate vector parameters updated in the first candidate list by the first candidate set. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include: determining one or more second candidate vector parameters updated in the first candidate list by the first candidate set; and determining a second location block according to one or more second candidate vector parameters, and determining a second candidate set of the current block according to the vector parameters of the second location block.
[0352] In other possible implementations, at least some of the candidate vector parameters of the first candidate list after the update may be all of the candidate vector parameters of the first candidate list after the update. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include the step of updating the first candidate list according to the first candidate set, determining a second location block according to all of the candidate vector parameters of the first candidate list after the update, and determining a second candidate set of the current block according to the vector parameters of the second location block.
[0353] In other possible implementations, at least some of the candidate vector parameters in the first candidate list after the update may be a predetermined number of candidate vector parameters in the first candidate list after the update. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include: a step of determining the first candidate list after the first candidate set, and then determining the first N candidate vector parameters in the first candidate list after the update; and a step of determining a second location block according to the N candidate vector parameters and determining a second candidate set of the current block according to the vector parameters of the second location block, wherein N is a positive integer.
[0354] It should be explained that, in an embodiment of the present application, the method further includes the step of determining a value of N according to the size parameter of the current block. That is, the number of checks can be limited according to the size of the current block, and, for example, the first 5 are checked for a current block with a size smaller than or equal to 16x16, and the first 10 are checked for other sizes.
[0355] In another possible implementation method, the step of determining a second set of candidates for the current block may include: updating a first list of candidates according to a first set of candidates, performing clustering on the first list of candidates after the update to determine M candidate vector parameters located at the clustering center; and determining a second location block according to the M candidate vector parameters, and determining a second set of candidates for the current block according to the vector parameters of the second location block, wherein M is a positive integer.
[0356] It is further explained that, in the embodiments of the present application, the second candidate set may be represented as IntraTMP_EBVP. For the construction of the IntraTMP_EBVP set (or IntraTMP_EBVP list), inspection may be performed only on all BVs that have been replaced by the first candidate list by the IntraTMP_Merge set. Additionally, EBVP-based updates may be performed on all options of the first candidate list after the update.
[0357] Additionally, in an embodiment of the present application, adjustments may be made to the BV objects to be examined in the IntraTMP_EBVP set and the number thereof. For example, the first 5 of the corresponding BV set may be examined, or the first 10 of the corresponding BV set may be examined. Alternatively, the number of examinations may be limited according to the size of the current block, for example, the first 5 may be examined for CUs with a size less than or equal to 16x16, and the first 10 may be examined for other sizes. Alternatively, clustering may be performed on the first candidate list after the update, and the clustering rule is the geometric distance to reach the clustering center. The number of clustering centers is 2 to 5, for example, EBVP operations are performed only on the clustering centers.
[0358] In another possible implementation, a second candidate set may not be constructed further. The method further includes the steps of: filling the first candidate set with vector parameters of the second position block until the first candidate set is filled when the first candidate set of the current block is not filled; and updating the first candidate list according to the first candidate set after filling.
[0359] That is, in an embodiment of the present application, BVs of EBVPs are also added to the IntraTMP_Merge set until the IntraTMP_Merge set is filled, and then updates are performed on the first candidate list with this IntraTMP_Merge set, that is, the number is limited to the number of unfilled items in the IntraTMP_Merge set.
[0360] For example, in an embodiment of the present application, after updating a first candidate list according to an IntraTMP_Merge set, for each BV inserted into the first candidate list from an IntraTMP_Merge set, a set of IntraTMP_EBVP is constructed and the first candidate list is updated again according to said list, and
[0361] First, for each current BV, a corresponding set of IntraTMP_EBVP is constructed from scratch. The five locations 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), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1) are determined, and after adding the current BV to these five location coordinates, the corresponding PU is checked whether it uses a BV-based prediction technique (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., adding the vertical and horizontal components respectively) is denoted as BV' and added to the TMP_EBVP set; then, the next BV' is considered as the current BV, and the above operation is repeated for this BV' to continuously build the available options in the TMP_EBVP set; if not used, the next position is checked.
[0362] In some embodiments, the method further includes the step of determining the completion of construction of a third candidate set when all vector parameters of a second location block are completely traversed or when the number of candidate vector parameters in a second candidate set is greater than a first threshold.
[0363] It should be explained that, in an embodiment of the present application, the first threshold value may be represented as V, or the length of the second candidate set is V. For example, the value of V may be 15. Alternatively, the length V of the IntraTMP_EBVP set may be set to a different value, for example, the value of V is set to 1, 2, 5, or 10.
[0364] In this way, the construction of the current IntraTMP_EBVP set is completed by repeating the above operation until all 5 locations are inspected or until the number of IntraTMP_EBVP sets being built is greater than V.
[0365] In some embodiments, after constructing a second candidate set, the method further comprises the steps of: determining a second matching cost value between a first template and a matching template corresponding to a third candidate vector parameter among the second candidate set according to a preset matching criterion; and updating the second candidate set by deleting the third candidate vector parameter from the second candidate set when the second matching cost value is greater than a second threshold value. Here, the third candidate vector parameter is a vector parameter of any one of the second candidate sets.
[0366] That is, in an embodiment of the present application, the BV can be limited according to a template cost (e.g., SAD, SATD, etc.) corresponding to the BV, and for each BV in the second candidate set, the template cost is first calculated to limit one cost threshold, and the BVs that do not exceed the threshold are added again to the IntraTMP_EBVP set to obtain the final second candidate set.
[0367] In some embodiments, the step of updating a first candidate list according to a 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, if the cost value corresponding to the third candidate vector parameter is smaller 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. Here, the third candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0368] In a specific embodiment, the step of replacing the candidate vector parameter corresponding to the maximum cost value among the first candidate list using the second candidate vector parameter may include the step of 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 after the update.
[0369] For example, in an embodiment of the present application, after the current IntraTMP_EBVP set is completed, an update is performed on the first candidate list. The specific operation of the update is to sequentially access each BV of the IntraTMP_EBVP set, 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 smaller than the maximum template matching cost of the first candidate list, replace this BV with the least effective BV in the first candidate list. The specific replacement operation is, for example, to 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 after the update. The search region bestRegionId where the newly inserted BV in the first candidate list is located is set to 7.
[0370] It is further explained that in the embodiments of the present application, the IntraTMP_Merge set may not be used here, that is, the extension is performed based on the BV obtained by searching directly within the search window in IntraTMP.
[0371] It is further explained that in the embodiments of the present application, the search may not be distinguished into approximate and detailed search steps, but merely a one-time search is performed, and then the BV options are expanded based on the one-time search results to obtain the final BV result.
[0372] In some embodiments, for updating the first candidate list, the method further comprises the steps of: determining the first K candidate vector parameters in the first set of candidates; and updating the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.
[0373] That is, in an embodiment of the present application, the IntraTMP_Merge set updates the approximate search list by taking only the first K (e.g., K can take 5) and performs expansion only on the basis of each BV of the IntraTMP_Merge set.
[0374] In some embodiments, for updating a first candidate list, the method further comprises: determining the first P candidate vector parameters among the first candidate set; determining a second location block according to the P candidate vector parameters and determining the vector parameters of the second location block; if the vector parameters of the second location block satisfy a second condition, constructing a fourth candidate set of the current block according to the vector parameters of the second location block, and determining the completion of constructing the fourth candidate set when all P candidate vector parameters are traversed or the fourth candidate set is filled; determining cost values corresponding to one or more candidate vector parameters among the fourth candidate set and determining Q candidate vector parameters from the fourth candidate set according to the cost values corresponding to one or more candidate vector parameters; and updating the first candidate list according to the Q candidate vector parameters, wherein P and Q are positive integers.
[0375] That is, in an embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP may be used together to maintain a single Merge set or list. For example, first, the first P BVs (e.g., P can take 5) of the IntraTMP_Merge set are taken, and an IntraTMP_EBVP expansion is performed based on these P BVs to construct a new Merge set of length L (e.g., L can take 28). After the expanded BVs fill the new Merge set or the expansion of all P BVs is completed, the cost of each BV of the new Merge set is calculated and the order is arranged, and then the first Q (e.g., Q can take 5) of the arranged list are taken and an update is performed on the first candidate list.
[0376] In step S1605, the predicted value of the current block is determined according to the first candidate list after the update.
[0377] It should be explained that in the embodiments of the present application, after obtaining a final approximate search list, a detailed search can be performed on said approximate search list. That is, the search process of the embodiments of the present application may first perform an approximate search and then perform a detailed search. Here, after obtaining a first candidate list, a search is performed around the optimal block vector BV1_BEST[p], p=0,…,M-1 obtained from the first candidate list after updating, using the detailed search reference point. Specifically, a second search area indicated by the candidate vector parameter in the first candidate list after updating is determined, and a search is performed within the second search area according to the second search step length to determine the vector parameter of the current block, wherein the value of the second search step length is smaller than the value of the first search step length of the approximate search step. For example, assuming the second search step length is 1, a detailed search is performed around the first search list with a step length of 1 to determine the vector parameter of the current block.
[0378] It is further explained that in an embodiment of the present application, a plurality of reference blocks of the current block are determined according to the vector parameters of the current block, and a predicted value of the current block can be determined according to the plurality of reference blocks. Specifically, a plurality of prediction blocks of the current block are determined according to the plurality of reference blocks, and weighted fusion is performed on the plurality of prediction blocks to determine the predicted value of the current block.
[0379] An embodiment of the present application provides a decoding method, specifically a method for expanding the coverage range of an Intra TMP search list. By utilizing information on spatially adjacent and non-adjacent reconstructed blocks and expanding the search area range of Intra TMP under the premise that encoding complexity is not significantly increased, the accuracy of prediction can be improved, bit rates can be further saved, and encoding and decoding efficiency can be improved, thereby enhancing encoding and decoding performance.
[0380] In another embodiment of the present application, FIG. 17 is a flowchart 1 of an encoding method provided in an embodiment of the present application. As illustrated in FIG. 17, the encoding method may include the following steps.
[0381] In step S1701, the first candidate list of the current block is determined.
[0382] It should be explained that the encoding method of the embodiment of the present application is applied to an encoder. Furthermore, the encoding method may specifically refer to an intra prediction method, and more specifically, an intra prediction method based on an Intra TMP extended block vector list. Here, the accuracy of the prediction is improved by expanding the coverage range of the first candidate list by sufficiently utilizing reconstruction information of spatially adjacent and non-adjacent locations.
[0383] Further to be explained, in an embodiment of the present application, a video picture may be divided into a plurality of coding blocks, and each coding block may include a first color component, a second color component, and a third color component, and the current block in an embodiment of the present application refers to a coding block that performs a current intra prediction of the video picture. Here, if the current block performs a prediction of the first color component and the first color component is a luminance component, the current block may be referred to as a luminance block; or, if the current block performs a prediction of the second color component and the second color component is a chroma component, the current block may be referred to as a chroma block.
[0384] Further explanation is that, in an embodiment of the present application, the first candidate list may include one or more candidate vector parameters. Here, the vector parameters may include block vector parameters and / or motion vector parameters. That is, here, the first candidate list may be a list containing more than one candidate BV and may be a list containing more than one candidate MV.
[0385] For example, regarding the block vector parameter, it may specifically indicate the location 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.
[0386] In some embodiments, regarding the step of determining a first candidate list of a current block, the method may include: a step of determining a first search area of a current block; and a step of determining a first candidate list of a current block according to the first search area.
[0387] What needs to be explained is that, in an embodiment of the present application, the step of determining a first search area of a current block may include: a step of determining a first template of a current block; and a step of determining a first search area of a current block according to the first template.
[0388] In an embodiment of the present application, a template type of the current block is determined first, and then a first template of the current block can be determined according to the template type. Here, the step of determining the template type of the current block may include: a step of determining the template type of the current block according to a reference sample of the current block; a step of determining the template type of the current block according to instruction information in a bit stream; or a step of determining the template type of the current block according to a size parameter of the current block.
[0389] In an embodiment of the present application, the reference sample of the current block includes at least one of the left adjacent reference sample of the current block, the upper adjacent reference sample of the current block, and the upper-left adjacent reference sample of the current block.
[0390] It is understandable that, in the embodiments of the present application, the reference sample of the current block may refer to a reference sample point adjacent to the current block, wherein "adjacent" may be spatially adjacent but is not limited thereto. For example, the adjacent may be temporally adjacent, spatially and temporally adjacent, and the reference sample of the current block may even be a reference sample obtained after performing specific processing on spatially adjacent, temporally adjacent, spatially and temporally adjacent reference sample points, etc., and the embodiments of the present application are not specifically limited thereto.
[0391] It is further understood that, in an embodiment of the present application, the reference sample of the current block may include an adjacent reconstructed sample of the current block, that is, an adjacent reconstructed sample of the current block may be selected as a template to search for a matching template within a first search area. It is to be explained that, in an embodiment of the present application, the reference sample of the current block, that is, the adjacent reconstructed sample of the current block, may include an upper reference sample, an upper-left reference sample, an upper-right reference sample, a left reference sample, and a lower-left reference sample of the current block.
[0392] It is further understood that in the embodiments of the present application, when determining the template type of the current block using a reference sample of the current block, the template type is classified and the template type is determined based on the availability of an adjacent reference sample.
[0393] In some embodiments, when determining the template type of the current block according to the reference sample of the current block, if the left adjacent reference sample of the current block, the upper adjacent reference sample of the current block, and the upper-left adjacent reference sample of the current block are all available, the template type of the current block is determined as a first value; if the left adjacent reference sample of the current block is available, the template type of the current block is determined as a second value; if the upper adjacent reference sample of the current block is available, the template type of the current block is determined as a third value; if both the left adjacent reference sample of the current block and the upper-left adjacent reference sample of the current block are available, the template type of the current block is determined as a fourth value; if both the left adjacent reference sample of the current block and the lower-left adjacent reference sample of the current block are available, the template type of the current block is determined as a fifth value; and if both the upper adjacent reference sample of the current block and the upper-right adjacent reference sample of the current block are available, the template type of the current block is determined as a sixth value.
[0394] It must be explained that, in an embodiment of the present application, if both the left-adjacent reference sample of the current block and the upper-adjacent reference sample of the current block are available when specified, the template type of the current block is determined as a first value. That is, for an L-shaped template, there may not be a left-adjacent reference sample when specified.
[0395] 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 may be any numerical value, and the present application is not specifically limited thereto. For example, the values of the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value may be 1, 2, 3, 4, 5, and 6 in sequence.
[0396] For example, in an embodiment of the present application, a template type can be represented by refTemplateType, and correspondingly, as shown in FIG. 3, a grid-filled block is the current block, and an adjacent area of the current block is a template T, where six template types are illustrated.
[0397] For example, regarding these six template types, when the upper-left reference sample, the upper reference sample, and the left reference sample are all available, the value of refTemplateType is 1 and the template form is as illustrated in FIG. 3(a); however, when the left reference sample is available, the value of refTemplateType is 2 and the template form is as illustrated in FIG. 3(b); however, when the upper reference sample is available, the value of refTemplateType is 3 and the template form is as illustrated in FIG. 3(c); however, when the left reference sample and the upper-left reference sample are available, the value of refTemplateType is 4 and the template form is as illustrated in FIG. 3(d); however, when the left reference sample and the lower-left reference sample are available, the value of refTemplateType is 5 and the template form is as illustrated in FIG. 3(e); However, when the upper reference sample and the upper right reference sample are available, the value of refTemplateType is 6, and the template form is as shown in (f) of FIG. 3.
[0398] In some embodiments, the template type of IntraTMP may be selected in accordance with instructions in the bit stream while combining information on the availability of the reference sample. For example, the determination of the template type can be implemented at the decoding end by assigning a sequence number for each template type and transmitting information on the template sequence number actually used in the bit stream. That is, in the embodiments of the present application, not only can the template type be determined according to the information on the availability of the reference sample of the current block, but the template type may also be determined according to information indicated in the bit stream, or the template type may be determined by combining the information on the availability of the reference sample and the information indicated in the bit stream. The present application makes no specific limitations.
[0399] Furthermore, in an embodiment of the present application, when determining a first template corresponding to a current block according to a template type, the step of determining a template reference sample of the current block according to the template type and the template size corresponding to the template type may be further included; and the step of determining the first template of the current block according to the next template reference sample.
[0400] It should be explained that, in an embodiment of the present application, the first template of the current block may include a template reference sample of the current block. Here, the template reference sample of the current block may be determined by the template type of the current block and the template size corresponding to the template type.
[0401] It is further explained that, in an embodiment of the present application, the first template of the current block may be composed of a reconstruction sample of one or more of the upper, upper-right, left, lower-left, and upper-left regions of the current block, that is, it may be composed of a reference sample of the current block.
[0402] It should be further explained that, in the embodiments of the present application, the template size corresponding to the template type may be preset, may be indicated through bit stream syntax elements, or may be adaptively selected according to the block size or other information. For example, when acquiring the left template, the template width templateW_size may be set to 4, and when acquiring the upper template, the template height templateH_size may be set to 4.
[0403] Accordingly, in an embodiment of the present application, by combining the value of the template type refTemplateType of the current block and the template size corresponding to said refTemplateType, it is possible to determine which part of the reconstruction sample to obtain and use as a template reference sample of the current block, thereby determining the corresponding first template. For example, when the value of refTemplateType is 1, one may choose to obtain the left, upper-left, and upper reconstruction samples of the current block; when the value of refTemplateType is 2, only the left 4th column reconstruction sample of the current block is obtained; and when the value of refTemplateType is 3, only the upper 4th row reconstruction sample of the current coding block is obtained.
[0404] 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.
[0405] That is, in an embodiment of the present application, by combining the template type of the current block and the corresponding template size, the template reference sample of the current block determined from the reference sample of the current block may be a first template corresponding to the current block.
[0406] It is understandable that, in an embodiment of the present application, the search process for vector parameters may include an initialization process, determining a search area (first search area) within the current frame of a first template, and determining one or more optimal vector parameters by searching in the first search area; therefore, when executing the search process, the initialization operation must be completed first.
[0407] For example, as shown in FIG. 5 above, 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.
[0408] Correspondingly, during the initialization process, uiPatchWidth can be initialized to nTbW + templateW_size and uiPatchHeight to nTbH + templateH_size, where templateW_size and templateH_size may be fixed constants, may be indicated via bitstream syntax elements, or may be dynamically adjusted according to the current block size or other information, and templateW_size and templateH_size may be the same or different. For example, templateW_size=4, templateH_size=4; or when the current block width is greater than 8, templateW_size is set to 4, and when the current block width is less than or equal to 8, templateW_size is set to 2, and when the current block height is greater than 8, templateH_size is set to 4, and when the current block height is less than or equal to 8, templateH_size is set to 2.
[0409] Furthermore, the cost threshold between templates is initialized and denoted as diffThreshold, for example, when the cost function is SAD, the threshold can be diffThreshold = ((1 << bitDepth) >> 2) × (uiPatchHeight × uiPatchWidth - nTbH × nTbW). Here, when the picture bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold for each sample point in the template region is 256.
[0410] Furthermore, initialize the location of the coding tree block CTB where the current block CB is located, ctbRsX, ctbRsY.
[0411] Furthermore, initialize the position offset of the current block CB within the current CTB. offsetLCBY = yTbCmp - ctbRsY, offsetLCBX = xTbCmp - ctbRsX.
[0412] Furthermore, initialize iTemplateSizeH= templateH_size and iTemplateSizeW= templateW_size.
[0413] Furthermore, iBvShift is initialized, and iBvShift is the precision of the vector parameter BV. For example, the precision of BV may be an integer sample precision, where iBvShift is 0, and the precision of BV may be a subsample precision, for example, when iBvShift is 1, it represents 1 / 2 sample precision, and when iBvShift is 2, it represents 1 / 4 sample precision, but is not specifically limited thereto.
[0414] Furthermore, the pre-configured search range of the template is initialized, and the pre-configured search range of the template may be set to a fixed size, or the search range may be dynamically adjusted according to the size of the current block. For example, searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR ×nTbW, searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR ×nTbH; where the value of TMP_SEARCH_RANGE_MULT_FACTOR may be a pre-configured value, may be indicated by bit stream syntax elements, and may also be adaptively adjusted according to information such as the size of the current block, for example, set to 5.
[0415] It is further understandable that, in an embodiment of the present application, the first search area may include a first type of search area and / or a second type of search area. Here, the first type of search area is a rectangular search area around the current block; and the second type of search area is an area pointed to by a vector parameter corresponding to a preset search position where the current block is located and an area pointed to by automatic relocation.
[0416] Here, the search area of the first type includes a total reconstruction area and / or a pending reconstruction area. Here, the sampling points in the total reconstruction area are all reconstructed sampling points; and the sampling points within the pending reconstruction area include reconstructed sampling points and / or unreconstructed sampling points.
[0417] That is, in an embodiment of the present application, the first search area can be divided into two parts.
[0418] One is a surrounding rectangular search area, which can be divided into two types: one is determined to have all sampling points within the area reconstructed (referred to as the total reconstructed area), for example, including four areas R1 to R4 in FIG. 6; and the other is uncertain whether all sampling points within the area have been reconstructed (referred to as the pending reconstructed area), for example, including two areas R5 to R6 in FIG. 6.
[0419] One is an extended search area, defined as the area pointed to by the BV corresponding to spatially adjacent and non-adjacent location PUs, and in the embodiment corresponding to FIG. 6, said area may be considered as R7; and the area pointed to by automatic relocation may be considered as R8. Since search points in R7 and / or R8 may not necessarily be adjacent to each other, the search for the R7 and / or R8 areas is performed progressively along the list.
[0420] In some embodiments, the step of determining a first candidate list of the current block according to a first search area may include: a step of determining one or more first candidate vector parameters by performing a search within the first search area according to a first search step length; and a step of adding one or more first candidate vector parameters to the first candidate list of the current block.
[0421] In a specific embodiment, the step of performing a search within a first search area according to a first search step length to determine one or more first candidate vector parameters may include: a step of iterating through search points within the first search area according to a first search step length and determining a first matching cost value between a matching template corresponding to a search point within the first search area and a first template according to a preset matching criterion; and a step of determining one or more matching search points according to the first matching cost value and determining one or more first candidate vector parameters according to the one or more matching search points.
[0422] It needs to be explained that, in an embodiment of the present application, the first search step length may be set to 3, and the first candidate list obtained therefrom may be referred to as an initial approximate search list.
[0423] Further explanation is that, in the embodiments of the present application, the preset matching criteria may include any one of the sum of absolute errors SAD, sum of transformed absolute errors SATD, sum of squared differences SSE, mean absolute deviation value MAD, mean absolute error MAE, mean squared error MSE, and normalized correlation coefficient NCC.
[0424] In a possible implementation method, when iterating through search points in the first search area, specifically the following may be included.
[0425] For the entire reconstruction area (e.g., corresponding to the four areas R1 to R4 in Fig. 6), a matching reconstruction block of one current block in the reconstruction area can be found through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0426] For pending reconstruction areas (e.g., corresponding to the two areas R5–R6 in Fig. 6), availability is determined through search points (iPosHor, iPoxVer) within each search area, i.e., each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and
[0427] If available, a matching reconstruction block for a single current block can be found in the reconstruction area, and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0428] If unavailable, template matching cost calculation is not performed.
[0429] Here, the determination of availability includes, but is not limited to, the simultaneous satisfaction of one or more of the following conditions, and
[0430] ● Each sampling point within the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0431] ● Each sampling point within the reconstruction block corresponding to the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0432] ● Each sampling point within the template and each sampling point within the corresponding reconstruction block do not exceed the defined range of the search window;
[0433] ● Whether each sampling point within the template is on the same Tile as the current encoding area;
[0434] ● Whether each sampling point within the reconstruction block corresponding to the template is on the same Tile as the current encoding area;
[0435] ● All sampling points within the template are reconstructed;
[0436] ● Each sampling point within the reconstruction block corresponding to the template is not located in the current encoding area;
[0437] l All sampling points within the reconstruction block corresponding to the template are reconstructed;
[0438] All available search points in all search ranges (regionId=0, 1, 2, 3, 4, 5) are iterated through to obtain the 30 search points with the smallest matching cost pDiff, the corresponding matching cost is denoted as pDiff_BEST[n], where n=0,…,29, the corresponding block vector BV is denoted as the optimal block vector BV_BEST[n], where each item is a single coordinate pair (pX_BEST, pY_BEST), where n=0,…,29, and the corresponding matching template is the optimal matching template T_BEST[n], where n=0,…,29.
[0439] Thus, in an embodiment of the present application, if the first search step length is 3, a search is performed within the first search area with a step length of 3. For example, within each area, pX is located between bvXMinsregionId and bvXMaxsregionId, and pY is located within the search range between bvYMinsregionId and bvYMaxsregionId. After performing an approximate search with a step length of 3, the preceding P optimal matching costs obtained by template matching are recorded as pDiff1_BEST[p], where p=0,…,P-1, and the corresponding block vector BV is represented as the optimal block vector BV1_BEST[p], where p=0,…,P-1. Here, P may be 1 or an integer value greater than 1 depending on demand, and the search area where the optimal matching search point is located is bestRegionId[p], where p=0,…,P-1. In this way, a first candidate list can be constructed according to P optimal block vectors BV1_BEST[p].
[0440] In step S1702, a second location block is determined according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first location block of the current block.
[0441] In step S1703, when the encoding parameter of the second position block includes a vector parameter, it is determined whether the vector parameter of the second position block satisfies the second condition according to the vector parameter of the second position block.
[0442] It should be explained that, in an embodiment of the present application, the first location block of the current block may include blocks of spatially adjacent locations and / or non-adjacent locations. Additionally, the number of first location blocks may be one or a plurality.
[0443] For example, for one or more predefined first location blocks, the predefined search locations may use, for instance, five spatially adjacent locations of the current block, left (xTbCmp-1, yTbCmp+nTbH-1), top-left (xTbCmp-1, yTbCmp-1), top (xTbCmp+nTbW-1, yTbCmp-1), top-right (xTbCmp+nTbW, yTbCmp-1), bottom-left (xTbCmp-1, yTbCmp+nTbH), and 18 spatially non-adjacent locations (specifically as shown in FIG. 9).
[0444] Further explanation is that, in an embodiment of the present application, the step of determining a second position block may include: determining a second position block according to a candidate vector parameter among a first candidate list; and / or determining a second position block according to a vector parameter of a first position block of the current block.
[0445] That is, in the embodiments of the present application, a second position block may be determined according to a candidate vector parameter in a first candidate list, or a second position block may be determined according to a vector parameter of a first position block, or a second position block may be determined according to the common vector parameter of a candidate vector parameter in a first candidate list and a vector parameter of a first position block, and is not specifically limited thereto.
[0446] In some embodiments, when determining a second location block according to a vector parameter of a first location block of a current block, the method may include: a step of determining whether a vector parameter of a first location block satisfies a first condition according to a vector parameter of a first location block when the encoding parameter of a first location block of a current block includes a vector parameter; and a step of determining a second location block according to a vector parameter of a first location block when the vector parameter of a first location block satisfies the first condition.
[0447] It needs to be explained 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 technique (i.e., IBC / IntraTMP), it can be determined that the encoding parameter of the first position block of the current block includes the vector parameter.
[0448] Further to be explained, in an embodiment of the present application, the first condition may include that the cost value corresponding to the vector parameter of the first location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list. That is, if the cost value corresponding to the vector parameter of the first location block is superior to 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 location block satisfies the first condition.
[0449] In some embodiments, regarding determining that a vector parameter of a first location block satisfies a first condition, the method may further include: determining a cost value corresponding to a vector parameter of a first location block according to a matching cost value between a matching template corresponding to a vector parameter of a first location block and a first template; determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and a first template; and determining that a vector parameter of a first location block satisfies the first condition if the cost value corresponding to a vector parameter of a first location block is smaller than the cost value corresponding to at least one candidate vector parameter of a first candidate list.
[0450] What needs to be further explained is that in an embodiment of the present application, the method further includes the step of updating a first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition.
[0451] In a specific embodiment, the step of updating the first candidate list according to the vector parameter of the first position block may include the step of adding the vector parameter of the first position block to the first candidate list.
[0452] That is, if the vector parameter of the first position block satisfies the first condition, the first candidate list can be updated using the vector parameter of the first position block. For example, the vector parameter of the first position block is added to the first candidate list according to the magnitude of the cost value, and the item with the largest cost value among the first candidate list is deleted to obtain the first candidate list after the update.
[0453] To further explain, in an embodiment of the present application, the method further includes the step of determining the search region where the vector parameter of the first location block is located as R6, that is, setting the value of bestRegionId to 6.
[0454] Further explanation is that in an embodiment of the present application, during the update process, first, it is checked whether the PU corresponding to the predefined search location uses IntraTMP / IBC technology, that is, whether the encoding parameter of the PU corresponding to the predefined search location includes a vector parameter; if it includes a vector parameter, the BV of this PU is determined, and then an update is performed on the first candidate list using this BV. The specific operation of the update is to sequentially access each item of the first candidate list, 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 smaller than the maximum cost value of the first candidate list, replace this BV with the least expensive BV of the first candidate list. For example, the specific operation may be to insert this BV into the first candidate list in order of cost size and delete the item with the largest cost among the first candidate list. Then, the value of the search region bestRegionId is set to 6.
[0455] It can be understood that the number of second position blocks can be one or multiple.
[0456] To further explain, the second location block represents the reference block pointed to by the vector parameter of the first location block. Alternatively, the second location block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first location block.
[0457] Further explanation is that in the embodiments of the present application, vector parameters are still exemplified as BV, and if the second position block uses a BV-based prediction technique (i.e., IBC / IntraTMP), it can be determined that the encoding parameter of the second position block includes the vector parameter.
[0458] For example, for a second location block, the vector parameters of the first location block are used as the current BV, and first, multiple candidate locations of the current block are determined, for example, five locations, center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), top-left (xTbCmp, yTbCmp), top-right (xTbCmp+nTbW-1, yTbCmp), bottom-left (xTbCmp, yTbCmp+nTbH-1), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). Next, the current BV is added to the coordinates of these five candidate locations, and then the corresponding PU is checked whether it uses a BV-based prediction mode (i.e., IBC / IntraTMP). When used, the newly obtained BV is considered as the current BV, and the above operation is repeated to determine the vector parameter of the second location block (which may be referred to as the “extended BV”). In other words, in an embodiment of the present application, the extended BV may 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, etc.
[0459] In some embodiments, the second condition may include that the cost value corresponding to the vector parameter of the second location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list. That is, if the cost value corresponding to the vector parameter of the second location block is superior to 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 location block satisfies the second condition.
[0460] What needs to be further explained is that, in an embodiment of the present application, the method further comprises: a step of determining a cost value corresponding to a vector parameter of a second position block according to a matching cost value between a matching template corresponding to a vector parameter of a second position block and a first template; a step of determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and a first template; and a step of determining that the vector parameter of a second position block satisfies a second condition if the cost value corresponding to a vector parameter of a second position block is smaller than the cost value corresponding to at least one candidate vector parameter of a first candidate list.
[0461] In step S1704, when the vector parameter of the second position block satisfies the second condition, the first candidate list is updated according to the vector parameter of the second position block.
[0462] It should be explained that, in an embodiment of the present application, regarding the vector parameters of the second position block, the vector parameters of the second position block may be one or a plurality of. Here, determining the vector parameters of the second position block may be stopped when all vector parameters of the first position block have been completely traversed, or when the number of vector parameters of the second position block obtained is greater than a first threshold value.
[0463] Further explanation is that in the embodiments of the present application, the first threshold value may be represented as V. For example, the value of V may be 15, but may be other numeric values, such as 1, 2, 5, 10, etc., and is not specifically limited here.
[0464] In some embodiments, the step of updating the first candidate list according to the vector parameter of the second position block may include the step of adding the vector parameter of the second position block to the first candidate list.
[0465] That is, if the vector parameter of the second location block satisfies the second condition, the first candidate list can be updated using the vector parameter of the second location block. For example, the vector parameter of the second location block is added to the first candidate list according to the magnitude of the cost value, and the item with the largest cost value among the first candidate list is deleted to obtain the first candidate list after the update.
[0466] In some embodiments, the method further includes the step of determining the search region where the vector parameter of the second location block is located as R7, that is, setting the value of bestRegionId to 7.
[0467] What needs to be explained is that, in the embodiment of the present application, for the vector parameters of the first position block obtained, first, for each current BV, five positions of the current block are determined: center (xTbCmp+nTbW / 2, yTbCmp+nTbH / 2), top-left (xTbCmp, yTbCmp), top-right (xTbCmp+nTbW-1, yTbCmp), bottom-left (xTbCmp, yTbCmp+nTbH-1), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1). After adding the current BV to these five position coordinates, the corresponding PU is checked whether it uses a BV-based prediction technique (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., adding the vertical and horizontal components respectively) is denoted as BV', and the next BV' is considered as the current BV, and the above operation is repeated for this BV' to continue determining available options for the extended BV; if not used, the next position is examined. The above operation is repeated until all 5 positions are examined or the number of determined extended BVs is greater than V, and the determination of the vector parameters of the second position block is stopped.
[0468] To further explain, after obtaining multiple extended BVs, an additional update is performed on the first candidate list. The specific operation of the update involves calculating the corresponding template matching cost for each of the multiple extended BVs, comparing this cost with the template matching cost of the BVs in the first candidate list, and if it is smaller than the maximum template matching cost in the first candidate list, replacing this BV with an inferior BV in the first candidate list. The specific replacement operation involves, for example, inserting this BV into the first candidate list in order of cost size and deleting the item with the largest cost in the first candidate list after the update. The value of the search region bestRegionId where the newly inserted BV in the first candidate list is located is set to 7.
[0469] That is, in an embodiment of the present application, if the BV of a first location block (a spatially adjacent location and / or non-adjacent location of the current block) is better than at least one BV of a first candidate list (first condition), the block pointed to by the BV of the first location block is examined, and if a BV exists in the block pointed to by the BV of the first location block, it is determined whether to add said BV to the first candidate list (second condition). At the same time, another feature of an embodiment of the present application is that the first location block contributes two candidate BVs to the first candidate list (adding one BV when the first condition is satisfied and adding another BV when the second condition is satisfied) to obtain the first candidate list after updating (i.e., the final approximate search list).
[0470] In some embodiments, regarding the update of the first candidate list, the method may further include the steps of: determining a first set of candidates for the current block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition, and updating the first candidate list according to the first set of candidates; and determining a second set of candidates for the current block according to the vector parameter of the second position block when the vector parameter of the second position block satisfies a second condition, and updating the first candidate list according to the second set of candidates.
[0471] It should be explained that in the embodiments of the present application, the first candidate set can be represented as IntraTMP_Merge and the second candidate set can be represented as IntraTMP_EBVP.
[0472] Further explanation is that, in some embodiments, the step of updating a first candidate list according to a 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, if the cost value corresponding to the second candidate vector parameter is smaller 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. Here, the second candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0473] In a specific embodiment, the step of replacing the candidate vector parameter corresponding to the maximum cost value among the first candidate list using the second candidate vector parameter may include the step of 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 after the update.
[0474] For example, in an embodiment of the present application, regarding the process of constructing the IntraTMP_Merge set (or IntraTMP_Merge list), specifically, it may involve checking whether the PU corresponding to such a location uses IntraTMP / IBC technology, and if it does, storing the BV of this PU in the IntraTMP_Merge set. After constructing the IntraTMP_Merge set, an update is performed on the first candidate list according to the IntraTMP_Merge set. The specific operation of the update is to sequentially access each item of the IntraTMP_Merge set, 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 smaller than the maximum template matching cost of the first candidate list, replace this BV with the least expensive BV of the first candidate list. The specific operation is, for example, to 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 after the update. Then, set the search area bestRegionId to 6.
[0475] It is further explained that in an embodiment of the present application, after updating a first candidate list according to a first candidate set, a second location block can be determined according to at least some of the candidate vector parameters in the first candidate list after the update. Additionally, if the vector parameters of the second location block satisfy a second condition, a second candidate set of the current block is constructed according to the vector parameters of the second location block.
[0476] In a possible implementation, at least some of the candidate vector parameters in the first candidate list after the update may be one or more second candidate vector parameters updated in the first candidate list by the first candidate set. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include: determining one or more second candidate vector parameters updated in the first candidate list by the first candidate set; and determining a second location block according to one or more second candidate vector parameters, and determining a second candidate set of the current block according to the vector parameters of the second location block.
[0477] In other possible implementations, at least some of the candidate vector parameters of the first candidate list after the update may be all of the candidate vector parameters of the first candidate list after the update. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include the step of updating the first candidate list according to the first candidate set, determining a second location block according to all of the candidate vector parameters of the first candidate list after the update, and determining a second candidate set of the current block according to the vector parameters of the second location block.
[0478] In other possible implementations, at least some of the candidate vector parameters in the first candidate list after the update may be a predetermined number of candidate vector parameters in the first candidate list after the update. Accordingly, in some embodiments, the step of determining a second candidate set of the current block may include: a step of determining the first candidate list after the first candidate set, and then determining the first N candidate vector parameters in the first candidate list after the update; and a step of determining a second location block according to the N candidate vector parameters and determining a second candidate set of the current block according to the vector parameters of the second location block, wherein N is a positive integer.
[0479] It should be explained that, in an embodiment of the present application, the method further includes the step of determining a value of N according to the size parameter of the current block. That is, the number of checks can be limited according to the size of the current block, and, for example, the first 5 are checked for a current block with a size smaller than or equal to 16x16, and the first 10 are checked for other sizes.
[0480] In another possible implementation method, the step of determining a second set of candidates for the current block may include: updating a first list of candidates according to a first set of candidates, performing clustering on the first list of candidates after the update to determine M candidate vector parameters located at the clustering center; and determining a second location block according to the M candidate vector parameters, and determining a second set of candidates for the current block according to the vector parameters of the second location block, wherein M is a positive integer.
[0481] It should be further explained that, in the embodiments of the present application, regarding the construction of the IntraTMP_EBVP set (or IntraTMP_EBVP list), inspection may be performed only on all BVs that have been replaced by the first candidate list by the IntraTMP_Merge set. Additionally, EBVP-based updates may be performed on all options of the first candidate list after the update.
[0482] Additionally, in an embodiment of the present application, adjustments may be made to the BV objects to be examined in the IntraTMP_EBVP list and the number thereof. For example, the examination may be performed using the first 5 of the corresponding BV set or the first 10 of the corresponding BV set. Alternatively, the number of examinations may be limited according to the size of the current block, for example, the first 5 may be examined for CUs with a size less than or equal to 16x16, and the first 10 for other sizes. Alternatively, clustering may be performed on the first candidate list after the update, and the clustering rule is the geometric distance to reach the clustering center. The number of clustering centers is 2 to 5, for example, EBVP operations are performed only on the clustering centers.
[0483] In another possible implementation, a second candidate set may not be constructed further. The method further includes the steps of: filling the first candidate set with vector parameters of the second position block until the first candidate set is filled when the first candidate set of the current block is not filled; and updating the first candidate list according to the first candidate set after filling.
[0484] That is, in an embodiment of the present application, BVs of EBVPs are also added to the IntraTMP_Merge set until the IntraTMP_Merge set is filled, and then updates are performed on the first candidate list 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 updating a first candidate list according to an IntraTMP_Merge set, for each BV inserted into the first candidate list from an IntraTMP_Merge set, a set of IntraTMP_EBVP is constructed and the first candidate list is updated again according to said list, and
[0486] First, for each current BV, a corresponding set of IntraTMP_EBVP is constructed from scratch. The five locations 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), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1) are determined, and after adding the current BV to these five location coordinates, the corresponding PU is checked whether it uses a BV-based prediction technique (i.e., IBC / IntraTMP). If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., adding the vertical and horizontal components respectively) is denoted as BV' and added to the TMP_EBVP list; then, the next BV' is considered as the current BV, and the above operation is repeated for this BV' to continuously build the available options in the TMP_EBVP list; if not used, the next position is checked.
[0487] In some embodiments, the method further includes the step of determining the completion of construction of a third candidate set when all vector parameters of a second location block are completely traversed or when the number of candidate vector parameters in a second candidate set is greater than a first threshold.
[0488] It should be explained that, in an embodiment of the present application, the first threshold value may be represented as V, or the length of the second candidate set is V. For example, the value of V may be 15. Alternatively, the length V of the IntraTMP_EBVP set may be set to a different value, for example, the value of V is set to 1, 2, 5, or 10.
[0489] In this way, the construction of the current IntraTMP_EBVP set is completed by repeating the above operation until all 5 locations are inspected or until the number of IntraTMP_EBVP sets being built is greater than V.
[0490] In some embodiments, after constructing a second candidate set, the method further comprises the steps of: determining a second matching cost value between a first template and a matching template corresponding to a third candidate vector parameter among the second candidate set according to a preset matching criterion; and updating the second candidate set by deleting the third candidate vector parameter from the second candidate set when the second matching cost value is greater than a second threshold value. Here, the third candidate vector parameter is a vector parameter of any one of the second candidate sets.
[0491] In an embodiment of the present application, the preset matching criteria may include any one of the sum of absolute errors SAD, sum of transformation absolute errors SATD, sum of squared differences SSE, mean absolute deviation value MAD, mean absolute error MAE, mean squared error MSE, and normalized correlation coefficient NCC. That is, it can be limited according to the template cost (e.g., SAD, SATD, etc.) corresponding to the BV, and for each BV in the second candidate set, the template cost is first calculated to limit one cost threshold, and the BVs that do not exceed the threshold are added again to the IntraTMP_EBVP set to obtain the final second candidate set.
[0492] In some embodiments, the step of updating a first candidate list according to a 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, if the cost value corresponding to the third candidate vector parameter is smaller 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. Here, the third candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0493] In a specific embodiment, the step of replacing the candidate vector parameter corresponding to the maximum cost value among the first candidate list using the second candidate vector parameter may include the step of 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 after the update.
[0494] For example, in an embodiment of the present application, after the current IntraTMP_EBVP set is completed, an update is performed on the first candidate list. The specific operation of the update is to sequentially access each BV of the IntraTMP_EBVP set, 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 smaller than the maximum template matching cost of the first candidate list, replace this BV with the least effective BV in the first candidate list. The specific replacement operation is, for example, to 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 after the update. The search region bestRegionId where the newly inserted BV in the first candidate list is located is set to 7.
[0495] It is further explained that in the embodiments of the present application, the IntraTMP_Merge set may not be used here, that is, the extension is performed based on the BV obtained by searching directly within the search window in IntraTMP.
[0496] It is further explained that in the embodiments of the present application, the search may not be distinguished into approximate and detailed search steps, but merely a one-time search is performed, and then the BV options are expanded based on the one-time search results to obtain the final BV result.
[0497] In some embodiments, for updating the first candidate list, the method further comprises the steps of: determining the first K candidate vector parameters in the first set of candidates; and updating the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.
[0498] That is, in an embodiment of the present application, the IntraTMP_Merge set updates the approximate search list by taking only the first K (e.g., K can take 5) and performs expansion only on the basis of each BV of the IntraTMP_Merge set.
[0499] In some embodiments, for updating a first candidate list, the method further comprises: determining the first P candidate vector parameters among the first candidate set; determining a second location block according to the P candidate vector parameters and determining the vector parameters of the second location block; if the vector parameters of the second location block satisfy a second condition, constructing a fourth candidate set of the current block according to the vector parameters of the second location block, and determining the completion of constructing the fourth candidate set when all P candidate vector parameters are traversed or the fourth candidate set is filled; determining cost values corresponding to one or more candidate vector parameters among the fourth candidate set and determining Q candidate vector parameters from the fourth candidate set according to the cost values corresponding to one or more candidate vector parameters; and updating the first candidate list according to the Q candidate vector parameters, wherein P and Q are positive integers.
[0500] That is, in an embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP may be used together to maintain a single Merge set or list. For example, first, the first P BVs (e.g., P can take 5) of the IntraTMP_Merge set are taken, and IntraTMP_EBVP expansion is performed based on these P BVs to construct a new Merge set of length L (e.g., L can take 28). After the expanded BVs fill the new Merge set or the expansion of all P BVs is completed, the cost of each BV of the new Merge set is calculated and the order is arranged, and then the first Q (e.g., Q can take 5) of the arranged list are taken and an update is performed on the first candidate list.
[0501] In step S1705, the predicted value of the current block is determined according to the first candidate list after the update.
[0502] It should be explained that, in the embodiments of the present application, after obtaining a final approximate search list, a detailed search can be performed on said approximate search list. That is, the search process of the embodiments of the present application may involve first performing an approximate search and then performing a detailed search.
[0503] In some embodiments, the step of determining the predicted value of the current block according to the first candidate list after updating may include the step of determining the vector parameters of the current block based on the first candidate list after updating; and the step of determining the predicted value of the current block according to the vector parameters of the current block.
[0504] In a specific embodiment, the step of determining the vector parameter of the current block based on the first candidate list after updating may include: determining a second search area indicated by the candidate vector parameter in the first candidate list after updating; and performing a search within the second search area according to the second search step length to determine the vector parameter of the current block, wherein the value of the second search step length is smaller than the value of the first search step length.
[0505] What needs to be explained in the embodiments of the present application is that the second search step length may be 1, but may be another value. Here, the second search step length must be smaller than the value of the first search step length of the approximate search step.
[0506] For example, the optimal block vector BV1_BEST[p], p=0,…,M-1 obtained from the first candidate list after updating is used as a fine-grained search reference point to perform a search in the surrounding area.
[0507] For each fine search reference point, first, the fine search ranges TmpRefineRangeHor and TmpRefineRangeVer are determined, and the fine search range (second search area) may be of a fixed size and is related to the search area; for example, for a reference point with a search area of 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 1; for a reference point with a search area of 6, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 2. Next, the location of the optimal matching reconstruction block obtained by the approximate search is calculated and used as the reference location of the fine search area, BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.
[0508] Using a direct search window, the fine-grained search area is treated as a single entire pending reconstruction area and traversed directly.
[0509] A new search range is obtained based on the optimal matching block location obtained through approximate search, and
[0510] iHorMax refine = min(picWidth - nTbW, BestPosX + TmpRefineRangeHor);
[0511] iHorMin refine = max( iTemplateSizeW, BestPosX - TmpRefineRangeHor);
[0512] iVerMax refine = min(picHeight - nTbH, BestPosY + TmpRefineRangeVer);
[0513] iVerMin refine = max( iTemplateSizeH, BestPosY - TmpRefineRangeVer );
[0514] Next, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs are iVerMin refine , iVerMax refine , iHorMin refine , iHorMax refine It can be calculated through,
[0515] bvXMins = iHorMin refine - xTbCmp;
[0516] bvXMaxs = iHorMax refine - xTbCmp;
[0517] bvYMins = iVerMin refine - yTbCmp;
[0518] bvYMaxs = iVerMax refine - yTbCmp;
[0519] Fine-grained search is pX bvXMins refine and bvXMaxs refine Located between, and pY is bvYMins refine and bvYMaxs refine It is performed within the range of block vectors located between them; that is, it traverses all search locations within the direct fine-grained search window and sequentially determines availability. For example, a search is performed with a second search step length of 1, and the preceding T optimal matching costs obtained by template matching of available points are recorded as pDiff_BEST[t], where t=0,…,T-1, and the corresponding block vector BV is represented as the optimal block vector BV_BEST[t], where t=0,…,T-1. Here, T is 1 or an integer greater than 1. For example, the value T=1.
[0520] After completing the above operations, the results of the approximate search and detailed search processes (where the detailed search 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). Here, pX_BEST and pY_BEST are the horizontal offset and vertical offset of the optimal matching template with respect to the current block template, respectively, and also the horizontal offset and vertical offset of the optimal matching reconstruction block with respect to the current block. In this way, the vector parameters of the current block can be obtained.
[0521] In some embodiments, the step of determining the vector parameters of the current block by performing a search within a second search area according to the second search step length may include the step of determining the vector parameters of the current block by performing a subsample search within the second search area according to the second search step length. That is, a subsample search can be implemented in a fine-grained search step.
[0522] It is further explained that in the embodiments of the present application, the vector parameters of the current block may be one or multiple. Here, if the vector parameters of the current block are multiple, a predicted value of the current block can be obtained by performing weighted fusion using the positions corresponding to the multiple BVs.
[0523] In some embodiments, when the vector parameter of the current block is one, the step of determining the predicted value of the current block according to the vector parameter of the current block may include: the step of determining the reference block of the current block according to the vector parameter of the current block; and the step of determining the predicted value of the current block according to the reference block.
[0524] For example, in an embodiment of the present application, when determining the reference block of the current block, it can be implemented using a simple translational copy. The specific operation is as follows: for x=0…nTbW-1, y=0…nTbH-1, RefBlock n [x][y] = recSamples[x + pX n ][y + pY n It is to determine the reconstruction samples recSamples of the current frame (i.e., the reference block of the current block) through ].
[0525] It should be explained that, in an embodiment of the present application, when determining the reference block of the current block according to the vector parameters of the current block, the initial reconstruction block of the current block may be determined first according to the vector parameters of the current block; and then a modification process may be performed on the initial reconstruction block to determine the reference block of the current block. Alternatively, filtering may be performed on the reference block to determine the reference block after filtering; and the predicted value of the current block may be determined according to the reference block after filtering.
[0526] It is further explained that in the embodiments of the present application, the predicted value determined through the vector parameters of the current block can be used as the final predicted value, and additionally, the final predicted value of the current block can be determined by performing a modification process (e.g., clip operation).
[0527] In some embodiments, when determining a predicted value of a current block according to a reference block, the method may include: a step of determining a first predicted block of the current block according to the reference block; a step of determining a second predicted block of the current block by performing a prediction on the current block according to a first prediction mode, wherein the first prediction mode is a non-intra template matching prediction mode; and a step of determining a predicted value of the current block according to the first predicted block and the second predicted block.
[0528] It should be explained that, in the embodiments of the present application, the first prediction mode may be a prediction mode different from the intra-template matching prediction mode used by the current block, for example, a PLANAR mode, a CCLM mode, an angle prediction mode, etc. Here, weighted fusion can be performed on the first prediction block and the second prediction block to determine the predicted value of the current block.
[0529] That is, in an embodiment of the present application, when determining the predicted value of the current block, modifications to the predicted value may be performed through a local filtering method, or modifications to the predicted value may be performed through weighting of multiple predicted values.
[0530] In some embodiments, when there are multiple vector parameters of the current block, the step of determining a predicted value of the current block according to the vector parameters of the current block may include: a step of determining multiple reference blocks of the current block according to the multiple vector parameters of the current block; and a step of determining a predicted value of the current block according to the reference blocks.
[0531] Further to be explained, in an embodiment of the present application, the step of determining a predicted value of a current block according to a plurality of reference blocks may include: a step of determining a plurality of predicted blocks of a current block according to a plurality of reference blocks; and a step of determining a predicted value of a current block by performing weighted fusion on a plurality of predicted blocks.
[0532] It is understandable that in IntraTMP mode, in addition to obtaining predicted values using the basic copying method, there exist methods for obtaining predicted values by performing filtering fusion using locations corresponding to multiple BVs, as well as methods for fusion prediction with general Intra mode.
[0533] In some embodiments, the step of determining the predicted value of the current block according to the vector parameters of the current block may further include: a step of determining a method for constructing the predicted value of the current block; and a step of determining the predicted value of the current block according to the vector parameters of the current block and the method for constructing the predicted value.
[0534] In a specific embodiment, the step of determining the prediction value construction method of the current block may include: a step of determining a candidate list of prediction value construction candidates for the current block—the candidate list of prediction value construction candidates includes at least one candidate prediction value construction method—; a step of performing cost calculation for each of the at least one candidate prediction value construction method to determine at least one cost result; and a step of determining a minimum cost result from at least one cost result and determining a candidate prediction value construction method corresponding to the minimum cost result as the prediction value construction method of the current block.
[0535] It should be explained that in the embodiments of the present application, the cost result can be determined by using a distortion value, specifically by using a rate distortion cost method, but it may be the size of SAD, the size of MSE, the size of SSE, or other criteria for judgment costs, and is not specifically limited here.
[0536] In some embodiments, the method further comprises the step of determining the value of a first syntax element—the value of the first syntax element is to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list—; and the step of performing encoding processing on the value of the first syntax element and writing the obtained encoding bit to a bit stream.
[0537] That is, when determining the predicted value of the current block, a list of candidate prediction values is determined through various single predicted values, predicted values after filtering, predicted values after weighting, and / or methods for constructing these predicted values, and by transmitting the syntax elements transmitted through the bit stream to the decoding end and decoding the bit stream at the decoding end, it is possible to determine which of the candidate list of prediction values is used to obtain the actual predicted value.
[0538] In some embodiments, the method further comprises the steps of: determining the value of a second syntax element; and performing encoding processing on the value of the second syntax element and writing the obtained encoding bit to a bit stream.
[0539] It is to be explained that, in an embodiment of the present application, the value of the second syntax element is intended to indicate whether the current block is using an intra-template matching prediction mode. Here, if the current block is using an intra-template matching prediction mode, it is determined that the value of the second syntax element is a first preset value; and if the current block is not using an intra-template matching prediction mode, it is determined that the value of the second syntax element is a second preset value.
[0540] In an embodiment of the present application, the first preset value and the second preset value are different. Here, 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.
[0541] Further explanation is that in an embodiment of the present application, when the current block uses an intra-template matching prediction mode, a step of determining a first candidate list of the current block is executed, that is, the encoding method illustrated in FIG. 17 is executed. That is, the method of an embodiment of the present application is applied to an intra-template matching prediction mode.
[0542] That is, in IntraTMP mode, in addition to obtaining predicted values using the basic copying method, there are methods to obtain predicted values by fusing locations corresponding to multiple BVs, methods to perform filtering on reference blocks corresponding to BVs and then copying, and methods to interpolate the corresponding reference blocks using BVs as subsamples and then copy. For example, during the decoding end region search process, a list of BV candidates is obtained using template matching, and then the first N items (e.g., N=3) are selected to perform weighted fusion. The above method may be referred to as IntraTMP Fusion mode. Alternatively, after obtaining a single optimal BV, multiple points are taken around the BV, and weighted fusion is performed on the predicted values corresponding to the multiple points to obtain the predicted value. The above method may be referred to as IntraTMP FLM mode. Alternatively, after obtaining a single optimal BV, a sequence arrangement is performed on the template with subsample precision to select the optimal direction and precision, and a predicted value is calculated using an interpolation filter; the above method may be referred to as the IntraTMP SubPel mode. It is not specifically limited thereto.
[0543] In some embodiments, after step S1705, referring to FIG. 18, the method further includes the following steps.
[0544] In step S1801, the predicted difference value of the current block is determined according to the predicted value of the current block.
[0545] In step S1802, encoding processing is performed on the predicted difference value of the current block, and the obtained encoding bit is written to the bit stream.
[0546] It should be explained that in an embodiment of the present application, after determining the predicted value of the current block according to the vector parameters of the current block, the predicted difference value of the current block may be additionally determined according to the predicted value of the current block. Specifically, the initial value of the current block may be determined, and a subtraction operation may be performed on the initial value and the predicted value of the current block to obtain the predicted difference value (residual) of the current block. In this way, the predicted difference value of the current block is recorded in a bit stream and transmitted to a decoding end, so that the decoding end obtains the predicted difference value of the current block through bit stream decoding and additionally determines the reconstruction value of the current block, thereby implementing the reconstruction of the current block.
[0547] In some embodiments, the embodiments of the present application provide a bit stream, said bit stream is generated by performing bit encoding on information to be encoded; wherein the information to be encoded includes at least one of a predicted difference value of a current block, a value of a first syntax element, and a value of a second syntax element.
[0548] In an embodiment of the present application, the value of the first syntax element is 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 to indicate whether the current block uses an intra-template matching prediction mode.
[0549] An embodiment of the present application provides an encoding method, specifically a method for expanding the coverage range of an Intra TMP search list. First, a first candidate list of the current block is determined, wherein the first candidate list includes one or more candidate vector parameters. Next, a second location block is determined according to at least one of the candidate vector parameters in the first candidate list and the vector parameters of the first location block of the current block. When the encoding parameter of the second location block includes the vector parameters, it is determined whether the vector parameters of the second location block satisfy a second condition according to the vector parameters of the second location block. When the vector parameters of the second location block satisfy the second condition, the first candidate list is updated according to the vector parameters of the second location block. Finally, the predicted value of the current block is determined according to the first candidate list after the update. In this way, when updating the first candidate list, the vector information of some second location blocks can be expanded according to the candidate vector parameters in the initial first candidate list and / or the vector parameters of the first location block (spatially adjacent and non-adjacent blocks of the current block), and the first candidate list can be supplemented according to the expanded vector information, thereby effectively utilizing the already reconstructed information of spatially adjacent and non-adjacent blocks. Furthermore, under the premise of guaranteeing encoding complexity, candidate vector information can be inferred based on the vector information of these already reconstructed blocks, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, and further saving bit rates, thereby enhancing encoding and decoding efficiency and improving encoding and decoding performance.
[0550] In another embodiment of the present application, based on the encoding and decoding method of the aforementioned embodiment, in the prediction process of IntraTMP, an adaptive relocation BV list is established to ensure sufficient utilization of all adjacent reconstructed sampling point information, and a different approach is adopted to reduce the search range by considering the complexity of the search area at a relative position different from the current block.
[0551] The prediction process of the embodiments of the present application is described in detail below.
[0552] In the input of IIntraTMP, the current block position (xTbCmp, yTbCmp), the current block width nTbW, and the current block height nTbH.
[0553] In the output of IntraTMP, the predicted value of the current block is predSamples[x][y], where x=0..nTbW-1 and y=0..nTbH-1.
[0554] Specifically, the prediction process of IntraTMP technology can be divided into four stages: determining the current template type, acquiring samples for reconstructing the current template, determining block vectors within a predefined search range, and generating predicted values. In this way, the predicted value of the current block can be obtained through the above process. It should be noted that Intra TMP-FLM technology can be applied to the prediction of the luminance component as well as the chroma component, and is not specifically limited thereto.
[0555] Here, regarding block vector determination ,The search process of IntraTMP is mainly divided into an initialization process, determining the search area of the template within the current frame, searching within the search area, and determining the optimal block vector, as specifically illustrated in Figure 4 above. Here, when searching for the optimal matching template in the search area, a search strategy can be adopted in which a rough search is performed first, followed by a detailed search.
[0556] Here, the approximate search may specifically determine the optimal approximate matching template in the search area with a first search step length (e.g., 3) or determine the optimal approximate matching template in the search area with a downsampled template (e.g., the downsampling factor is 3).
[0557] Here, fine-finish search may specifically determine the optimal fine-finish matching template in the search area with a second search step length (e.g., 1, in the case of subsample precision, subsample interpolation must be performed on the reconstructed samples, which is not described in detail here) or determine the optimal fine-finish matching template around the optimal approximate matching template after completing the approximate search.
[0558] In Step 1, initialize.
[0559] Here, uiPatchWidth can be initialized to nTbW + templateW_size and uiPatchHeight to nTbH + templateH_size, where templateW_size and templateH_size may be fixed constants or may be dynamically adjusted according to the size of the coding block, and templateW_size and templateH_size may be the same or different. For example, templateW_size=4, templateH_size=4; or when the width of the coding block is greater than 8, templateW_size is set to 4, and when the width of the coding block is less than or equal to 8, templateW_size is set to 2; when the height of the coding block is greater than 8, templateH_size is set to 4, and when the height of the coding block is less than or equal to 8, templateH_size is set to 2. The specific implications of the parameters are as illustrated in the aforementioned FIG. 5.
[0560] The cost threshold between templates is initialized and denoted as diffThreshold, for example, when the cost function is SAD, the threshold can be diffThreshold = ((1 << bitDepth) >> 2) * (uiPatchHeight * uiPatchWidth - nTbH * nTbW), and when the picture bit depth bitDepth is 10, diffThreshold indicates that the distortion threshold for each sample point in the template region is 256.
[0561] Initializes the location of the coding tree block CTB where the coding block CB is located, ctbRsX, ctbRsY.
[0562] Initializes the current Cb as the position offset within the current CTB, and offsetLCBY = yTbCmp - ctbRsY, offsetLCBX = xTbCmp - ctbRsX.
[0563] Initialize iTemplateSizeH= templateH_size and iTemplateSizeW= templateW_size.
[0564] Initialize iBvShift, where iBvShift is the precision of the block vector BV. The precision of BV can be integer sample precision, where iBvShift is 0, and the precision of BV can be subsample precision, for example, when iBvShift is 1, it represents 1 / 2 sample precision, and when iBvShift is 2, it represents 1 / 4 sample precision.
[0565] Initializes the pre-configured search range of the template, and the pre-configured search range of the template can be set to a fixed size or can be dynamically adjusted according to the coding block size, for example,
[0566] searchRangeWidth = TMP_SEARCH_RANGE_MULT_FACTOR * nTbW;
[0567] searchRangeHeight = TMP_SEARCH_RANGE_MULT_FACTOR * nTbH;
[0568] Here, the value of TMP_SEARCH_RANGE_MULT_FACTOR is a preset value, for example, set to a fixed value of 5.
[0569] In Step 2, determine the search area of the template within the current frame.
[0570] Here, the above search area can be divided into two types.
[0571] One is a surrounding rectangular search area. It is divided into two parts: one in which all sampling points within the area have been reconstructed (referred to as the total reconstructed area), for example, including four areas R1 to R4 in Fig. 6; and one in which it is uncertain whether all sampling points within the area have been reconstructed (referred to as the pending reconstructed area), for example, including two areas R5 to R6 in Fig. 6.
[0572] One is an extended search area. It is defined as an area pointed to by a BV corresponding to spatially adjacent and non-adjacent location PUs, and in the embodiment corresponding to FIG. 6, said area may be considered as R7; and the area pointed to by automatic relocation may be considered as R8. Since search points in R7 and / or R8 may not necessarily be adjacent to each other, the search for the R7 and / or R8 areas is performed progressively along the list.
[0573] For search points within a search area, all search points within the specified search area can be traversed, or various methods can be adopted to limit the search range to a local area while considering computational complexity and coding efficiency. For example, for a pending reconstruction area (corresponding to the two areas R5–R6 in FIG. 6) or a whole reconstruction area (e.g., corresponding to the four areas R1–R4 in FIG. 6), the width of the search range can be limited to the original 1 / wIndex and the height to the original 1 / hIndex, where wIndex and hIndex are both arbitrary positive integers greater than or equal to 1. The limited search range takes the area closer to the unit to be encoded. Also, for example, when reducing the search range of the R5 area, the width of the R5 search area can be reduced to half of the original and the height to half of the original, and the final search range can take the upper-right quarter area of the R5 area.
[0574] In step 3, the optimal block vector BV is determined by searching in the search area.
[0575] bvXMins and bvXMaxs represent the minimum and maximum offsets of the block vector in the horizontal direction, respectively, and bvYMins and bvYMaxs represent the minimum and maximum offsets of the block vector in the vertical direction, respectively.
[0576] bvXMins regionId , bvXMaxs regionId , bvYMins regionId , bvYMaxs regionId is iVerMin determined in Step 2 regionId , iVerMax regionId , iHorMin regionId , iHorMax regionId It can be calculated through,
[0577] bvXMins regionId = iHorMin regionId - xTbCmp;
[0578] bvXMaxs regionId = iHorMax regionId - xTbCmp;
[0579] bvYMins regionId = iVerMin regionId - yTbCmp;
[0580] bvYMaxs regionId = iVerMax regionId - yTbCmp;
[0581] Here, bvXMins regionId , bvXMaxs regionId , bvYMins regionId and bvYMaxs regionId It determines the horizontal and vertical offset range for the current block of the search point, that is, the range of the block vector BV.
[0582] For the entire reconstruction area (e.g., corresponding to the four areas R1 to R4 in Fig. 6), a matching reconstruction block of one current block in the reconstruction area can be found through the search points (iPosHor, iPoxVer) within each search area, that is, each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0583] For pending reconstruction areas (e.g., corresponding to the two areas R5–R6 in Fig. 6), availability is determined through search points (iPosHor, iPoxVer) within each search area, i.e., each block vector BV (composed of a horizontal component and a vertical component, (pX, pY), where pX=iPosHor-xTbCmp and pY=iPosVer-yTbCmp, so pX is located between bvXMins and bvXMaxs and pY is located between bvYMins and bvYMaxs), and
[0584] If available, a matching reconstruction block for a single current block can be found in the reconstruction area, and the adjacent reconstruction sample of the matching reconstruction block is the matching template. In this way, the matching cost between the adjacent template of the current block and the adjacent template of the reconstruction block can be calculated and denoted as pDiff.
[0585] If unavailable, template matching cost calculation is not performed.
[0586] Here, the determination of availability includes, but is not limited to, the simultaneous satisfaction of one or more of the following conditions, and
[0587] ● Each sampling point within the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0588] ● Each sampling point within the reconstruction block corresponding to the template does not exceed the valid coordinate range defined by the picture sampling point boundary;
[0589] ● Each sampling point within the template and each sampling point within the corresponding reconstruction block do not exceed the defined range of the search window;
[0590] ● Whether each sampling point within the template is on the same Tile as the current encoding area;
[0591] ● Whether each sampling point within the reconstruction block corresponding to the template is on the same Tile as the current encoding area;
[0592] ● All sampling points within the template are reconstructed;
[0593] ● Each sampling point within the reconstruction block corresponding to the template is not located in the current encoding area;
[0594] ● All sampling points within the reconstruction block corresponding to the template are reconstructed;
[0595] All available search points in all search ranges (regionId=0, 1, 2, 3, 4, 5) are iterated through to obtain the 30 search points with the smallest matching cost pDiff, the corresponding matching cost is denoted as pDiff_BEST[n], where n=0,…,29, the corresponding block vector BV is denoted as the optimal block vector BV_BEST[n], where each item is a single coordinate pair (pX_BEST, pY_BEST), where n=0,…,29, and the corresponding matching template is the optimal matching template T_BEST[n], where n=0,…,29.
[0596] In a possible implementation, if the search strategy first performs a rough search and then performs a fine search, it may be as illustrated in FIG. 7. A specific implementation involves constructing a rough search list within a search area and determining a fine search list around the rough search list BV with a step length of 1.
[0597] Regarding possible implementation methods, with reference to FIG. 19 for the approximate search step, specific implementation is as follows.
[0598] In step S1901, an initial approximate search list is constructed within the search area with a step length of 3.
[0599] What needs to be explained is that pX within each region is bvXMins regionId and bvXMaxs regionId Located between, and pY is bvYMins regionId wa bvYMaxs regionIdWithin the search range located between, an approximate search is performed with a step length of 3. The preceding P optimal matching costs obtained by template matching through the approximate search with a step length of 3 are recorded as pDiff1_BEST[p], where p=0,…,P-1, and the corresponding block vector BV is recorded as the optimal block vector BV1_BEST[p], where p=0,…,P-1. Here, P can be 1 or an integer value greater than 1 depending on demand, and the search region where the optimal matching search point is located is bestRegionId[p], where p=0,…,P-1.
[0600] In step S1902, the Intra TMP_Merge list is constructed to update the approximate search list.
[0601] After searching for P reference points in the search area, a list of candidate BVs that the current block can reference is constructed using multiple predefined search positions, referred to as the IntraTMP_Merge list.
[0602] Predefined search locations may use, for example, five spatially adjacent locations in the current block, left (xTbCmp-1, yTbCmp+nTbH-1), top-left (xTbCmp-1, yTbCmp-1), top (xTbCmp+nTbW-1, yTbCmp-1), top-right (xTbCmp+nTbW, yTbCmp-1), bottom-left (xTbCmp-1, yTbCmp+nTbH), and 18 spatially non-adjacent locations (as shown in FIG. 9).
[0603] In an embodiment of the present application, an embodiment of the construction process checks whether the PU corresponding to this location uses IntraTMP / IBC technology, and if it does, stores the BV of this PU in the IntraTMP_Merge list. After constructing the IntraTMP_Merge list, an update is performed on the approximate search list. The specific operation of the update is to sequentially access each item in this list, calculate the template matching cost corresponding to each BV, compare this cost with the template matching cost of the initial approximate search list, and if it is smaller than the maximum template matching cost of the approximate search list, replace this BV with the least expensive BV in the approximate search list. The specific operation is, for example, to insert this BV into the approximate search list in order of cost size and delete the item with the largest cost in the approximate search list. Then, the search region bestRegionId is set to 6. It should also be noted that the above construction process is actually a list merging process; however, the list of results corresponding to R1 through R6 is constructed first, and then the result of R7 is inserted into the appropriate position in the said list. In practice, other search orders and merging strategies may exist.
[0604] In an embodiment of the present application, depending on the requirements of the algorithm, one or more fine search reference points (indicated here as M, where 1 <= M <= P) are provided in the approximate search step and passed to the next step. For example, M=1.
[0605] In step S1903, the Intra TMP_EBVP list is constructed to update the approximate search list.
[0606] After updating the approximate search list according to the IntraTMP_Merge list, for each BV inserted into the approximate search list from each Merge list, construct one IntraTMP_EBVP list and perform updates on the approximate search list according to the list,
[0607] First, for each current BV, a corresponding IntraTMP_EBVP list is constructed from scratch. 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), and bottom-right (xTbCmp+nTbW-1, yTbCmp+nTbH-1) are determined, and after adding the current BV to these five position coordinates, the corresponding PU is checked whether it uses a BV-based prediction technique (i.e., IBC / IntraTMP).
[0608] If used, the sum of the BV stored in the corresponding PU and the current BV (vector sum, i.e., adding the vertical and horizontal components respectively) is denoted as BV' and added to the TMP_EBVP list; then, the next BV' is considered as the current BV, and the above operation is repeated for this BV' to continuously build the available options in the TMP_EBVP list; if not used, the next position is checked.
[0609] In this way, the construction of the current IntraTMP_EBVP list is completed by repeating the above operation until all 5 locations are inspected, or until the number of IntraTMP_EBVP lists being constructed is greater than T (e.g., T can take 15). Additionally, the number can be limited to a relatively small value such as 1, 2, 5, or 10, or it can be limited so that future operations are not performed if SAD exceeds a specified threshold, or it can be limited to a total number of expansions (similar to the IBC-ARBVP method, a limited length end of the merge list is optionally added until the list is filled, in which case R7 and the new R7 can be considered the same candidate region); or it can be limited to both the number and SAD, etc.
[0610] In an embodiment of the present application, after the current IntraTMP_EBVP list is completed, an update is performed on the approximate search list. The specific operation of the update is to sequentially access each BV in the IntraTMP_EBVP list, calculate the corresponding template matching cost, compare this cost with the template matching cost of the BV in the approximate search list to be updated, and if it is smaller than the maximum template matching cost of the approximate search list, replace this BV with the least expensive BV in the approximate search list. The specific replacement operation is, for example, to insert this BV into the approximate search list in order of cost size and delete the item with the largest cost in the approximate search list. The search region bestRegionId where the newly inserted BV in the approximate search list is located is set to 7. It should be noted that the function of the search region bestRegionId here is originally intended to provide a basis for accessing surrounding samples during fine-grained search and filtering.
[0611] It is necessary to explain further that regarding steps S1902 and S1903, the so-called “update” is essentially a process of merging lists, and such an update order does not necessarily exist. It is also necessary to explain that in memory storage, there are three lists: the approximate search list, the Intra TMP-Merge list, and the Intra TMP-EBVP list. Here, the approximate search list is essential, while the other two lists may not actually be constructed and are used as a single inspection order; when one suitable option is inspected, it is used to update the approximate search list.
[0612] Furthermore, after the approximate search is completed, a detailed search list can be determined around the approximate search list BV with a step length of 1. Specifically, the optimal block vector BV1_BEST[p], p=0,…,M-1 obtained from the approximate search is used as a detailed search reference point to perform a search around it.
[0613] In a specific embodiment, for each fine search reference point, the fine search range TmpRefineRangeHor and TmpRefineRangeVer are first determined, and the fine search range may be of a fixed size and may also be related to the search area, for example, in the case of a reference point where the search area is 0 to 5, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 1, and in the case of a reference point where the search area is 6, both TmpRefineRangeHor and TmpRefineRangeVer may be set to 2, and then the location of the optimal matching reconstruction block obtained by approximate search is calculated and used as the reference location of the fine search area, and BestPosX = xTbCmp + pX1_BEST, BestPosY = yTbCmp + pY1_BEST.
[0614] Using a direct search window, the fine-grained search area is treated as a single entire pending reconstruction area and traversed directly.
[0615] A new search range is obtained based on the optimal matching block location obtained through approximate search, and
[0616] iHorMax refine = min(picWidth - nTbW, BestPosX + TmpRefineRangeHor);
[0617] iHorMin refine = max( iTemplateSizeW, BestPosX - TmpRefineRangeHor);
[0618] iVerMax refine = min(picHeight - nTbH, BestPosY + TmpRefineRangeVer);
[0619] iVerMin refine = max( iTemplateSizeH, BestPosY - TmpRefineRangeVer );
[0620] Next, the adjusted block vectors BVbvXMins, bvXMaxs, bvYMins, bvYMaxs are iVerMin refine , iVerMax refine , iHorMin refine , iHorMax refine It can be calculated through,
[0621] bvXMins = iHorMin refine - xTbCmp;
[0622] bvXMaxs = iHorMax refine - xTbCmp;
[0623] bvYMins = iVerMin refine - yTbCmp;
[0624] bvYMaxs = iVerMax refine - yTbCmp;
[0625] Fine-grained search is pX bvXMins refine and bvXMaxs refine Located between, and pY is bvYMins refine and bvYMaxs refine It is performed within the range of block vectors located between them; that is, it traverses all search locations within the direct fine-grained search window and sequentially determines availability. For example, a search is performed with a step length of 1, and the preceding T optimal matching costs obtained by template matching of available points are recorded as pDiff_BEST[t], where t=0,…,T-1, and the corresponding block vector BV is represented as the optimal block vector BV_BEST[t], where t=0,…,T-1. Here, T is 1 or an integer greater than 1. For example, T=1.
[0626] In this way, after completing the above operation, the results of the approximate search and detailed search processes (wherein the detailed selection process includes one or more reference point searches) can be 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). Here, pX_BEST and pY_BEST are the horizontal offset and vertical offset of the current coding block template of the optimal matching template, respectively, and are also the horizontal offset and vertical offset of the current coding block of the optimal matching reconstruction block.
[0627] Further explanation is that in the embodiments of the present application, adjustments can be made to the aforementioned search method.
[0628] In a possible implementation, the BV list updated from the Intra TMP_Merge list through Intra TMP_EBVP can be merged with the list of original rectangular search areas to form a new approximate search list, and then a detailed search can be performed. Referring to FIG. 20, a specific embodiment is as follows.
[0629] In step S2001, the Intra TMP_Merge list is constructed to update the approximate search list.
[0630] In step S2002, the Intra TMP_EBVP list is constructed to update the approximate search list.
[0631] In step S2003, an initial approximate search list is constructed within the search area with a step length of 3.
[0632] In step S2004, a new approximate search list is determined.
[0633] In step S2005, a detailed search list is determined around the approximate search list BV with a step length of 1.
[0634] In another possible implementation method, an EBVP update is performed on the list of original rectangular search areas, and after merging with the Intra TMP_Merge list to create a new approximate search list, a fine-grained search can be performed. Referring to FIG. 21, a specific implementation is as follows.
[0635] In step S2101, an initial approximate search list is constructed within the search area with a step length of 3.
[0636] In step S2102, the Intra TMP_EBVP list is constructed to update the approximate search list.
[0637] In step S2103, the Intra TMP_Merge list is constructed to update the approximate search list.
[0638] In step S2104, a new approximate search list is determined.
[0639] In step S2105, a detailed search list is determined around the approximate search list BV with a step length of 1.
[0640] In another possible implementation method, the list of original rectangular search areas is first updated with an Intra TMP_Merge list, and then an EBVP update is performed on the modified list. In the second update process, all options of the updated approximate search list can be constructed based on the Intra TMP_EBVP list, and a detailed search is performed using the final list as the new approximate search list. Referring to FIG. 22, the specific implementation is as follows.
[0641] In step S2201, an initial approximate search list is constructed within the search area with a step length of 3.
[0642] In step S2202, the Intra TMP_Merge list is constructed to update the approximate search list.
[0643] In step S2203, the Intra TMP_EBVP list is constructed to update the approximate search list.
[0644] In step S2204, a detailed search list is determined around the approximate search list BV with a step length of 1.
[0645] It is further explained that in the embodiments of the present application, inspection can be performed only on all BVs replaced by the IntraTMP_Merge list in the approximate selection list, and adjustment can also be performed on the BV objects to be inspected and their number in the IntraTMP_EBVP list.
[0646] For example, you can perform a check using the first 5 of the corresponding BV set or the first 10 of the corresponding BV set. Alternatively, you can limit the number of checks based on the size of the current block; for example, check the first 5 for blocks with a size of 16x16 or less, and check the first 10 for other sizes. Alternatively, you can perform clustering on the approximate selection list, where the clustering rule is the geometric distance to the clustering center. The number of clustering centers is 2 to 5, but EBVP operations are performed on the clustering centers. Alternatively, you can add BVs of EBVP to the end of the IntraTMP_Merge list until the IntraTMP_Merge list is filled, and update the initial approximate search list with this IntraTMP_Merge list, i.e., the number is limited to the number of unfilled items in the IntraTMP_Merge list.
[0647] It should be further explained that in the embodiments of the present application, the IntraTMP_EBVP list length can be modified to a different value. For example, the list length can be limited to 1, 2, 5, or 10.
[0648] Further explanation is that in the embodiment of the present application, limitation can be performed according to the template cost (e.g., SAD, SATD, etc.) corresponding to the BV, and for each BV of the EBVP, the template cost is first calculated to limit one cost threshold, and the BV that does not exceed the threshold is added back to the EBVP list.
[0649] Further explanation is that in the embodiments of the present application, sub-sample search can be implemented in the fine-grained search step.
[0650] Further explanation is that, in an embodiment of the present application, when constructing the prediction value of the current block, a modification to the prediction value may be performed through a local filtering method. Alternatively, when constructing the prediction value of the current block, a modification to the prediction value may be performed through multiple prediction value weights. Alternatively, when constructing the prediction value, a candidate list of prediction values may be constructed through various single prediction values, prediction values after filtering, prediction values after weighting, and / or methods for constructing such prediction values, and a syntax element transmitted through a bit stream may determine at the decoding end which of the candidate list to use to obtain the actual prediction value.
[0651] It is further explained that in the embodiments of the present application, the IntraTMP_Merge list may not be used, that is, the expansion is performed based on the BV obtained by directly searching within the search window in IntraTMP.
[0652] It should be further explained that in the embodiments of the present application, the search may not be divided into approximate and detailed search steps, but merely a one-time search is performed, and then the BV options are expanded based on the one-time search results to obtain a final BV result.
[0653] Further explanation is that in an embodiment of the present application, the IntraTMP_Merge list updates the approximate search list by taking only the first K (e.g., K can take 5) and performs expansion only on the basis of each BV of the IntraTMP_Merge list.
[0654] Further explanation is that in an embodiment of the present application, IntraTMP_Merge and IntraTMP_EBVP are used together to maintain a single Merge list, first taking the first P BVs (e.g., P can take 5) of the IntraTMP_Merge list, and performing an IntraTMP_EBVP expansion based on these P BVs to construct a new Merge list of length L (e.g., L can take 28). After 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 the order is arranged, and then the first Q (e.g., Q can take 5) of the arranged list are taken and an update is performed on the approximate selection list.
[0655] In the embodiments of the present application, the specific implementation of the aforementioned embodiments has been described in detail through the embodiments. As can be seen therefrom, according to the technical method of the aforementioned embodiments, a method for expanding the scope of application of the IntraTMP search list is proposed hereto to increase the BV candidate locations inferred based on the BV information of the reconstructed blocks, thereby effectively improving encoding accuracy. That is, the present technical method effectively utilizes information on spatially adjacent and non-adjacent reconstructed blocks and, under the premise of not significantly increasing encoding complexity, expands the scope of the IntraTMP search area, thereby improving prediction accuracy and enhancing encoding and decoding efficiency and encoding and decoding performance.
[0656] In another embodiment of the present application, based on the same inventive concept as the previously described embodiment, FIG. 23 is an exemplary diagram of the configuration structure of an encoder provided in an embodiment of the present application. As shown in FIG. 23, the encoder (230) may include a first determination unit (2301), a first update unit (2302), and a first prediction unit (2303), and
[0657] The first decision unit (2301) is configured to determine a first candidate list of the current block, and the first candidate list includes one or more candidate vector parameters, and
[0658] The first update unit (2302) is configured to determine a second position block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first position block of a current block, and when the encoding parameter of the second position block includes a vector parameter, determine whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block, and when the vector parameter of the second position block satisfies the second condition, update the first candidate list according to the vector parameter of the second position block.
[0659] The first prediction unit (2303) is configured to determine the predicted value of the current block according to the first candidate list after the update.
[0660] In some embodiments, the first determination unit (2301) is also configured to determine 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 encoding parameter of the first position block of the current block includes a vector parameter; and to determine a second position block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition.
[0661] In some embodiments, the vector parameters include block vector parameters and / or motion vector parameters.
[0662] In some embodiments, the first determination unit (2301) is also configured to determine a first search area of the current block; and, according to the first search area, to determine a first candidate list of the current block.
[0663] In some embodiments, the first determination unit (2301) is also configured to determine a first template of the current block; and, according to the first template, to determine a first search area of the current block.
[0664] In some embodiments, the first determination unit (2301) is also configured to perform a search within a first search area according to a first search step length to determine one or more first candidate vector parameters; and to add one or more first candidate vector parameters to a first candidate list of the current block.
[0665] In some embodiments, the first determination unit (2301) is also configured to iterate through search points in a first search area according to a first search step length and determine a first matching cost value between a matching template corresponding to a search point in the first search area and a first template according to a preset matching criterion; determine one or more matching search points according to the first matching cost value and determine one or more first candidate vector parameters according to the one or more matching search points.
[0666] In some embodiments, the first condition includes that the cost value corresponding to the vector parameter of the first location block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0667] In some embodiments, the first determination unit (2301) is also configured to determine a cost value corresponding to a vector parameter of the first position block according to a matching cost value between a matching template corresponding to a vector parameter of the first position block and a first template; determine a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and a first template; and determine that the vector parameter of the first position block satisfies the first condition when the cost value corresponding to the vector parameter of the first position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0668] In some embodiments, the first update unit (2302) is also configured to update the first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition.
[0669] In some embodiments, the first update unit (2302) is also configured to add vector parameters of the first position block to the first candidate list.
[0670] In some embodiments, the second position block represents the reference block pointed to by the vector parameter of the first position block.
[0671] In some embodiments, the second location block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first location block.
[0672] In some embodiments, the number of second position blocks is one or a plurality.
[0673] In some embodiments, the second condition includes that the cost value corresponding to the vector parameter of the second location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list.
[0674] In some embodiments, the first determination unit (2301) is also configured to determine a cost value corresponding to a vector parameter of the second position block according to a matching cost value between a matching template corresponding to a vector parameter of the second position block and a first template; determine a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and a first template; and determine that the vector parameter of the second position block satisfies the second condition if the cost value corresponding to the vector parameter of the second position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0675] In some embodiments, the first update unit (2302) is also configured to add the vector parameter of the second position block to the first candidate list.
[0676] In some embodiments, the first update unit (2302) is also configured to determine a first set of candidates for the current block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition, and to update a first candidate list according to the first set of candidates; and to determine a second set of candidates for the current block according to the vector parameter of the second position block when the vector parameter of the second position block satisfies a second condition, and to update a first candidate list according to the second set of candidates; and the first prediction unit (2303) is also configured to determine a predicted value of the current block according to the first candidate list after the update.
[0677] In some embodiments, the first update unit (2302) also determines a cost value corresponding to a second candidate vector parameter in a first candidate set and determines a maximum cost value corresponding to one or more candidate vector parameters in a first candidate list; and if the cost value corresponding to the second candidate vector parameter is smaller than the maximum cost value in the first candidate list, the first candidate list is configured to update the first candidate list by replacing the candidate vector parameter corresponding to the maximum cost value in the first candidate list with the second candidate vector parameter; wherein the second candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0678] In some embodiments, the first update unit (2302) is also configured to add a 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 after the update.
[0679] In some embodiments, the first determination unit (2301) is also configured to determine one or more second candidate vector parameters updated in the first candidate list by the first candidate set; determine a second location block according to the one or more second candidate vector parameters, and determine a second candidate set of the current block according to the vector parameters of the second location block.
[0680] In some embodiments, the first decision unit (2301) is also configured to update the first candidate list according to the first candidate set, determine the second location block according to all candidate vector parameters of the first candidate list after the update, and determine the second candidate set of the current block according to the vector parameters of the second location block.
[0681] In some embodiments, the first determination unit (2301) is also configured to update 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 location block according to the candidate vector parameters of N, and determine the second candidate set of the current block according to the vector parameters of the second location block; wherein N is a positive integer.
[0682] In some embodiments, the first determination unit (2301) is also configured to determine the value of N according to the size parameter of the current block.
[0683] In some embodiments, the first decision unit (2301) is also configured to update the first candidate list according to the first candidate set, and then perform clustering on the first candidate list after the update to determine M candidate vector parameters located at the clustering center; determine a second location block according to the M candidate vector parameters, and determine a second candidate set of the current block according to the vector parameters of the second location block, wherein M is a positive integer.
[0684] In some embodiments, the first decision unit (2301) is also configured to determine the completion of construction of the third candidate set when all vector parameters of the second location block are completely traversed or when the number of candidate vector parameters in the second candidate set is greater than the first threshold.
[0685] In some embodiments, the first update unit (2302) is also configured to determine a second matching cost value between a matching template corresponding to a third candidate vector parameter among a second candidate set and a first template according to a preset matching criterion; and if the second matching cost value is greater than a second threshold, to delete the third candidate vector parameter from the second candidate set and update the second candidate set, wherein the third candidate vector parameter is a vector parameter of any one of the second candidate sets.
[0686] In some embodiments, the first update unit (2302) is also configured to fill the vector parameters of the second position block into the first candidate set until the first candidate set is filled when the first candidate set of the current block is not filled; and to update the first candidate list according to the first candidate set after filling.
[0687] In some embodiments, the first update unit (2302) is also configured to determine the first K candidate vector parameters in the first set of candidates; and to update the first candidate list according to the first K candidate vector parameters; wherein K is a positive integer.
[0688] In some embodiments, the first update unit (2302) is also configured to determine the first P candidate vector parameters among the first candidate set; determine a second location block according to the P candidate vector parameters and determine the vector parameters of the second location block; if the vector parameters of the second location block satisfy the second condition, construct a fourth candidate set of the current block according to the vector parameters of the second location block, and if all P candidate vector parameters are traversed or the fourth candidate set is filled, determine the completion of constructing the fourth candidate set; determine a cost value corresponding to one or more candidate vector parameters among the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set according to the cost value corresponding to one or more candidate vector parameters; and update the first candidate list according to the Q candidate vector parameters, wherein P and Q are positive integers.
[0689] In some embodiments, the first prediction unit (2303) is also configured to determine the vector parameters of the current block based on the first candidate list after the update; and to determine the predicted value of the current block based on the vector parameters of the current block.
[0690] In some embodiments, the first determination unit (2301) is also configured to determine a second search area indicated by a candidate vector parameter in a first candidate list; and to perform a search within the second search area according to a second search step length to determine a vector parameter of the current block, wherein the value of the second search step length is smaller than the value of the first search step length.
[0691] In some embodiments, the first determination unit (2301) is also configured to perform a subsample search within a second search area according to a second search step length to determine the vector parameters of the current block.
[0692] In some embodiments, the first prediction unit (2303) is also 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 to determine a predicted value of the current block according to the reference block.
[0693] In some embodiments, the first prediction unit (2303) is also configured to perform filtering on a reference block to determine the reference block after filtering, and to determine the predicted value of the current block according to the reference block after filtering.
[0694] In some embodiments, the first prediction unit (2303) is also configured to determine a first prediction block of the current block according to a reference block; to perform a prediction on the current block according to a first prediction mode to determine a second prediction block of the current block; and to determine a predicted value of the current block according to the first prediction block and the second prediction block, wherein the first prediction mode is a non-intra template matching prediction mode.
[0695] In some embodiments, the first prediction unit (2303) is also configured to determine multiple reference blocks of the current block according to multiple vector parameters of the current block when there are multiple vector parameters of the current block; and to determine a predicted value of the current block according to multiple reference blocks.
[0696] In some embodiments, the first prediction unit (2303) is also configured to determine a plurality of prediction blocks of the current block according to a plurality of reference blocks; and to perform weighted fusion on the plurality of prediction blocks to determine the predicted value of the current block.
[0697] In some embodiments, the first prediction unit (2303) is also configured to determine a method for constructing the prediction value of the current block; and to determine the prediction value of the current block according to the vector parameters of the current block and the method for constructing the prediction value.
[0698] In some embodiments, the first determination unit (2301) is also configured to determine a candidate list of predicted value construction methods for the current block; to perform cost calculations for each of at least one candidate predicted value construction method to determine at least one cost result, and to determine a minimum cost result from at least one cost result to determine a candidate predicted value construction method corresponding to the minimum cost result to determine the predicted value construction method for the current block; wherein the candidate list of predicted value construction methods includes at least one candidate predicted value construction method.
[0699] In some embodiments, referring to FIG. 23, the encoder (230) further comprises a coding unit (2304), wherein the first determination unit (2301) is also configured to determine the value of a first syntax element; wherein the value of the first syntax element is to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list; and the coding unit (2304) is configured to perform encoding processing on the value of the first syntax element and write the obtained encoding bit to a bit stream.
[0700] In some embodiments, the first determination unit (2301) is also configured to determine the value of a second syntax element; wherein the value of the second syntax element is to indicate whether the current block uses an intra-template matching prediction mode; and the coding unit (2304) is also configured to perform encoding processing on the value of the second syntax element and write the obtained encoding bit to a bit stream.
[0701] In some embodiments, the first decision unit (2301) is also configured to perform the step of determining a first candidate list of the current block when the current block uses an intra-template matching prediction mode.
[0702] In some embodiments, the first determination unit (2301) is also configured to determine the predicted difference value of the current block according to the predicted value of the current block; and the coding unit (2304) is also configured to perform encoding processing on the predicted difference value of the current block and write the obtained encoding bit to a bit stream.
[0703] It can be understood that, in the embodiments of the present application, a “unit” may be a partial circuit, a partial processor, a partial program or software, etc., and of course may be a module, and may also be non-modular. Furthermore, each component in the present embodiment may be integrated into a single processing unit, or each unit may exist independently and physically, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of hardware or may be implemented in the form of a software function module.
[0704] When the integrated unit described above is implemented in the form of a software function module rather than being sold or used as an independent product, it may be stored on a single computer-readable storage medium. Based on this understanding, the technical solution of the present embodiment, or parts contributing to existing technology, or all or part of the technical solution described above may be implemented in the form of a software product. The computer software product is stored on a single storage medium and includes several instructions that cause a computer device (such as a personal computer, server, or network device) or processor to execute all or part of the steps of the method described in the present embodiment. The aforementioned storage medium includes various media capable of storing program code, such as U disks, mobile disks, Read-Only Memory (ROM), Random Access Memory (RAM), magnetic disks, or optical disks.
[0705] Accordingly, an embodiment of the present application provides a computer-readable storage medium applied to an encoder (230), said computer-readable storage medium has a computer program stored therein, and when said computer program is executed by a first processor, a method according to any one of the aforementioned embodiments is implemented.
[0706] Based on the configuration of the encoder (230) and the computer-readable storage medium, FIG. 24 is an example diagram of a specific hardware structure of the encoder provided in an embodiment of the present application. As illustrated in FIG. 24, the encoder (230) may include a first communication interface (2401), a first memory (2402), and a first processor (2403), and each component is coupled through a first bus system (2404). It is understood that the first bus system (2404) is intended to implement connection communication between these components. In addition to the data bus, the first bus system (2404) further includes a power bus, a control bus, and a status signal bus. However, for clarity, in FIG. 24, each of the various buses is referred to as the first bus system (2404). Here,
[0707] The first communication interface (2401) is for receiving and transmitting signals during the process of transmitting and receiving between other external network elements;
[0708] The first memory (2402) is for storing a computer program that can be operated on the first processor (2403);
[0709] The first processor (2403) is for determining, when operating the computer program, a first candidate list of the current block—the first candidate list includes one or more candidate vector parameters—; determining a second location block according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first location block of the current block; determining whether the vector parameters of the second location block satisfy a second condition according to the vector parameters of the second location block when the encoding parameters of the second location block include vector parameters; updating the first candidate list according to the vector parameters of the second location block when the vector parameters of the second location block satisfy the second condition; and determining the predicted value of the current block according to the first candidate list after the update.
[0710] It is understandable that the first memory (2402) in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. Here, the non-volatile memory may 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 may be a Random Access Memory (RAM) that serves as an external fast cache. By way of exemplary description rather than limiting, 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 linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus random access memory (DRRAM). The first memory (2402) of the system and method described in this application includes, but is not limited to, these memories and any other suitable type of memory.
[0711] The first processor (2403) may be an integrated circuit chip having the capability to process signals. In the implementation process, each step of the method may be completed by an integrated logic circuit in hardware or a software-type instruction within the first processor (2403). The first processor (2403) may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a separate gate or transistor logic device, or a separate hardware component. Each method, step, and logic block diagram disclosed in the embodiments of this application may be implemented or executed. The general-purpose processor may be a microprocessor or any general-purpose processor, etc. The steps of the method disclosed in combination with the embodiments of this application may be directly reflected to a hardware decoding processor to be executed and completed, or may be executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located on a storage medium widely known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, or a register. 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 method in combination with this hardware.
[0712] It is understandable that the embodiments described in this application may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing unit may be implemented among one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units or combinations for performing the functions described in this application. For a software implementation, the technology described in this application may be implemented through modules (e.g., processes, functions, etc.) that execute the functions described in this application. Software code may be stored in memory and executed through a processor. Memory may be implemented in the processor or outside the processor.
[0713] Optionally, as another embodiment, the first processor (2403) is also configured to implement any of the above-described methods when the computer program is operated.
[0714] The present embodiment provides an encoder, wherein, for the encoder, when updating a first candidate list, vector information of some second location blocks can be expanded according to candidate vector parameters in the initial first candidate list and / or vector parameters of a first location block (spatially adjacent and non-adjacent blocks of the current block), and the first candidate list can be supplemented according to the expanded vector information, thereby effectively utilizing already reconstructed information of spatially adjacent and non-adjacent blocks, and candidate vector information can be inferred according to such already reconstructed block vector information under the premise of guaranteeing encoding complexity, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, saving additional bit rates, and improving encoding and decoding performance by increasing encoding and decoding efficiency.
[0715] In another embodiment of the present application, based on the same inventive concept as the previously described embodiment, FIG. 25 is an exemplary diagram of the configuration structure of a decoder provided in an embodiment of the present application. As shown in FIG. 25, the decoder (250) may include a second decision unit (2501), a second update unit (2502), and a second prediction unit (2503), and
[0716] The second decision unit (2501) is configured to determine a first candidate list of the current block, and the first candidate list includes one or more candidate vector parameters, and
[0717] The second update unit (2502) is configured to determine a second position block according to at least one of a candidate vector parameter in a first candidate list and a vector parameter of a first position block of a current block, and when the decoding parameter of the second position block includes a vector parameter, determine whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block, and when the vector parameter of the second position block satisfies the second condition, update the first candidate list according to the vector parameter of the second position block.
[0718] The second prediction unit (2503) is configured to determine the predicted value of the current block according to the first candidate list after the update.
[0719] In some embodiments, the second determination unit (2501) is also configured to determine 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 decoding parameter of the first position block of the current block includes a vector parameter; and to determine the second position block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition.
[0720] In some embodiments, the vector parameters include block vector parameters and / or motion vector parameters.
[0721] In some embodiments, the second determination unit (2501) is also configured to determine a first search area of the current block; and, according to the first search area, to determine a first candidate list of the current block.
[0722] In some embodiments, the second determination unit (2501) is also configured to determine a first template of the current block; and, according to the first template, to determine a first search area of the current block.
[0723] In some embodiments, the second determination unit (2501) is also configured to perform a search within a first search area according to a first search step length to determine one or more first candidate vector parameters; and to add one or more first candidate vector parameters to a first candidate list of the current block.
[0724] In some embodiments, the second determination unit (2501) is also configured to iterate through search points in a first search area according to a first search step length and determine a first matching cost value between a matching template corresponding to a search point in the first search area and a first template according to a preset matching criterion; determine one or more matching search points according to the first matching cost value and determine one or more first candidate vector parameters according to the one or more matching search points.
[0725] In some embodiments, the first condition includes that the cost value corresponding to the vector parameter of the first location block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0726] In some embodiments, the second determination unit (2501) is also configured to determine a cost value corresponding to a vector parameter of the first position block according to a matching cost value between a matching template corresponding to a vector parameter of the first position block and a first template; determine a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and a first template; and determine that the vector parameter of the first position block satisfies the first condition if the cost value corresponding to the vector parameter of the first position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0727] In some embodiments, the second update unit (2502) is also configured to update the first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition.
[0728] In some embodiments, the second update unit (2502) is also configured to add the vector parameter of the first position block to the first candidate list.
[0729] In some embodiments, the second position block represents the reference block pointed to by the vector parameter of the first position block.
[0730] In some embodiments, the second location block represents the block pointed to by the vector parameter of the reference block pointed to by the vector parameter of the first location block.
[0731] In some embodiments, the number of second position blocks is one or a plurality.
[0732] In some embodiments, the second condition includes that the cost value corresponding to the vector parameter of the second location block is superior to the cost value corresponding to at least one candidate vector parameter in the first candidate list.
[0733] In some embodiments, the second determination unit (2501) is also configured to determine a cost value corresponding to a vector parameter of the second position block according to a matching cost value between a matching template corresponding to a vector parameter of the second position block and a first template; determine a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and a first template; and determine that the vector parameter of the second position block satisfies the second condition if the cost value corresponding to the vector parameter of the second position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list.
[0734] In some embodiments, the second update unit (2502) is also configured to add the vector parameter of the second location block to the first candidate list.
[0735] In some embodiments, the second update unit (2502) is also configured to determine a first set of candidates for the current block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition, and to update a first candidate list according to the first set of candidates; and to determine a second set of candidates for the current block according to the vector parameter of the second position block when the vector parameter of the second position block satisfies a second condition, and to update a first candidate list according to the second set of candidates; and the second prediction unit (2503) is also configured to determine a predicted value of the current block according to the first candidate list after the update.
[0736] In some embodiments, the second update unit (2502) also determines a cost value corresponding to a second candidate vector parameter in a first candidate set and determines a maximum cost value corresponding to one or more candidate vector parameters in a first candidate list; and if the cost value corresponding to the second candidate vector parameter is smaller than the maximum cost value in the first candidate list, the second candidate vector parameter is used to replace the candidate vector parameter corresponding to the maximum cost value in the first candidate list, thereby updating the first candidate list; wherein the second candidate vector parameter is a vector parameter of any one of the first candidate sets.
[0737] In some embodiments, the second update unit (2502) is also 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 after the update.
[0738] In some embodiments, the second determination unit (2501) is also configured to determine one or more second candidate vector parameters updated in the first candidate list by the first candidate set; determine a second location block according to the one or more second candidate vector parameters, and determine a second candidate set of the current block according to the vector parameters of the second location block.
[0739] In some embodiments, the second decision unit (2501) is also configured to update the first candidate list according to the first candidate set, determine the second location 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 parameters of the second location block.
[0740] In some embodiments, the second decision unit (2501) is also configured to update the first candidate list according to the first candidate set, and then determine the first N candidate vector parameters in the first candidate list after the update; determine the second location block according to the candidate vector parameters of N, and determine the second candidate set of the current block according to the vector parameters of the second location block; wherein N is a positive integer.
[0741] In some embodiments, the second determination unit (2501) is also configured to determine the value of N according to the size parameter of the current block.
[0742] In some embodiments, the second decision unit (2501) is also configured to update the first candidate list according to the first candidate set, and then perform clustering on the first candidate list after the update to determine M candidate vector parameters located at the clustering center; determine a second location block according to the M candidate vector parameters, and determine a second candidate set of the current block according to the vector parameters of the second location block, wherein M is a positive integer.
[0743] In some embodiments, the second decision unit (2501) is also configured to determine the completion of construction of the third candidate set when all vector parameters of the second location block are completely traversed or when the number of candidate vector parameters in the second candidate set is greater than the first threshold.
[0744] In some embodiments, the second update unit (2502) is also configured to determine a second matching cost value between a matching template corresponding to a third candidate vector parameter among the second candidate set and a first template according to a preset matching criterion; and if the second matching cost value is greater than a second threshold, to delete the third candidate vector parameter from the second candidate set and update the second candidate set, wherein the third candidate vector parameter is a vector parameter of any one of the second candidate sets.
[0745] In some embodiments, the second update unit (2502) is also configured to fill the vector parameters of the second position block into the first candidate set until the first candidate set is filled when the first candidate set of the current block is not filled; and to update the first candidate list according to the first candidate set after filling.
[0746] In some embodiments, the second update unit (2502) is also configured to determine the first K candidate vector parameters in the first set of candidates; and to update the first list of candidates according to the first K candidate vector parameters; wherein K is a positive integer.
[0747] In some embodiments, the second update unit (2502) is also configured to determine the first P candidate vector parameters among the first candidate set; determine a second location block according to the P candidate vector parameters and determine the vector parameters of the second location block; if the vector parameters of the second location block satisfy the second condition, construct a fourth candidate set of the current block according to the vector parameters of the second location block, and if all P candidate vector parameters are traversed or the fourth candidate set is filled, determine the completion of constructing the fourth candidate set; determine cost values corresponding to one or more candidate vector parameters among the fourth candidate set, and determine Q candidate vector parameters from the fourth candidate set according to the cost values corresponding to one or more candidate vector parameters; and update the first candidate list according to the Q candidate vector parameters, wherein P and Q are positive integers.
[0748] In some embodiments, the second prediction unit (2503) is also configured to determine the vector parameters of the current block based on the first candidate list after the update; and to determine the predicted value of the current block based on the vector parameters of the current block.
[0749] In some embodiments, the second determination unit (2501) is also configured to determine a second search area indicated by a candidate vector parameter in the first candidate list after updating; and to perform a search within the second search area according to a second search step length to determine a vector parameter of the current block, wherein the value of the second search step length is smaller than the value of the first search step length.
[0750] In some embodiments, the second determination unit (2501) is also configured to determine the vector parameters of the current block by performing a subsample search within the second search area according to the second search step length.
[0751] In some embodiments, the second prediction unit (2503) is also 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 to determine a predicted value of the current block according to the reference block.
[0752] In some embodiments, the second prediction unit (2503) is also configured to perform filtering on a reference block to determine the reference block after filtering, and to determine the predicted value of the current block according to the reference block after filtering.
[0753] In some embodiments, the second prediction unit (2503) is also configured to determine a first prediction block of the current block according to a reference block; to perform a prediction on the current block according to a first prediction mode to determine a second prediction block of the current block; and to determine a predicted value of the current block according to the first prediction block and the second prediction block, wherein the first prediction mode is a non-intra template matching prediction mode.
[0754] In some embodiments, the second prediction unit (2503) is also configured to determine multiple reference blocks of the current block according to multiple vector parameters of the current block when there are multiple vector parameters of the current block; and to determine a predicted value of the current block according to multiple reference blocks.
[0755] In some embodiments, the second prediction unit (2503) is also configured to determine a plurality of prediction blocks of the current block according to a plurality of reference blocks; and to determine a predicted value of the current block by performing weighted fusion on the plurality of prediction blocks.
[0756] In some embodiments, referring to FIG. 25, the decoder (250) may further include a decoding unit (2504), said decoding unit (2504) configured to decode a bit stream to determine the value of a first syntax element; and a second prediction unit (2503) configured to determine a method for constructing a predicted value of a current block according to the value of the first syntax element and a candidate list for constructing a predicted value of a current block; and to determine a predicted value of a current block according to the vector parameter of the current block and the method for constructing a predicted value.
[0757] In some embodiments, the decoding unit (2504) is also configured to decode a bit stream to determine the value of a second syntax element; and the second determination unit (2501) is also configured to perform the step of determining a first candidate list of the current block when the second syntax element indicates that the current block uses an intra-template matching prediction mode.
[0758] In some embodiments, the decoding unit (2504) is also configured to decode the bit stream to determine the predicted difference value of the current block; and the second determination unit (2501) is also configured to determine the reconstruction value of the current block according to the predicted difference value and the predicted value of the current block.
[0759] It can be understood that, in this embodiment, the “unit” may be a partial circuit, partial processor, partial program or software, etc., and may, of course, be a module or may also be non-modular. Furthermore, each component in this embodiment may be integrated into a single processing unit, or each unit may exist independently and physically, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of hardware or in the form of a software function module.
[0760] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it may be stored on a computer-readable storage medium. Based on this understanding, the present embodiment provides a computer-readable storage medium applied to a decoder (250), said computer-readable storage medium has a computer program stored on it, and implements a method according to any one of the aforementioned embodiments when said computer program is executed by a second processor.
[0761] Based on the configuration of the decoder (250) and the computer-readable storage medium, FIG. 26 is an example diagram of a specific hardware structure of the decoder provided in an embodiment of the present application. As illustrated in FIG. 26, the decoder (250) may include a second communication interface (2601), a second memory (2602), and a second processor (2603), and each component is coupled through a second bus system (2604). It can be understood that the second bus system (2604) is intended to implement connection communication between these components. The second bus system (2604) includes a data bus and, in addition, further includes a power bus, a control bus, and a status signal bus. However, for clarity of description, in FIG. 26, all various buses are referred to as the second bus system (2604). Here,
[0762] The second communication interface (2601) is for receiving and transmitting signals in the process of transmitting and receiving information between other external network elements;
[0763] The second memory (2602) is for storing a computer program that can be operated on the second processor (2603);
[0764] The second processor (2603) is for determining a first candidate list of the current block when operating the computer program - the first candidate list includes one or more candidate vector parameters -; determining a second location block according to the candidate vector parameters in the first candidate list and / or the vector parameters of the first location block of the current block; determining whether the vector parameters of the second location block satisfy a second condition according to the vector parameters of the second location block when the decoding parameters of the second location block include vector parameters; updating the first candidate list according to the vector parameters of the second location block when the vector parameters of the second location block satisfy the second condition; and determining the predicted value of the current block according to the first candidate list after the update.
[0765] Optionally, as another embodiment, the second processor (2603) is also configured to execute the method of any one of the aforementioned embodiments when the computer program is operated.
[0766] It is understandable that the hardware functions of the second memory (2602) and the first memory (2402) are similar, and the hardware functions of the second processor (2603) and the first processor (2403) are similar, and are not further explained here.
[0767] The present embodiment provides a decoder, wherein, for the decoder, when updating a first candidate list, vector information of some second location blocks can be expanded according to candidate vector parameters in the initial first candidate list and / or vector parameters of a first location block (spatially adjacent and non-adjacent blocks of the current block), and the first candidate list can be supplemented according to the expanded vector information, thereby effectively utilizing already reconstructed information of spatially adjacent and non-adjacent blocks, and candidate vector information can be inferred according to the vector information of such already reconstructed blocks under the premise of guaranteeing encoding complexity, thereby expanding the coverage range of the IntraTMP search list, improving prediction accuracy, saving additional bit rates, and improving encoding and decoding performance by increasing encoding and decoding efficiency.
[0768] In another embodiment of the present application, FIG. 27 is an example diagram of the configuration structure of an encoding and decoding system provided in an embodiment of the present application. As shown in FIG. 27, the encoding and decoding system (270) may include an encoder (2701) and a decoder (2702).
[0769] In an embodiment of the present application, the encoder (2701) may be any one of the encoders of the above-described embodiment, and the decoder (2702) may be any one of the decoders of the above-described embodiment.
[0770] It must be explained that, in this application, the term “include” or any other variation thereof is intended to include a non-exclusive inclusion, thereby causing a process, me...
Claims
Claim 1 A decoding method applied to a decoder, wherein the decoding method comprises: a step of determining a first candidate list of a current block, wherein the first candidate list includes one or a plurality of candidate vector parameters; a step of determining a second position block according to at least one of a candidate vector parameter in the first candidate list and a vector parameter of a first position block of the current block; a step of 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 decoding parameter of the second position block includes a vector parameter; a step of updating the first candidate list according to the vector parameter of the second position block when the vector parameter of the second position block satisfies the second condition; and a step of determining a predicted value of the current block according to the first candidate list. Claim 2 A decoding method according to claim 1, wherein when determining a second position block according to a vector parameter of a first position block of the current block, the decoding method further comprises: a step of determining whether a vector parameter of a first position block satisfies a first condition according to a vector parameter of a first position block when the decoding parameter of a first position block of the current block includes a vector parameter; and a step of determining a second position block according to a vector parameter of a first position block when the vector parameter of a first position block satisfies the first condition. Claim 3 A decoding method according to claim 1, characterized in that the vector parameter includes at least one of a block vector parameter and a motion vector parameter. Claim 4 A decoding method according to claim 1, wherein the step of determining a first candidate list of the current block comprises: a step of determining a first search area of the current block; and a step of determining a first candidate list of the current block according to the first search area. Claim 5 A decoding method according to claim 4, wherein the step of determining a first search area of the current block comprises: a step of determining a first template of the current block; and a step of determining a first search area of the current block according to the first template. Claim 6 A decoding method according to claim 4, wherein the step of determining a first candidate list of the current block according to the first search area comprises: a step of determining one or more first candidate vector parameters by performing a search within the first search area according to the first search step length; and a step of adding the one or more first candidate vector parameters to the first candidate list of the current block. Claim 7 A decoding method according to claim 6, wherein the step of performing a search within the first search area according to the first search step length to determine one or more first candidate vector parameters comprises: a step of traversing search points within the first search area according to the first search step length and determining a first matching cost value between a matching template corresponding to a search point within the first search area and the first template according to a preset matching criterion; and a step of determining one or more matching search points according to the first matching cost value and determining one or more first candidate vector parameters according to the one or more matching search points. Claim 8 A decoding method according to paragraph 2, wherein the first condition comprises that the cost value corresponding to the vector parameter of the first position block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 9 In claim 8, the decoding method further comprises: a step of determining a cost value corresponding to a vector parameter of a first position block according to a matching cost value between a matching template corresponding to a vector parameter of a first position block and the first template; a step of determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and the first template; and a step of determining that the vector parameter of a first position block satisfies a first condition when the cost value corresponding to a vector parameter of a first position block is smaller than the cost value corresponding to at least one candidate vector parameter of a first candidate list. Claim 10 A decoding method according to paragraph 2, wherein the decoding method further comprises the step of updating the first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition. Claim 11 A decoding method according to claim 10, wherein the step of updating the first candidate list according to the vector parameter of the first position block includes the step of adding the vector parameter of the first position block to the first candidate list. Claim 12 A decoding 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. Claim 13 A decoding method according to claim 1, 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. Claim 14 A decoding method according to claim 1, wherein the second condition comprises that the cost value corresponding to the vector parameter of the second position block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 15 In claim 14, the decoding method further comprises: a step of determining a cost value corresponding to a vector parameter of the second position block according to a matching cost value between a matching template corresponding to a vector parameter of the second position block and the first template; a step of determining a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and the first template; and a step of determining that the vector parameter of the second position block satisfies a second condition when the cost value corresponding to the vector parameter of the second position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 16 A decoding method according to claim 1, wherein the step of updating the first candidate list according to the vector parameter of the second position block includes the step of adding the vector parameter of the second position block to the first candidate list. Claim 17 The decoding method according to claim 1 further comprises the steps of: determining a first set of candidates for the current block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition, and updating the first list of candidates according to the first set of candidates; determining a second set of candidates for the current block according to the vector parameter of the second position block when the vector parameter of the second position block satisfies a second condition, and updating the first list of candidates according to the second set of candidates; and determining a predicted value of the current block according to the first list of candidates. Claim 18 A decoding method according to claim 17, wherein the step of updating the first candidate list according to the first candidate set comprises: 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, if the cost value corresponding to the second candidate vector parameter is smaller 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, thereby updating the first candidate list, wherein the second candidate vector parameter is any one of the vector parameters in the first candidate set. Claim 19 A decoding method according to claim 18, wherein the step of replacing the candidate vector parameter corresponding to the maximum cost value of the first candidate list using the second candidate vector parameter comprises the step of 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. Claim 20 A decoding method according to claim 18, wherein the step of determining a second set of candidates for the current block comprises: determining one or more second candidate vector parameters updated to the first candidate list by the first set of candidates; and determining the second position block according to the one or more second candidate vector parameters, and determining a second set of candidates for the current block according to the vector parameters of the second position block. Claim 21 A decoding method according to claim 18, wherein the step of determining a second candidate set of the current block comprises the step of updating a first candidate list according to the first candidate set, determining a second position block according to all candidate vector parameters of the first candidate list, and determining a second candidate set of the current block according to the vector parameters of the second position block. Claim 22 A decoding method according to claim 17, wherein the step of determining a second set of candidates for the current block comprises: a step of determining the first N candidate vector parameters in the first list after updating the first list of candidates according to the first set of candidates; and a step of determining the second position block according to the N candidate vector parameters and determining the second set of candidates for the current block according to the vector parameters of the second position block, wherein N is a positive integer. Claim 23 In claim 22, the decoding method is characterized by further including the step of determining the value of N according to the size parameter of the current block. Claim 24 A decoding method according to claim 17, wherein the step of determining a second candidate set of the current block comprises: updating a first candidate list according to the first candidate set, performing clustering on the first candidate list to determine M candidate vector parameters located at the clustering center; and determining a second location block according to the M candidate vector parameters, and determining a second candidate set of the current block according to the vector parameters of the second location block, wherein M is a positive integer. Claim 25 In claim 17, the decoding method further comprises the step of determining the completion of construction of the third candidate set when all vector parameters of the second position block are completely traversed or when the number of candidate vector parameters of the second candidate set is greater than the first threshold value. Claim 26 In claim 25, the decoding method further comprises: a step of determining a second matching cost value between a matching template corresponding to a third candidate vector parameter of the second candidate set and the first template according to a preset matching criterion; and a step of updating the second candidate set by deleting the third candidate vector parameter from the second candidate set when the second matching cost value is greater than a second threshold value, wherein the third candidate vector parameter is a vector parameter of any one of the second candidate sets. Claim 27 In claim 17, the decoding method further comprises the step of filling the vector parameters of the second position block into the first candidate set until the first candidate set is filled when the first candidate set of the current block is not filled; and the step of updating the first candidate list according to the first candidate set after it is filled. Claim 28 A decoding method according to claim 17, wherein the step of updating the first candidate list according to the first candidate set comprises: determining the first K candidate vector parameters among the first candidate set; and updating the first candidate list according to the first K candidate vector parameters, wherein K is a positive integer. Claim 29 In claim 17, the decoding method further comprises: a step of determining the first P candidate vector parameters among the first candidate set; a step of determining the second position block according to the P candidate vector parameters and determining the vector parameters of the second position block; a step of constructing a fourth candidate set of the current block according to the vector parameters of the second position block when the vector parameters of the second position block satisfy a second condition, and determining the completion of the construction of the fourth candidate set when all of the P candidate vector parameters are completely traversed or the fourth candidate set is filled; a step of determining a cost value corresponding to one or more candidate vector parameters among the fourth candidate set and determining Q candidate vector parameters from the fourth candidate set according to the cost value corresponding to the one or more candidate vector parameters; and a step of updating the first candidate list according to the Q candidate vector parameters - P and Q are positive integers - Claim 30 A decoding method characterized in that, in any one of claims 1 to 29, the step of determining the predicted value of the current block according to the first candidate list comprises: the step of determining the vector parameter of the current block based on the first candidate list; and the step of determining the predicted value of the current block according to the vector parameter of the current block. Claim 31 A decoding method according to claim 30, wherein the step of determining the vector parameter of the current block based on the first candidate list comprises: a step of determining a second search area indicated by the candidate vector parameter in the first candidate list; and a step of determining the vector parameter of the current block by performing a search within the second search area according to a second search step length, wherein the value of the second search step length is smaller than the value of the first search step length. Claim 32 A decoding method according to claim 31, wherein the step of determining the vector parameters of the current block by performing a search within the second search area according to the second search step length includes the step of determining the vector parameters of the current block by performing a sub-sample search within the second search area according to the second search step length. Claim 33 A decoding method according to claim 30, wherein when the vector parameter of the current block is one, the step of determining the predicted value of the current block according to the vector parameter of the current block comprises: the step of determining the reference block of the current block according to the vector parameter of the current block; and the step of determining the predicted value of the current block according to the reference block. Claim 34 A decoding method according to claim 33, wherein the step of determining the predicted value of the current block according to the reference block comprises: a step of performing filtering on the reference block to determine the reference block after filtering; and a step of determining the predicted value of the current block according to the reference block after filtering. Claim 35 A decoding method according to claim 33, wherein the step of determining a predicted value of the current block according to the reference block comprises: a step of determining a first predicted block of the current block according to the reference block; a step of determining a second predicted block of the current block by performing a prediction on the current block according to a first prediction mode - the first prediction mode is a non-intra template matching prediction mode -; and a step of determining a predicted value of the current block according to the first predicted block and the second predicted block. Claim 36 A decoding method according to claim 30, wherein when there are multiple vector parameters of the current block, the step of determining a predicted value of the current block according to the vector parameters of the current block comprises: a step of determining multiple reference blocks of the current block according to the multiple vector parameters of the current block; and a step of determining a predicted value of the current block according to the multiple reference blocks. Claim 37 A decoding method according to claim 36, wherein the step of determining a predicted value of the current block according to the plurality of reference blocks comprises: a step of determining a plurality of predicted blocks of the current block according to the plurality of reference blocks; and a step of performing weighted fusion on the plurality of predicted blocks to determine a predicted value of the current block. Claim 38 A decoding method according to claim 30, wherein the step of determining a predicted value of the current block according to the vector parameter of the current block comprises: a step of decoding a bit stream to determine the value of a first syntax element; a step of 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; and a step of 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. Claim 39 A decoding method according to any one of claims 1 to 38, wherein the decoding method further comprises the step of decoding a bit stream to determine the value of a second syntax element; and the step of determining a first candidate list of a current block when the second syntax element indicates that the current block uses an intra-template matching prediction mode. Claim 40 A decoding method according to any one of claims 1 to 38, wherein the decoding method further comprises: a step of decoding a bit stream to determine a predicted difference value of the current block; and a step of determining a reconstruction value of the current block according to the predicted difference value and the predicted value of the current block. Claim 41 An encoding method applied to an encoder, wherein the encoding method comprises: a step of determining a first candidate list of a current block, wherein the first candidate list includes one or a plurality of candidate vector parameters; a step of determining a second position block according to at least one of a candidate vector parameter among the first candidate list and a vector parameter of a first position block of the current block; a step of 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 encoding parameter of the second position block includes a vector parameter; a step of updating the first candidate list according to the vector parameter of the second position block when the vector parameter of the second position block satisfies the second condition; and a step of determining a predicted value of the current block according to the first candidate list. Claim 42 In claim 41, when determining a second position block according to a vector parameter of a first position block of the current block, the encoding method comprises: a step of determining whether a vector parameter of a first position block satisfies a first condition according to a vector parameter of a first position block when a decoding parameter of a first position block of the current block includes a vector parameter; and a step of determining a second position block according to a vector parameter of a first position block when a vector parameter of a first position block satisfies the first condition. Claim 43 An encoding method according to claim 41, characterized in that the vector parameter includes at least one of a block vector parameter and a motion vector parameter. Claim 44 An encoding method according to claim 41, wherein the step of determining a first candidate list of the current block comprises: a step of determining a first search area of the current block; and a step of determining a first candidate list of the current block according to the first search area. Claim 45 An encoding method according to claim 44, wherein the step of determining a first search area of the current block comprises: a step of determining a first template of the current block; and a step of determining a first search area of the current block according to the first template. Claim 46 An encoding method according to claim 44, wherein the step of determining a first candidate list of the current block according to the first search area comprises: a step of determining one or more first candidate vector parameters by performing a search within the first search area according to the first search step length; and a step of adding the one or more first candidate vector parameters to the first candidate list of the current block. Claim 47 An encoding method according to claim 46, wherein the step of determining one or more first candidate vector parameters by performing a search within the first search area according to the first search step length comprises: a step of iterating through search points within the first search area according to the first search step length and determining a first matching cost value between a matching template corresponding to a search point within the first search area and the first template according to a preset matching criterion; and a step of determining one or more matching search points according to the first matching cost value and determining one or more first candidate vector parameters according to the one or more matching search points. Claim 48 An encoding method according to claim 42, wherein the first condition comprises that the cost value corresponding to the vector parameter of the first position block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 49 In claim 48, the encoding method further comprises: a step of determining a cost value corresponding to a vector parameter of a first position block according to a matching cost value between a matching template corresponding to a vector parameter of a first position block and the first template; a step of determining a cost value corresponding to at least one candidate vector parameter of a first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of a first candidate list and the first template; and a step of determining that the vector parameter of a first position block satisfies a first condition when the cost value corresponding to the vector parameter of the first position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 50 In claim 42, the encoding method further comprises the step of updating the first candidate list according to the vector parameter of the first position block when the vector parameter of the first position block satisfies the first condition. Claim 51 An encoding method according to claim 50, wherein the step of updating the first candidate list according to the vector parameter of the first position block includes the step of adding the vector parameter of the first position block to the first candidate list. Claim 52 An encoding method according to claim 41, wherein the second position block represents a reference block pointed to by the vector parameter of the first position block. Claim 53 An encoding 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. Claim 54 An encoding method according to claim 41, wherein the second condition comprises that the cost value corresponding to the vector parameter of the second position block is superior to the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 55 In claim 54, the encoding method further comprises: a step of determining a cost value corresponding to a vector parameter of the second position block according to a matching cost value between a matching template corresponding to a vector parameter of the second position block and the first template; a step of determining a cost value corresponding to at least one candidate vector parameter of the first candidate list according to a matching cost value between a matching template corresponding to at least one candidate vector parameter of the first candidate list and the first template; and a step of determining that the vector parameter of the second position block satisfies a second condition when the cost value corresponding to the vector parameter of the second position block is smaller than the cost value corresponding to at least one candidate vector parameter of the first candidate list. Claim 56 An encoding method according to claim 41, wherein the step of updating the first candidate list according to the vector parameter of the second position block includes the step of adding the vector parameter of the second position block to the first candidate list. Claim 57 In claim 41, the encoding method further comprises: a step of determining a first set of candidates for the current block according to the vector parameter of the first position block when the vector parameter of the first position block satisfies a first condition, and updating the first list of candidates according to the first set of candidates; a step of determining a second set of candidates for the current block according to the vector parameter of the second position block when the vector parameter of the second position block satisfies a second condition, and updating the first list of candidates according to the second set of candidates; and a step of determining a predicted value of the current block according to the first list of candidates. Claim 58 An encoding method according to claim 57, wherein the step of updating the first candidate list according to the first candidate set comprises: 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, if the cost value corresponding to the second candidate vector parameter is smaller 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, thereby updating the first candidate list, wherein the second candidate vector parameter is any one of the vector parameters in the first candidate set. Claim 59 An encoding method according to claim 58, wherein the step of replacing the candidate vector parameter corresponding to the maximum cost value of the first candidate list using the second candidate vector parameter comprises the step of 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. Claim 60 An encoding method according to claim 58, wherein the step of determining a second candidate set of the current block comprises: determining one or more second candidate vector parameters updated to the first candidate list by the first candidate set; and determining the second position block according to the one or more second candidate vector parameters, and determining the second candidate set of the current block according to the vector parameters of the second position block. Claim 61 An encoding method according to claim 58, wherein the step of determining a second set of candidates for the current block comprises, after updating the first list of candidates according to the first set of candidates, determining the second position block according to all candidate vector parameters of the first list of candidates, and determining the second set of candidates for the current block according to the vector parameters of the second position block. Claim 62 An encoding method according to claim 57, wherein the step of determining a second candidate set of the current block comprises: a step of determining the first candidate list after updating the first candidate list according to the first candidate set; and a step of determining the second position block according to the N candidate vector parameters and determining the second candidate set of the current block according to the vector parameters of the second position block, wherein N is a positive integer. Claim 63 In claim 62, the encoding method further comprises the step of determining the value of N according to the size parameter of the current block. Claim 64 An encoding method according to claim 57, wherein the step of determining a second candidate set of the current block comprises: updating a first candidate list according to the first candidate set, performing clustering on the first candidate list to determine M candidate vector parameters located at the clustering center; and determining a second location block according to the M candidate vector parameters, and determining a second candidate set of the current block according to the vector parameters of the second location block, wherein M is a positive integer. Claim 65 In claim 57, the encoding method further comprises the step of determining the completion of construction of the third candidate set when all vector parameters of the second position block are completely traversed or when the number of candidate vector parameters of the second candidate set is greater than the first threshold value. Claim 66 In claim 65, the encoding method further comprises: a step of determining a second matching cost value between a matching template corresponding to a third candidate vector parameter of the second candidate set and the first template according to a preset matching criterion; and a step of updating the second candidate set by deleting the third candidate vector parameter from the second candidate set when the second matching cost value is greater than a second threshold value, wherein the third candidate vector parameter is a vector parameter of any one of the second candidate sets. Claim 67 In claim 57, the encoding method further comprises the steps of: filling the vector parameters of the second position block into the first candidate set until the first candidate set is filled when the first candidate set of the current block is not filled; and updating the first candidate list according to the first candidate set after it is filled. Claim 68 An encoding method according to claim 57, wherein the step of updating the first candidate list according to the first candidate set comprises: determining the first K candidate vector parameters among the first candidate set; and updating the first candidate list according to the first K candidate vector parameters, wherein K is a positive integer. Claim 69 In claim 57, the encoding method further comprises: a step of determining the first P candidate vector parameters among the first candidate set; a step of determining the second position block according to the P candidate vector parameters and determining the vector parameters of the second position block; a step of constructing a fourth candidate set of the current block according to the vector parameters of the second position block when the vector parameters of the second position block satisfy a second condition, and determining the completion of the construction of the fourth candidate set when all of the P candidate vector parameters are completely traversed or the fourth candidate set is filled; a step of determining a cost value corresponding to one or more candidate vector parameters among the fourth candidate set and determining Q candidate vector parameters from the fourth candidate set according to the cost value corresponding to the one or more candidate vector parameters; and a step of updating the first candidate list according to the Q candidate vector parameters - P and Q are positive integers - Claim 70 An encoding method characterized in that, in any one of claims 41 to 69, the step of determining the predicted value of the current block according to the first candidate list comprises: the step of determining the vector parameter of the current block based on the first candidate list; and the step of determining the predicted value of the current block according to the vector parameter of the current block. Claim 71 An encoding method according to claim 70, wherein the step of determining the vector parameter of the current block based on the first candidate list comprises: a step of determining a second search area indicated by the candidate vector parameter in the first candidate list; and a step of determining the vector parameter of the current block by performing a search within the second search area according to the second search step length, wherein the value of the second search step length is smaller than the value of the first search step length. Claim 72 An encoding method according to claim 71, wherein the step of determining the vector parameters of the current block by performing a search within the second search area according to the second search step length includes the step of determining the vector parameters of the current block by performing a sub-sample search within the second search area according to the second search step length. Claim 73 An encoding method according to claim 70, wherein when the vector parameter of the current block is one, the step of determining the predicted value of the current block according to the vector parameter of the current block comprises: the step of determining the reference block of the current block according to the vector parameter of the current block; and the step of determining the predicted value of the current block according to the reference block. Claim 74 An encoding method according to claim 73, wherein the step of determining the predicted value of the current block according to the reference block comprises: a step of performing filtering on the reference block to determine the reference block after filtering; and a step of determining the predicted value of the current block according to the reference block after filtering. Claim 75 An encoding method characterized in that, in claim 73, the step of determining a predicted value of the current block according to the reference block comprises: a step of determining a first predicted block of the current block according to the reference block; a step of determining a second predicted block of the current block by performing a prediction on the current block according to a first prediction mode - the first prediction mode is a non-intra-template matching prediction mode -; and a step of determining a predicted value of the current block according to the first predicted block and the second predicted block. Claim 76 An encoding method according to claim 70, wherein when there are multiple vector parameters of the current block, the step of determining a predicted value of the current block according to the vector parameters of the current block comprises: a step of determining multiple reference blocks of the current block according to the multiple vector parameters of the current block; and a step of determining a predicted value of the current block according to the multiple reference blocks. Claim 77 An encoding method according to claim 76, wherein the step of determining a predicted value of the current block according to the plurality of reference blocks comprises: a step of determining a plurality of predicted blocks of the current block according to the plurality of reference blocks; and a step of performing weighted fusion on the plurality of predicted blocks to determine a predicted value of the current block. Claim 78 An encoding method characterized in that, in claim 70, the step of determining a predicted value of the current block according to the vector parameters of the current block comprises: a step of determining a method for constructing the predicted value of the current block; and a step of determining a predicted value of the current block according to the vector parameters of the current block and the method for constructing the predicted value. Claim 79 An encoding method characterized in that, in claim 78, the step of determining a method for constructing a predicted value of the current block comprises: a step of determining a candidate list of methods for constructing a predicted value of the current block—wherein the candidate list of methods for constructing a predicted value includes at least one candidate method for constructing a predicted value—; a step of performing a cost calculation for each of the at least one candidate method for constructing a predicted value and determining at least one cost result; and a step of determining a minimum cost result from the at least one cost result and determining a candidate method for constructing a predicted value of the current block corresponding to the minimum cost result. Claim 80 In claim 79, the encoding method further comprises the step of determining the value of a first syntax element—the value of the first syntax element is intended to indicate the index number of the prediction value construction method of the current block in the prediction value construction candidate list—; and the step of performing encoding processing on the value of the first syntax element and writing the obtained encoding bit to a bit stream. Claim 81 An encoding method according to any one of claims 41 to 80, wherein the encoding method further comprises the step of determining the value of a second syntax element—the value of the second syntax element is for indicating whether the current block uses an intra-template matching prediction mode—; and the step of performing encoding processing on the value of the second syntax element and writing the obtained encoding bit to a bit stream. Claim 82 In claim 81, the encoding method further comprises the step of determining a first candidate list of the current block when the current block uses an intra-template matching prediction mode. Claim 83 An encoding method according to any one of claims 41 to 80, wherein the encoding method further comprises: a step of determining a predicted difference value of the current block according to a predicted value of the current block; and a step of performing encoding processing on the predicted difference value of the current block and writing the obtained encoding bit to a bit stream. Claim 84 A bit stream, wherein the bit stream is generated by performing bit encoding according to information to be encoded, and the information to be encoded includes at least one of a prediction difference value of a current block, a value of a first syntax element, and a value of a second syntax element, wherein the value of the first syntax element is intended to indicate an index number of the prediction value construction method of the current block in a prediction value construction candidate list, and the value of the second syntax element is intended to indicate whether the current block uses an intra-template matching prediction mode. Claim 85 An encoder comprising a first decision unit, a first update unit, and a first prediction unit, wherein the first decision unit is configured to determine a first candidate list of a current block, and the first candidate list includes one or a plurality of candidate vector parameters; the first update unit is configured to determine a second position block according to at least one of a candidate vector parameter in the first candidate list and a vector parameter of a first position block of the current block, and if the encoding parameter of the second position block includes a vector parameter, determine whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block, and if the vector parameter of the second position block satisfies the second condition, update the first candidate list according to the vector parameter of the second position block, and the first prediction unit is configured to determine a predicted value of the current block according to the first candidate list. Claim 86 An encoder comprising a first memory and a first processor, wherein the first memory is for storing a computer program operable on the first processor, and the first processor is for executing an encoding method according to any one of claims 41 to 83 when the computer program is operated. Claim 87 A decoder comprising a second decision unit, a second update unit, and a second prediction unit, wherein the second decision unit is configured to determine a first candidate list of a current block, and the first candidate list includes one or a plurality of candidate vector parameters; the second update unit determines a second position block according to at least one of a candidate vector parameter in the first candidate list and a vector parameter of a first position block of the current block; if the decoding parameter of the second position block includes a vector parameter, determines whether the vector parameter of the second position block satisfies a second condition according to the vector parameter of the second position block; and if the vector parameter of the second position block satisfies the second condition, is configured to update the first candidate list according to the vector parameter of the second position block; and the second prediction unit is configured to determine a predicted value of the current block according to the first candidate list. Claim 88 A decoder comprising a second memory and a second processor, wherein the second memory is for storing a computer program operable on the second processor, and the second processor is for executing a decoding method according to any one of claims 1 to 40 when the computer program is operated. Claim 89 A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed, the computer-readable storage medium is characterized by implementing a decoding method according to any one of claims 1 to 40 or an encoding method according to any one of claims 41 to 83.
