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

By improving the block vector list construction method, including multiple AR-BVP construction and the use of sub-pixel precision block vectors, the problem of poor flexibility of the block vector list is solved, and the intra-frame prediction efficiency and encoding and decoding performance are improved.

WO2025199773A1PCT designated stage Publication Date: 2025-10-02GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083935
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-03-26
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

The existing block vector list construction method is relatively fixed and has poor flexibility. It cannot adapt to different prediction scenarios, resulting in low intra-frame prediction efficiency and affecting encoding and decoding performance.

Method used

When constructing the block vector list, we perform AR-BVP at least twice and check non-AR-BVP block vectors, add reference block vectors and sub-pixel precision block vectors, and use different template error calculation methods to sort them to improve the diversity of the block vector list.

Benefits of technology

It improves the efficiency of intra-frame prediction and enhances the encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083935_02102025_PF_FP_ABST
    Figure CN2024083935_02102025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are an encoding method, a decoding method, a code stream, an encoder, a decoder, and a storage medium. The decoding method comprises: when a current block uses a preset intra prediction mode, constructing a block vector list of the current block; and on the basis of the block vector list of the current block, determining a prediction block of the current block, wherein the block vector list of the current block satisfies at least one of the following: the block vector list being constructed by means of executing at least two instances of AR-BVP, and between the execution of the at least two instances of AR-BVP, executing an inspection operation for at least one non-AR-BVP block vector; the block vector list comprises a block vector of a reference block corresponding to a guide block vector of the current block; the block vector list comprises block vectors with sub-pixel precision, the block vectors with sub-pixel precision being used for DIMD or TIMD or SGPM; and the block vector list is obtained by means of sorting template error values corresponding to the block vectors in the block vector list, the template error values of the block vectors being determined by means of a preset template error calculation mode, which is determined on the basis of an error calculation mode during a template search process corresponding to the current block or second syntax flag information transmitted in a code stream.
Need to check novelty before this filing date? Find Prior Art

Description

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

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

[0002] As demand for video display quality increases, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information and therefore requires more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.

[0003] In video coding standards, common intra-frame prediction methods, such as intra block copy (IBC), decoder intra mode derivation (DIMD), and template-based intra mode derivation (TIMD), can achieve block-vector-based prediction by constructing a block vector list. However, the current block vector list construction method is relatively fixed and inflexible, making it difficult to adapt to different prediction scenarios, reducing intra-frame prediction efficiency and affecting codec performance.

[0004] Summary of the Invention

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

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

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

[0008] Decoding the code stream to determine first syntax identification information;

[0009] When the first syntax identification information indicates that the current block uses a preset intra prediction mode, constructing a block vector list of the current block;

[0010] Determining a prediction block of the current block according to the block vector list of the current block;

[0011] The block vector list of the current block satisfies at least one of the following:

[0012] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0013] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0014] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0015] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

[0017] When it is determined that the current block uses a preset intra-frame prediction mode, writing first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode;

[0018] Constructing a block vector list of the current block;

[0019] Determining a prediction block of the current block according to the block vector list of the current block;

[0020] The block vector list of the current block satisfies at least one of the following:

[0021] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0022] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0023] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0024] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

[0027] A first determining unit is configured to, when determining that a current block uses a preset intra-frame prediction mode, write first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following:

[0028] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0029] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0030] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0031] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

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

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

[0036] The second determining unit is configured to decode the code stream and determine first syntax identification information; if the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block, wherein the block vector list for the current block satisfies at least one of the following:

[0037] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0038] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0039] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0040] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

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

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

[0045] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. When a current block uses a preset intra-frame prediction mode, a block vector list for the current block is constructed; a prediction block for the current block is determined based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following conditions: the block vector list is constructed by executing at least two AR-BVPs, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to a reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, which is determined based on an error calculation method of a template search process corresponding to the current block or second syntax identification information transmitted in the bitstream. That is to say, in an embodiment of the present application, the construction and / or use process of the block vector list in the intra-frame prediction process can be adjusted and improved. The diversity of the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or directly using the block vector of the reference block as a candidate block vector to add to the block vector list, and / or using a block vector list with sub-pixel precision for intra-frame prediction, and / or using different template error calculation methods to reorder the block vector list, etc., thereby improving the efficiency of intra-frame prediction and improving encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] FIG1 is a flow chart of a hybrid coding framework;

[0047] FIG2 is a schematic diagram of adjacent blocks and non-adjacent blocks;

[0048] FIG3 is a schematic diagram of the implementation of AR-BVP technology;

[0049] FIG4 is a second schematic diagram of an implementation method of the AR-BVP technology;

[0050] FIG5 is a schematic diagram of the implementation of the IntraTMP technology;

[0051] FIG6 is a second schematic diagram of the implementation of the IntraTMP technology;

[0052] FIG7 is a schematic diagram of the implementation of the SGPM technology;

[0053] FIG8 is a schematic diagram of the implementation of DIMD technology;

[0054] FIG9 is a schematic diagram of the implementation of TIMD technology;

[0055] FIG10 is a block diagram of an encoder according to an embodiment of the present application;

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

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

[0058] FIG13 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application;

[0059] FIG14 is a schematic diagram of a block vector of a reference block provided in an embodiment of the present application;

[0060] FIG15 is a schematic diagram of a template provided in an embodiment of the present application;

[0061] FIG16 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

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

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

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

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

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

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

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

[0069] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0070] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0071] In video images, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is typically represented by the symbol Y, the blue chrominance component is typically represented by the symbols Cb or U, and the red chrominance component is typically represented by the symbols Cr or V. Thus, video images can be represented in either the YCbCr or YUV format.

[0072] Video codec standards can adopt a block-based hybrid coding framework. Specifically, the images in the video are divided into square maximum coding units (LCUs) or coding tree units (CTUs) of the same size (such as 128x128, 64x64, etc.). Each maximum coding unit or coding tree unit can be divided into rectangular coding units (CUs) according to rules. Coding units may also be divided into prediction units (PUs), transform units (TUs), etc.

[0073] Specifically, as shown in Figure 1, the hybrid coding framework includes a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filter module 15, and a decoded picture cache module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b, and the inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. Additionally, because there is a strong similarity between adjacent images in a video, inter-image prediction is used in video coding and decoding technology to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0074] Furthermore, the transformation converts the predicted image blocks into the frequency domain, redistributing the energy. Combined with quantization, this removes information that is insensitive to the human eye, eliminating visual redundancy. Entropy coding can eliminate character redundancy based on the current context model and the probability information of the binary bit stream.

[0075] The basic process of a video codec is as follows: On the encoder side, after reading a black-and-white or color image, it is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The prediction block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used to generate a prediction block for the current block. On the other hand, the bitstream is parsed to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​dequantized and inversely transformed to obtain a residual block. The prediction block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain the decoded image.

[0076] The encoder also needs to perform similar operations as the decoder to obtain a decoded image. The decoded image can be used as a reference image for inter-frame prediction of subsequent images.

[0077] The block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode information or parameter information determined by the encoder need to be written into the bitstream if necessary. The decoder parses the bitstream and determines the same block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode information or parameter information as the encoder based on the existing information, thereby ensuring that the decoded image obtained by the encoder and the decoder are the same.

[0078] During prediction, the current block can be divided into prediction units, and during transformation, the current block can be divided into transformation units. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or process may be optimized. The embodiments of the present application are applicable to the basic process of the video codec under the block-based hybrid coding framework, but are not limited to this framework and process.

[0079] In addition, in the embodiments of the present application, the current block (CB) can be the current coding unit, the current prediction unit, or the current transform unit. Due to the need for parallel processing, the image can be divided into slices, etc. Slices in the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, and it can generally be understood that a frame is an image. The frame described in the embodiments of the present application can also be replaced by an image or a slice, etc.

[0080] The following is a detailed introduction to several related prediction technologies.

[0081] (1) Intra-frame block copy

[0082] Intra-frame block copying (IBC) is an intra-frame prediction technique that uses block vectors to obtain predicted pixels. Similar to inter-frame prediction, prediction is achieved by using a block vector pointing from the current block to a reference block. The difference is that the reference block for inter-frame prediction comes from an already coded reconstructed frame, while the reference block for IBC comes from the reconstructed portion of the current frame. Block vector information must be transmitted in the bitstream, so similar to intra-frame prediction, there are two modes: IBC-AMVP and IBC-Merge.

[0083] IBC-AMVP mode: The encoder searches for the reference block and corresponding block vector (BV) of the current block and constructs a candidate list (AMVP list) to obtain the block vector prediction (BV Prediction, BVP). Simply by writing the BVP index in the list and the difference between the BVP and BV (BVD) into the bitstream, the decoder can reconstruct the BV to complete the prediction of the current block.

[0084] IBC-Merge mode: Prediction is performed using a constructed list of merge candidates. The best merge candidate in the list is selected through encoding processes such as Sum of Absolute Transformed Difference (SATD) and Rate Distortion Optimization (RDO). The block vector of this candidate is directly used to obtain the reference block. By encoding only the merge index of the merge candidate in the list, the decoder can obtain the BV and complete the prediction of the current block.

[0085] Candidates in the AMVP / Merge list can be obtained by the following methods:

[0086] 1. Inherit the block vector of the adjacent block

[0087] 2. Inherit the block vectors of non-adjacent blocks

[0088] 3. Inherit the block vector in the historical block vector cache list

[0089] 4. Auto-Relocated Block Vector Prediction (AR-BVP) constructed from existing block vectors

[0090] 5. Obtain block vector by averaging existing block vectors

[0091] 6. Default block vector (related to block size)

[0092] FIG2 is a schematic diagram of adjacent blocks and non-adjacent blocks. As shown in FIG2 , the dot-filled small block is the current block, the blocks numbered 1-5 are called adjacent blocks, and the rest are called non-adjacent blocks.

[0093] For AR-BVP technology, a guiding block vector (BV) BV can be determined for the current coding block B0 0,1 , and determine the reference block B1 based on the block vector. If there is a block vector BV in the area of ​​the reference block B1 1,2 , then a new block vector BV can be constructed 0,2 =BV 0,1 +BV 1,2 , as the candidate block vector of the current coding block. By analogy, according to BV 0,n The reference block B can be determined n , if in B n There is a block vector BV in the region n,n+1 , then a new block vector BV can be constructed 0,n+1 =BV 0,1 +BV 1,2 +…+BV n,n+1 , which can be regarded as constructing a new AR-BVP by continuing to construct the AR-BVP.

[0094] FIG3 is a schematic diagram of the implementation of AR-BVP technology. As shown in FIG3, the reference block vector of the current coding block B0 is BV 0,1 , and determine the reference block B1 based on the block vector. If there is a block vector BV in the area of ​​the reference block B1 1,2 , then a new block vector BV can be constructed 0,2 =BV 0,1 +BV 1,2 , as the candidate block vector of the current coding block. According to BV 0,2 The reference block B2 can be determined if there is a block vector BV in the area of ​​B2 2,3 , then a new block vector BV can be constructed 0,3 =BV 0,1 +BV 1,2 +BV 2,3 According to BV 0,3 The reference block B3 can be determined.

[0095] FIG4 is a second schematic diagram of the implementation of the AR-BVP technology. As shown in FIG4 , when determining the reference block B n The corresponding block vector BV n,n+1For example, the center, upper left, upper right, lower left and lower right of the reference block are checked in turn to see if there is a coding block predicted by IBC or Intra Template Matching Prediction (IntraTMP) mode. If so, the saved block vector is used as the block vector BV. n,n+1 .

[0096] After constructing the AMVP / Merge list, the list can be reordered based on the template error values ​​of the candidates in the list. The template error value can be obtained by the template error value between the candidate reference block template and the current block template, such as the Sum of Absolute Difference (SAD) value.

[0097] (2) Intra-frame template matching prediction

[0098] Intra-frame template matching prediction technology, referred to as IntraTMP technology, is a special intra-frame prediction coding tool. IntraTMP is mainly implemented through the following process:

[0099] The reconstructed pixels of the L-shaped part adjacent to the current block are selected as the template, and the most similar template is searched in the reconstructed area of ​​the given current frame. The reconstructed block corresponding to the most similar template is used as the matching block and used as the prediction block of the current block.

[0100] FIG5 is a first schematic diagram of the implementation of the IntraTMP technology. As shown in FIG5 , R1 to R4 are available IntraTMP search areas, and matching blocks are searched point by point in these areas in a raster scan order.

[0101] Here, the codec uses the flag intra_tmp_flag to indicate whether the current block is encoded using the IntraTMP mode. If so, the same template matching process is performed on the decoder to obtain the same predicted block on the decoder, without the need to additionally encode the block vector information from the current block to the matching block.

[0102] FIG6 is a second implementation diagram of the IntraTMP technology. As shown in FIG6 , one IntraTMP search method is to divide the search process into two steps: first, a sparse search (Sparse search) and then a refinement search (Refinement search). Sparse search is to perform template matching with a step size S (i.e., every S points in the horizontal and vertical directions, S>1). For example, in the search area, instead of searching for matching blocks point by point, the search is performed at intervals in the horizontal and vertical directions. For example, if the block vector currently being template matched is (X0, Y0), then the next block vector to be template matched should be (X0+S, Y0), and the vertical coordinate of the next block vector to be template matched should be Y0+S. Refinement search is to perform template matching with a smaller step size S' in the adjacent area of ​​the best matching block vector based on the search results of the sparse search.

[0103] IntraTMP can be combined with a Merge List (IntraTMP with Merge Candidates). This method extends the IntraTMP search process or the IntraTMP candidate block vector list based on the block vector information in the Merge List. For example, a sparse list is generated from a sparse search, and a Merge List is constructed and merged with the sparse list to obtain a larger list of candidate block vectors. This new list can be used to perform a refined search, improving search performance.

[0104] (3) Spatial Geometry Partitioning Mode (SGPM)

[0105] The SGPM mode is an intra mode similar to the geometry partitioning mode (GPM), which can perform a weighted combination of two intra prediction blocks, where the weight value can correspond to different geometric partitioning methods.

[0106] Figure 7 is a schematic diagram of the implementation of SGPM technology. As shown in Figure 7, one SGPM implementation combines a geometric partitioning mode (partition mode) with two intra modes (intra mode0 and intra mode1) as a single SGPM prediction candidate. A list of intra modes can be constructed based on the intra modes of adjacent and non-adjacent blocks. This list of possible intra modes is combined with the constructed list of block vectors to construct a list of prediction candidates for the SGPM mode. The candidate list can be reordered based on template error. When the SGPM mode flag is true, the prediction candidate selected for the current block is determined by the explicitly passed index value sgpm_index, completing the geometric partition prediction for the intra mode.

[0107] (4) Decoding intra-frame mode derivation

[0108] The DIMD mode is a method for deriving intra-frame modes based on the Histogram of Gradient (HoG). This method calculates the gradient value in the template area of ​​the current block and converts it into an angle, thereby constructing a histogram of the intra-frame angle mode. According to the histogram, several intra-frame angle modes with higher amplitudes can be obtained.

[0109] Figure 8 illustrates the implementation of DIMD technology. In a typical DIMD implementation, the DIMD encoding block derives multiple intra-frame angle modes based on the HoG. It also constructs a list of block vectors and calculates the template error to derive an optimal non-angle mode. The prediction blocks from these modes are weighted and combined to produce the final prediction block.

[0110] (5) Template-based intra-frame mode derivation technology.

[0111] Template-based intra mode derivation (TIMD) is a method for inferring intra modes based on the error values ​​of intra modes in the template area. This method constructs a list of most probable modes (MPMs) based on existing coding information, predicts the modes in the list in the template area, and obtains the corresponding template error values, thereby inferring the optimal intra mode.

[0112] FIG9 is a schematic diagram of the implementation of the TIMD technology. As shown in FIG9 , similar to the DIMD method, TIMD can use two prediction modes with the smallest template error values ​​and an intra-frame non-angle mode to generate prediction blocks in implementation, and weightedly combine these prediction blocks to obtain the final prediction block.

[0113] Many common intra-frame prediction methods achieve block-vector-based predictions by constructing a block vector list. Therefore, the construction and use of the block vector list significantly impacts intra-frame prediction efficiency. Related technologies face issues such as the relatively fixed construction of AR-BVP candidates when constructing the block vector list; methods such as SGPM and DIMD only consider integer-pixel block vectors when using block vectors; and the relatively fixed reordering process of the block vector list.

[0114] In other words, the current method of constructing the block vector list is relatively fixed and has poor flexibility. It cannot be well adapted to different prediction scenarios, reduces the efficiency of intra-frame prediction, and affects the encoding and decoding performance.

[0115] Based on this, an embodiment of the present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. When the current block uses a preset intra-frame prediction mode, a block vector list of the current block is constructed; based on the block vector list of the current block, a prediction block of the current block is determined; wherein the block vector list of the current block satisfies at least one of the following: the block vector list is constructed by executing at least two AR-BVPs, and between executing at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to the guide block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM; the block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, which is determined according to the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream. That is to say, in an embodiment of the present application, the construction and / or use process of the block vector list in the intra-frame prediction process can be adjusted and improved. The diversity of the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or directly using the block vector of the reference block as a candidate block vector to add to the block vector list, and / or using a block vector list with sub-pixel precision for intra-frame prediction, and / or using different template error calculation methods to reorder the block vector list, etc., thereby improving the efficiency of intra-frame prediction and improving encoding and decoding performance.

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

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

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

[0119] Furthermore, FIG12 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application. As shown in FIG12 , the network architecture includes one or more electronic devices 31 to 3N and a communication network 01, wherein the electronic devices 31 to 3N can perform video interaction through the communication network 01. During implementation, the electronic devices can be various types of devices with video coding and decoding functions. For example, the electronic devices can include smartphones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensor devices, servers, etc., and are not specifically limited in the embodiments of the present application.

[0120] In an embodiment of the present application, a network architecture of a video encoding and decoding system including a decoding method and an encoding method is provided. The decoder or encoder in the embodiment of the present application can be the aforementioned electronic device. In other words, the electronic device in the embodiment of the present application has video encoding and decoding capabilities and can generally include a video encoder (i.e., encoder) and a video decoder (i.e., decoder).

[0121] It should also be noted that the embodiments of the present application are mainly applied to the intra-frame prediction part shown in Figure 10 and the intra-frame prediction part shown in Figure 11. In other words, the embodiments of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder.

[0122] It should also be noted that when the embodiment of the present application is applied to the encoder as shown in Figure 10, the "current block" specifically refers to the encoding block to be predicted; when the embodiment of the present application is applied to the decoder as shown in Figure 11, the "current block" specifically refers to the decoding block to be predicted.

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

[0124] Step 1301: Decode the code stream and determine first syntax identification information.

[0125] It should be noted that in the embodiments of the present application, the method is applied to a decoder. Specifically, based on the structure of decoder 200 shown in FIG15 , the decoding method of the embodiments of the present application can be applied to intra-frame prediction, primarily to the intra-frame prediction method constructed using a block vector list, thereby improving the prediction efficiency of intra-frame prediction.

[0126] It should also be noted that, in embodiments of the present application, the first syntax identification information is used to indicate whether the current block uses a preset intra-frame prediction mode. In some embodiments, if the value of the first syntax identification information is a first value, it is determined that the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; if the value of the first syntax identification information is a second value, it is determined that the first syntax identification information indicates that the current block does not use the preset intra-frame prediction mode.

[0127] It should also be noted that, in an embodiment of the present application, the preset intra-frame prediction mode may include at least one of the following: intra-frame block copy IBC, intra-frame template matching prediction IntraTMP, spatial geometry partitioning mode SGPM, decoding-end intra-frame mode derivation DIMD, and template-based intra-frame mode derivation TIMD.

[0128] It can be understood that in the embodiments of the present application, for different preset intra-frame prediction modes, the representation method of the first syntax identification information can be different. For example, for IBC, the corresponding first syntax identification information can be expressed as cu_pred_mode, for DIMD, the corresponding first syntax identification information can be expressed as cu_dimd_flag, and for IntraTMP, the corresponding first syntax identification information can be expressed as cu_tmp_flag.

[0129] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.

[0130] In a specific embodiment, taking the first value as 1 and the second value as 0 as an example, if the value of cu_pred_mode obtained through decoding is 1, it can be determined that the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; if the value of cu_pred_mode obtained through decoding is 0, it can be determined that the first syntax identification information indicates that the current block does not use the preset intra-frame prediction mode.

[0131] It should be noted that, in the embodiment of the present application, the preset intra-frame prediction mode may be a mode for performing intra-frame prediction by constructing a block vector list.

[0132] In some embodiments, the preset intra prediction mode may include at least one of the following: intra block copy IBC, intra template matching prediction IntraTMP, spatial geometry partitioning mode SGPM, decoding-end intra mode derivation DIMD, and template-based intra mode derivation TIMD.

[0133] Among them, IBC realizes prediction through the block vector pointing from the current block to the reference block; IntraTMP uses template matching to use the reconstructed block corresponding to the most similar template as the matching block, which is used as the prediction block of the current coding block; SGPM can weightedly combine two intra-frame prediction blocks, and the weight value can correspond to different geometric division methods; DIMD will derive multiple intra-frame angle modes based on HoG, and will also derive an optimal non-angle mode by constructing a block vector list and calculating the template error, and weightedly combine the prediction blocks of these modes to obtain the final prediction block; TIMD constructs the most likely mode (MPM) list based on the existing coding information, and predicts the mode in the list in the template area to obtain the corresponding template error value, thereby deriving the optimal intra-frame mode.

[0134] Step 1302: When the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, construct a block vector list for the current block; wherein the block vector list for the current block may satisfy at least one of the following: the block vector list is constructed by executing AR-BVP at least twice, and between executing AR-BVP at least twice, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of a reference block corresponding to a reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, which is determined according to an error calculation method of a template search process corresponding to the current block or the second syntax identification information transmitted in the bitstream.

[0135] It should be noted that, in an embodiment of the present application, when the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, a block vector list of the current block can be further constructed.

[0136] Furthermore, in an embodiment of the present application, the block vector list of the current block may satisfy at least one of the following:

[0137] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0138] The block vector list includes the block vector of the reference block corresponding to the reference block vector of the current block;

[0139] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM;

[0140] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

[0141] It should be noted that in embodiments of the present application, the block vector list for the current block may be constructed through at least two AR-BVP passes, and between the at least two AR-BVP passes, a check operation may be performed on at least one non-AR-BVP block vector. In the process of constructing the block vector list for the current block, different candidate block vectors may be obtained through at least two AR-BVP passes, and the obtained candidate block vectors may be checked and added to the block vector list. Between the at least two AR-BVP passes, a check operation may also be performed on at least one non-AR-BVP block vector.

[0142] It should be noted that, in the embodiments of the present application, the block vector list of the current block may include a reference block vector corresponding to the guide block vector of the current block. In the process of constructing the block vector list of the current block, the block vector of the reference block determined based on the guide block vector in the AR-BVP process may be directly used as a candidate block vector, and the candidate block vector may be checked and added to the block vector list.

[0143] It should be noted that, in the embodiments of the present application, when the preset intra prediction mode is DIMD, TIMD, or SGPM, the constructed block vector list of the current block may include block vectors with sub-pixel precision. The block vectors added to the block vector list of the current block may be of sub-pixel precision, thereby obtaining a prediction block with sub-pixel precision.

[0144] It should be noted that, in an embodiment of the present application, the block vector list for the current block may be obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list. A preset template error calculation method for calculating the template error values ​​of the block vectors in the block vector list may be first determined. The preset template error calculation method may be determined based on the error calculation method used in the template search process corresponding to the current block, or may be determined based on second syntax identification information transmitted in the bitstream.

[0145] Furthermore, in an embodiment of the present application, when constructing a block vector list of the current block, the first block vector in the block vector list of the current block can be determined as the first guide block vector of the current block, and the first candidate block vector of the current block can be determined based on the first guide block vector; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in a historical block vector cache list HMVP; then the first candidate block vector and the second block vector are added to the block vector list; wherein the second block vector can be a non-AR-BVP block vector, for example, the second block vector can be a non-AR-BVP block vector different from the first block vector; then the third block vector in the block vector list is determined as the second guide block vector of the current block, and the second candidate block vector of the current block is determined based on the second guide block vector; wherein the third block vector at least includes the first candidate block vector; and then the second candidate block vector can be added to the block vector list.

[0146] It should be noted that in the embodiments of the present application, a block vector list for the current block can be constructed using block vectors of adjacent blocks of the current block, block vectors of non-adjacent blocks of the current block, and any number of block vectors in the historical block vector cache list HMVP. The first block vector can be any one or more block vectors in the block vector list for the current block, i.e., the first block vector can be a non-AR-BVP block vector.

[0147] Accordingly, in an embodiment of the present application, the second block vector may be a non-AR-BVP block vector, for example, the second block vector may be a non-AR-BVP block vector different from the first block vector, wherein the second block vector may also be a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, or any number of block vectors in the historical block vector cache list HMVP that are different from the first block vector.

[0148] It should be noted that, in an embodiment of the present application, the second block vector may be a non-AR-BVP block vector that is determined after performing a check operation on at least one non-AR-BVP block vector after completing the first AR-BVP and can be added to the block vector list.

[0149] Accordingly, in an embodiment of the present application, the third block vector may include the first candidate block vector constructed through AR-BVP, and may also include the first block vector and / or the second block vector. That is, after the first candidate block vector and the second block vector are added to the block vector list of the current block, in addition to the first candidate block vector being used as the guidance block vector for the next AR-BVP, other block vectors in the block vector list of the current block may also be used as guidance block vectors for the next AR-BVP.

[0150] It can be understood that in the embodiments of the present application, taking the example of constructing a block vector candidate list for the current block using two AR-BVP processes, during the first AR-BVP process, the first block vector in the block vector list of the current block can be used as the first guide block vector, and then the corresponding first candidate block vector can be determined based on the first guide block vector, wherein the first candidate block vector is the AR-BVP block vector. After the first AR-BVP process, the obtained first candidate block vector (AR-BVP block vector) and the second block vector (a non-AR-BVP block vector different from the first block vector) can be added to the block vector list of the current block. Then, during the second AR-BVP process, the third block vector in the block vector list can be first used as the second guide block vector, wherein the third block vector includes at least the first candidate block vector obtained by the first AR-BVP process. Then, the corresponding second candidate block vector can be determined based on the second guide block vector, and the second candidate block vector can be the AR-BVP block vector. Finally, the obtained second candidate block vector can be added to the block vector list.

[0151] It is understood that in the embodiments of the present application, during the process of constructing the block vector list for the current block, the AR-BVP process may be performed more than twice, and this application does not specifically limit this. For example, after adding the obtained second candidate block vector to the block vector list, a guide block vector for the next AR-BVP process may be further determined based on the block vector list, and then a corresponding candidate block vector may be determined based on the guide block vector and added to the block vector candidate list.

[0152] For example, in some embodiments, it is assumed that when building the block vector list, the AR-BVP can be constructed in two steps. For example, the candidate block vectors can be checked and added in the following order:

[0153] a) Inherit the block vector of the adjacent block

[0154] b) Inherit the block vectors of non-adjacent blocks

[0155] c) Constructing AR-BVP from existing block vectors

[0156] d) Inherit the block vector in the historical block vector cache list

[0157] e) Constructing AR-BVP from existing block vectors

[0158] f) Obtain a block vector by averaging the existing block vectors

[0159] g) Default block vector

[0160] The existing block vectors are part or all of the block vectors in the constructed block vector list. After adding the adjacent / non-adjacent block vectors, the first AR-BVP construction process is performed. Thereafter, after adding the block vectors in the historical block vector cache list, the second AR-BVP construction process is performed.

[0161] Furthermore, in an embodiment of the present application, when constructing a block vector list of the current block, the first block vector in the block vector list of the current block can be determined as the first guide block vector of the current block, and the first reference block corresponding to the first guide block vector can be determined; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in the HMVP; then the block vector of the first reference block is determined as the first candidate block vector of the current block; and / or, the first guide block vector and the block vector of the first reference block are summed to determine the first candidate block vector of the current block; and finally, the first candidate block vector can be added to the block vector list.

[0162] It should be noted that in an embodiment of the present application, when constructing a block vector list for the current block, the corresponding reference block may be first determined based on the guide block vector, and then the corresponding candidate block vector may be determined using the block vector of the reference block. After AR-BVP processing is completed, when determining the candidate block vector using the block vector of the reference block, the sum of the guide block vector and the block vector of the reference block may be used to determine the candidate block vector and add it to the block vector candidate list, or the block vector of the reference block may be directly used to determine the candidate block vector and add it to the block vector candidate list.

[0163] It is understood that in the embodiment of the present application, in the process of determining the first candidate block vector based on the first guide block vector, the first reference block can be first determined based on the first guide block vector, and then the first candidate block vector can be determined based on the block vector of the first reference block. The first candidate block vector can be determined by summing the first guide block vector and the block vector of the first reference block, or the block vector of the first reference block can be directly determined as the first candidate block vector. Of course, the first candidate block vector can also include both the sum of the first guide block vector and the block vector of the first reference block and the block vector of the first reference block, as well as the block vector of the first reference block.

[0164] That is to say, in an embodiment of the present application, the block vector of the reference block determined according to the reference block vector can be directly added to the block vector list as a candidate block vector, that is, the block vector list of the current block includes the block vector of the reference block corresponding to the reference block vector of the current block.

[0165] For example, in some embodiments, it is assumed that when constructing a block vector list, the block vector of the reference block can be directly used as a block vector candidate (candidate block vector). Specifically, for a given guide block vector BV_0 and a corresponding block vector BV_ref of a reference block, a candidate block vector BV_arbvp=BV_0+BV_ref can be obtained by adding the guide block vector and the block vector of the reference block. Alternatively, the block vector BV_ref of the reference block can be directly used as a candidate block vector BV_ext=BV_ref. Alternatively, when constructing an AR-BVP, each time a reference block vector is obtained based on the guide block vector, BV_arbvp and BV_ext can be added to the block vector list as candidate block vectors.

[0166] Furthermore, in an embodiment of the present application, when constructing a block vector list of a current block, the first block vector in the block vector list of the current block may be first determined as the first guide block vector of the current block, and a first reference block corresponding to the first guide block vector may be determined; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in an HMVP; then the block vector of the first reference block is determined as the first candidate block vector of the current block; and / or, the first guide block vector and the block vector of the first reference block are summed to determine the first candidate block vector of the current block; then the first candidate block vector and the second block vector may be summed to determine the first candidate block vector of the current block. The amount is added to the block vector list; wherein the second block vector can be a non-AR-BVP block vector, for example, the second block vector can be a non-AR-BVP block vector different from the first block vector; then the third block vector in the block vector list is determined as the second guide block vector of the current block, and the second reference block corresponding to the second guide block vector is determined; wherein the third block vector at least includes the first candidate block vector; then the block vector of the second reference block is determined as the second candidate block vector of the current block; and / or, the second guide block vector and the block vector of the second reference block are summed to determine the second candidate block vector of the current block; finally, the second candidate block vector can be added to the block vector list.

[0167] It can be understood that in the embodiment of the present application, taking two AR-BVP processes to construct a block vector candidate list for the current block as an example, during the first AR-BVP process, the first block vector in the block vector list of the current block can be used as the first guide block vector, and then the corresponding first candidate block vector is determined based on the first guide block vector, wherein the first candidate block vector is an AR-BVP block vector, and the first candidate block vector may include the block vector of the first reference block corresponding to the first candidate block vector, and / or the sum of the first guide block vector and the block vector of the corresponding first reference block. After the first AR-BVP process, the obtained first candidate block vector (AR-BVP block vector) and the second block vector (a non-AR-BVP block vector different from the first block vector) can be added to the block vector list of the current block. Next, a second AR-BVP process is performed. The third block vector in the block vector list can be used as a second guide block vector, where the third block vector includes at least the first candidate block vector obtained by the first AR-BVP process. A corresponding second candidate block vector can then be determined based on the second guide block vector. The second candidate block vector is an AR-BVP block vector and can include the block vector of the second reference block corresponding to the second candidate block vector and / or the sum of the second guide block vector and the block vector of the corresponding second reference block. Finally, the obtained second candidate block vector can be added to the block vector list.

[0168] It is understood that in the embodiments of the present application, during the process of constructing the block vector list for the current block, the AR-BVP process may be performed more than twice, and this application does not specifically limit this. For example, after adding the obtained second candidate block vector to the block vector list, a guide block vector for the next AR-BVP process may be further determined based on the block vector list, and then a corresponding candidate block vector may be determined based on the guide block vector and added to the block vector candidate list.

[0169] It can be understood that in an embodiment of the present application, in the process of constructing the block vector list of the current block, it is possible to choose to add the block vector of the reference block corresponding to the guidance vector to the block vector list of the current block in any one or more AR-BVP processing processes.

[0170] That is, in the embodiment of the present application, when constructing the block vector list, AR-BVP can be constructed in at least two steps; at the same time, during the AR-BVP processing, the block vector of the reference block can be directly used as the candidate block vector.

[0171] Furthermore, in an embodiment of the present application, during the AR-BVP process to obtain candidate block vectors, the guide block vector may be determined based on existing block vectors in the block vector list. The first guide block vector in the first AR-BVP process and the second guide block vector in the second AR-BVP process may be partially identical or completely different.

[0172] That is, in the embodiments of the present application, the process of constructing an AR-BVP can be the same or different at different times. For example, when constructing an AR-BVP for the first time, all existing block vectors in the block vector list can be used as guide block vectors; when constructing an AR-BVP for the second time, all existing block vectors in the list and the newly added AR-BVP can be used as guide block vectors.

[0173] Exemplarily, in some embodiments, the first guide block vector in the first AR-BVP processing process may include some or all block vectors in the block vector list, and the second guide block vector in the second AR-BVP processing process may include a non-AR-BVP block vector in the block vector list that is different from the first guide block vector, and may also include a newly constructed AR-BVP block vector (i.e., the first candidate block vector) added to the block vector list after the first AR-BVP processing.

[0174] Furthermore, in an embodiment of the present application, AR-BVP processing can be performed based on the guidance block vector of the current block to obtain at least one candidate block vector, so that a block vector list of the current block can be constructed until a preset end condition is met; wherein the preset end condition includes at least one of the following: the number of AR-BVP processes is greater than or equal to a preset threshold; the number of candidate block vectors determined by AR-BVP processing is greater than or equal to a first number threshold; the number of block vectors in the block vector list is greater than or equal to a second number threshold.

[0175] It is understood that in the embodiments of the present application, the preset threshold, the first quantity threshold, and the second quantity threshold can all be pre-set integers greater than 0, and this application does not specifically limit them. For example, the preset threshold can be 3, the first quantity threshold can be 5, and the second quantity threshold can be 15.

[0176] That is, in the embodiment of the present application, after determining the guide block vector (such as the first guide block vector or the second guide block vector), one or more AR-BVP block vectors can be constructed. 0,1 Determine the reference block B1, and then use the block vector BV in the area of ​​the reference block B1 to determine the reference block B1. 1,2 Construct a new block vector BV 0,2 =BV 0,1 +BV1,2 Then, AR-BVP treatment can be continued, for example according to BV 0,n The reference block B can be determined n , if in B n There is a block vector BV in the region n,n+1 , then a new block vector BV can be constructed 0,n+1 =BV 0,1 +BV 1,2 +…+BV n,n+1 .

[0177] It should be noted that, in an embodiment of the present application, the end conditions (preset end conditions) of the AR-BVP construction process may include but are not limited to: the number of iterations of constructing the AR-BVP, the number of AR-BVPs added to the block vector list, and the number of current block vectors in the block vector list.

[0178] It should be noted that in the embodiments of the present application, the AR-BVP construction process can be the same or different at different times. For example, the first AR-BVP construction can be performed independently of the added AR-BVP (the first candidate block vector). The second AR-BVP construction can be performed based on the newly added AR-BVP (the second candidate block vector) to construct multiple AR-BVPs for each guide block vector.

[0179] Furthermore, in an embodiment of the present application, when determining a candidate block vector of a current block based on a block vector of a reference block, the guide block vector and the block vector of at least one reference block are summed respectively to determine the candidate block vector; and / or, the guide block vector and at least one block vector of the reference block are summed respectively to determine the candidate block vector.

[0180] It should be noted that, in the embodiment of the present application, one or more corresponding reference blocks may be determined according to the guide block vector, and block vectors of one or more corresponding reference blocks may also be determined according to the guide block vector.

[0181] Exemplarily, in some embodiments, when determining the first candidate block vector of the current block based on the block vector of the first reference block, the first guide block vector and the block vector of at least one first reference block are summed respectively to determine the first candidate block vector; and / or, the first guide block vector and at least one block vector of the first reference block are summed respectively to determine the first candidate block vector.

[0182] That is to say, in an embodiment of the present application, for a guide block vector, at least one corresponding reference block can be determined at at least one position in the corresponding reference area, and for any of the reference blocks, the reference block can correspond to at least one block vector.

[0183] For example, in some embodiments, FIG14 is a schematic diagram of a block vector for a reference block provided in an embodiment of the present application. As shown in FIG14 , when determining the block vector corresponding to a reference block, multiple positions may be checked. For example, the center, upper left, upper right, lower left, and lower right of the reference block may be checked in sequence to determine whether a coding block exists. If so, the stored block vectors are used as the block vectors. Any reference block may include one or more block vectors. For example, the reference block at the center may store two block vectors.

[0184] Furthermore, in an embodiment of the present application, the number of block vectors in the HMVP added to the block vector list may be determined based on the number of block vectors in the block vector list.

[0185] That is, in the embodiment of the present application, when constructing the block vector list, the number of block vectors added from the HMVP to the block vector list may be adjusted according to the number of block vectors that have been added.

[0186] Exemplarily, in some embodiments, assuming that the maximum length of the block vector list is N, and before the block vector in the HMVP is added, there are already n block vectors in the block vector list, then the number of block vectors in the HMVP added to the block vector list can be set according to N and n, for example, the number of block vectors in the HMVP added to the block vector list is determined to be (N–n) / 2.

[0187] Furthermore, in an embodiment of the present application, before adding any block vector (AR-BVP block vector or non-AR-BVP block vector) to the block vector list, the block vector may be checked. If the block vector does not meet a preset addition condition, the block vector is not added to the block vector list. If the block vector meets the preset addition condition, the block vector is added to the block vector list. The preset addition condition includes at least one of the following: the block vector is different from any block vector in the block vector list; or the reference block corresponding to the block vector exists.

[0188] For example, in some embodiments, between executing at least two AR-BVPs, a check operation may be performed on at least one non-AR-BVP block vector. For example, a check operation may be performed on a block vector in the HMVP (a non-AR-BVP block vector) to determine whether the block vector in the HMVP can be added to the block vector list of the current block. If the block vector in the HMVP is the same as a block vector already added to the list, the non-AR-BVP block vector is not added. That is, if the non-AR-BVP block vector for which the check operation is performed does not meet the addition condition, the non-AR-BVP block vector is not added.

[0189] Accordingly, in some embodiments, between executing at least two AR-BVPs, after performing a check operation on at least one non-AR-BVP block vector, if any of the non-AR-BVP block vectors is different from any of the block vectors already added to the list, and the reference block corresponding to the non-AR-BVP block vector exists, it can be determined that the non-AR-BVP block vector can be added to the block vector list of the current block.

[0190] Step 1303: Determine the prediction block of the current block according to the block vector list of the current block.

[0191] In an embodiment of the present application, when the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, after constructing the block vector list of the current block, the prediction block of the current block can be further determined based on the block vector list of the current block.

[0192] Furthermore, in an embodiment of the present application, when the preset intra prediction mode is DIMD, TIMD, or SGPM, the constructed block vector list of the current block may include block vectors with sub-pixel precision. Accordingly, when determining the prediction block of the current block based on the block vector list of the current block, the template error value of the block vector in the block vector list may be first determined based on the block vector with sub-pixel precision in the block vector list; and then the prediction block of the current block may be determined based on the template error value of the block vector in the block vector list.

[0193] It is understood that in the embodiment of the present application, for a block vector list with sub-pixel precision, the block vectors in the block vector list have corresponding sub-pixel precision parameters, and the sub-pixel precision parameters can represent the precision value of the block vector. The sub-pixel precision parameter can be a value greater than 0 and less than or equal to 1. For example, the sub-pixel precision parameter of a block vector is 1 / 16.

[0194] Furthermore, in an embodiment of the present application, when determining the template error value of the block vector in the block vector list based on the sub-pixel precision block vector in the block vector list, the template type parameter and the template size parameter corresponding to the template type parameter can be determined first; then, based on the template type parameter, the template size parameter and the sub-pixel bit parameter of the sub-pixel precision block vector, the adjusted block vector corresponding to the sub-pixel precision block vector can be determined; then, based on the adjusted block vector, the prediction value of the reference template can be determined; finally, the template error value of the block vector in the block vector list can be determined based on the prediction value of the reference template and the reconstructed value of the current template.

[0195] It should be noted that, in the embodiment of the present application, the template type parameter can determine the type of the template, wherein the type of the corresponding template can be determined as the upper template or the left template according to the template type parameter.

[0196] It should be noted that, in the embodiments of the present application, the template size parameter can determine the size of the template, wherein the width or height of the corresponding template can be determined according to the template size parameter. For the upper template, the corresponding width is the width value of the current block, and the corresponding height can be determined by the template size parameter; for the left template, the corresponding height is the height value of the current block, and the corresponding width can be determined by the template size parameter.

[0197] Exemplarily, in some embodiments, Figure 15 is a schematic diagram of the template provided in an embodiment of the present application. As shown in Figure 15, the height value of the current block is H, and the width value is W. The two template types corresponding to the current block are determined according to the template type parameters, such as the upper template and the left template. Based on the template size parameters of the upper template, the width of the upper template can be determined as Tw, and based on the template size parameters of the left template, the height of the left template can be determined as Th.

[0198] It should be noted that in an embodiment of the present application, when determining the adjusted block vector corresponding to the block vector with sub-pixel precision based on the template type parameter, the template size parameter and the sub-pixel bit parameter of the block vector with sub-pixel precision, the template corresponding to the current block and the size value of the template can be determined based on the template type parameter and the template size parameter, and then the sub-pixel bit parameter corresponding to the block vector and the size value of the template can be used to perform adjustments to obtain the adjusted block vector.

[0199] For example, in some embodiments, assuming that the template corresponding to the current block is determined to be the upper template based on the template type parameter, the size value of the corresponding template is the height Th, and the sub-pixel bit parameter of the corresponding block vector BV is mv_bits, then the block vector BV can be adjusted according to the following formula to obtain the corresponding adjusted block vector BV_top: BV_top=BV+(Th< <mv_bits) (1)

[0200] For example, in some embodiments, assuming that the template corresponding to the current block is determined to be a left template based on the template type parameter, the size value of the corresponding template is a width Tw, and the sub-pixel bit parameter of the corresponding block vector BV is mv_bits, then the block vector BV can be adjusted according to the following formula to obtain the corresponding adjusted block vector BV_left: BV_left=BV+(Tw< <mv_bits) (2)

[0201] Furthermore, in an embodiment of the present application, when determining the prediction value of a reference template based on an adjusted block vector, when a candidate reference template corresponding to the adjusted block vector is available, the prediction value of the reference template can be determined based on the adjusted block vector and a sub-pixel difference algorithm; when the candidate reference template corresponding to the adjusted block vector is not available, the prediction value of the reference template can be determined based on the block vector in a block vector list and a sub-pixel difference algorithm.

[0202] It can be understood that in the embodiments of the present application, the corresponding candidate reference template can be determined based on the adjusted block vector. If the candidate reference template is available, the prediction value of the reference template can be directly determined based on the adjusted block vector and the sub-pixel difference algorithm; if the candidate reference template is not available, the adjusted block vector is no longer used, and the prediction value of the reference template is determined based on the block vector before adjustment and the sub-pixel difference algorithm.

[0203] Exemplarily, in some embodiments, assuming that the adjusted block vector is BV_top, a candidate reference template with width and height W and Th is obtained based on BV_top. If the candidate reference template is available, the prediction value of the corresponding reference template can be calculated based on BV_top through a sub-pixel difference algorithm; if the candidate reference template is not available, BV_top can be adjusted to be equal to BV, and the prediction value of the corresponding reference template can be calculated through a sub-pixel difference algorithm.

[0204] It should be noted that, in the embodiment of the present application, the sub-pixel difference algorithm can be implemented by a difference filter, wherein the interpolation filter can be a 2-tap interpolation filter, which can be the same as the 2-tap interpolation filter used in inter-frame prediction and IBC prediction.

[0205] Accordingly, in the embodiments of the present application, the prediction of the left template region can also be obtained in the above manner, that is, the prediction value of the corresponding reference template can be further determined based on BV_left. Ultimately, the template error value corresponding to the block vector can be calculated based on the prediction value of the reference template and the reconstructed value of the current template, and then the prediction block of the current block can be determined based on the template error value of the block vector in the block vector list.

[0206] For example, in some embodiments, assuming that the preset intra-frame prediction mode is DIMD, the template error value of the predefined intra-frame non-angle mode can be calculated. For example, one mode Planar is predefined, and the template error value of the Planar mode is calculated based on the reference pixel; then the best non-angle prediction method can be selected based on the candidate block vector in the block vector list and the template error value of the intra-frame non-angle mode. If the best prediction method is to use a candidate block vector, when the block vector has sub-pixel accuracy, the reference block of the current block can be obtained based on interpolation filtering, where the interpolation filter can use an n-tap filter, for example, n is 8, which can be the same as the interpolation filter during IBC prediction; after obtaining the best non-angle prediction method, it is combined with the prediction block generated by the intra-frame angle mode derived by HoG to obtain the final prediction block.

[0207] Furthermore, in an embodiment of the present application, the block vector list of the current block can be obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list. Accordingly, when determining the prediction block of the current block based on the block vector list of the current block, a block vector template error calculation can be first performed on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list; then, the block vector list can be sorted based on the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list; finally, the prediction block of the current block can be determined based on the sorted block vector list.

[0208] It should be noted that, in embodiments of the present application, a preset template error calculation method for calculating template error values ​​for block vectors in the block vector list may be determined first. The preset template error calculation method may be determined based on an error calculation method used in a template search process corresponding to the current block, or may be determined based on second syntax identification information transmitted in the bitstream.

[0209] It will be appreciated that, in an embodiment of the present application, one implementation is that the second syntax identification information is used to indicate whether the preset template error calculation method is SAD or MR-SAD, which can be represented by cu_tmp_lic_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SAD.

[0210] It will be appreciated that in an embodiment of the present application, another implementation is that the second syntax identification information is used to indicate whether the preset template error calculation method is SATD or MR-SATD, which can be represented by cu_tmp_lic_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SATD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SATD.

[0211] It will be appreciated that in another embodiment of the present application, the second syntax identification information is used to indicate whether the preset template error calculation method is SATD or SAD, which can be represented by cu_tmp_satd_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SATD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD.

[0212] It can be understood that in an embodiment of the present application, another implementation method is that the second syntax identification information is used to indicate that the preset template error calculation method is one of SAD, MR-SAD, SATD, and MR-SATD, which can be jointly represented by cu_tmp_lic_flag and cu_tmp_satd_flag. In some embodiments, if the value of the first information cu_tmp_lic_flag in the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or SATD; if the value of the first information cu_tmp_lic_flag in the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SAD or MR-SATD; if the value of the second information cu_tmp_satd_flag in the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or MR-SATD; if the value of the second information cu_tmp_satd_flag in the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or MR-SAD. For example, when the value of cu_tmp_lic_flag is the first value and the value of cu_tmp_satd_flag is the first value, it can be determined that the preset template error calculation method is SATD; when the value of cu_tmp_lic_flag is the second value and the value of cu_tmp_satd_flag is the first value, it can be determined that the preset template error calculation method is MR-SATD.

[0213] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.

[0214] In a specific embodiment, taking the first value as 1 and the second value as 0 as an example, if the value of cu_tmp_lic_flag obtained through decoding is 1, then it can be determined that the second syntax identification information indicates that the preset template error calculation method is SAD; if the value of cu_tmp_lic_flag obtained through decoding is 0, then it can be determined that the first syntax identification information indicates that the preset template error calculation method is MR-SAD.

[0215] Furthermore, in an embodiment of the present application, when performing block vector template error calculation on block vectors in a block vector list and determining the template error value of the block vectors in the block vector list, the code stream can be decoded to determine the second syntax identification information; then, a preset template error calculation method is determined based on the second syntax identification information; wherein the preset template error calculation method includes any one of the following: SAD, MR-SAD, SATD, MR-SATD; finally, based on the preset template error calculation method, it can be determined that the block vectors in the candidate block vector list correspond to a template error value of at least one template type.

[0216] It can be understood that in the embodiment of the present application, it can be determined according to the second syntax identification information whether the preset template error calculation method for performing block vector template error calculation is SAD, MR-SAD, SATD, or MR-SATD.

[0217] Exemplarily, in some embodiments, assuming that the second syntax identification information is represented by cu_tmp_lic_flag, then by taking the value of cu_tmp_lic_flag, it can be determined that the preset template error calculation method is SAD or MR-SAD, or it can be determined that the preset template error calculation method is SATD or MR-SATD.

[0218] Exemplarily, in some embodiments, assuming that the second syntax identification information is represented by cu_tmp_satd_flag, then the value of cu_tmp_satd_flag can be used to determine whether the preset template error calculation method is SAD or SATD.

[0219] For example, in some embodiments, assuming that the second identification information includes the first information cu_tmp_lic_flag and the second information cu_tmp_satd_flag, then the values ​​of cu_tmp_lic_flag and cu_tmp_satd_flag can be used to determine whether the preset template error calculation method is SAD, MR-SAD, SATD, or MR-SATD. For example, when the value of cu_tmp_lic_flag is a first value and the value of cu_tmp_satd_flag is a first value, it can be determined that the preset template error calculation method is SATD; when the value of cu_tmp_lic_flag is a second value and the value of cu_tmp_satd_flag is a first value, it can be determined that the preset template error calculation method is MR-SATD.

[0220] Furthermore, in an embodiment of the present application, when determining a preset template error calculation method based on the second grammatical identification information, a first template error calculation method and a second template error calculation method can be first determined based on the second grammatical identification information; wherein, the first template error calculation method is used to perform a sparse search of at least one template type, and the second template error calculation method is used to perform a fine search of at least one template type and a block vector template error calculation.

[0221] That is to say, in an embodiment of the present application, based on the value of the second syntax identification information (for example, cu_tmp_lic_flag), a first template error calculation method for sparse search and a second template error calculation method for fine search and block vector template error calculation can be determined, that is, the block vector template error calculation is consistent with the template error calculation method in the fine search stage.

[0222] Exemplarily, in some embodiments, assuming that the value of the second syntax identification information cu_tmp_lic_flag is the first value, it can be determined that the sparse search stage uses MR-SAD (the first template error calculation method), the fine search stage uses MR-SATD (the second template error calculation method), and the block vector template error calculation uses MR-SATD.

[0223] Furthermore, in an embodiment of the present application, when the preset template error calculation method is determined based on the second grammar identification information, a third template error calculation method and a fourth template error calculation method can be determined based on the second grammar identification information; wherein, the third template error calculation method is used to perform a sparse search and block vector template error calculation of at least one template type, and the fourth template error calculation method is used to perform a fine search of at least one template type.

[0224] That is to say, in an embodiment of the present application, based on the value of the second syntax identification information (for example, cu_tmp_lic_flag), a third template error calculation method for sparse search and block vector template error calculation, and a fourth template error calculation method for fine search can be determined, that is, the block vector template error calculation is consistent with the template error calculation method in the sparse search stage.

[0225] Exemplarily, in some embodiments, assuming that the value of the second syntax identification information cu_tmp_lic_flag is the second value, it can be determined that the sparse search stage uses SAD (the third template error calculation method), the block vector template error calculation uses SATD, and the fine search stage uses SATD (the fourth template error calculation method).

[0226] Furthermore, in an embodiment of the present application, when the preset template error calculation method is determined based on the second grammar identification information, a fifth template error calculation method can be determined based on the second grammar identification information; wherein, the fifth template error calculation method is used to perform a sparse search of at least one template type, a fine search of at least one template type, and a block vector template error calculation.

[0227] That is to say, in an embodiment of the present application, based on the value of the second syntax identification information (for example, cu_tmp_lic_flag), the fifth template error calculation method for performing sparse search, fine search and block vector template error calculation can be determined, that is, the block vector template error calculation is consistent with the template error calculation method of the fine search stage and the sparse search stage.

[0228] Exemplarily, in some embodiments, assuming that the value of the second syntax identification information cu_tmp_lic_flag is the first value, it can be determined that the sparse search stage uses MR-SAD (the fifth template error calculation method), the fine search stage uses MR-SAD, and the block vector template error calculation uses MR-SAD.

[0229] Further, in an embodiment of the present application, the second grammar identification information includes first information and second information. When determining the preset template error calculation method based on the second grammar identification information, a sixth error calculation method can be determined based on the first information and the second information; wherein the sixth error calculation method is used to perform a sparse search of at least one template type, a fine search of at least one template type, and a block vector template error calculation.

[0230] That is to say, in an embodiment of the present application, based on the values ​​of the first information (for example, cu_tmp_lic_flag) and the second information (such as cu_tmp_satd_flag) in the second syntax identification information, a sixth template error calculation method for sparse search, fine search and block vector template error calculation can be determined, that is, the block vector template error calculation is consistent with the template error calculation method of the fine search stage and the sparse search stage, and the calculation method is determined by the values ​​of cu_tmp_lic_flag and cu_tmp_satd_flag.

[0231] Exemplarily, in some embodiments, assuming that the value of the first information cu_tmp_lic_flag in the second syntax identification information is the first value, it can be determined to use SAD or SATD. If the value of cu_tmp_satd_flag is the first value, it can be further determined to use SATD. If the value of cu_tmp_satd_flag is the second value, it can be further determined to use SAD.

[0232] That is to say, in an embodiment of the present application, in an embodiment of the present application, the cu_tmp_satd_flag and cu_tmp_lic_flag flags can be encoded at the same time to determine whether the template error of the search and block vector list is calculated using SAD, SATD, MR-SAD, or MR-SATD.

[0233] Furthermore, when performing block vector template error calculation on the block vectors in the block vector list to determine the template error value of the block vectors in the block vector list, block vector template error calculation can be performed on the block vectors in the block vector list according to the preset template error calculation method of the sparse search in the template search process corresponding to the current block to determine the template error value of the block vectors in the block vector list; or, block vector template error calculation can be performed on the block vectors in the block vector list according to the preset template error calculation method of the fine search in the template search process corresponding to the current block to determine the template error value of the block vectors in the block vector list.

[0234] That is to say, in an embodiment of the present application, the preset template error calculation method for block vector template error calculation can directly reuse the template error calculation method of the sparse search stage, or the preset template error calculation method for block vector template error calculation can directly reuse the template error calculation method of the fine search stage.

[0235] Furthermore, in an embodiment of the present application, when the block vector list is sorted according to the template error values ​​of the block vectors in the block vector list to obtain the sorted block vector list, the code stream can be decoded to determine the third syntax identification information; then, at least one number of templates corresponding to at least one template type is determined based on the third syntax identification information; and then, based on the at least one number of templates, the template error values ​​of the block vectors in the candidate block vector list corresponding to at least one template type are sorted respectively to obtain at least one first candidate list corresponding to at least one template type.

[0236] It should be noted that in an embodiment of the present application, for different template types, the number of templates corresponding to different template types can be determined, and then the template error values ​​of the block vectors under different template types can be sorted based on the number of templates. Finally, the first candidate list corresponding to the different template types can be obtained, that is, the sorted block vector list includes the first candidate list corresponding to the different template types.

[0237] It is understandable that in an embodiment of the present application, the third syntax identification information is used to indicate the number of templates corresponding to different template types, which can be represented by cu_tmp_idx. In some embodiments, based on the value of the third syntax identification information, the search results that need to be maintained corresponding to different template types can be determined. For example, based on the value of the third syntax identification information, it is determined that the search results corresponding to the L-type template, the upper template, and the left template need to be maintained respectively, that is, the number of templates corresponding to the L-type template, the upper template, and the left template is determined to be M0, M1, and M2, where M0, M1, and M2 are all integers greater than or equal to 0.

[0238] Exemplarily, in some embodiments, the current block uses MR-SAD to calculate the template error. When the value of the third syntax identification information cu_tmp_idx is greater than a threshold N (e.g., N=13), it is necessary to maintain the search results corresponding to the L-type template, the upper template, and the left template, respectively. Accordingly, the template error is calculated using MR-SAD for the block vectors in the block vector list, and the template error values ​​diff0, diff1, and diff2 corresponding to the L-type template, the upper template, and the left template are obtained, respectively. Based on diff0, diff1, and diff2 of the block vectors, the best M0, M1, and M2 candidate block vectors under the L-type template, the upper template, and the left template are obtained, which can be recorded as mrgList0, mrgList1, and mrgList2; wherein mrgList0, mrgList1, and mrgList2 are the first candidate lists corresponding to the L-type template, the upper template, and the left template, respectively.

[0239] Furthermore, in an embodiment of the present application, when determining the prediction block of the current block based on the sorted block vector list, a sparse search can be first performed according to at least one template type to obtain at least one second candidate list corresponding to the at least one template type; then the at least one first candidate list and the at least one second candidate list can be merged to obtain at least one third candidate list corresponding to the at least one template type; then, based on the at least one third candidate list, a fine search can be performed according to at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; finally, the target candidate list corresponding to the current block can be determined according to the at least one fourth candidate list, and the prediction block of the current block can be determined according to the target candidate list.

[0240] Exemplarily, in some embodiments, sparse searches are performed for the L-shaped template, upper template, and left template, respectively, and the search results are recorded as sparseList0, sparseList1, and sparseList2, which are the search results under the template error values ​​corresponding to the L-shaped template, upper template, and left template, respectively; wherein, sparseList0, sparseList1, and sparseList2 are the second candidate lists corresponding to the L-shaped template, upper template, and left template, respectively.

[0241] Exemplarily, in some embodiments, the block vector list and the sparse search results are merged, that is, at least one first candidate list and at least one second candidate list are merged respectively. For example, mrgList0 and sprseList0 are merged, that is, the top K candidate block vectors with the smallest MR-SAD corresponding to the L-shaped template are retained, K can be an integer greater than or equal to the maximum length of sparseList0, and the merged list is recorded as sparseList0'. Accordingly, mrgList1 and sprseList1 can be merged to obtain the corresponding sparseList1', and mrgList2 and sprseList2 can be merged to obtain the corresponding sparseList2'. Among them, sparseList0', sparseList1' and sparseList2' are the third candidate lists corresponding to the L-shaped template, the upper template and the left template, respectively.

[0242] Exemplarily, in some embodiments, based on the merged third candidate lists sparseList0', sparseList1' and sparseList2' corresponding to the L-shaped template, upper template and left template, a fine search can be performed respectively to obtain the search results sparselist0', sparselist1' and sparselist2' under the template error values ​​corresponding to the L-shaped template, upper template and left template; wherein, sparselist0', sparselist1' and sparselist2' are the fourth candidate lists corresponding to the L-shaped template, upper template and left template respectively.

[0243] Exemplarily, in some embodiments, when determining the target candidate list corresponding to the current block based on at least one fourth candidate list, at least one fourth candidate list may be merged, for example, sparselist0', sparselist1' and sparselist2' may be merged to obtain the final target candidate list.

[0244] Furthermore, in an embodiment of the present application, after performing a sparse search and obtaining at least one second candidate list, AR-BVP construction can be performed based on any of the second candidate lists. Specifically, a third reference block vector can be first determined based on the second candidate list, and then a third candidate block vector for the current block can be determined based on the third reference block vector. Subsequently, a template error value corresponding to the third candidate block vector can be determined, and the second candidate list can be updated based on the template error value corresponding to the third candidate block vector.

[0245] For example, in some embodiments, block vectors in the candidate list sparseList obtained through sparse search can be used as guide block vectors (third guide block vectors) to construct AR-BVP candidates (third candidate block vectors). Template error values ​​for these AR-BVP candidates can then be calculated and the sparseList can be updated. SparseLists of different template types can be used to construct AR-BVP candidates, and the sparseList can be updated based on the template error values ​​of the AR-BVP candidates.

[0246] Furthermore, in an embodiment of the present application, when determining the prediction block of the current block based on the sorted block vector list, a sparse search can be first performed according to at least one template type to obtain at least one second candidate list corresponding to the at least one template type; then the first candidate list corresponding to the preset template type and the at least one second candidate list are merged to obtain at least one third candidate list corresponding to the at least one template type; then, based on the at least one third candidate list, a fine search can be performed according to at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; finally, a target candidate list corresponding to the current block can be determined based on the at least one fourth candidate list, and the prediction block of the current block can be determined based on the target candidate list.

[0247] It should be noted that in the embodiments of the present application, when merging the block vector list and the sparse search results, a first candidate list corresponding to a preset template type can be selected and merged with at least one second candidate list to obtain at least one third candidate list corresponding to at least one template type. The preset template type can be any one of an L-shaped template, an upper template, and a left template.

[0248] Exemplarily, in some embodiments, when merging the block vector list and the sparse search results, mrgList0 can be merged with sprseList0, sprseList1 and sprseList2 respectively, and then the merged lists are recorded as sparseList0', sparseList1' and sparseList2', where sparseList0', sparseList1' and sparseList2' are the third candidate lists corresponding to the L-shaped template, upper template and left template respectively.

[0249] That is to say, in an embodiment of the present application, a block vector list mrgList can be constructed and reordered according to a preset template type (such as an L-type template), and candidate lists sparseList0, sparseList1 and sparseList2 under the L-type template, upper template and left template are obtained according to a sparse search. Subsequently, only mrgList can be merged with sparseList0, sparseList1 and sparseList2 respectively.

[0250] Furthermore, in an embodiment of the present application, in a process of performing a fine search based on at least one third candidate list, all template search areas corresponding to all block vectors in the third candidate list are the same; or, in a process of performing a fine search based on at least one third candidate list, the template search areas corresponding to the fourth block vectors in the third candidate list are the same; wherein the fourth block vector is a block vector derived from the first candidate list.

[0251] It should be noted that in the embodiments of the present application, when performing a refined search based on at least one third candidate list and at least one template type, the template search regions corresponding to the block vectors in the third candidate list may be the same or different. For example, the two template search regions corresponding to any two block vectors in the third candidate list may be the same; or, the two template search regions corresponding to any two fourth block vectors in the third candidate list may be the same.

[0252] It is understood that in the embodiment of the present application, the fourth block vector may be a block vector in the third candidate list that originates from the first candidate list. That is, during the merging of the first candidate list with the second candidate list, the fourth block vector in the first candidate list forms the third candidate list.

[0253] Furthermore, in an embodiment of the present application, when determining the prediction block of the current block based on the block vector list of the current block, the code stream can also be decoded to determine the block vector index number of the current block; then, based on the block vector index number and the block vector list of the current block, the target block vector of the current block can be determined; finally, the prediction block of the current block can be determined based on the target block vector.

[0254] For example, in some embodiments, if the preset intra-frame prediction mode is IBC, the prediction block of the current block can be further determined based on the decoded block vector index number in combination with the constructed block vector list of the current block. For example, in IBC merge mode, a block vector is selected from the block vector list based on the decoded merge index (block vector index number), and the reference block of the current block is obtained as the prediction block.

[0255] Furthermore, in an embodiment of the present application, the code stream is decoded to determine a residual block of the current block; and then a reconstructed block of the current block can be determined based on the residual block and the prediction block.

[0256] It can be understood that, in the embodiment of the present application, after determining the residual block and the prediction block of the current block, the sum of the residual block and the prediction block can be determined as the reconstructed block of the current block.

[0257] In summary, through the decoding method proposed in the above steps 1301 to 1303, the construction and / or use process of the block vector list in the intra-frame prediction process is adjusted and improved. On the one hand, when constructing the block vector list, the AR-BVP candidate block vector can be constructed in batches. On the other hand, the block vector of the reference block can be directly used as the candidate block vector to be added to the block vector list; on the other hand, a block vector list with sub-pixel precision can be used for intra-frame prediction; on the other hand, multiple methods can be used to determine multiple template error calculation methods, so that the block vector list can be reordered using different template error calculation methods.

[0258] That is to say, the decoding method proposed in the embodiment of the present application is an improved method for constructing and / or using a block vector list, wherein the block vector list can be an AMVP / Merge list of the IBC mode, a Merge list of the IntraTMP mode, or a block vector list constructed in other intra-frame modes to obtain predictions based on block vectors. In the process of constructing and / or using the block vector list, the AR-BVP candidate block vectors can be constructed in stages, and / or; the block vectors of the reference blocks can be directly added to the block vector list, and / or; a block vector list with sub-pixel precision can be used in the intra-frame mode, and / or; different template error calculation methods can be used to sort the block vector list, etc., thereby improving the diversity of the block vector list and the efficiency of the block vector list.

[0259] Below, the decoding method proposed in the embodiment of the present application is exemplified in the IBC mode with the first syntax identification information being cu_pred_mode. When constructing the block vector list, the AR-BVP can be constructed in multiple steps, and the block vector of the reference block can also be directly added to the block vector list as a block vector candidate.

[0260] Decoding process:

[0261] 1. Decode the prediction mode cu_pred_mode of the current block. When the prediction mode is IBC mode, build a block vector list for subsequent prediction. For example, in merge mode, build a block vector list and determine the block vector and prediction information of the current block (such as the local illumination compensation (LIC) flag, etc.) based on the merge index; for example, in AMVP mode, build a block vector list and determine the predicted block vector of the current block based on the BVP index, and combine the block vector residual BVD to obtain the final block vector;

[0262] 2. Construct a list of block vectors, check and add candidate block vectors in sequence, and add AR-BVP candidates in batches. For example, you can construct it in the following order:

[0263] a) Inherit the block vector of the adjacent block

[0264] b) Inherit the block vectors of non-adjacent blocks

[0265] c) Constructing AR-BVP from existing block vectors

[0266] d) Inherit the block vector in the historical block vector cache list

[0267] e) Constructing AR-BVP from existing block vectors

[0268] f) Obtain a block vector by averaging the existing block vectors

[0269] g) Default block vector (related to block size)

[0270] After adding adjacent / non-adjacent block vectors, the AR-BVP is constructed. After that, after adding block vectors in the historical block vector cache list, the AR-BVP is constructed.

[0271] 3. Determine the process of constructing AR-BVP. The guide block vectors for constructing AR-BVP may include: all block vectors already in the list, part (one or more) of the block vectors in the list, and a newly constructed block vector (AR-BVP). After determining a certain guide block vector, one or more AR-BVPs may be constructed. The end conditions of the construction process may include: the number of iterations of constructing AR-BVP, the number of added AR-BVPs, and the number of current lists; the process of constructing AR-BVPs may be different for different times. For example, when constructing AR-BVP for the first time, all the block vectors already in the list are used as guide block vectors, and construction is not continued based on the added AR-BVP. When constructing AR-BVP for the second time, all the block vectors already in the list and the newly added AR-BVP are used as guide block vectors, and each guide block vector constructs multiple AR-BVPs;

[0272] 4. For a given guide block vector BV_0 and a reference block vector BV_ref, in addition to adding them to obtain BV_arbvp = BV_0 + BV_ref, BV_ref can be directly checked as a candidate block vector BV_ext = BV_ref and added to the block vector list. For example, when constructing AR-BVP, each time a reference block vector is obtained based on the guide block vector, BV_arbvp and BV_ext can be checked and added separately;

[0273] 5. Build a list of block vectors based on the above steps, and then use this list to complete the encoding of the current block. For example, in IBC merge mode, a block vector is selected from the list based on the decoded merge index to obtain the reference block of the current block as the prediction block. Combined with the decoded residual information, the reconstructed block of the current block is obtained.

[0274] When constructing the block vector list, the number of block vectors (HMVP candidates) added from the HMVP cache can be adjusted based on the number of block vectors already added. For example, if the maximum length of the IBC block vector list is N and there are already n HMVP candidates in the list before adding them, then at most (N – n) / 2 HMVP candidates can be added.

[0275] It should be noted that the decoding method proposed in the embodiment of the present application was experimentally verified. When the stepwise constructed AR-BVP is applied to the IBC mode, a Y component coding gain of about -0.01% can be achieved on the enhanced compression reference software test platform (Enhanced Compression Model, ECM) reference software.

[0276] It should be noted that, through experimental verification of the decoding method proposed in the embodiment of the present application, a Y component coding gain of approximately -0.03% can be achieved when the method of directly using the block vector of the reference block as the candidate block vector is applied to the IntraTMP mode.

[0277] The decoding method proposed in the embodiments of the present application is described below in an exemplary manner using DIMD mode with the first syntax identifier cu_dimd_flag. In DIMD mode, a sub-pixel precision block vector list can be constructed. A prediction block based on sub-pixel interpolation is obtained based on the block vectors in the block vector list. This is then combined with the prediction block obtained by intra prediction to obtain the final prediction block. For example, the prediction block based on sub-pixel difference can be combined with the intra mode prediction block derived from the gradient histogram (HoG).

[0278] Decoding process:

[0279] 1. Decode the cu_dimd_flag flag of the current block. When cu_dimd_flag is true, it indicates that the current coding block uses the DIMD prediction mode. The current block can obtain the HoG based on the reconstructed area (or encoded information) and derive the intra-frame angle mode to generate the corresponding prediction block.

[0280] 2. Construct a list of block vectors, where the accuracy of candidate block vectors is sub-pixel. For example, the accuracy of block vectors is 1 / 16 pixel. Candidate block vectors can be obtained from adjacent blocks, non-adjacent blocks, AR-BVP candidates, historical block vector cache, etc.

[0281] 3. Calculate the template error for the N block vectors in the block vector list. For example, the width and height of the template are Tw and Th. The width and height of the current block are W and H. The template area is shown in Figure 15.

[0282] The candidate block vector is BV, and the predictions for the upper template and the left template are obtained respectively. For example, the upper template region is obtained. The BV is adjusted according to the template height Th, BV_top = BV+(Th << mv_bits), where mv_bits is the number of sub-pixel bits. Based on the upper left corner of the current block, a reference block with width W and height Th is obtained according to BV_top. If the reference block is not available, BV_top is adjusted to be equal to BV and the reference block is obtained. If BV contains a sub-pixel part, the reference block is obtained based on sub-pixel interpolation. The interpolation filter can be a 2-tap interpolation filter, which can be the same as the 2-tap interpolation filter used in inter-frame prediction and IBC prediction. The obtained reference block is used as the prediction for the upper template region. Similarly, the prediction for the left template region is obtained. According to the predicted value and the reconstructed value of the template region, the template error value is calculated, such as the SAD value;

[0283] 4. The template error value of the predefined intra non-angle mode can be calculated. For example, 1 mode Planar is predefined, and the template error value of the Planar mode is calculated according to the reference pixels;

[0284] 5. The best non-angle prediction method is selected according to the candidate block vector and the template error value of the intra non-angle mode. If the best prediction method is to use a certain candidate block vector, when the block vector is sub-pixel accurate, the reference block of the current block can be obtained based on interpolation filtering, and the interpolation filter can use an n-tap filter, for example, n is 8, which can be the same as the interpolation filter in IBC prediction;

[0285] 6. According to the above steps, the best non-angle prediction method is obtained, and it is combined with the prediction block generated by the intra angle mode derived from HoG to obtain the final prediction block, completing the encoding of the current block.

[0286] It should be noted that when the sub-pixel block vector list is applied to the DIMD and SGPM modes for experimental verification of the decoding method proposed in this application embodiment, a coding gain of approximately -0.01% in the Y component can be obtained.

[0287] Below, the decoding method proposed in the embodiment of the present application is exemplified in the IntraTMP mode, with the first syntax identification information being cu_tmp_flag, the second syntax identification information being cu_tmp_lic_flag, and the third syntax identification information being cu_tmp_idx. Among them, the block vector list can be reordered according to the template error. There are many ways to calculate the template error and select the template area. For example, the template area and error calculation method can be predefined for the block vector list, or can be consistent with the current prediction process. Taking the IntraTMP mode as an example, the current block can use error calculation methods such as SAD and MR-SAD, and the template area can be divided into L-type template, upper template and left template. The corresponding syntax elements in the prediction process based on the block vector list are as follows:

[0288]

[0289] cu_tmp_flag

[0290] if(cu_tmp_flag)

[0291] {

[0292]

[0293] cu_tmp_lic_flag

[0294]

[0295] cu_tmp_idx

[0296]

[0297] }

[0298]

[0299] Decoding process:

[0300] 1. Decode the cu_tmp_flag flag of the current block. When cu_tmp_flag is true, it indicates that the current coding block uses the IntraTMP prediction mode. Decode the cu_tmp_lic_flag flag. When cu_tmp_lic_flag is true, the current block uses SAD to calculate the template error value; when cu_tmp_lic_flag is false, the current block uses MR-SAD to calculate the template error value; decode the cu_tmp_idx index value and determine which type of template needs to be used for template matching based on this value.

[0301] 2. Construct a block vector list. The candidate block vectors can be obtained from adjacent blocks, non-adjacent blocks, AR-BVP candidates, historical block vector cache, etc.

[0302] 3. Calculate the template error values ​​of the candidate block vectors in the block vector list, and reorder them based on the template error values, retaining the top M. Determine the template error calculation method and template used based on cu_tmp_lic_flag and cu_tmp_idx. For example, when cu_tmp_lic_flag is true, the current block uses MR-SAD to calculate the template error. When cu_tmp_idx is greater than the threshold N, it is necessary to maintain the search results corresponding to the L-type template, upper template, and left template respectively. Accordingly, MR-SAD is used to calculate the template error for the candidates in the block vector list, and the template error values ​​diff0, diff1, and diff2 corresponding to the L-type template, upper template, and left template are obtained respectively. Based on the candidate diff0, diff1, and diff2, the best M0, M1, and M2 candidate block vectors under the L-type template, upper template, and left template are obtained, which can be recorded as mrgList0, mrgList1, and mrgList2;

[0303] 4. Based on the template error of the block vector list, the maximum template errors pDiff0, pDiff1, and pDiff2 of the L-shaped template, the upper template, and the lower left template can be obtained. This value is related to the template error value of the candidate in the block vector list. For example, pDiff0 can be equal to the maximum diff0 in the mrgList0 candidate plus 1. In subsequent sparse search and fine search, the template error value of the candidate block vector searched needs to be less than pDiff;

[0304] 5. Perform sparse search and record the search results as sparseList0, sparseList1 and sparseList2, which are the search results under the template error values ​​corresponding to the L-shaped template, upper template and left template respectively;

[0305] 6. Merge the block vector list and the sparse search results. For example, merge mrgList0 and sprseList0 to retain the top K candidate block vectors with the smallest MR-SAD corresponding to the L-shaped template. K can be an integer greater than or equal to the maximum length of sparseList0. The merged list is recorded as sparseList0';

[0306] 7. Based on the above steps, we obtain sparselist0', sparselist1' and sparselist2', and conduct a fine search to determine the final candidate list of IntraTMP block vectors. The final candidate list can be obtained by merging sparselist0', sparselist1' and sparselist2';

[0307] 8. Based on the final IntraTMP block vector candidate list and the decoded cu_tmp_idx, cu_tmp_lic_flag and other related syntax elements, the prediction block of the current block is obtained to complete the encoding of the current block.

[0308] It should be noted that in the embodiments of the present application, the IntraTMP mode can use SATD and MR-SATD as the calculation method of the template error. One implementation method is to use SAD in the sparse search stage and SATD in the fine search stage. If the cu_tmp_lic_flag flag of the current block is true, MR-SAD and MR-SATD are used accordingly. SATD or MR-SATD can be used when calculating the template error value of the block vector list, which is consistent with the fine search stage; another implementation method is to indicate whether SATD is used during the search by writing the flag cu_tmp_satd_flag of the code stream. For example, SAD is used when cu_tmp_satd_flag is false, and SATD is used when cu_tmp_satd_flag is true. The cu_tmp_satd_flag flag can be used to determine how the template error value of the block vector list is calculated. When cu_tmp_satd_flag is false, SAD is used, and when cu_tmp_satd_flag is true, SATD is used. It is also possible to encode the cu_tmp_satd_flag and cu_tmp_lic_flag flags at the same time to determine whether the template error of the search and block vector list is calculated using SAD, SATD, MR-SAD, or MR-SATD.

[0309] It should be noted that in the embodiments of this application, the candidate list sparseList obtained by sparse search can be used as a guide block vector to construct AR-BVP candidates, calculate the template error values ​​of these AR-BVP candidates, and update the sparseList (the list stores the n candidates with the smallest template error values). SparseLists of different template types can be used to construct AR-BVP candidates, and the sparseList is updated based on the template error values ​​of the AR-BVP candidates.

[0310] It should be noted that in the embodiments of the present application, when a block vector list is used in the IntraTMP mode search process, it can only be used for searches corresponding to one template type. For example, in Example 3, a block vector list mrgList is constructed and reordered based on the L-shaped template, and candidate lists sparseList0, sparseList1, and sparseList2 under the L-shaped template, the upper template, and the left template are obtained through sparse search. mrgList can be merged with sparseList0 (the candidate list corresponding to the L-shaped template).

[0311] It should be noted that the decoding method proposed in the embodiment of the present application was experimentally verified, and when the method of reordering the block vector list using SAD and MR-SAD respectively was applied to the IntraTMP mode, a Y component coding gain of about -0.02% could be achieved.

[0312] An embodiment of the present application provides a coding and decoding method, which, when a current block uses a preset intra-frame prediction mode, constructs a block vector list of the current block; determines a prediction block of the current block based on the block vector list of the current block; wherein the block vector list of the current block satisfies at least one of the following: the block vector list is constructed by executing at least two AR-BVPs, and between executing at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, which is determined according to the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream. That is to say, in an embodiment of the present application, the construction and / or use process of the block vector list in the intra-frame prediction process can be adjusted and improved. The diversity of the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or directly using the block vector of the reference block as a candidate block vector to add to the block vector list, and / or using a block vector list with sub-pixel precision for intra-frame prediction, and / or using different template error calculation methods to reorder the block vector list, etc., thereby improving the efficiency of intra-frame prediction and improving encoding and decoding performance.

[0313] In yet another embodiment of the present application, FIG16 is a flow chart of an encoding method provided in an embodiment of the present application. As shown in FIG16 , the method may include:

[0314] Step 1601: When it is determined that the current block uses a preset intra prediction mode, first syntax identification information is written into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra prediction mode.

[0315] It should be noted that in the embodiments of the present application, the method is applied to an encoder. Specifically, based on the structure of encoder 200 shown in FIG15 , the encoding method of the embodiments of the present application can be applied to intra-frame prediction, primarily to the intra-frame prediction method constructed using a block vector list, thereby improving the prediction efficiency of intra-frame prediction.

[0316] It should also be noted that, in embodiments of the present application, the first syntax identification information is used to indicate whether the current block uses a preset intra-frame prediction mode. In some embodiments, if the value of the first syntax identification information is a first value, it is determined that the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; if the value of the first syntax identification information is a second value, it is determined that the first syntax identification information indicates that the current block does not use the preset intra-frame prediction mode.

[0317] It should also be noted that, in an embodiment of the present application, the preset intra-frame prediction mode may include at least one of the following: intra-frame block copy IBC, intra-frame template matching prediction IntraTMP, spatial geometry partitioning mode SGPM, decoding-end intra-frame mode derivation DIMD, and template-based intra-frame mode derivation TIMD.

[0318] It can be understood that in the embodiments of the present application, for different preset intra-frame prediction modes, the representation method of the first syntax identification information can be different. For example, for IBC, the corresponding first syntax identification information can be expressed as cu_pred_mode, for DIMD, the corresponding first syntax identification information can be expressed as cu_dimd_flag, and for IntraTMP, the corresponding first syntax identification information can be expressed as cu_tmp_flag.

[0319] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.

[0320] It can be understood that in an embodiment of the present application, after determining that the current block uses the preset intra-frame prediction mode, the corresponding first syntax identification information can be further determined, and the first syntax identification information can be written into the code stream and transmitted to the encoding end, so that the encoding end determines the preset intra-frame prediction mode used by the current block based on the first syntax identification information obtained by decoding.

[0321] It should be noted that, in the embodiment of the present application, the preset intra-frame prediction mode may be a mode for performing intra-frame prediction by constructing a block vector list.

[0322] In some embodiments, the preset intra prediction mode may include at least one of the following: intra block copy IBC, intra template matching prediction IntraTMP, spatial geometry partitioning mode SGPM, decoding-end intra mode derivation DIMD, and template-based intra mode derivation TIMD.

[0323] Among them, IBC realizes prediction through the block vector pointing from the current block to the reference block; IntraTMP uses template matching to use the reconstructed block corresponding to the most similar template as the matching block, which is used as the prediction block of the current coding block; SGPM can weightedly combine two intra-frame prediction blocks, and the weight value can correspond to different geometric division methods; DIMD will derive multiple intra-frame angle modes based on HoG, and will also derive an optimal non-angle mode by constructing a block vector list and calculating the template error, and weightedly combine the prediction blocks of these modes to obtain the final prediction block; TIMD constructs the most likely mode (MPM) list based on the existing coding information, and predicts the mode in the list in the template area to obtain the corresponding template error value, thereby deriving the optimal intra-frame mode.

[0324] Step 1602: Construct a block vector list for the current block; wherein the block vector list for the current block may satisfy at least one of the following: the block vector list is constructed by executing AR-BVP at least twice, and between executing AR-BVP at least twice, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, which is determined according to the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the bitstream.

[0325] It should be noted that, in the embodiment of the present application, when it is determined that the current block uses the preset intra-frame prediction mode, a block vector list of the current block can be further constructed.

[0326] Furthermore, in an embodiment of the present application, the block vector list of the current block may satisfy at least one of the following:

[0327] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0328] The block vector list includes the block vector of the reference block corresponding to the reference block vector of the current block;

[0329] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM;

[0330] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

[0331] It should be noted that in embodiments of the present application, the block vector list for the current block may be constructed through at least two AR-BVP passes, and between the at least two AR-BVP passes, a check operation may be performed on at least one non-AR-BVP block vector. In the process of constructing the block vector list for the current block, different candidate block vectors may be obtained through at least two AR-BVP passes, and the obtained candidate block vectors may be checked and added to the block vector list. Between the at least two AR-BVP passes, a check operation may also be performed on at least one non-AR-BVP block vector.

[0332] It should be noted that, in the embodiments of the present application, the block vector list of the current block may include a reference block vector corresponding to the guide block vector of the current block. In the process of constructing the block vector list of the current block, the block vector of the reference block determined based on the guide block vector in the AR-BVP process may be directly used as a candidate block vector, and the candidate block vector may be checked and added to the block vector list.

[0333] It should be noted that, in the embodiments of the present application, when the preset intra prediction mode is DIMD, TIMD, or SGPM, the constructed block vector list of the current block may include block vectors with sub-pixel precision. The block vectors added to the block vector list of the current block may be of sub-pixel precision, thereby obtaining a prediction block with sub-pixel precision.

[0334] It should be noted that, in an embodiment of the present application, the block vector list for the current block may be obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list. A preset template error calculation method for calculating the template error values ​​of the block vectors in the block vector list may be first determined. The preset template error calculation method may be determined based on the error calculation method used in the template search process corresponding to the current block, or may be determined based on second syntax identification information transmitted in the bitstream.

[0335] Furthermore, in an embodiment of the present application, when constructing a block vector list of the current block, the first block vector in the block vector list of the current block can be determined as the first guide block vector of the current block, and the first candidate block vector of the current block can be determined based on the first guide block vector; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in a historical block vector cache list HMVP; then the first candidate block vector and the second block vector are added to the block vector list; wherein the second block vector can be a non-AR-BVP block vector, for example, the second block vector can be a non-AR-BVP block vector different from the first block vector; then the third block vector in the block vector list is determined as the second guide block vector of the current block, and the second candidate block vector of the current block is determined based on the second guide block vector; wherein the third block vector at least includes the first candidate block vector; and then the second candidate block vector can be added to the block vector list.

[0336] It should be noted that in the embodiments of the present application, a block vector list for the current block can be constructed using block vectors of adjacent blocks of the current block, block vectors of non-adjacent blocks of the current block, and any number of block vectors in the historical block vector cache list HMVP. The first block vector can be any one or more block vectors in the block vector list for the current block, i.e., the first block vector can be a non-AR-BVP block vector.

[0337] Accordingly, in an embodiment of the present application, the second block vector may be a non-AR-BVP block vector, for example, the second block vector may be a non-AR-BVP block vector different from the first block vector, wherein the second block vector may also be a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, or any number of block vectors in the historical block vector cache list HMVP that are different from the first block vector.

[0338] Accordingly, in an embodiment of the present application, the third block vector may include the first candidate block vector constructed through AR-BVP, and may also include the first block vector and / or the second block vector. That is, after the first candidate block vector and the second block vector are added to the block vector list of the current block, in addition to the first candidate block vector being used as the guidance block vector for the next AR-BVP, other block vectors in the block vector list of the current block may also be used as guidance block vectors for the next AR-BVP.

[0339] It can be understood that in the embodiments of the present application, taking the example of constructing a block vector candidate list for the current block using two AR-BVP processes, during the first AR-BVP process, the first block vector in the block vector list of the current block can be used as the first guide block vector, and then the corresponding first candidate block vector can be determined based on the first guide block vector, wherein the first candidate block vector is the AR-BVP block vector. After the first AR-BVP process, the obtained first candidate block vector (AR-BVP block vector) and the second block vector (a non-AR-BVP block vector different from the first block vector) can be added to the block vector list of the current block. Then, during the second AR-BVP process, the third block vector in the block vector list can be first used as the second guide block vector, wherein the third block vector includes at least the first candidate block vector obtained by the first AR-BVP process. Then, the corresponding second candidate block vector can be determined based on the second guide block vector, and the second candidate block vector can be the AR-BVP block vector. Finally, the obtained second candidate block vector can be added to the block vector list.

[0340] It is understood that in the embodiments of the present application, during the process of constructing the block vector list for the current block, the AR-BVP process may be performed more than twice, and this application does not specifically limit this. For example, after adding the obtained second candidate block vector to the block vector list, a guide block vector for the next AR-BVP process may be further determined based on the block vector list, and then a corresponding candidate block vector may be determined based on the guide block vector and added to the block vector candidate list.

[0341] For example, in some embodiments, it is assumed that when building the block vector list, the AR-BVP can be constructed in two steps. For example, the candidate block vectors can be checked and added in the following order:

[0342] a) Inherit the block vector of the adjacent block

[0343] b) Inherit the block vectors of non-adjacent blocks

[0344] c) Constructing AR-BVP from existing block vectors

[0345] d) Inherit the block vector in the historical block vector cache list

[0346] e) Constructing AR-BVP from existing block vectors

[0347] f) Obtain a block vector by averaging the existing block vectors

[0348] g) Default block vector

[0349] The existing block vectors are part or all of the block vectors in the constructed block vector list. After adding the adjacent / non-adjacent block vectors, the first AR-BVP construction process is performed. Thereafter, after adding the block vectors in the historical block vector cache list, the second AR-BVP construction process is performed.

[0350] Furthermore, in an embodiment of the present application, when constructing a block vector list of the current block, the first block vector in the block vector list of the current block can be determined as the first guide block vector of the current block, and the first reference block corresponding to the first guide block vector can be determined; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in the HMVP; then the block vector of the first reference block is determined as the first candidate block vector of the current block; and / or, the first guide block vector and the block vector of the first reference block are summed to determine the first candidate block vector of the current block; and finally, the first candidate block vector can be added to the block vector list.

[0351] It should be noted that in an embodiment of the present application, when constructing a block vector list for the current block, the corresponding reference block may be first determined based on the guide block vector, and then the corresponding candidate block vector may be determined using the block vector of the reference block. After AR-BVP processing is completed, when determining the candidate block vector using the block vector of the reference block, the sum of the guide block vector and the block vector of the reference block may be used to determine the candidate block vector and add it to the block vector candidate list, or the block vector of the reference block may be directly used to determine the candidate block vector and add it to the block vector candidate list.

[0352] It is understood that in the embodiment of the present application, in the process of determining the first candidate block vector based on the first guide block vector, the first reference block can be first determined based on the first guide block vector, and then the first candidate block vector can be determined based on the block vector of the first reference block. The first candidate block vector can be determined by summing the first guide block vector and the block vector of the first reference block, or the block vector of the first reference block can be directly determined as the first candidate block vector. Of course, the first candidate block vector can also include both the sum of the first guide block vector and the block vector of the first reference block and the block vector of the first reference block, as well as the block vector of the first reference block.

[0353] That is to say, in an embodiment of the present application, the block vector of the reference block determined according to the reference block vector can be directly added to the block vector list as a candidate block vector, that is, the block vector list of the current block includes the block vector of the reference block corresponding to the reference block vector of the current block.

[0354] For example, in some embodiments, it is assumed that when constructing a block vector list, the block vector of the reference block can be directly used as a block vector candidate (candidate block vector). Specifically, for a given guide block vector BV_0 and a corresponding block vector BV_ref of a reference block, a candidate block vector BV_arbvp=BV_0+BV_ref can be obtained by adding the guide block vector and the block vector of the reference block. Alternatively, the block vector BV_ref of the reference block can be directly used as a candidate block vector BV_ext=BV_ref. Alternatively, when constructing an AR-BVP, each time a reference block vector is obtained based on the guide block vector, BV_arbvp and BV_ext can be added to the block vector list as candidate block vectors.

[0355] Furthermore, in an embodiment of the present application, when constructing a block vector list of a current block, the first block vector in the block vector list of the current block may be first determined as the first guide block vector of the current block, and a first reference block corresponding to the first guide block vector may be determined; wherein the first block vector includes at least one of the following: a block vector of an adjacent block of the current block, a block vector of a non-adjacent block of the current block, and a block vector in an HMVP; then the block vector of the first reference block is determined as the first candidate block vector of the current block; and / or, the first guide block vector and the block vector of the first reference block are summed to determine the first candidate block vector of the current block; then the first candidate block vector and the second block vector may be summed to determine the first candidate block vector of the current block. The amount is added to the block vector list; wherein the second block vector can be a non-AR-BVP block vector, for example, the second block vector can be a non-AR-BVP block vector different from the first block vector; then the third block vector in the block vector list is determined as the second guide block vector of the current block, and the second reference block corresponding to the second guide block vector is determined; wherein the third block vector at least includes the first candidate block vector; then the block vector of the second reference block is determined as the second candidate block vector of the current block; and / or, the second guide block vector and the block vector of the second reference block are summed to determine the second candidate block vector of the current block; finally, the second candidate block vector can be added to the block vector list.

[0356] It can be understood that in the embodiment of the present application, taking two AR-BVP processes to construct a block vector candidate list for the current block as an example, during the first AR-BVP process, the first block vector in the block vector list of the current block can be used as the first guide block vector, and then the corresponding first candidate block vector is determined based on the first guide block vector, wherein the first candidate block vector is an AR-BVP block vector, and the first candidate block vector may include the block vector of the first reference block corresponding to the first candidate block vector, and / or the sum of the first guide block vector and the block vector of the corresponding first reference block. After the first AR-BVP process, the obtained first candidate block vector (AR-BVP block vector) and the second block vector (a non-AR-BVP block vector different from the first block vector) can be added to the block vector list of the current block. Next, a second AR-BVP process is performed. The third block vector in the block vector list can be used as a second guide block vector, where the third block vector includes at least the first candidate block vector obtained by the first AR-BVP process. A corresponding second candidate block vector can then be determined based on the second guide block vector. The second candidate block vector is an AR-BVP block vector and can include the block vector of the second reference block corresponding to the second candidate block vector and / or the sum of the second guide block vector and the block vector of the corresponding second reference block. Finally, the obtained second candidate block vector can be added to the block vector list.

[0357] It is understood that in the embodiments of the present application, during the process of constructing the block vector list for the current block, the AR-BVP process may be performed more than twice, and this application does not specifically limit this. For example, after adding the obtained second candidate block vector to the block vector list, a guide block vector for the next AR-BVP process may be further determined based on the block vector list, and then a corresponding candidate block vector may be determined based on the guide block vector and added to the block vector candidate list.

[0358] It can be understood that in an embodiment of the present application, in the process of constructing the block vector list of the current block, it is possible to choose to add the block vector of the reference block corresponding to the guidance vector to the block vector list of the current block in any one or more AR-BVP processing processes.

[0359] That is, in the embodiment of the present application, when constructing the block vector list, AR-BVP can be constructed in at least two steps; at the same time, during the AR-BVP processing, the block vector of the reference block can be directly used as the candidate block vector.

[0360] Furthermore, in an embodiment of the present application, during the AR-BVP process to obtain candidate block vectors, the guide block vector may be determined based on existing block vectors in the block vector list. The first guide block vector in the first AR-BVP process and the second guide block vector in the second AR-BVP process may be partially identical or completely different.

[0361] That is, in the embodiments of the present application, the process of constructing an AR-BVP can be the same or different at different times. For example, when constructing an AR-BVP for the first time, all existing block vectors in the block vector list can be used as guide block vectors; when constructing an AR-BVP for the second time, all existing block vectors in the list and the newly added AR-BVP can be used as guide block vectors.

[0362] Exemplarily, in some embodiments, the first guide block vector in the first AR-BVP processing process may include some or all block vectors in the block vector list, and the second guide block vector in the second AR-BVP processing process may include a non-AR-BVP block vector in the block vector list that is different from the first guide block vector, and may also include a newly constructed AR-BVP block vector (i.e., the first candidate block vector) added to the block vector list after the first AR-BVP processing.

[0363] Furthermore, in an embodiment of the present application, AR-BVP processing can be performed based on the guidance block vector of the current block to obtain at least one candidate block vector, so that a block vector list of the current block can be constructed until a preset end condition is met; wherein the preset end condition includes at least one of the following: the number of AR-BVP processes is greater than or equal to a preset threshold; the number of candidate block vectors determined by AR-BVP processing is greater than or equal to a first number threshold; the number of block vectors in the block vector list is greater than or equal to a second number threshold.

[0364] It is understood that in the embodiments of the present application, the preset threshold, the first quantity threshold, and the second quantity threshold can all be pre-set integers greater than 0, and this application does not specifically limit them. For example, the preset threshold can be 3, the first quantity threshold can be 5, and the second quantity threshold can be 15.

[0365] That is, in the embodiment of the present application, after determining the guide block vector (such as the first guide block vector or the second guide block vector), one or more AR-BVP block vectors can be constructed. 0,1 Determine the reference block B1, and then use the block vector BV in the area of ​​the reference block B1 to determine the reference block B1. 1,2 Construct a new block vector BV 0,2 =BV 0,1 +BV1,2 Then, AR-BVP treatment can be continued, for example according to BV 0,n The reference block B can be determined n , if in B n There is a block vector BV in the region n,n+1 , then a new block vector BV can be constructed 0,n+1 =BV 0,1 +BV 1,2 +…+BV n,n+1 .

[0366] It should be noted that, in an embodiment of the present application, the end conditions (preset end conditions) of the AR-BVP construction process may include but are not limited to: the number of iterations of constructing the AR-BVP, the number of AR-BVPs added to the block vector list, and the number of current block vectors in the block vector list.

[0367] It should be noted that in the embodiments of the present application, the AR-BVP construction process can be the same or different at different times. For example, the first AR-BVP construction can be performed independently of the added AR-BVP (the first candidate block vector). The second AR-BVP construction can be performed based on the newly added AR-BVP (the second candidate block vector) to construct multiple AR-BVPs for each guide block vector.

[0368] Furthermore, in an embodiment of the present application, when determining a candidate block vector of a current block based on a block vector of a reference block, the guide block vector and the block vector of at least one reference block are summed respectively to determine the candidate block vector; and / or, the guide block vector and at least one block vector of the reference block are summed respectively to determine the candidate block vector.

[0369] It should be noted that, in the embodiment of the present application, one or more corresponding reference blocks may be determined according to the guide block vector, and block vectors of one or more corresponding reference blocks may also be determined according to the guide block vector.

[0370] Exemplarily, in some embodiments, when determining the first candidate block vector of the current block based on the block vector of the first reference block, the first guide block vector and the block vector of at least one first reference block are summed respectively to determine the first candidate block vector; and / or, the first guide block vector and at least one block vector of the first reference block are summed respectively to determine the first candidate block vector.

[0371] That is to say, in an embodiment of the present application, for a guide block vector, at least one corresponding reference block can be determined at at least one position in the corresponding reference area, and for any of the reference blocks, the reference block can correspond to at least one block vector.

[0372] For example, in some embodiments, as shown in FIG14 , when determining the block vector corresponding to the reference block, multiple positions may be checked. For example, the center, upper left, upper right, lower left, and lower right of the reference block may be checked in sequence to see whether there is a coding block. If so, the stored block vector is used as the block vector. Any reference block may include one or more block vectors.

[0373] Furthermore, in an embodiment of the present application, the number of block vectors in the HMVP added to the block vector list may be determined based on the number of block vectors in the block vector list.

[0374] That is, in the embodiment of the present application, when constructing the block vector list, the number of block vectors added from the HMVP to the block vector list may be adjusted according to the number of block vectors that have been added.

[0375] Exemplarily, in some embodiments, assuming that the maximum length of the block vector list is N, and before the block vector in the HMVP is added, there are already n block vectors in the block vector list, then the number of block vectors in the HMVP added to the block vector list can be set according to N and n, for example, the number of block vectors in the HMVP added to the block vector list is determined to be (N–n) / 2.

[0376] Furthermore, in an embodiment of the present application, before adding any block vector (AR-BVP block vector or non-AR-BVP block vector) to the block vector list, the block vector may be checked. If the block vector does not meet a preset addition condition, the block vector is not added to the block vector list. If the block vector meets the preset addition condition, the block vector is added to the block vector list. The preset addition condition includes at least one of the following: the block vector is different from any block vector in the block vector list; or the reference block corresponding to the block vector exists.

[0377] For example, in some embodiments, between executing at least two AR-BVPs, a check operation may be performed on at least one non-AR-BVP block vector. For example, a check operation is performed on a block vector in the HMVP (a non-AR-BVP block vector) to determine whether the block vector in the HMVP can be added to the block vector list of the current block. If the block vector in the HMVP is the same as the block vector already added to the list, then

[0378] The non-AR-BVP block vector is not added. That is, for the non-AR-BVP block vector for which the check operation is performed, if the addition condition is not met, the non-AR-BVP block vector is not added.

[0379] Accordingly, in some embodiments, between executing at least two AR-BVPs, after performing a check operation on at least one non-AR-BVP block vector, if any of the non-AR-BVP block vectors is different from any of the block vectors already added to the list, and the reference block corresponding to the non-AR-BVP block vector exists, it can be determined that the non-AR-BVP block vector can be added to the block vector list of the current block.

[0380] Step 1603: Determine the prediction block of the current block according to the block vector list of the current block.

[0381] In an embodiment of the present application, after constructing the block vector list of the current block, the prediction block of the current block may be further determined according to the block vector list of the current block.

[0382] Furthermore, in an embodiment of the present application, when the preset intra prediction mode is DIMD, TIMD, or SGPM, the constructed block vector list of the current block may include block vectors with sub-pixel precision. Accordingly, when determining the prediction block of the current block based on the block vector list of the current block, the template error value of the block vector in the block vector list may be first determined based on the block vector with sub-pixel precision in the block vector list; and then the prediction block of the current block may be determined based on the template error value of the block vector in the block vector list.

[0383] It is understood that in the embodiment of the present application, for a block vector list with sub-pixel precision, the block vectors in the block vector list have corresponding sub-pixel precision parameters, and the sub-pixel precision parameters can represent the precision value of the block vector. The sub-pixel precision parameter can be a value greater than 0 and less than or equal to 1. For example, the sub-pixel precision parameter of a block vector is 1 / 16.

[0384] Furthermore, in an embodiment of the present application, when determining the template error value of the block vector in the block vector list based on the sub-pixel precision block vector in the block vector list, the template type parameter and the template size parameter corresponding to the template type parameter can be determined first; then, based on the template type parameter, the template size parameter and the sub-pixel bit parameter of the sub-pixel precision block vector, the adjusted block vector corresponding to the sub-pixel precision block vector can be determined; then, based on the adjusted block vector, the prediction value of the reference template can be determined; finally, the template error value of the block vector in the block vector list can be determined based on the prediction value of the reference template and the reconstructed value of the current template.

[0385] It should be noted that, in the embodiment of the present application, the template type parameter can determine the type of the template, wherein the type of the corresponding template can be determined as the upper template or the left template according to the template type parameter.

[0386] It should be noted that, in the embodiments of the present application, the template size parameter can determine the size of the template, wherein the width or height of the corresponding template can be determined according to the template size parameter. For the upper template, the corresponding width is the width value of the current block, and the corresponding height can be determined by the template size parameter; for the left template, the corresponding height is the height value of the current block, and the corresponding width can be determined by the template size parameter.

[0387] Exemplarily, in some embodiments, as shown in FIG15 , the height value of the current block is H, and the width value is W. Two template types corresponding to the current block are determined according to the template type parameters, such as the upper template and the left template. The width of the upper template can be determined as Tw based on the template size parameters of the upper template, and the height of the left template can be determined as Th based on the template size parameters of the left template.

[0388] It should be noted that in an embodiment of the present application, when determining the adjusted block vector corresponding to the block vector with sub-pixel precision based on the template type parameter, the template size parameter and the sub-pixel bit parameter of the block vector with sub-pixel precision, the template corresponding to the current block and the size value of the template can be determined based on the template type parameter and the template size parameter, and then the sub-pixel bit parameter corresponding to the block vector and the size value of the template can be used to perform adjustments to obtain the adjusted block vector.

[0389] For example, in some embodiments, assuming that the template corresponding to the current block is determined to be the upper template based on the template type parameter, the size value of the corresponding template is the height Th, and the sub-pixel bit parameter of the corresponding block vector BV is mv_bits, then the block vector BV can be adjusted according to the following formula to obtain the corresponding adjusted block vector BV_top: BV_top=BV+(Th< <mv_bits) (1)

[0390] For example, in some embodiments, assuming that the template corresponding to the current block is determined to be a left template based on the template type parameter, the size value of the corresponding template is a width Tw, and the sub-pixel bit parameter of the corresponding block vector BV is mv_bits, then the block vector BV can be adjusted according to the following formula to obtain the corresponding adjusted block vector BV_left: BV_left=BV+(Tw< <mv_bits) (2)

[0391] Furthermore, in an embodiment of the present application, when determining the prediction value of a reference template based on an adjusted block vector, when a candidate reference template corresponding to the adjusted block vector is available, the prediction value of the reference template can be determined based on the adjusted block vector and a sub-pixel difference algorithm; when the candidate reference template corresponding to the adjusted block vector is not available, the prediction value of the reference template can be determined based on the block vector in a block vector list and a sub-pixel difference algorithm.

[0392] It can be understood that in the embodiments of the present application, the corresponding candidate reference template can be determined based on the adjusted block vector. If the candidate reference template is available, the prediction value of the reference template can be directly determined based on the adjusted block vector and the sub-pixel difference algorithm; if the candidate reference template is not available, the adjusted block vector is no longer used, and the prediction value of the reference template is determined based on the block vector before adjustment and the sub-pixel difference algorithm.

[0393] Exemplarily, in some embodiments, assuming that the adjusted block vector is BV_top, a candidate reference template with width and height W and Th is obtained based on BV_top. If the candidate reference template is available, the prediction value of the corresponding reference template can be calculated based on BV_top through a sub-pixel difference algorithm; if the candidate reference template is not available, BV_top can be adjusted to be equal to BV, and the prediction value of the corresponding reference template can be calculated through a sub-pixel difference algorithm.

[0394] It should be noted that, in the embodiment of the present application, the sub-pixel difference algorithm can be implemented by a difference filter, wherein the interpolation filter can be a 2-tap interpolation filter, which can be the same as the 2-tap interpolation filter used in inter-frame prediction and IBC prediction.

[0395] Accordingly, in the embodiments of the present application, the prediction of the left template region can also be obtained in the above manner, that is, the prediction value of the corresponding reference template can be further determined based on BV_left. Ultimately, the template error value corresponding to the block vector can be calculated based on the prediction value of the reference template and the reconstructed value of the current template, and then the prediction block of the current block can be determined based on the template error value of the block vector in the block vector list.

[0396] For example, in some embodiments, assuming that the preset intra-frame prediction mode is DIMD, the template error value of the predefined intra-frame non-angle mode can be calculated. For example, one mode Planar is predefined, and the template error value of the Planar mode is calculated based on the reference pixel; then the best non-angle prediction method can be selected based on the candidate block vector in the block vector list and the template error value of the intra-frame non-angle mode. If the best prediction method is to use a candidate block vector, when the block vector has sub-pixel accuracy, the reference block of the current block can be obtained based on interpolation filtering, where the interpolation filter can use an n-tap filter, for example, n is 8, which can be the same as the interpolation filter during IBC prediction; after obtaining the best non-angle prediction method, it is combined with the prediction block generated by the intra-frame angle mode derived by HoG to obtain the final prediction block.

[0397] Furthermore, in an embodiment of the present application, the block vector list of the current block can be obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list. Accordingly, when determining the prediction block of the current block based on the block vector list of the current block, a block vector template error calculation can be first performed on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list; then, the block vector list can be sorted based on the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list; finally, the prediction block of the current block can be determined based on the sorted block vector list.

[0398] It should be noted that, in embodiments of the present application, a preset template error calculation method for calculating template error values ​​for block vectors in the block vector list may be determined first. The preset template error calculation method may be determined based on an error calculation method used in a template search process corresponding to the current block, or may be determined based on second syntax identification information transmitted in the bitstream.

[0399] It will be appreciated that, in an embodiment of the present application, one implementation is that the second syntax identification information is used to indicate whether the preset template error calculation method is SAD or MR-SAD, which can be represented by cu_tmp_lic_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SAD.

[0400] It will be appreciated that in an embodiment of the present application, another implementation is that the second syntax identification information is used to indicate whether the preset template error calculation method is SATD or MR-SATD, which can be represented by cu_tmp_lic_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SATD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SATD.

[0401] It will be appreciated that in another embodiment of the present application, the second syntax identification information is used to indicate whether the preset template error calculation method is SATD or SAD, which can be represented by cu_tmp_satd_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SATD; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD.

[0402] It can be understood that in an embodiment of the present application, another implementation method is that the second syntax identification information is used to indicate that the preset template error calculation method is one of SAD, MR-SAD, SATD, and MR-SATD, which can be jointly represented by cu_tmp_lic_flag and cu_tmp_satd_flag. In some embodiments, if the value of the first information cu_tmp_lic_flag in the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or SATD; if the value of the first information cu_tmp_lic_flag in the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is MR-SAD or MR-SATD; if the value of the second information cu_tmp_satd_flag in the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or MR-SATD; if the value of the second information cu_tmp_satd_flag in the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the preset template error calculation method is SAD or MR-SAD. For example, when the value of cu_tmp_lic_flag is the first value and the value of cu_tmp_satd_flag is the first value, it can be determined that the preset template error calculation method is SATD; when the value of cu_tmp_lic_flag is the second value and the value of cu_tmp_satd_flag is the first value, it can be determined that the preset template error calculation method is MR-SATD.

[0403] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.

[0404] Furthermore, in an embodiment of the present application, when performing block vector template error calculation on block vectors in a block vector list and determining the template error value of the block vector in the block vector list, a preset template error calculation method can be determined, and second syntax identification information can be written into the bitstream; wherein the second syntax identification information is used to determine the preset template error calculation method, and the preset template error calculation method includes any one of the following: SAD, MR-SAD, SATD, MR-SATD; finally, based on the preset template error calculation method, it can be determined that the block vector in the candidate block vector list corresponds to a template error value of at least one template type.

[0405] It is understood that in the embodiments of the present application, the preset template error calculation method for performing block vector template error calculation may include any one of SAD, MR-SAD, SATD, and MR-SATD. After determining the preset template error calculation method for performing block vector template error calculation, corresponding second syntax identification information may be further determined, and the second syntax identification information may be written into the bitstream for transmission to the decoding end.

[0406] Exemplarily, in some embodiments, assuming that the second syntax identification information is represented by cu_tmp_lic_flag, then by taking the value of cu_tmp_lic_flag, it can be determined that the preset template error calculation method is SAD or MR-SAD, or it can be determined that the preset template error calculation method is SATD or MR-SATD.

[0407] Exemplarily, in some embodiments, assuming that the second syntax identification information is represented by cu_tmp_satd_flag, then the value of cu_tmp_satd_flag can be used to determine whether the preset template error calculation method is SAD or SATD.

[0408] For example, in some embodiments, assuming that the second identification information includes the first information cu_tmp_lic_flag and the second information cu_tmp_satd_flag, then the values ​​of cu_tmp_lic_flag and cu_tmp_satd_flag can be used to determine whether the preset template error calculation method is SAD, MR-SAD, SATD, or MR-SATD. For example, when the value of cu_tmp_lic_flag is a first value and the value of cu_tmp_satd_flag is a first value, it can be determined that the preset template error calculation method is SATD; when the value of cu_tmp_lic_flag is a second value and the value of cu_tmp_satd_flag is a first value, it can be determined that the preset template error calculation method is MR-SATD.

[0409] Furthermore, in an embodiment of the present application, when determining a preset template error calculation method, a first template error calculation method and a second template error calculation method can be determined first; wherein the first template error calculation method is used to perform a sparse search of at least one template type, and the second template error calculation method is used to perform a fine search of at least one template type and a block vector template error calculation.

[0410] That is to say, in an embodiment of the present application, a first template error calculation method for sparse search and a second template error calculation method for fine search and block vector template error calculation can be determined, that is, the block vector template error calculation is consistent with the template error calculation method in the fine search stage.

[0411] Furthermore, in an embodiment of the present application, when determining a preset template error calculation method, a third template error calculation method and a fourth template error calculation method can be determined; wherein, the third template error calculation method is used to perform a sparse search and block vector template error calculation of at least one template type, and the fourth template error calculation method is used to perform a fine search of at least one template type.

[0412] That is to say, in an embodiment of the present application, a third template error calculation method for sparse search and block vector template error calculation, and a fourth template error calculation method for fine search can be determined, that is, the block vector template error calculation is consistent with the template error calculation method in the sparse search stage.

[0413] Furthermore, in an embodiment of the present application, when determining the preset template error calculation method, a fifth template error calculation method can be determined; wherein, the fifth template error calculation method is used to perform a sparse search of at least one template type, a fine search of at least one template type, and a block vector template error calculation.

[0414] That is to say, in an embodiment of the present application, a fifth template error calculation method can be determined for performing sparse search, fine search and block vector template error calculation, that is, the block vector template error calculation is consistent with the template error calculation method of the fine search stage and the sparse search stage.

[0415] Further, in an embodiment of the present application, the second syntax identification information includes first information and second information, and when determining the preset template error calculation method, a sixth error calculation method is determined; wherein the sixth error calculation method is used to perform a sparse search of at least one template type, a fine search of at least one template type and a block vector template error calculation; and then the first information and the second information can be determined according to the sixth error calculation method.

[0416] That is to say, in an embodiment of the present application, a sixth template error calculation method can be determined for performing sparse search, fine search and block vector template error calculation, that is, the block vector template error calculation is consistent with the template error calculation method of the fine search stage and the sparse search stage.

[0417] That is to say, in an embodiment of the present application, in an embodiment of the present application, the cu_tmp_satd_flag and cu_tmp_lic_flag flags can be encoded at the same time to indicate which of SAD, SATD, MR-SAD, and MR-SATD is used to calculate the template error of the search and block vector list.

[0418] Furthermore, when performing block vector template error calculation on the block vectors in the block vector list to determine the template error value of the block vectors in the block vector list, block vector template error calculation can be performed on the block vectors in the block vector list according to the preset template error calculation method of the sparse search in the template search process corresponding to the current block to determine the template error value of the block vectors in the block vector list; or, block vector template error calculation can be performed on the block vectors in the block vector list according to the preset template error calculation method of the fine search in the template search process corresponding to the current block to determine the template error value of the block vectors in the block vector list.

[0419] That is to say, in an embodiment of the present application, the preset template error calculation method for block vector template error calculation can directly reuse the template error calculation method of the sparse search stage, or the preset template error calculation method for block vector template error calculation can directly reuse the template error calculation method of the fine search stage.

[0420] Furthermore, in an embodiment of the present application, when the block vector list is sorted according to the template error values ​​of the block vectors in the block vector list to obtain the sorted block vector list, at least one number of templates corresponding to at least one template type can be determined, and third syntax identification information can be written into the bitstream; wherein the third syntax identification information is used to determine the at least one number of templates corresponding to the at least one template type; then, based on the at least one template number, the template error values ​​corresponding to the at least one template type of the block vectors in the candidate block vector list are sorted respectively to obtain at least one first candidate list corresponding to the at least one template type.

[0421] It should be noted that in an embodiment of the present application, for different template types, the number of templates corresponding to different template types can be determined, and then the template error values ​​of block vectors under different template types can be sorted based on the number of templates. Finally, the first candidate list corresponding to different template types can be obtained, that is, the sorted block vector list includes the first candidate list corresponding to different template types.

[0422] It will be appreciated that in embodiments of the present application, the third syntax identification information is used to indicate the number of templates corresponding to different template types, which can be represented by cu_tmp_idx. In some embodiments, the search results corresponding to different template types that need to be maintained can be determined based on the value of the third syntax identification information. For example, based on the value of the third syntax identification information, it is determined that the search results corresponding to the L-shaped template, the upper template, and the left template need to be maintained separately. That is, the number of templates corresponding to the L-shaped template, the upper template, and the left template is determined to be M0, M1, and M2, where M0, M1, and M2 are all integers greater than or equal to 0.

[0423] Exemplarily, in some embodiments, the current block uses MR-SAD to calculate the template error. When the value of the third syntax identification information cu_tmp_idx is greater than a threshold N (e.g., N=13), it is necessary to maintain the search results corresponding to the L-type template, the upper template, and the left template, respectively. Accordingly, the template error is calculated using MR-SAD for the block vectors in the block vector list, and the template error values ​​diff0, diff1, and diff2 corresponding to the L-type template, the upper template, and the left template are obtained, respectively. Based on diff0, diff1, and diff2 of the block vectors, the best M0, M1, and M2 candidate block vectors under the L-type template, the upper template, and the left template are obtained, which can be recorded as mrgList0, mrgList1, and mrgList2; wherein mrgList0, mrgList1, and mrgList2 are the first candidate lists corresponding to the L-type template, the upper template, and the left template, respectively.

[0424] Furthermore, in an embodiment of the present application, when determining the prediction block of the current block based on the sorted block vector list, a sparse search can be first performed according to at least one template type to obtain at least one second candidate list corresponding to the at least one template type; then the at least one first candidate list and the at least one second candidate list can be merged to obtain at least one third candidate list corresponding to the at least one template type; then, based on the at least one third candidate list, a fine search can be performed according to at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; finally, the target candidate list corresponding to the current block can be determined according to the at least one fourth candidate list, and the prediction block of the current block can be determined according to the target candidate list.

[0425] Exemplarily, in some embodiments, sparse searches are performed for the L-shaped template, upper template, and left template, respectively, and the search results are recorded as sparseList0, sparseList1, and sparseList2, which are the search results under the template error values ​​corresponding to the L-shaped template, upper template, and left template, respectively; wherein, sparseList0, sparseList1, and sparseList2 are the second candidate lists corresponding to the L-shaped template, upper template, and left template, respectively.

[0426] Exemplarily, in some embodiments, the block vector list and the sparse search results are merged, that is, at least one first candidate list and at least one second candidate list are merged respectively. For example, mrgList0 and sprseList0 are merged, that is, the top K candidate block vectors with the smallest MR-SAD corresponding to the L-shaped template are retained, K can be an integer greater than or equal to the maximum length of sparseList0, and the merged list is recorded as sparseList0'. Accordingly, mrgList1 and sprseList1 can be merged to obtain the corresponding sparseList1', and mrgList2 and sprseList2 can be merged to obtain the corresponding sparseList2'. Among them, sparseList0', sparseList1' and sparseList2' are the third candidate lists corresponding to the L-shaped template, the upper template and the left template, respectively.

[0427] Exemplarily, in some embodiments, based on the merged third candidate lists sparseList0', sparseList1' and sparseList2' corresponding to the L-shaped template, upper template and left template, a fine search can be performed respectively to obtain the search results sparselist0', sparselist1' and sparselist2' under the template error values ​​corresponding to the L-shaped template, upper template and left template; wherein, sparselist0', sparselist1' and sparselist2' are the fourth candidate lists corresponding to the L-shaped template, upper template and left template respectively.

[0428] Exemplarily, in some embodiments, when determining the target candidate list corresponding to the current block based on at least one fourth candidate list, at least one fourth candidate list may be merged, for example, sparselist0', sparselist1' and sparselist2' may be merged to obtain the final target candidate list.

[0429] Furthermore, in an embodiment of the present application, after performing a sparse search and obtaining at least one second candidate list, AR-BVP construction can be performed based on any of the second candidate lists. Specifically, a third reference block vector can be first determined based on the second candidate list, and then a third candidate block vector for the current block can be determined based on the third reference block vector. Subsequently, a template error value corresponding to the third candidate block vector can be determined, and the second candidate list can be updated based on the template error value corresponding to the third candidate block vector.

[0430] For example, in some embodiments, block vectors in the candidate list sparseList obtained through sparse search can be used as guide block vectors (third guide block vectors) to construct AR-BVP candidates (third candidate block vectors). Template error values ​​for these AR-BVP candidates can then be calculated and the sparseList can be updated. SparseLists of different template types can be used to construct AR-BVP candidates, and the sparseList can be updated based on the template error values ​​of the AR-BVP candidates.

[0431] Furthermore, in an embodiment of the present application, when determining the prediction block of the current block based on the sorted block vector list, a sparse search can be first performed according to at least one template type to obtain at least one second candidate list corresponding to the at least one template type; then the first candidate list corresponding to the preset template type and the at least one second candidate list are merged to obtain at least one third candidate list corresponding to the at least one template type; then, based on the at least one third candidate list, a fine search can be performed according to at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; finally, a target candidate list corresponding to the current block can be determined based on the at least one fourth candidate list, and the prediction block of the current block can be determined based on the target candidate list.

[0432] It should be noted that in the embodiments of the present application, when merging the block vector list and the sparse search results, a first candidate list corresponding to a preset template type can be selected and merged with at least one second candidate list to obtain at least one third candidate list corresponding to at least one template type. The preset template type can be any one of an L-shaped template, an upper template, and a left template.

[0433] Exemplarily, in some embodiments, when merging the block vector list and the sparse search results, mrgList0 can be merged with sprseList0, sprseList1 and sprseList2 respectively, and then the merged lists are recorded as sparseList0', sparseList1' and sparseList2', where sparseList0', sparseList1' and sparseList2' are the third candidate lists corresponding to the L-shaped template, upper template and left template respectively.

[0434] That is to say, in an embodiment of the present application, a block vector list mrgList can be constructed and reordered according to a preset template type (such as an L-type template), and candidate lists sparseList0, sparseList1 and sparseList2 under the L-type template, upper template and left template are obtained according to a sparse search. Subsequently, only mrgList can be merged with sparseList0, sparseList1 and sparseList2 respectively.

[0435] Furthermore, in an embodiment of the present application, in a process of performing a fine search based on at least one third candidate list, all template search areas corresponding to all block vectors in the third candidate list are the same; or, in a process of performing a fine search based on at least one third candidate list, the template search areas corresponding to the fourth block vectors in the third candidate list are the same; wherein the fourth block vector is a block vector derived from the first candidate list.

[0436] It should be noted that in the embodiments of the present application, when performing a refined search based on at least one third candidate list and at least one template type, the template search regions corresponding to the block vectors in the third candidate list may be the same or different. For example, the two template search regions corresponding to any two block vectors in the third candidate list may be the same; or, the two template search regions corresponding to any two fourth block vectors in the third candidate list may be the same.

[0437] It is understood that in the embodiment of the present application, the fourth block vector may be a block vector in the third candidate list that originates from the first candidate list. That is, during the merging of the first candidate list with the second candidate list, the fourth block vector in the first candidate list forms the third candidate list.

[0438] Furthermore, in embodiments of the present application, when determining the prediction block for the current block based on the block vector list of the current block, a target block vector for the current block can also be determined from the block vector list of the current block; then, the prediction block for the current block can be determined based on the target block vector. Accordingly, a block vector index number for the current block can also be determined based on the target block vector, and the block vector index number can be written into the bitstream.

[0439] For example, in some embodiments, if the preset intra prediction mode is IBC, the block vector index number of the current block can be determined based on the target block vector. For example, in IBC merge mode, the merge index (block vector index number) is determined based on the target block vector.

[0440] Furthermore, in an embodiment of the present application, a residual block of the current block is determined according to the original block and the predicted block of the current block; and the residual block of the current block is written into the bitstream.

[0441] It can be understood that, in the embodiment of the present application, after the prediction block of the current block is determined, the difference between the original block and the prediction block of the current block can be determined as the residual block of the current block.

[0442] In summary, through the encoding method proposed in the above steps 1601 to 1603, the construction and / or use process of the block vector list in the intra-frame prediction process is adjusted and improved. On the one hand, when constructing the block vector list, the AR-BVP candidate block vector can be constructed in batches. On the other hand, the block vector of the reference block can be directly used as the candidate block vector to be added to the block vector list; on the other hand, a block vector list with sub-pixel precision can be used for intra-frame prediction; on the other hand, multiple methods can be used to determine multiple template error calculation methods, so that the block vector list can be reordered using different template error calculation methods.

[0443] That is to say, the encoding method proposed in the embodiment of the present application is an improved method for constructing and / or using a block vector list, wherein the block vector list can be an AMVP / Merge list of the IBC mode, a Merge list of the IntraTMP mode, or a block vector list constructed in other intra-frame modes to obtain predictions based on block vectors. In the process of constructing and / or using the block vector list, the diversity of the block vector list and the efficiency of utilizing the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or; directly adding the block vector of the reference block to the block vector list, and / or; using a block vector list with sub-pixel precision in the intra-frame mode, and / or; using different template error calculation methods to sort the block vector list.

[0444] Below, the encoding method proposed in the embodiment of the present application is exemplarily described in IBC mode with the first syntax identification information being cu_pred_mode. When constructing the block vector list, the AR-BVP can be constructed in multiple steps, and the block vector of the reference block can also be directly added to the block vector list as a block vector candidate.

[0445] Coding process:

[0446] 1. Encode the current block and determine whether the current block is encoded in IBC mode;

[0447] 2. Construct a list of block vectors, check and add candidate block vectors in sequence, and add AR-BVP candidates in batches. For example, you can construct it in the following order:

[0448] a) Inherit the block vector of the adjacent block

[0449] b) Inherit the block vectors of non-adjacent blocks

[0450] c) Constructing AR-BVP from existing block vectors

[0451] d) Inherit the block vector in the historical block vector cache list

[0452] e) Constructing AR-BVP from existing block vectors

[0453] f) Obtain a block vector by averaging the existing block vectors

[0454] g) Default block vector (related to block size)

[0455] After adding adjacent / non-adjacent block vectors, the AR-BVP is constructed. After that, after adding block vectors in the historical block vector cache list, the AR-BVP is constructed.

[0456] 3. Determine the process of constructing AR-BVP. The guide block vectors for constructing AR-BVP may include: all block vectors already in the list, part (one or more) of the block vectors in the list, and a newly constructed block vector (AR-BVP). After determining a certain guide block vector, one or more AR-BVPs may be constructed. The end conditions of the construction process may include: the number of iterations of constructing AR-BVP, the number of added AR-BVPs, and the number of current lists; the process of constructing AR-BVPs may be different for different times. For example, when constructing AR-BVP for the first time, all the block vectors already in the list are used as guide block vectors, and construction is not continued based on the added AR-BVP. When constructing AR-BVP for the second time, all the block vectors already in the list and the newly added AR-BVP are used as guide block vectors, and each guide block vector constructs multiple AR-BVPs;

[0457] 4. For a given guide block vector BV_0 and a reference block vector BV_ref, in addition to adding them to obtain BV_arbvp = BV_0 + BV_ref, BV_ref can be directly checked as a candidate block vector BV_ext = BV_ref and added to the block vector list. For example, when constructing AR-BVP, each time a reference block vector is obtained based on the guide block vector, BV_arbvp and BV_ext can be checked and added separately;

[0458] 5. If the current block is in IBC merge mode, determine the merge index value, select the corresponding block vector from the block vector list, and obtain the reference block as the prediction block of the current block;

[0459] 6. If the current block is in IBC AMVP mode, determine the block vector of the current block based on the encoder search, and obtain the reference block as the prediction block of the current block. Determine the BVP index value and select the corresponding block vector from the block vector list. Determine the block vector residual (BVD) based on the block vector and the block vector of the current block.

[0460] 7. The residual block is obtained from the predicted block of the current block and the original value of the current block. After conversion through steps such as transform and quantization, it is encoded using the entropy coding method. In addition, the coding information such as cu_pred_mode, merge index value, BVD, etc. is encoded to complete the coding of the current block.

[0461] It should be noted that the coding method proposed in the embodiment of the present application was experimentally verified. When the stepwise constructed AR-BVP was applied to the IBC mode, a Y component coding gain of about -0.01% could be achieved on the Enhanced Compression Model (ECM) reference software test platform.

[0462] It should be noted that, through experimental verification of the coding method proposed in the embodiment of the present application, a Y component coding gain of approximately -0.03% can be achieved when the method of directly using the block vector of the reference block as the candidate block vector is applied to the IntraTMP mode.

[0463] The following describes an exemplary encoding method proposed in an embodiment of the present application using DIMD mode with the first syntax identifier cu_dimd_flag. In DIMD mode, a sub-pixel precision block vector list can be constructed. A prediction block based on sub-pixel interpolation is obtained based on the block vectors in the block vector list. This prediction block is then combined with the prediction block obtained by intra prediction to obtain the final prediction block. For example, a prediction block based on sub-pixel differences can be combined with an intra mode prediction block derived from a gradient histogram (HoG).

[0464] Coding process:

[0465] 1. Encode the current block and determine whether the current block is encoded in DIMD prediction mode;

[0466] 2. Obtain HoG based on the reconstructed area (or encoded information) and derive the intra-frame angle mode to generate the corresponding prediction block;

[0467] 3. Construct a list of block vectors, where the accuracy of candidate block vectors is sub-pixel. For example, the accuracy of block vectors is 1 / 16 pixel. Candidate block vectors can be obtained from adjacent blocks, non-adjacent blocks, AR-BVP candidates, historical block vector cache, etc.

[0468] 4. Calculate the template error for the N block vectors in the block vector list. For example, the width and height of the template are Tw and Th. The width and height of the current block are W and H. The template area is shown in Figure 15.

[0469] The candidate block vector is BV, and the predictions for the upper template and the left template are obtained respectively. For example, the upper template region is obtained. Adjust BV according to the template height Th, BV_top = BV + (Th << mv_bits), where mv_bits is the number of sub-pixel bits. Based on the upper-left corner of the current block, a reference block with width W and height Th is obtained according to BV_top. If the reference block is not available, adjust BV_top to be equal to BV and obtain the reference block. If BV contains sub-pixel parts, the reference block is obtained based on sub-pixel interpolation. The interpolation filter can be a 2-tap interpolation filter, which can be the same as the 2-tap interpolation filter used in inter-frame prediction and IBC prediction. The obtained reference block is used as the prediction of the upper template region. Similarly, the prediction of the left template region is obtained. According to the predicted value and the reconstructed value of the template region, the template error value is calculated, such as the SAD value;

[0470] 5. The template error value of the predefined intra non-angle mode can be calculated. For example, 1 mode Planar is predefined, and the template error value of the Planar mode is calculated according to the reference pixels;

[0471] 6. The best non-angle prediction method is selected according to the candidate block vector and the template error value of the intra non-angle mode. If the best prediction method is to use a certain candidate block vector, when the block vector is of sub-pixel accuracy, the reference block of the current block can be obtained based on interpolation filtering. The interpolation filter can use an n-tap filter. For example, n is 8, and it can be the same as the interpolation filter in IBC prediction;

[0472] 7. According to the above steps, the best non-angle prediction method is obtained, and it is combined with the prediction block generated by the intra angle mode derived from HoG to obtain the final prediction block. The residual block is obtained from the prediction block of the current block and the original value of the current block, and after being transformed and quantized, etc., it is encoded by the entropy coding method. In addition, the coding information such as cu_dimd_flag is encoded to complete the coding of the current block.

[0473] It should be noted that through experimental verification of the coding method proposed in the embodiments of this application, when the sub-pixel block vector list is applied to the DIMD and SGPM modes, a coding gain of about -0.01% in the Y component can be achieved.

[0474] Below, the encoding method proposed in the embodiment of the present application is exemplified in the IntraTMP mode, with the first syntax identification information being cu_tmp_flag, the second syntax identification information being cu_tmp_lic_flag, and the third syntax identification information being cu_tmp_idx. Among them, the block vector list can be reordered according to the template error. There are many ways to calculate the template error and select the template area. For example, the template area and error calculation method can be predefined for the block vector list, or can be consistent with the current prediction process. Taking the IntraTMP mode as an example, the current block can use error calculation methods such as SAD and MR-SAD, and the template area can be divided into L-type template, upper template and left template. The corresponding syntax elements in the prediction process based on the block vector list are as follows:

[0475]

[0476] cu_tmp_flag

[0477] if(cu_tmp_flag)

[0478] {

[0479]

[0480] cu_tmp_lic_flag

[0481]

[0482] cu_tmp_idx

[0483]

[0484] }

[0485]

[0486] Coding process:

[0487] 1. Encode the current block and determine whether the current block selects the IntraTMP prediction mode;

[0488] 2. Construct a block vector list. The candidate block vectors can be obtained from adjacent blocks, non-adjacent blocks, AR-BVP candidates, historical block vector cache, etc.

[0489] 3. Calculate the template error values ​​of the candidate block vectors in the block vector list and reorder them based on the template error values, retaining the top M. The template error values ​​corresponding to the L-shaped template, upper template, and left template under the SAD and MR-SAD calculation methods can be calculated respectively to obtain the corresponding sorted block vector lists, recorded as mrgList0, mrgList1, mrgList2, mrgListMR0, mrgListMR1, and mrgListMR2;

[0490] 4. The maximum template error value pDiff can be obtained according to step 3. This value is related to the template error value of the candidate in the block vector list. For example, pDiff can be equal to the maximum diff in the mrgList candidate plus 1. In subsequent sparse search and fine search, the template error value of the candidate block vector searched needs to be less than pDiff. Different template error calculation methods and template types can set corresponding pDiff;

[0491] 5. Perform a sparse search to obtain the search results corresponding to the L-shaped template, upper template, and left template under the SAD and MR-SAD calculation methods, which can be recorded as sparseList0, sparseList1, sparseList2, sparseListMR0, sparseListMR1, and sparseListMR2. Merge the corresponding block vector lists and sparse search results. Perform a refined search based on the merged lists to obtain the final IntraTMP block vector candidate lists under the SAD and MR-SAD calculation methods respectively;

[0492] 6. Determine whether the current block uses the IntraTMP block vector candidate list corresponding to SAD or the list corresponding to MR-SAD, and set the corresponding cu_tmp_lic_flag flag value. Further determine the block vector selected by the current block in the list, represented by the index value cu_tmp_idx. Based on the block vector, obtain the reference block as the prediction block of the current block. The residual block is obtained by converting the predicted block of the current block and the original value of the current block, and is converted through steps such as transform and quantization and then encoded using the entropy coding method. In addition, the coding information such as cu_tmp_flag, cu_tmp_idx, and cu_tmp_lic_flag are encoded to complete the encoding of the current block.

[0493] It should be noted that in the embodiments of the present application, the IntraTMP mode can use SATD and MR-SATD as the calculation method of the template error. One implementation method is to use SAD in the sparse search stage and SATD in the fine search stage. If the cu_tmp_lic_flag flag of the current block is true, MR-SAD and MR-SATD are used accordingly. SATD or MR-SATD can be used when calculating the template error value of the block vector list, which is consistent with the fine search stage; another implementation method is to indicate whether SATD is used during the search by writing the flag cu_tmp_satd_flag of the code stream. For example, SAD is used when cu_tmp_satd_flag is false, and SATD is used when cu_tmp_satd_flag is true. The cu_tmp_satd_flag flag can be used to determine how the template error value of the block vector list is calculated. When cu_tmp_satd_flag is false, SAD is used, and when cu_tmp_satd_flag is true, SATD is used. It is also possible to encode the cu_tmp_satd_flag and cu_tmp_lic_flag flags at the same time to determine whether the template error of the search and block vector list is calculated using SAD, SATD, MR-SAD, or MR-SATD.

[0494] It should be noted that in the embodiments of this application, the candidate list sparseList obtained by sparse search can be used as a guide block vector to construct AR-BVP candidates, calculate the template error values ​​of these AR-BVP candidates, and update the sparseList (the list stores the n candidates with the smallest template error values). SparseLists of different template types can be used to construct AR-BVP candidates, and the sparseList is updated based on the template error values ​​of the AR-BVP candidates.

[0495] It should be noted that in the embodiments of the present application, when a block vector list is used in the IntraTMP mode search process, it can only be used for searches corresponding to one template type. For example, in Example 3, a block vector list mrgList is constructed and reordered based on the L-shaped template, and candidate lists sparseList0, sparseList1, and sparseList2 under the L-shaped template, the upper template, and the left template are obtained through sparse search. mrgList can be merged with sparseList0 (the candidate list corresponding to the L-shaped template).

[0496] It should be noted that the coding method proposed in the embodiment of the present application was experimentally verified, and when the method of reordering the block vector list using SAD and MR-SAD respectively was applied to the IntraTMP mode, a Y component coding gain of about -0.02% could be achieved.

[0497] An embodiment of the present application provides a coding and decoding method, which, when a current block uses a preset intra-frame prediction mode, constructs a block vector list of the current block; determines a prediction block of the current block based on the block vector list of the current block; wherein the block vector list of the current block satisfies at least one of the following: the block vector list is constructed by executing at least two AR-BVPs, and between executing at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, or TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to the block vectors in the block vector list; wherein the template error value of the block vector is determined by a preset template error calculation method, which is determined according to the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream. That is to say, in an embodiment of the present application, the construction and / or use process of the block vector list in the intra-frame prediction process can be adjusted and improved. The diversity of the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or directly using the block vector of the reference block as a candidate block vector to add to the block vector list, and / or using a block vector list with sub-pixel precision for intra-frame prediction, and / or using different template error calculation methods to reorder the block vector list, etc., thereby improving the efficiency of intra-frame prediction and improving encoding and decoding performance.

[0498] Based on the above embodiment, in another embodiment of the present application, based on the same inventive concept as the above embodiment, FIG17 is a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in FIG17, the encoder 170 may include a first determining unit 1701, wherein:

[0499] The first determining unit 1701 is configured to, when determining that a current block uses a preset intra prediction mode, write first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra prediction mode; construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following:

[0500] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0501] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0502] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0503] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

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

[0507] Based on the composition of the above-mentioned encoder 170 and the computer-readable storage medium, Figure 18 is a schematic diagram of the specific hardware structure of an encoder provided by an embodiment of the present application. As shown in Figure 18, the encoder 170 may include: a first communication interface 1801, a first memory 1802 and a first processor 1803; the components are coupled together through a first bus system 1804. It can be understood that the first bus system 1804 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 1804 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 1804 in the figure. Among them,

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

[0509] A first memory 1802 is used to store computer programs that can be run on the first processor 1803;

[0510] The first processor 1803 is configured to, when running the computer program, perform the following operations: when determining that the current block uses a preset intra-frame prediction mode, writing first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; constructing a block vector list for the current block; and determining a prediction block for the current block based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following conditions:

[0511] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0512] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0513] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0514] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

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

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

[0519] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG19 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application. As shown in FIG19 , the decoder 190 may include a second determining unit 1901, wherein:

[0520] The second determining unit 1901 is configured to decode the bitstream and determine first syntax identification information; if the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block, wherein the block vector list for the current block satisfies at least one of the following:

[0521] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0522] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0523] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0524] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

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

[0527] Based on the composition of the above-mentioned decoder 190 and the computer-readable storage medium, Figure 20 is a schematic diagram of the specific hardware structure of a decoder provided in an embodiment of the present application. As shown in Figure 20, the decoder 190 may include: a second communication interface 2001, a second memory 2002 and a second processor 2003; the components are coupled together through a second bus system 2004. It can be understood that the second bus system 2004 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 2004 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 2004 in the figure. Among them,

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

[0529] The second memory 2002 is used to store computer programs that can be run on the second processor 2003;

[0530] The second processor 2003 is configured to, when running the computer program, perform the following steps: decoding a bitstream to determine first syntax identification information; if the first syntax identification information indicates that a current block uses a preset intra-frame prediction mode, constructing a block vector list for the current block; and determining a prediction block for the current block based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following conditions:

[0531] The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector;

[0532] The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block;

[0533] The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM;

[0534] The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

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

[0536] It can be understood that the hardware functions of the second memory 2002 are similar to those of the first memory 1802, and the hardware functions of the second processor 2003 are similar to those of the first processor 1803; they will not be described in detail here.

[0537] In yet another embodiment of the present application, FIG21 is a schematic diagram of the structure of a coding and decoding system provided in an embodiment of the present application. As shown in FIG21 , the coding and decoding system 210 may include an encoder 2101 and a decoder 2102 .

[0538] In an embodiment of the present application, the encoder 2101 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2102 may be the decoder described in any one of the aforementioned embodiments.

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

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

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

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

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

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

[0545] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. When a current block uses a preset intra-frame prediction mode, a block vector list for the current block is constructed; a prediction block for the current block is determined based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following conditions: the block vector list is constructed by executing at least two AR-BVPs, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; the block vector list includes block vectors of reference blocks corresponding to a reference block vector of the current block; the block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM; the block vector list is obtained by sorting template error values ​​corresponding to block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, which is determined based on an error calculation method of a template search process corresponding to the current block or second syntax identification information transmitted in the bitstream. That is to say, in an embodiment of the present application, the construction and / or use process of the block vector list in the intra-frame prediction process can be adjusted and improved. The diversity of the block vector list can be improved by constructing AR-BVP candidate block vectors in batches, and / or directly using the block vector of the reference block as a candidate block vector to add to the block vector list, and / or using a block vector list with sub-pixel precision for intra-frame prediction, and / or using different template error calculation methods to reorder the block vector list, etc., thereby improving the efficiency of intra-frame prediction and improving encoding and decoding performance.

Claims

1. A decoding method, applied to a decoder, comprising: Decoding the code stream to determine first syntax identification information; When the first syntax identification information indicates that the current block uses a preset intra prediction mode, constructing a block vector list of the current block; Determining a prediction block of the current block according to the block vector list of the current block; The block vector list of the current block satisfies at least one of the following: The block vector list is constructed by performing at least two automatic repositioning block vector prediction (AR-BVP) operations, and between performing the at least two AR-BVP operations, performing a check operation on at least one non-AR-BVP block vector. The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for decoding-side intra-frame mode derivation DIMD, or template-based intra-frame mode derivation TIMD, or spatial geometry partitioning mode SGPM; The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

2. The method according to claim 1, wherein The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first guide block vector of the current block, and determine a first candidate block vector of the current block based on the first guide block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in a historical block vector cache list HMVP; Adding the first candidate block vector and a second block vector to the block vector list; wherein the second block vector is a non-AR-BVP block vector; Determining a third block vector in the block vector list as a second reference block vector for the current block, and determining a second candidate block vector for the current block based on the second reference block vector; wherein the third block vector includes at least the first candidate block vector; The second candidate block vector is added to the block vector list.

3. The method according to claim 1, wherein The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first reference block vector of the current block, and determine a first reference block corresponding to the first reference block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in HMVP; determining the block vector of the first reference block as a first candidate block vector of the current block; and / or summing the first guide block vector and the block vector of the first reference block to determine the first candidate block vector of the current block; The first candidate block vector is added to the block vector list.

4. The method according to claim 1, wherein: The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first reference block vector of the current block, and determine a first reference block corresponding to the first reference block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in HMVP; determining the block vector of the first reference block as a first candidate block vector of the current block; and / or summing the first guide block vector and the block vector of the first reference block to determine the first candidate block vector of the current block; Adding the first candidate block vector and a second block vector to the block vector list; wherein the second block vector is a non-AR-BVP block vector; Determining a third block vector in the block vector list as a second reference block vector for the current block, and determining a second reference block corresponding to the second reference block vector; wherein the third block vector includes at least the first candidate block vector; determining the block vector of the second reference block as a second candidate block vector of the current block; and / or summing the second guide block vector and the block vector of the second reference block to determine a second candidate block vector of the current block; The second candidate block vector is added to the block vector list.

5. The method according to claim 4, wherein The method further comprises: Performing AR-BVP processing on the guide block vector of the current block to obtain at least one candidate block vector to construct the block vector list of the current block until a preset end condition is satisfied; wherein the preset end condition includes at least one of the following: The number of AR-BVP processes is greater than or equal to a preset threshold; The number of candidate block vectors determined by the AR-BVP process is greater than or equal to a first number threshold; The number of block vectors in the block vector list is greater than or equal to a second number threshold.

6. The method according to claim 2 or 3, wherein: The method further comprises: The number of block vectors in the HMVP added to the block vector list is determined according to the number of block vectors in the block vector list.

7. The method according to claim 4, wherein: The determining, according to the block vector list of the current block, a predicted block of the current block, comprises: Determining template error values ​​of block vectors in the block vector list according to the block vectors with sub-pixel precision in the block vector list; A prediction block of the current block is determined according to a template error value of a block vector in the block vector list.

8. The method according to claim 7, wherein: The determining, based on the block vectors with sub-pixel precision in the block vector list, the template error value of the block vector in the block vector list includes: Determine a template type parameter and a template size parameter corresponding to the template type parameter; Determining an adjusted block vector corresponding to the sub-pixel precision block vector according to the template type parameter, the template size parameter, and the sub-pixel bit parameter of the sub-pixel precision block vector; determining a prediction value of a reference template according to the adjusted block vector; The template error values ​​of the block vectors in the block vector list are determined according to the predicted value of the reference template and the reconstructed value of the current template.

9. The method according to claim 8, wherein The determining the prediction value of the reference template according to the adjusted block vector includes: When a candidate reference template corresponding to the adjusted block vector is available, determining a prediction value of the reference template according to the adjusted block vector and a sub-pixel difference algorithm; In a case where the candidate reference template corresponding to the adjusted block vector is unavailable, a prediction value of the reference template is determined according to the block vectors in the block vector list and a sub-pixel difference algorithm.

10. The method according to any one of claims 4, 7 to 9, wherein: The determining, according to the block vector list of the current block, a predicted block of the current block, comprises: Performing block vector template error calculation on the block vectors in the block vector list to determine template error values ​​of the block vectors in the block vector list; sorting the block vector list according to the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list; Based on the sorted block vector list, a prediction block for the current block is determined.

11. The method according to claim 10, wherein: The performing block vector template error calculation on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list includes: Decoding the code stream to determine the second syntax identification information; Determining a preset template error calculation method according to the second syntax identification information; wherein the preset template error calculation method includes any one of the following: absolute error sum SAD, MR-SAD, absolute transform error sum SATD, MR-SATD; Based on the preset template error calculation method, it is determined that the block vectors in the candidate block vector list correspond to the template error value of the at least one template type.

12. The method according to claim 11, wherein The determining a preset template error calculation method according to the second grammar identification information includes: A first template error calculation method and a second template error calculation method are determined according to the second syntax identification information; wherein the first template error calculation method is used to perform a sparse search of the at least one template type, and the second template error calculation method is used to perform a fine search and block vector template error calculation of the at least one template type.

13. The method according to claim 11, wherein The determining a preset template error calculation method according to the second grammar identification information includes: A third template error calculation method and a fourth template error calculation method are determined according to the second syntax identification information; wherein the third template error calculation method is used to perform a sparse search and block vector template error calculation of the at least one template type, and the fourth template error calculation method is used to perform a fine search of the at least one template type.

14. The method according to claim 11, wherein The determining a preset template error calculation method according to the second grammar identification information includes: A fifth template error calculation method is determined according to the second syntax identification information; wherein the fifth template error calculation method is used to perform a sparse search of the at least one template type, a fine search of the at least one template type and a block vector template error calculation.

15. The method according to claim 11, wherein The second grammar identification information includes first information and second information, and determining the preset template error calculation method according to the second grammar identification information includes: A sixth error calculation method is determined based on the first information and the second information; wherein the sixth error calculation method is used to perform a sparse search of the at least one template type, a fine search of the at least one template type, and a block vector template error calculation.

16. The method according to claim 10, wherein The performing block vector template error calculation on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list includes: performing block vector template error calculation on the block vectors in the block vector list according to the preset template error calculation method of the sparse search in the template search process corresponding to the current block to determine the template error values ​​of the block vectors in the block vector list; or Block vector template error calculation is performed on the block vectors in the block vector list according to the preset template error calculation method of the fine search in the template search process corresponding to the current block, and template error values ​​of the block vectors in the block vector list are determined.

17. The method according to any one of claims 10 to 15, wherein: Sorting the block vector list according to the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list includes: Decoding the code stream to determine third syntax identification information; determining, according to the third grammar identification information, at least one template quantity corresponding to the at least one template type; According to the at least one template quantity, the template error values ​​of the block vectors in the candidate block vector list corresponding to the at least one template type are sorted respectively to obtain at least one first candidate list corresponding to the at least one template type.

18. The method according to claim 17, wherein The step of determining a prediction block for the current block based on the sorted block vector list includes: Performing sparse search according to the at least one template type respectively to obtain at least one second candidate list corresponding to the at least one template type; Merging the at least one first candidate list and the at least one second candidate list respectively to obtain at least one third candidate list corresponding to the at least one template type; Based on the at least one third candidate list, performing a refined search according to the at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; A target candidate list corresponding to the current block is determined according to the at least one fourth candidate list, and a prediction block of the current block is determined according to the target candidate list.

19. The method according to claim 18, wherein The method further comprises: For any one of the second candidate lists, determining a third reference block vector according to the second candidate list, and determining a third candidate block vector of the current block according to the third reference block vector; Determine a template error value corresponding to the third candidate block vector, and update the second candidate list according to the template error value corresponding to the third candidate block vector.

20. The method according to claim 18, wherein The step of determining a prediction block for the current block based on the sorted block vector list includes: Performing sparse search according to the at least one template type respectively to obtain at least one second candidate list corresponding to the at least one template type; Merging the first candidate list and the at least one second candidate list corresponding to the preset template type respectively to obtain at least one third candidate list corresponding to the at least one template type; Based on the at least one third candidate list, performing a refined search according to the at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; A target candidate list corresponding to the current block is determined according to the at least one fourth candidate list, and a prediction block of the current block is determined according to the target candidate list.

21. The method according to any one of claims 18 to 20, wherein: described In the process of performing the refined search based on the at least one third candidate list, all template search areas corresponding to all block vectors in the third candidate list are the same; or, During the fine search based on the at least one third candidate list, the template search areas corresponding to the fourth block vectors in the third candidate list are all the same; wherein the fourth block vector is a block vector from the first candidate list.

22. A coding method, applied to an encoder, comprising: When it is determined that the current block uses a preset intra-frame prediction mode, writing first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; Constructing a block vector list of the current block; Determining a prediction block of the current block according to the block vector list of the current block; The block vector list of the current block satisfies at least one of the following: The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM; The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

23. The method according to claim 22, wherein The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first guide block vector of the current block, and determine a first candidate block vector of the current block based on the first guide block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in a historical block vector cache list HMVP; Adding the first candidate block vector and a second block vector to the block vector list; wherein the second block vector is a non-AR-BVP block vector; Determining a third block vector in the block vector list as a second reference block vector for the current block, and determining a second candidate block vector for the current block based on the second reference block vector; wherein the third block vector includes at least the first candidate block vector; The second candidate block vector is added to the block vector list.

24. The method according to claim 22, wherein The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first reference block vector of the current block, and determine a first reference block corresponding to the first reference block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in HMVP; determining the block vector of the first reference block as a first candidate block vector of the current block; and / or summing the first guide block vector and the block vector of the first reference block to determine the first candidate block vector of the current block; The first candidate block vector is added to the block vector list.

25. The method according to any one of claims 22, wherein: The step of constructing a block vector list of the current block includes: Determine a first block vector in the block vector list of the current block as a first reference block vector of the current block, and determine a first reference block corresponding to the first reference block vector; wherein the first block vector includes at least one of the following: a block vector of a neighboring block of the current block, a block vector of a non-neighboring block of the current block, and a block vector in HMVP; determining the block vector of the first reference block as a first candidate block vector of the current block; and / or summing the first guide block vector and the block vector of the first reference block to determine the first candidate block vector of the current block; Adding the first candidate block vector and a second block vector to the block vector list; wherein the second block vector is a non-AR-BVP block vector; Determining a third block vector in the block vector list as a second reference block vector for the current block, and determining a second reference block corresponding to the second reference block vector; wherein the third block vector includes at least the first candidate block vector; determining the block vector of the second reference block as a second candidate block vector of the current block; and / or summing the second guide block vector and the block vector of the second reference block to determine a second candidate block vector of the current block; The second candidate block vector is added to the block vector list.

26. The method according to claim 25, wherein The method further comprises: Performing AR-BVP processing on the guide block vector of the current block to obtain at least one candidate block vector to construct the block vector list of the current block until a preset end condition is satisfied; wherein the preset end condition includes at least one of the following: The number of AR-BVP processes is greater than or equal to a preset threshold; The number of candidate block vectors determined by the AR-BVP process is greater than or equal to a first number threshold; The number of block vectors in the block vector list is greater than or equal to a second number threshold.

27. The method according to claim 23 or 24, wherein The method further comprises: The number of block vectors in the HMVP added to the block vector list is determined according to the number of block vectors in the block vector list.

28. The method according to claim 25, wherein The determining, according to the block vector list of the current block, a predicted block of the current block, comprises: Determining template error values ​​of block vectors in the block vector list according to the block vectors with sub-pixel precision in the block vector list; A prediction block of the current block is determined according to a template error value of a block vector in the block vector list.

29. The method according to claim 28, wherein The determining, based on the block vectors with sub-pixel precision in the block vector list, the template error value of the block vector in the block vector list includes: Determine a template type parameter and a template size parameter corresponding to the template type parameter; Determining an adjusted block vector corresponding to the sub-pixel precision block vector according to the template type parameter, the template size parameter, and the sub-pixel bit parameter of the sub-pixel precision block vector; determining a prediction value of a reference template according to the adjusted block vector; The template error values ​​of the block vectors in the block vector list are determined according to the predicted value of the reference template and the reconstructed value of the current template.

30. The method according to claim 29, wherein The determining the prediction value of the reference template according to the adjusted block vector includes: When a candidate reference template corresponding to the adjusted block vector is available, determining a prediction value of the reference template according to the adjusted block vector and a sub-pixel difference algorithm; In a case where the candidate reference template corresponding to the adjusted block vector is unavailable, a prediction value of the reference template is determined according to the block vectors in the block vector list and a sub-pixel difference algorithm.

31. The method according to any one of claims 25, 28-30, wherein: The determining, according to the block vector list of the current block, a predicted block of the current block, comprises: Performing block vector template error calculation on the block vectors in the block vector list to determine template error values ​​of the block vectors in the block vector list; sorting the block vector list according to the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list; Based on the sorted block vector list, a prediction block for the current block is determined.

32. The method according to claim 31, wherein The performing block vector template error calculation on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list includes: Determining a preset template error calculation method and writing the second syntax identification information into a bitstream; wherein the second syntax identification information is used to determine the preset template error calculation method; the preset template error calculation method includes any one of the following: Sum of Absolute Errors (SAD), MR-SAD, Sum of Absolute Transform Errors (SATD), MR-SATD; Based on the preset template error calculation method, it is determined that the block vectors in the candidate block vector list correspond to the template error value of the at least one template type.

33. The method according to claim 32, wherein The method of calculating the preset template error includes: Determine a first template error calculation method and a second template error calculation method; wherein, the first template error calculation method is used to perform a sparse search of the at least one template type, and the second template error calculation method is used to perform a fine search of the at least one template type and a block vector template error calculation.

34. The method of claim 32, wherein: The method of calculating the preset template error includes: Determine a third template error calculation method and a fourth template error calculation method; wherein, the third template error calculation method is used to perform a sparse search and block vector template error calculation of the at least one template type, and the fourth template error calculation method is used to perform a fine search of the at least one template type.

35. The method of claim 32, wherein: The method of calculating the preset template error includes: Determine a fifth template error calculation method; wherein the fifth template error calculation method is used to perform a sparse search of the at least one template type, a fine search of the at least one template type, and a block vector template error calculation.

36. The method of claim 32, wherein: The second grammar identification information includes first information and second information, and determining the preset template error calculation method includes: Determining a sixth error calculation method; wherein the sixth error calculation method is used to perform a sparse search of the at least one template type, a fine search of the at least one template type, and a block vector template error calculation; The first information and the second information are determined according to the sixth error calculation method.

37. The method of claim 31, wherein The performing block vector template error calculation on the block vectors in the block vector list to determine the template error values ​​of the block vectors in the block vector list includes: performing block vector template error calculation on the block vectors in the block vector list according to the preset template error calculation method of the sparse search in the template search process corresponding to the current block to determine the template error values ​​of the block vectors in the block vector list; or Block vector template error calculation is performed on the block vectors in the block vector list according to the preset template error calculation method of the fine search in the template search process corresponding to the current block, and template error values ​​of the block vectors in the block vector list are determined.

38. The method according to any one of claims 31 to 36, wherein: Sorting the block vector list according to the template error values ​​of the block vectors in the block vector list to obtain a sorted block vector list includes: Determining at least one template quantity corresponding to the at least one template type, and writing third syntax identification information into the bitstream; wherein the third syntax identification information is used to determine the at least one template quantity corresponding to the at least one template type; According to the at least one template quantity, the template error values ​​of the block vectors in the candidate block vector list corresponding to the at least one template type are sorted respectively to obtain at least one first candidate list corresponding to the at least one template type.

39. The method according to claim 38, wherein The step of determining a prediction block for the current block based on the sorted block vector list includes: Performing sparse search according to the at least one template type respectively to obtain at least one second candidate list corresponding to the at least one template type; Merging the at least one first candidate list and the at least one second candidate list respectively to obtain at least one third candidate list corresponding to the at least one template type; Based on the at least one third candidate list, performing a refined search according to the at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; A target candidate list corresponding to the current block is determined according to the at least one fourth candidate list, and a prediction block of the current block is determined according to the target candidate list.

40. The method of claim 39, wherein The method further comprises: For any one of the second candidate lists, determining a third reference block vector according to the second candidate list, and determining a third candidate block vector of the current block according to the third reference block vector; Determine a template error value corresponding to the third candidate block vector, and update the second candidate list according to the template error value corresponding to the third candidate block vector.

41. The method of claim 39, wherein The step of determining a prediction block for the current block based on the sorted block vector list includes: Performing sparse search according to the at least one template type respectively to obtain at least one second candidate list corresponding to the at least one template type; Merging the first candidate list and the at least one second candidate list corresponding to the preset template type respectively to obtain at least one third candidate list corresponding to the at least one template type; Based on the at least one third candidate list, performing a refined search according to the at least one template type to obtain at least one fourth candidate list corresponding to the at least one template type; A target candidate list corresponding to the current block is determined according to the at least one fourth candidate list, and a prediction block of the current block is determined according to the target candidate list.

42. The method according to any one of claims 39 to 41, wherein: described In the process of performing the refined search based on the at least one third candidate list, all template search areas corresponding to all block vectors in the third candidate list are the same; or, During the fine search based on the at least one third candidate list, the template search areas corresponding to the fourth block vectors in the third candidate list are all the same; wherein the fourth block vector is a block vector from the first candidate list.

43. A code stream, wherein The code stream is generated by bit coding according to information to be coded; wherein the information to be coded includes at least one of the following: first syntax identification information, second syntax identification information, and third syntax identification information.

44. An encoder comprising a first determining unit, wherein: A first determining unit is configured to, when determining that a current block uses a preset intra-frame prediction mode, write first syntax identification information into a bitstream; wherein the first syntax identification information indicates that the current block uses the preset intra-frame prediction mode; construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block; wherein the block vector list for the current block satisfies at least one of the following: The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; The block vector list includes block vectors with sub-pixel precision; wherein the block vectors with sub-pixel precision are used for DIMD, TIMD, or SGPM; The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

45. An encoder comprising a first memory and a first processor, wherein: a first memory for storing a computer program capable of running on the first processor; The first processor is configured to execute the method according to any one of claims 22 to 42 when running the computer program.

46. ​​A decoder comprising a second determining unit, wherein: The second determining unit is configured to decode the code stream and determine first syntax identification information; if the first syntax identification information indicates that the current block uses a preset intra-frame prediction mode, construct a block vector list for the current block; and determine a prediction block for the current block based on the block vector list for the current block, wherein the block vector list for the current block satisfies at least one of the following: The block vector list is constructed by executing AR-BVP at least twice, and between executing the at least two AR-BVPs, a check operation is performed on at least one non-AR-BVP block vector; The block vector list includes block vectors of reference blocks corresponding to the reference block vector of the current block; The block vector list includes sub-pixel precision block vectors; wherein the sub-pixel precision block vectors are used for DIMD, or TIMD, or SGPM; The block vector list is obtained by sorting the template error values ​​corresponding to the block vectors in the block vector list; wherein the template error values ​​of the block vectors are determined by a preset template error calculation method, and the preset template error calculation method is determined based on the error calculation method of the template search process corresponding to the current block or the second syntax identification information transmitted in the code stream.

47. A decoder comprising a second memory and a second processor, wherein: a second memory for storing a computer program capable of running on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program.

48. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, which, when executed by at least one processor, implements the method according to any one of claims 1 to 21 or the method according to any one of claims 22 to 42.

Citation Information

Patent Citations

  • Method and apparatus for video coding using block vector with adaptive spatial resolution

    US20240031558A1

  • Method, apparatus, and medium for video processing

    WO2023046127A1

  • Method, apparatus, and medium for video processing

    WO2024012460A1

  • Video coding method and apparatus, video decoding method and apparatus, and system

    WO2024031691A1