Encoding / decoding method, bitstream, encoder, decoder, and storage medium
By determining block vector candidate lists and removing redundant vectors, the method addresses redundancy in IBC and IntraTMP modes, enhancing video encoding and decoding efficiency.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-04-14
- Publication Date
- 2026-05-12
AI Technical Summary
Existing video encoding technologies suffer from redundancy in Intra Block Copy (IBC) and Intra Template Matching Prediction (IntraTMP) modes due to overlapping search ranges, leading to inefficient encoding and decoding processes.
The proposed method reduces redundancy by determining a first and second block vector candidate list based on a region range, using specific syntax identifiers to indicate prediction modes, and removing overlapping block vectors, thereby improving encoding efficiency.
This approach enhances video encoding and decoding efficiency by reducing redundancy in block vectors, leading to improved representation of header information and overall video encoding efficiency.
Smart Images

Figure 2026514566000001_ABST
Abstract
Description
[Technical Field]
[0001] This application relates to the video encoding and decoding technology, and more particularly to encoding and decoding methods, bitstreams, encoders, decoders, and storage media. [Background technology]
[0002] Intra Block Copy (IBC) is a block-level coding mode that uses motion search to find the optimal block vector (BV) for each coded block. The optimal block vector is found by searching in the reconstruction region of the frame in which the current coded block is located (i.e., the current coded frame). Intra Template Matching Prediction (Intra TMP) is also a coding mode that performs intra prediction based on the BV, and its motion search process uses template matching as an evaluation criterion.
[0003] However, in actual encoding processes, IBC mode and IntraTMP mode have many similarities, such as both using BV to obtain predicted values and both being used for encoding natural video and screen content video. However, the configuration methods in related technologies overlap with the search range of other prediction modes, resulting in redundancy, which is detrimental to highly efficient encoding and thus affects video encoding efficiency. [Overview of the project] [Problems that the invention aims to solve]
[0004] This invention provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium, which can improve the representation efficiency of header information by removing BV information that is redundantly represented between different modes, thereby improving the overall video encoding efficiency. [Means for solving the problem]
[0005] The technical solution of this application can be realized as follows.
[0006] In the first embodiment, the embodiment of the present application provides a decoding method, the method is Decrypting the bitstream and determining the prediction mode of the current block, If the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, then the first block vector candidate list of the current block is determined. Determine the first region range, and determine the second block vector candidate list based on the first block vector candidate list and the first region range. This includes determining the predicted value of the current block based on the second block vector candidate list.
[0007] In a second embodiment, the embodiment of the present application provides an encoding method, the method is Currently, the prediction mode for the block is determined, If the prediction mode indicates that the current block uses a prediction mode based on intrablock merging, then determine the first block vector candidate list for the current block. Determine the first region range, and determine the second block vector candidate list based on the first block vector candidate list and the first region range. This includes determining the predicted value of the current block based on the second block vector candidate list.
[0008] In a third embodiment, the embodiment of the present application provides a bitstream generated by bit encoding based on information to be encoded, wherein the information to be encoded is: The current block includes at least one of the following: predicted difference value of the current block, candidate block vector index information, extended candidate block vector index information, first syntax identifier information, second syntax identifier information, and third syntax identifier information. Here, the first syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock copying, the second syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock merging, and the third syntactic identifier is used to indicate whether the current block uses the MBVD mode.
[0009] In a fourth embodiment, an embodiment of the present application provides a decoder, the decoder is A decoding unit configured to decode a bitstream and determine the prediction mode of the current block, If the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, the first determination unit is configured to determine a first block vector candidate list of the current block and determine a first region range, A first removal unit is configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range, The system includes a first prediction unit configured to determine the predicted value of the current block based on the second block vector candidate list.
[0010] In a fifth embodiment, the present invention provides a decoder comprising a first memory and a first processor, wherein, The first memory is configured to store computer programs that can be executed by the first processor. The first processor is configured to perform the method described in the first embodiment by executing a computer program.
[0011] In a sixth embodiment, an embodiment of the present application provides an encoder, the encoder is, Determine the prediction mode of the current block. When the current block uses a prediction mode based on intra-block merge, a second determination unit configured to determine a first block vector candidate list of the current block and determine a first region range; A second removal unit configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range; A second prediction unit configured to determine a predicted value of the current block based on the second block vector candidate list.
[0012] In a seventh aspect, an embodiment of the present application provides an encoder including a second memory and a second processor, where The second memory is configured to store a computer program executable by the second processor, The second processor is configured to execute the method described in the second aspect by executing the computer program.
[0013] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for realizing the method described in the first aspect or the method described in the second aspect.
Advantages of the Invention
[0014] Embodiments of the present application provide an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. In both the encoding side and the decoding side, in the block encoding / decoding process, for the scenario of intra-motion mode prediction, within the first region range, based on the first block vector candidate list of the current block, for example, by removing the block vectors that overlap with the intra-template matching prediction mode, a second block vector candidate list is determined. Based on the block vectors with redundancy removed in the second block vector candidate list, the prediction value of the current block is determined. As a result, the redundancy of the block vectors is reduced. When performing encoding / decoding using the block vectors after redundancy removal, the expression efficiency of the header information can be improved, and thus the encoding / decoding efficiency of the video can be improved.
Brief Description of the Drawings
[0015] [Figure 1] It is a schematic diagram showing an optional process for the decoding side to obtain the reconstructed pixel value according to an embodiment of the present application. [Figure 2a] It is schematic diagram 1 showing an optional template type according to an embodiment of the present application. [Figure 2b] It is schematic diagram 2 showing an optional template type according to an embodiment of the present application. [Figure 2c] It is schematic diagram 3 showing an optional template type according to an embodiment of the present application. [Figure 2d] It is schematic diagram 4 showing an optional template type according to an embodiment of the present application. [Figure 2e] It is schematic diagram 5 showing an optional template type according to an embodiment of the present application. [Figure 2f] It is schematic diagram 6 showing an optional template type according to an embodiment of the present application. [Figure 3] It is a schematic diagram showing an optional adjacent block position according to an embodiment of the present application. [Figure 4] It is a schematic diagram showing an optional BVP candidate item according to an embodiment of the present application. [Figure 5] This is a schematic diagram illustrating the optional template cost calculation according to the embodiment of the present invention. [Figure 6] This is a schematic diagram showing the selective candidate item clustering according to the embodiment of the present invention. [Figure 7a] Figure 1 is a schematic diagram showing the flow of the optional candidate item search according to the embodiment of the present application. [Figure 7b] Figure 2 is a schematic diagram showing the flow of the optional candidate item search according to the embodiment of the present application. [Figure 8] This is a schematic diagram illustrating the determination of an arbitrarily selected block vector according to an embodiment of the present invention. [Figure 9a] Figure 1 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 9b] Figure 2 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 9c] Figure 3 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 9d] Figure 4 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 10] Figure 5 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 11] Figure 6 is a schematic diagram showing an optional IBC reference region according to the embodiment of the present application. [Figure 12] This is a schematic diagram illustrating the prediction process for an optional Intra TMP according to an embodiment of the present invention. [Figure 13] This is a schematic diagram showing the optional template search region according to the embodiment of the present application. [Figure 14] This is a schematic diagram showing the prediction flow of the optional IntraTMP mode according to the embodiment of the present invention. [Figure 15] This is a schematic diagram showing the refinement flow of the optional IntraTMP mode according to the embodiment of the present invention. [Figure 16]Figure 1 is a schematic diagram showing the search flow for an optional Intra TMP Fusion mode according to the embodiment of the present invention. [Figure 17] Figure 2 is a schematic diagram showing the search flow for an optional Intra TMP Fusion mode according to the embodiment of the present invention. [Figure 18] This is a schematic diagram showing the predictive value determination flow for the arbitrarily selected Intra TMP Fusion mode according to the embodiment of the present invention. [Figure 19a] Figure 1 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present invention. [Figure 19b] Figure 2 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present invention. [Figure 19c] Figure 3 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present invention. [Figure 19d] Figure 4 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present invention. [Figure 19e] Figure 5 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present application. [Figure 19f] Figure 6 is a schematic diagram showing the structure of an arbitrarily selected filter according to the embodiment of the present invention. [Figure 20] This is a schematic diagram showing the selective TM-FLM prediction according to the embodiments of the present invention. [Figure 21] This is an illustrative flowchart of an optional decoding method according to the embodiments of the present invention. [Figure 22] This is flowchart 1 illustrating an optional encoding method according to the embodiment of the present application. [Figure 23] Flowchart 2 illustrates an optional encoding method according to the embodiment of the present application. [Figure 24] Flowchart 3 illustrates an exemplary optional encoding method according to the embodiment of the present application. [Figure 25] Flowchart 4 illustrates an optional coding method according to the embodiment of the present application. [Figure 26] This is an illustrative structural diagram of the decoder configuration according to an embodiment of the present invention. [Figure 27] This is a schematic diagram of the specific hardware structure of the decoder according to the embodiment of the present invention. [Figure 28] This is an illustrative structural diagram of the encoder configuration according to an embodiment of the present invention. [Figure 29] This is a schematic diagram of the specific hardware structure of the encoder according to the embodiment of the present invention. [Figure 30] This is an illustrative structural diagram of the configuration of the coding and decoding system according to an embodiment of the present invention. [Modes for carrying out the invention]
[0016] The drawings herein are incorporated into the specification and constitute part of this specification, and these drawings illustrate embodiments that conform to the embodiments of the present application and are used together with the specification to illustrate the technical solutions of the present application. Clearly, the drawings described above are only a few embodiments of the present application, and it should be understood that those skilled in the art can derive other drawings based on these drawings without any creative effort.
[0017] The flowchart shown in the diagram is merely illustrative and does not necessarily have to include all content and actions / steps, nor does it necessarily have to be performed in the order described. For example, some actions / steps can be further broken down, some actions / steps can be combined, or partially combined, so the actual execution order may be changed depending on the actual situation.
[0018] In order to provide a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the drawings. The drawings are for reference and explanation purposes only and are not intended to limit the embodiments of this application.
[0019] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art. The terms used herein are for illustrative purposes only and are not intended to limit the application.
[0020] In the following description, the term “several embodiments” refers to a subset of all possible embodiments, and to the extent that it is understandable, “several embodiments” may be the same subset or different subsets of all possible embodiments, and these can be combined with one another without conflict. The terms “first / second / third” as used in the embodiments of this application are merely for distinguishing similar subjects and do not represent a particular order of subjects, and to the extent that it is understandable, “first / second / third” may, in some cases, be replaced with a particular order or sequence, thereby allowing the embodiments of this application described herein to be carried out in an order other than that shown or described.
[0021] Where descriptions such as "First / Second" appear in this application, the following explanation is added: The terms "First / Second / Third" as used in the following explanation are merely for distinguishing similar subjects and do not represent a specific order of subjects. Understandably, "First / Second / Third" may, in some cases, be interchangeable with a specific order or sequence, thereby allowing the embodiments of this application described herein to be carried out in an order other than that shown or described.
[0022] Before describing the embodiments of this application in further detail, we will first explain the nouns and terms referred to in the embodiments of this application, and the following interpretations apply to the nouns and terms referred to in the embodiments of this application.
[0023] Video coding standard, Versatile Video Coding (H.266 / VVC); Intra-block copy (IBC); Intra Template Matching Prediction (Intra TMP) Block vector (BV); Template Matching (TM) Advanced Motion Vector Prediction (AMVP) mode; Advanced Block Vector Prediction (ABVP); Combined inter and intra prediction (CIIP); Geometric Partitioning Prediction (GPM:Geometric Partitioning Mode); Local illumination compensation (LIC).
[0024] To facilitate understanding of the embodiments of this application, we will first briefly introduce the relevant concepts of the BV-based prediction technology relating to the embodiments of this application as follows.
[0025] Currently, BV-based prediction techniques mainly include prediction based on intrablock copy (IBC) and prediction based on intratemplate matching (IntraTMP). The following provides a detailed explanation of these two BV-based prediction techniques.
[0026] Intrablock Copy (IBC) is an extension of the Video Coding Standard (VVC) for screen content coding, and can significantly improve the coding efficiency of screen content sequences.
[0027] IBC is a block-level coding mode, and like interframe technology, the coding side performs motion search to find the optimal block vector (BV) for each coded block. Here, motion search can be understood as block matching, and the block vector is also called the motion vector (MV). The block vector is a vector that points from the current block to a reference block. The difference from interframe technology is that the optimal block vector in IBC is obtained by searching in the reconstruction domain of the frame in which the current coded block is located (i.e., the current coded frame), whereas the motion vector in interframe is obtained by searching in the adjacent reference frame in the time domain of the current coded frame.
[0028] In coding standards such as H.265 / HEVC SCC, H.266 / VVC, and AV1, AVS3, and EVC, IBC technology is used as an important tool for screen-to-video coding. In ECM, the search model for the next generation of H.266 / VVC coding standards, IBC technology continues to be used as a tool for screen-to-video coding, and has been further extended into a toolset that uses multiple modes in combination. At the same time, it has also been introduced into the field of coding normal natural video, making it a more versatile video coding tool.
[0029] Intra-Template Matching Prediction (IntraTMP) is also an encoding mode that performs intra-prediction based on BV block vectors. Unlike IBC, its motion search block matching process is performed on both the decoding and encoding sides, and the matching criteria in the search process are not based on the degree of matching of the encoded blocks themselves, but rather on template matching (TM).
[0030] On the decoding side, the basic decoding process for IBC mode or IntraTMP mode involves several steps: obtaining the BV, obtaining the predicted value using the BV, and determining the reconstructed value.
[0031] The decoder can analyze the bitstream and determine the decoding mode corresponding to the current block, such as IBC mode or IntraTMP mode, based on the corresponding syntactic element information (mode identification information).
[0032] Referring to Figure 1, Figure 1 is a schematic diagram showing an optional process in which the decoding side acquires reconstructed pixel values according to an embodiment of the present invention, and as shown in Figure 1, the process in which the decoding side acquires reconstructed pixel values includes steps S11 to S13.
[0033] In step S11, BV is obtained.
[0034] On the decoding side, the decoder obtains the block vector corresponding to the current block by analyzing the bitstream.
[0035] Specifically, the decoder obtains the BV through parsing. In actual implementation, since there can be multiple ways to obtain the BV, the bitstream can include mode information about the BV acquisition method and corresponding parameter information. For example, if the IBC merge mode is obtained from the syntax element, the decoder constructs a merge list, parses the merge list choice index, and then obtains specific information about the BV from the corresponding choice in the merge list based on the index. In another example, if it is the normal IBC mode (i.e., IBC-ABVP mode), the decoder obtains specific information about the BV by parses the value of the syntax element describing the BV or the predicted difference value of the BV in the bitstream. In yet another example, if it is the IntraTMP mode, the decoder either directly obtains one optimal BV through a BV search within a certain range, or constructs a list of candidate BVs and then determines the specific information about the BV ultimately used by the syntax element in the bitstream.
[0036] In step S12, predictive samples are obtained using BV.
[0037] On the decoding side, the decoder uses the BV to obtain the predicted value corresponding to the predicted sample. Obtaining the predicted value using the BV usually involves copying the corresponding region pointed to by the BV to obtain the predicted value of the current block.
[0038] In step S13, a reconstituted sample is obtained.
[0039] On the decoding side, if prediction residuals exist, the decoder must analyze the bitstream to obtain the prediction residuals. Then, it performs processes such as adding the prediction residuals and the predicted values to obtain the final reconstructed value of the current block.
[0040] Since both IBC merge mode and IntraTMP mode involve template matching and template matching costs in the encoding and decoding processes, template matching will be explained uniformly below.
[0041] Referring to Figures 2a, 2b, 2c, 2d, 2e, and 2f, Figures 2a to 2f are schematic diagrams showing optional template types according to embodiments of the present application. As shown in Figures 2a to 2f, template types include a variety of types, including, but are not limited to, the template types shown in Figures 2a to 2f. Here, Figures 2a, 2b, and 2c are three commonly used template types. The template type shown in Figure 2a is the upper and left-hand regions of the Current Block, the template type shown in Figure 2b is the left-hand region of the Current Block, and the template type shown in Figure 2c is the upper region of the Current Block. Different template types may be valid simultaneously or used individually (for example, using only the template type shown in Figure 2a). The specific available template types are specified by syntactic elements.
[0042] Furthermore, by analyzing the bitstream and the corresponding syntactic element information, the template type adopted by the current block can be determined. Here, the current block can perform template matching using one template type to determine its BV, or it can perform template matching using a combination of multiple template types to determine its BV. The present application makes no limitations on this.
[0043] The process of calculating template matching costs involves using a predetermined cost function to represent the cost values of the reference block and the current block by utilizing the difference in pixel values between the reference block's template and the current block's template.
[0044] Here, the specified cost function may be the sum of absolute differences (SAD), the sum of absolute differences in transformation (SATD), the mean squared error (MSE), the sum of squared errors (SSD), the mean absolute difference (MAD), the mean squared error deviation (MSD), the normalized cross-correlation coefficient (NCC), or the like.
[0045] The specified cost function may be any one of the above cost functions, or any combination of the above cost functions, and the present application does not impose any limitations on this.
[0046] For example, the cost function of the absolute sum of errors (SAD) can be shown by equation (1).
[0047]
number
[0048] The steps for S11 (obtaining BV, i.e., deriving BV) are described in detail below.
[0049] Regarding S11, the luminance block vector bvL and the chromaticity block vector bvC will be explained here.
[0050] (1) Luminance component: Based on the current block's brightness position information, width, and height, the current block's brightness block vector (bvL) is determined.
[0051] Input: A luminance position (xCb, yCb) specifying the top-left corner sample of the current encoded block (current block) relative to the top-left corner luminance sample of the current image, a variable cbWidth specifying the width of the current encoded block within the luminance sample, and a variable cbHeight specifying the height of the current encoded block within the luminance sample.
[0052] Furthermore, by analyzing the bitstream, the decoder can obtain the size information (i.e., width and height) of the current block from the header information.
[0053] Output: Block vector of luminance (bvL: Block Vector Luma).
[0054] IBC modes can be broadly divided into two main categories: IBC merge mode and IBC ABVP mode (similar to the merge and AMVP modes in VVC interframe modes), and the process for obtaining the BV can include steps S21 to S23 in either case.
[0055] In step S21, when deriving bvL, it is necessary to establish an IBC block vector candidate list bvCandList in both cases.
[0056] In IBC mode, the process of obtaining the current block's bvL requires establishing a block vector candidate list bvCandList, which contains multiple candidate items.
[0057] Note that the number of block vectors (i.e., the number of candidate items) in the block vector candidate list bvCandList for different modes may differ. For example, the number of candidate items that can be included in bvCandList for IBC merge mode is 6, and the number of candidate items that can be included in bvCandList for IBC ABVP mode is 2. Of course, in the embodiments of this application, the number of candidate items that can be included in bvCandList may be N, where N is a positive integer greater than or equal to 1. The number of candidate items N is set in advance, and the decoder and encoder agree or specify in advance the value of N corresponding to the block vector candidate list bvCandList corresponding to the current block. For example, if the decoder and encoder agree or specify that the value of N corresponding to the block vector candidate list bvCandList corresponding to the current block is 8, then in the process of encoding or decoding the current block, the number of candidate items included in the established IBC block vector candidate list bvCandList will be 8.
[0058] In step S22, candidate items in the selected list are determined based on the bitstream.
[0059] By analyzing the bitstream, the index value of the bvL corresponding to the current block is determined, and based on this index value, a candidate item corresponding to the current block is determined from the block vector candidate list.
[0060] Here, in IBC mode and IntraTMP mode, the candidate item information (i.e., availability condition) in the block vector candidate list includes at least one of the following pieces of information:
[0061] 1) Prediction direction (L0 or L1, usually L0 by default), 2) BV information (horizontal component, vertical component), 3) Reference frame (default is current image), the current image is the current reference frame. 4) Inversion type (e.g., no inversion, horizontal inversion, and vertical inversion), 5) Whether or not to use LIC (Linear Model).
[0062] The availability conditions described above are merely examples, and may include any one of the above-mentioned availability conditions, or a combination of multiple of them. Of course, other availability conditions may also be included, and this application makes no limitations on this.
[0063] In step S23, the final BV is determined based on the candidate item.
[0064] Furthermore, step S21 includes steps S211 to S215.
[0065] In step S211, the derivation of candidate spatial domain items is as follows:
[0066] If the usage conditions are met (for example, if the size condition IsGt4by4 is TRUE, the variable IsGt4by4 is TRUE if the product of the luminance width and height is greater than 16), the process for deriving a candidate spatial block vector from neighboring coding units, as defined in the decoding standard, is invoked, taking the luminance coded block position (xCb, yCb), the luminance coded block width cbWidth, and the height cbHeight as input, and the output is an availability flag, e.g., availableFlagA1, availableFlagB1, and block vectors bvA1 and bvB1, where the size condition IsGt4by4 represents the block size limit. Here, availableFlagA1 represents the availability flag corresponding to block vector bvA1, and availableFlagB1 represents the availability flag corresponding to block vector bvB1.
[0067] For example, if the value of the availability flag availableFlagA1 is a first predetermined value, it indicates that the block vector bvA1 is available as a candidate item, and if the value of the availability flag availableFlagA1 is a second predetermined value, it indicates that the block vector bvA1 is not available as a candidate item.
[0068] Note that the first predetermined value and the second predetermined value are different, and the first and second predetermined values may be in parameter format or numerical format. Specifically, the availability flag availableFlagA1 may be a parameter written in the profile, or it may be the value of a flag, and there is no particular limitation to this here.
[0069] For example, the first predetermined value and the second predetermined value may be set to 1 and the second predetermined value to 0, or the first predetermined value to 0 and the second predetermined value to 1, or the first predetermined value to true and the second predetermined value to false, or the first predetermined value to false and the second predetermined value to true, but the specifics are not limited here.
[0070] Furthermore, the criteria for determining availability detection for each candidate item (i.e., availability conditions) include at least one of the following:
[0071] Condition 1: Whether the sum of the current block position and the offset position due to BVP exceeds the picture boundary. Condition 2: Whether the sum of the current block location and the block location pointed to by the BVP does not cover the current block. Condition 3: Whether the sum of the current block position and the offset position due to BVP exceeds the available area of the IBC. Condition 4: Whether the current block location plus the location of the block pointed to by BVP has been reconfigured.
[0072] Since the reference block is already a reconfigured block, it has BV information, and based on this, it can only be determined as a candidate item if it simultaneously satisfies conditions 1, 2, 3, and 4.
[0073] Furthermore, the above-mentioned availability conditions (Condition 1, Condition 2, Condition 3, and Condition 4) are merely examples, and the availability conditions include, but are not limited to, Condition 1, Condition 2, Condition 3, and Condition 4, and may include any one of the above availability conditions, or any combination of the multiple conditions, and may actually include other availability conditions, but the embodiments of this application do not impose any limitations on this.
[0074] The availability conditions include, but are not limited to, conditions 1, 2, 3, and 4 above. The availability conditions are defined or agreed upon by both the encoder and the decoder, and consistent detection results can be obtained by performing availability detection on the block vector of the current block according to the availability conditions defined by both.
[0075] Furthermore, a block vector is only considered a candidate item if it simultaneously satisfies all availability conditions.
[0076] For example, if the availability conditions for block vector availability detection agreed upon by both codecs include conditions 1, 2, 3, and 4, and block vector bvA1 satisfies only conditions 1, 2, and 3, but not condition 4, then block vector bvA1 will not be considered a candidate item. If block vector bvA1 satisfies conditions 1, 2, 3, and 4 simultaneously, then block vector bvA1 will be considered a candidate item.
[0077] Furthermore, in the process of determining candidate items, it is necessary to traverse the adjacent blocks of the current block according to a predetermined order to determine the candidate items. Here, the predetermined order for traversing adjacent blocks is defined in both the encoder and the decoder, and in the encoding or decoding process, the adjacent blocks of the current block are traversed according to the predetermined order that has already been determined. Referring to Figure 3, Figure 3 is a schematic diagram showing the arbitrarily selected adjacent block positions according to an embodiment of the present invention. As shown in Figure 3, the adjacent blocks of the current block include A0, A1, B0, B1, and B2, and the predetermined order (i.e., the traversal order) can be set to A1→B1→B0→A0→B2, and this predetermined order is defined or agreed upon in advance in both codecs. Of course, the predetermined order here is merely an example, and the present invention is not limited thereto.
[0078] In step S212, the candidate spatial domain item is added to the candidate list.
[0079] When the usage conditions are met (for example, when the size condition IsGt4by4 is TRUE), that is, for candidate items that meet the availability conditions, the construction of the block vector candidate list bvCandList can be expressed as follows:
[0080] i=0 if(availableFlagA1) bvCandList[i++]=bvA1 if(availableFlagB1) bvCandList[i++]=bvB1 For each block vector in the current block, the availability flag of the block vector is checked to determine whether or not the block vector meets the availability conditions. If a block vector meets the availability conditions, it is added to the block vector candidate list bvCandList, and the number of candidate items in the block vector candidate list bvCandList is updated.
[0081] For example, in a process of traversing adjacent blocks of the current block in a predetermined order A1→B1→B0→A0→B2, it is determined whether the availability flag availableFlagA1 of adjacent block A1 is true (or equal to 1) in the predetermined order A1→B1→B0→A0→B2. If the availability flag availableFlagA1 of adjacent block A1 is true (or equal to 1), the block vector bvA1 corresponding to adjacent block A1 is designated as the i-th candidate item in the block vector candidate list bvCandList, and 1 is added to i. Subsequently, it is determined whether the availability flag availableFlagB1 of adjacent block B1 is true (or equal to 1). If the availability flag availableFlagB1 of adjacent block B1 is true (or equal to 1), the block vector bvB1 corresponding to adjacent block B1 is designated as the i-th candidate item in the block vector candidate list bvCandList, and 1 is added to i. Next, determine whether the availability flag availableFlagB0 of the adjacent block B0 is true (or equal to 1). If the availability flag availableFlagB0 of the adjacent block B0 is false (or equal to 0), then determine whether the availability flag availableFlagA0 of the adjacent block A0 is true (or equal to 1), and so on.
[0082] In step S213, check the number of valid items in the candidate list.
[0083] The number of valid items in the candidate list is represented using numCurrCand, and the derivation process for the variable numCurrCand (the number of candidates obtained so far) is as follows.
[0084] If the usage conditions are met (for example, if the size condition IsGt4by4 is TRUE), numCurrCand is set to be equal to the number of candidates in bvCandList; otherwise, numCurrCand is set to 0.
[0085] In step S214, if the candidate list does not reach the specified number of items, the process of deriving historical candidate items, detecting availability, and adding items continues.
[0086] If the candidate list does not reach the specified number of items (for example, 6 items for IBC merge mode and 2 items for IBC ABVP mode), the history candidate list can be updated by continuing to derive, detect availability of, and add history candidate items. Specifically, BVs that previously appeared in the row where the current CTU is located are designated as history candidate items, selected from the history list, and added to the list from back to front.
[0087] Specifically, if numCurrCand is less than MaxNumIbcMergeCand (the maximum number of candidates in IBC merge mode) and NumHmvpIbcCand (the maximum number of candidates for the history-optimal block vector (Hmvp) in IBC mode) is greater than 0, the history-based IBC block vector derivation process defined in the decoding standard is invoked, with bvCandList and numCurrCand as inputs and the modified bvCandList and numCurrCand as outputs.
[0088] In step S215, the check for valid items in the candidate list and the addition of other available candidate items are continued until the specified number of items is reached.
[0089] The available candidate items include at least one of the following: pairwise mean candidate items and zero-value BV candidate items.
[0090] For example, a pairwise mean candidate can be constructed using the first and second candidate items and can be expressed as follows:
[0091] mvAmgLX=(mvCand0LX+mvCand1LX+1)≫1 For example, a zero-value BV can be set directly as follows:
[0092] Set bvCandList[numCurrCand][0] to 0. (Horizontal component of bv) Set bvCandList[numCurrCand][1] to 0. (Vertical component of bv) As another example, a pair of BVP candidate items located in the IBC reference region can also be designated as proposed candidate items. Referring to Figure 4, which is a schematic diagram showing optional BVP candidate items according to an embodiment of the present invention, the coordinates of a pair of BVP candidate items are determined by the width and height of the current block and the ΔX and ΔY parameters, the reference region is determined in the IBC's reconstructed region, and a pair of proposed candidate items are determined in the reference region as proposed candidate items (shown as A, B, and C in Figure 4).
[0093] Each time an item is added to the block vector candidate list bvCandList, the number of valid items in the candidate list, numCurrCand, increases by 1. The number of valid items in the candidate list, numCurrCand, can be written to the bitstream.
[0094] In summary, through steps S211 to S215, we can complete the establishment of the basic block vector candidate list bvCandList.
[0095] Based on the block vector candidate list bvCandList, if the current block mode is IBC merge mode, a cost calculation can be performed using a template on the order of the block vector candidate list bvCandList, and the candidate items in bvCandList can be reordered to adjust the order of the candidate items in the candidate list. This allows for a reduction in the transmission of encoded bits and an effective improvement in encoding efficiency by making full use of high spatial correlation.
[0096] For example, in IBC merge mode, after constructing an intermediate candidate list (i.e., bvCandList) using the list construction method described above (note that the length of this intermediate candidate list may be greater than or equal to the maximum number of candidates in IBC merge mode), all candidate items in the list are re-sorted using a template, sorted in ascending order of template matching cost, and the first N (e.g., N=6) candidate items of the sorted list are selected.
[0097] Referring to Figure 5, which is a schematic diagram showing the optional template cost calculation according to an embodiment of the present invention, as shown in Figure 5, in IBC merge mode, the SAD of the template position of the reference block pointed to by each candidate item and the template position of the current block are calculated, that is, the cost value between the template (T) of the current block and the reference sample template (RT) of the reference block pointed to by the BV of an IBC merge candidate item is calculated, the cost values corresponding to each reference block are arranged in ascending order, and the first 6 candidate items (N items) are selected as the candidate list for IBC merge.
[0098] Based on the block vector candidate list bvCandList, if the current block mode is IBC ABVP mode, an operation can be performed to remove candidate redundancy based on the distance between candidate items. Specifically, the number of candidates remains at two, and candidate lists are established for integer pixels and 4-pixel precision, respectively.
[0099] If the current block's mode is IBC ABVP mode, and the current block corresponds to a non-RRIBC mode (no inversion), then if there are more than two valid BVP candidates, the maximum of six BVP candidates in the candidate list are clustered based on the Euclidean distance between them, with the radius (R) determined as a logarithmic function of the width (cbWidth) and height (cbHeight) of the current block for a pair of block vectors, and if the Euclidean distance between the reference locations pointed to by some BV candidates is less than R, they are clustered, and here the radius (R) can be determined by equation (2).
[0100] R=log2((cbWidth·cbHeight)≫MIN_PU_SIZE (2) In equation (2), cbWidth represents the current block width, cbHeight represents the current block height, and MIN_PU_SIZE represents the size of the largest prediction unit (PU). Here, the prediction unit PU is equivalent to a candidate item.
[0101] Referring to Figure 6, which is a schematic diagram showing optional candidate item clustering according to an embodiment of the present invention, as shown in Figure 6, when the current block (CB) corresponds to a non-RRIBC mode and there are more than two valid BVP candidates, up to six BVP candidates in the candidate list (shown as BVP1, BVP2, BVP3, BVP4, BVP5, and BVP6 in Figure 6) are clustered based on the Euclidean distance between the reference blocks (PB) corresponding to each BVP. As shown in Figure 6, up to six BVP candidates are grouped based on the distance between the reference blocks (PB) pointed to by each BVP. As shown in Figure 6, if the distance (L2) between the PB pointed to by BVP1 and the PB pointed to by BVP2, and the distance (L2) between the PB pointed to by BVP1 and the PB pointed to by BVP5 are close and both are smaller than the radius R, then the PB pointed to by BVP1, the PB pointed to by BVP2, and the PB pointed to by BVP5 can be clustered and classified into Group 1. If the distance (L2) between the PB pointed to by BVP3 and the PB pointed to by BVP6 is less than the radius R, then the PBs pointed to by BVP3 and BVP6 can be clustered and classified into Group 2. Since the PB pointed to by BVP4 is relatively far from the remaining five PBs, the PB pointed to by BVP4 can be clustered and classified into Group 3.
[0102] The clustering method is performed according to the order of the candidate list. Within each cluster, the BVP with the lowest TM cost is selected as the representative candidate for that pair. Then, all representative candidates for all clusters are sorted by template, and the top two pairs of representative candidates are selected for the motion estimation process.
[0103] As an example, taking the clustering of candidate items shown in Figure 6, first, the cost values of the templates for the PBs pointed to by BVP1, BVP2, and BVP5 in Group 1, and the template of the current block (CB), are calculated and sorted, and the PB with the smallest cost value in Group 1 is selected as the representative candidate item for Group 1. In Group 2, the cost values of the templates for the PBs pointed to by BVP3 and BVP6, and the template of the current block (CB), are calculated and sorted, and the PB with the smallest cost value in Group 2 is selected as the representative candidate item for Group 2. In Group 3, the cost value of the PB pointed to by BVP4 and the template of the current block (CB) is calculated and this is designated as the representative candidate item for Group 3. Next, the representative candidate items for Group 1, Group 2, and Group 3 are sorted, and the top two representative candidate items with the smallest cost values are selected as the final candidate items.
[0104] If the current block mode is IBC ABVP mode, and the current block corresponds to Reconstruction-Reordered IBC (RRIBC), the candidate items can be adjusted to point to the boundaries of a valid IBC search region based on the horizontal or vertical orientation of the RRIBC mode.
[0105] In this context, the inverted IBC mode is a method in which, when BV makes predictions for the current block by specifying a reference block for the symmetry features of some shapes or characters, the reference block is copied in an inverted order of row or column coordinates, and then used as the predicted value.
[0106] For step S22, in IBC merge mode (general_merge_flag[xCb][yCb] is true) and IBC ABVP mode (general_merge_flag[xCb][yCb] is false), the candidate index bvIdx is derived in the following way, where general_merge_flag indicates whether or not it is IBC merge mode, and the above process can be expressed as follows.
[0107] bvIdx=general_merge_flag[xCb][yCb]?merge_idx[xCb][yCb]:bvp_L0_flag[xCb][yCb] Here, the decoder parses the bitstream and, if the general_merge_flag of the current block is true (equal to 1), retrieves the index value of the candidate item for the current block from the bitstream.
[0108] For step S23, in IBC merge mode, a specific bvL can be obtained based on the index bvIdx and the block vector candidate list bvCandList, and the above process can be expressed as follows.
[0109] bvL[0]=bvCandList[bvIdx][0] bvL[1]=bvCandList[bvIdx][1] This bvL will be the final BV.
[0110] If the block is currently in Intra-Block Copy Merge Mode with Block Vector Difference (IBC MBVD), similar to MMVD in VVC's interframe technology, one candidate item from the IBC merge list is used as the starting point, and one candidate item is selected from a predefined set of candidate points corresponding to a set of distances and directions, with the corresponding block vector becoming the final BV. That is, an offset is performed with the current candidate item as the center point to obtain a set of candidate points, and then one candidate item is selected from this set of candidate points as the final BV.
[0111] For example, if the block is currently in IBC MBVD mode, define the distance set as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD directions are two positive and negative horizontal directions and two positive and negative vertical directions.
[0112] The base candidate items are selected from the top five candidate items in the re-sorted IBC merge list, and all possible MBVD refinement positions for each base candidate (i.e., 20 × 4 candidate items) are re-sorted based on the SAD cost between the template and its reference to each refinement position. Finally, the top eight refinement positions with the smallest template SAD are retained for MBVD index coding. IBC-MBVD candidate items do not inherit the inversion type from adjacent blocks coded in RR-IBC. The MBVD index is binarized by a Rice code with a parameter equal to 1.
[0113] Furthermore, in IBC merge mode, after obtaining bvL based on the above information, local refinement is performed on BV using TM. Specifically, a search is performed within a narrow range centered on the obtained bvL, and the optimal BV within that range is selected as the final BV based on the criterion of minimizing the template matching cost. In other words, local refinement is performed on each of the eight candidate items (bvL) obtained, and the optimal BV within the local range of that candidate item is obtained as the final BV.
[0114] As an example, let's consider performing TM refinement on candidate items in the IBC merge mode candidate list. One specific implementation process is as follows:
[0115] When constructing candidate items, the inversion type will be set to "no inversion" by default.
[0116] In IBC TM merge mode, this specifies whether the transmitted syntactic elements undergo integer pixel-precision TM refinement. Both the refinement motion vector and the template position used in each refinement step must adhere to the reference area constraints.
[0117] The search is performed in the vicinity of the location pointed to by the candidate item, and the optimal position is determined by the size of the SAD between the template of the reference block and the template of the current block. The search methods include, but are not limited to, the following. The search range is set to [-8,8], and first, as shown in the upper left corner of the diagram below, a diamond search of integer pixels is performed to find 8 points in the vicinity of the center position. The maximum number of searches is 375, and the search continues even after the first optimal position is determined, with subsequent search processes finding 5 points at even positions and 3 points at odd positions.
[0118] For illustrative purposes, referring to Figure 7a, which is schematic diagram 1 showing the flow of the arbitrarily selected candidate item search according to an embodiment of the present invention, and as shown in Figure 7a, if the initially determined optimal position (shown as a grid circle in Figure 7a) is an even-numbered point, the five points shown as black dots in Figure 7a are then searched. Referring to Figure 7b, which is schematic diagram 2 showing the flow of the arbitrarily selected candidate item search according to an embodiment of the present invention, and as shown in Figure 7b, if the initially determined optimal position (shown as a grid circle in Figure 7a) is an odd-numbered point, the three points shown as black dots in Figure 7b are then searched. After the above diamond-shaped search process, a cross search of integer pixels is performed only once, that is, after the current optimal position is found by the diamond-shaped search, four positions located one pixel point away from the current optimal position—below, to the right, above, and to the left—are checked to update the final optimal position, that is, the refined candidate list is updated.
[0119] Currently, when a block is in IBC ABVP mode, the predicted bvL is obtained using the index bvIdx and the block vector candidate list bvCandList. The true bvL needs to be further calculated by adding the block vector difference (BVD), and this generalized specific process includes steps S31 to S33.
[0120] In step S31, the horizontal and vertical components of BVD are obtained, where MvdL0 is the difference in the forward motion vector. The above process can be expressed as follows:
[0121] bvd[0]=MvdL0[xCb][yCb][0] bvd[1]=MvdL0[xCb][yCb][1] In step S32, a rounding operation is performed on the predicted bvL obtained above, where the right shift parameter AmvrShift is used for rounding and the left shift parameter AmvrShift is used to improve the resolution. The above process can be expressed as follows:
[0122] offset=(AmvrShift==0)?0:((1≪(AmvrShift-1))-1) bvL[0]=Sign(bvL[0])* (((Abs(bvL[0])+offset)≫AmvrShift)≪AmvrShift) bvL[1]=Sign(bvL[1])* (((Abs(bvL[1])+offset)≫AmvrShift)≪AmvrShift) In step S33, for the true bvL, its range is from -217 to 217. -1 It needs to be kept within that range, which can be derived as follows.
[0123] u[0]=(bvL[0]+bvd[0]+218)%218 bvL[0]=(u[0]≧217)?(u[0]-218):u[0] u[1]=(bvL[1]+bvd[1]+218)%218 bvL[1]=(u[1]≧217)?(u[1]-218):u[1] Referring to Figure 8, which is a schematic diagram showing the optional block vector determination according to an embodiment of the present invention, as shown in Figure 8, after obtaining the horizontal and vertical components of the BVD of the current PU, the final BV is determined based on the BVP and BVD corresponding to the current PU.
[0124] Furthermore, the method for obtaining the BVD in step S31 can also be derived from syntactic elements obtained by other encoding methods. The BVD of IBC ABVP uses subpixels, integer pixels, or 4 pixels as units. During encoding, the code can be predicted, and the suffix of the exponential Golomb code obtained after binarization can also be predicted. Therefore, the syntactic elements can be defined by multiple pieces of information obtained from the BVD value: a flag of 0 or not, a prefix, a code, and a suffix. The actual value of the BVD can be obtained by analyzing the combination of this information.
[0125] In one specific example, the identifier for whether BVD is 0 or not employs context coding. Values (absolute value -1) are binarized using a first-order exponential Golomb, the first five bins of the EG1 prefix are context coded, and the remaining prefixes are bypass coded. Up to four bins of the EG1 suffix transmit the predicted index using context coding, while the other bins of the EG1 suffix employ bypass coding. Two bins of the sign bit transmit the sign predicted index using context coding. The predictions for one suffix bin transmitting the predicted index for both the horizontal and vertical directions, and one bin transmitting the sign index for both the horizontal and vertical directions, are sorted using the current block template and the corresponding BV template to derive the suffix and sign predicted indices.
[0126] The final derived BV must fall within the specified range (a coordinate range based on rows and columns).
[0127] For example, in a VVC, the reference area of the IBC is 128x128, and for a CTU of 128x128 size, the reference area can refer to Figures 9a to 9d. Figure 9a is schematic diagram 1 showing an optional IBC reference area according to an embodiment of the present application. As shown in Figure 9a, the reference blocks in the reference area of the current block may include three reference blocks in the shaded area, of which one block marked with an "x" is not a reference block. Figure 9b is schematic diagram 2 showing an optional IBC reference area according to an embodiment of the present application. As shown in Figure 9b, the reference blocks in the reference area of the current block may include three reference blocks in the shaded area, of which two blocks marked with an "x" are not reference blocks. Figure 9c is schematic diagram 3 showing an optional IBC reference area according to an embodiment of the present application. As shown in Figure 9c, the reference blocks in the reference area of the current block may include three reference blocks in the shaded area, of which three blocks marked with an "x" are not reference blocks. Figure 9d is a schematic diagram of an optional IBC reference region according to an embodiment of the present application. As shown in Figure 9d, the reference blocks in the reference region of the current block may include the three shaded reference blocks, of which the four blocks marked with an "x" are not considered reference blocks.
[0128] Exemplary, in ECM7.0, if the size of the CTU is 128, the reference region of the IBC can refer to Figure 10, where, as shown in Figure 10, one rectangle represents one CTU, a mesh rectangle represents the CTU where the current block is located, and a black dot rectangle represents its reference region. Specifically, assuming that the current block to be encoded is located at CTU(m,n), the reference region includes CTUs with indices (m-2,n-2)…(W,n-2)…(0,n-1)…(W,n-1), (0,n)…(m,n), where W represents the largest horizontal index in the current Tile, Slice, or Picture.
[0129] For example, if the size of the CTU is 256, the reference area of the IBC can refer to Figure 11, and as shown in Figure 11, the reference area is adjusted so that one rectangle represents one CTU, the mesh rectangle represents the CTU where the block is currently located, and the black dot rectangle represents its reference area.
[0130] The range over which each block performs a block vector search (or local search) is limited to horizontal [-(C≪1),C≫2] and vertical [-C,C≫2] to accommodate the expansion of the reference domain, where C represents the CTU size.
[0131] The above describes how to obtain luminance BV in IBC-related modes. In contrast, in IntraTMP mode, the input and output for obtaining luminance BV are basically the same, but the specific method differs, the main difference being that the search process is performed on the decoding side.
[0132] Referring to Figure 12, which is a schematic diagram showing the prediction process of an arbitrarily selected Intra TMP according to an embodiment of the present invention, as shown in Figure 12, in Intra TMP mode, the decoding side searches within a certain range near the zero value BV and finds the optimal BV (BV_best) based on the minimum template matching cost, or constructs an optimal BV list. The zero value BV is the current block, and the decoder aims to minimize the template matching cost, searches within a certain range near the current block, obtains a reference frame (Ref Block) corresponding to the optimal template (T-BEST) with the minimum template matching cost, and takes the optimal BV (BV-BEST) corresponding to the reference frame as the final BV.
[0133] Referring to Figure 13, which is a schematic diagram showing an optional template search region according to an embodiment of the present invention, the dashed rectangle represents the searchable region of the template, the rectangle in the center of the dashed rectangle is the current block, and as can be seen from this, the searchable region of the template in the current block is a square region, and compared with the reference region of IBC mode shown in Figures 10 and 11, the reference region of Intra TMP mode shown in Figure 13 is closer to a square, while the reference region of IBC mode exhibits an elongated characteristic.
[0134] Referring to Figure 14, which is a schematic diagram showing the prediction flow of an optional IntraTMP mode according to an embodiment of the present invention, the prediction flow of the IntraTMP mode includes steps S41 to S43, as shown in Figure 14.
[0135] In step S41, the current template type is determined.
[0136] In step S42, the current template pixel is obtained.
[0137] In step S43, a block vector is determined within a predefined search range.
[0138] In IntraTMP mode, the template type is first obtained, then template pixels are obtained around the current block based on that type, and a search is performed within a predefined search range. When the final BV is determined directly by the template matching cost, the item with the minimum template matching cost becomes the final BV. When a list of BV candidates is established by the template matching cost, the list stores multiple BV candidates in ascending order of template matching cost, and the final BV candidate to be selected is determined by the corresponding syntactic element in the bitstream. This BV candidate becomes the final BV.
[0139] (2) Chromaticity component: In the IBC mode or IntraTMP mode of the chromaticity component, the chromaticity BV can be derived based on the luminance BV, and prediction and reconstruction can be performed based on this BV. The process for deriving the chromaticity BV based on the luminance BV is as follows:
[0140] Input: Brightness bvL (1 / 16 pixel precision) Output: Chromaticity bvC (Block Vector Chroma) (1 / 32 pixel precision) The derivation process may involve direct scaling or refinement using TM after scaling. An example of a scaling operation is as follows:
[0141] bvC[0]=((bvL[0]≫(3+SubWidthC))*32) bvC[1]=((bvL[1]≫(3+SubHeightC))*32) The variables SubWidthC and SubHeightC specifically depend on the chromaticity format sampling structure specified by sps_chroma_format_idc, and Table 1 shows the correspondence between the chromaticity format sampling structures, with the specific correspondences being as follows.
[0142] [Table 1]
[0143] The refinement operation may also be carried out in the following manner.
[0144] Referring to Figure 15, which is a schematic diagram showing the refinement flow of an optional IntraTMP mode according to an embodiment of the present invention, as shown in Figure 15, the current block employs TM template matching to perform refinement, that is, after obtaining the luminance BV, the offset position is found using the position and BV of the chromaticity block, and refinement is performed near the offset position using the template to obtain the optimal BV (refined BV) based on the criterion that the TMcost is minimized.
[0145] Step S12 (Acquisition of prediction samples using BV) is described in detail below.
[0146] Input: A luminance position (xCb, yCb) specifying the top-left corner sample of the current encoded block relative to the top-left corner luminance sample of the current image, a variable cbWidth specifying the width of the current encoded block within the luminance sample, a variable cbHeight specifying the height of the current encoded block within the luminance sample, a block vector bv, and a variable cIdx specifying the color component index of the current block.
[0147] Output: Predicted sample sequence predSamples.
[0148] An example of a derivation process for obtaining a predicted block by direct copying is as follows:
[0149] When cIdx is 0, i.e., for the luminance component, the following holds for x = xCb..xCb + cbWidth-1 and y = yCb..yCb + cbHeight-1.
[0150] xVb=(x+(bvL[0]≫4))&(IbcBufWidthY-1) / / Return to integer pixel precision position of the component yVb=(y+(bvL[1]≫4))&(CtbSizeY-1) predSamples[x][y]=ibcVirBuf[0][xVb][yVb] / / Predicted value of one pixel point IbcBufWidthY is the width of the luminance pixels in the reconstructed buffer stored in the IBC, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconstructed pixel stored in the IBC.
[0151] When cIdx is not 0, i.e., in the case of the chromaticity component, for x = xCb / SubWidthC..xCb / SubWidthC + cbWidth / SubWidthC-1 and y = yCb / SubHeightC..yCb / SubHeightC + cbHeight / SubHeightC-1, the following holds:
[0152] xVb=(x+(bvC[0]≫4))&(IbcBufWidthC-1) yVb=(y+(bvC[1]≫4))&((CtbSizeY / subHeightC)-1) predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb] In addition to the basic acquisition methods described above, there is an IBC inversion mode, which requires a method to obtain the predicted value after horizontally or vertically inverting the prediction region. For example, one syntax element indicates whether or not to invert, and if so, whether to horizontally or vertically invert. The decoding side obtains the predicted pixel value of the encoded block by rearranging the reference region pixels in reverse order horizontally or vertically based on the instructions of the syntax.
[0153] In addition to the acquisition process described above, it is also possible to use templates to establish a model between the current block and the predicted region, process the predicted block based on the model, and then obtain the predicted value of the current block. For example, the IBC LIC mode is applied to IBC merge and IBC ABVP and compensates for local illumination changes using a linear equation. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed in terms of a scaling parameter α and an offset parameter β, i.e., α*p[x]+β compensates for illumination changes, where p[x] is the reference sample pointed to by the BV at position x in the current image. The linear model parameters are derived using the least squares method.
[0154] Based on the predicted values obtained above, a weighted prediction can be performed using other intra-prediction methods, and the result after weighted prediction can be used as the final prediction result.
[0155] The weighted prediction method includes a method that weights and combines the results obtained by the above prediction process at each pixel position with the prediction results obtained by the normal intra-directional prediction mode, based on VVC's inter / intra composite prediction (CIIP). Furthermore, it also includes a method that, based on VVC's inter-geometric prediction mode (GPM), uses a single wedge division as a basis, uses results obtained by different prediction modes in different wedge regions, and performs weighted mixing according to a certain rule near the wedge division line.
[0156] An example of the operation process in IBC CIIP mode: The IBC prediction value of the current block and the prediction value of a certain intra-mode are weighted and merged, and the normal merge, TM merge, MBVD, and ABVP modes can be applied to the IBC prediction portion.
[0157] If the IBC prediction portion is in the normal IBC merge, TM merge, or MBVD mode, the weight ratio of IBC prediction to intra prediction is 13:3. The intra mode includes the TIMD mode of the current block and the intra prediction mode in the candidate BV. If the second prediction mode of the intra mode is the same as the first prediction mode, it is determined whether the first prediction mode is in PLANAR mode. If so, the second prediction mode is replaced with the horizontal prediction mode; otherwise, the second prediction mode is replaced with PLANAR mode.
[0158] If the IBC prediction portion is in ABVP mode, the weight ratio between IBC prediction and intra prediction is 1:1. The TIMD mode is obtained as the first prediction mode of the intra prediction mode. If the derived prediction mode is the horizontal prediction mode, PLANAR is obtained as the second prediction mode of the intra prediction mode; otherwise, the horizontal prediction mode is obtained as the second prediction mode of the intra prediction mode.
[0159] An example of the operation process in IBC GPM mode: Normal merge and TM merge can be applied to the IBC prediction portion. Only a mode is created where one partition is IBC and one partition is INTRA, and the intra-prediction mode (IPM) candidate list is constructed using the same method as inter-frame GPM, with the size of the IPM candidate list predefined as 3.
[0160] In practical implementation, there are a total of 48 geometric partitioning modes, which can be divided into two sets of geometric partitioning modes. Table 2 shows the first geometric partitioning model set, and Table 3 shows the second geometric partitioning model set.
[0161] [Table 2]
[0162] [Table 3]
[0163] When using IBC GPM, transmit the IBC GPM geometric partition mode set flag to indicate whether the first or second geometric partition mode set is selected, followed by the geometric partition mode index. Then, transmit the partition flag within the IBC-GPM frame to indicate whether intra-prediction is used for the first subpartition. Here, the intra-prediction portion must transmit the intra-prediction mode index, and the IBC prediction portion must transmit the MERGE index.
[0164] In IntraTMP mode, in addition to obtaining predicted values using the basic copy method, there are methods to obtain predicted values by filtering and fusing using the corresponding positions of multiple BVs, and methods to perform fused prediction with the normal Intra mode.
[0165] For example, the decoding side obtains a list of BV candidates using template matching in the region search process, then selects the first N items (e.g., N=3) from that list and performs weighted fusion. This method is also known as IntraTMP Fusion mode.
[0166] Alternatively, after obtaining one optimal BV, multiple points are acquired around that BV, and weighted fusion of these points against their corresponding predicted values is performed to obtain the predicted values. This method is also known as IntraTMP FLM mode.
[0167] Alternatively, after obtaining one optimal BV, the predicted value obtained using that BV is weighted and combined with the predicted value obtained in a normal Intra mode, such as Planar mode or Directional mode (the Directional mode may be derived by TIMD or obtained by identifying it in the Intra candidate list using an Index transmitted in a bitstream) to obtain the predicted value. This method is also called IntraTMP CIIP mode.
[0168] Referring to Figure 16, Figure 16 is a schematic diagram showing the search flow for an optional Intra TMP Fusion mode according to an embodiment of the present invention, and as shown in Figure 16, the search flow for an Intra TMP Fusion mode includes steps S51 to S53.
[0169] In step S51, initialization is performed.
[0170] In step S52, the search area for templates in the current frame is determined.
[0171] In step S53, a search is performed within the search area to determine the block vectors corresponding to the N matching templates.
[0172] In IntraTMP Fusion mode, the Intra TMP Fusion technique performs a search within the search domain and determines block vectors corresponding to N matching templates.
[0173] Furthermore, referring to Figure 17, which is a schematic diagram 2 showing the search flow for an optional Intra TMP Fusion mode according to an embodiment of the present application, and as shown in Figure 17, step S53 includes steps S531 to S532.
[0174] In step S531, the value of the number of candidate templates N is determined.
[0175] Intra TMP Fusion technology first requires determining the value of N, where N may be an artificially set constant, for example, N = 4. N can be any integer within a certain numerical range, for example, N = any integer in [2,8]. The range of N values is artificially set in advance, and the encoding side can determine the optimal N value using methods such as coarse selection by cost 1, coarse selection by cost 2, coarse selection by cost 3, or fine selection by cost 4, and transmit the optimal N value to the decoding side in bitstream format. Here, each of the cost 1, 2, 3, and 4 items may be one of the cost functions for evaluating the mode, such as SAD, SATD, MSE, MAD, or RDO.
[0176] In step S532, the comparison criteria for the matching templates are determined, and the block vectors BV corresponding to the N matching templates are recorded.
[0177] After determining the number of candidate templates N, it is necessary to select block vectors BV corresponding to the N candidate templates that best match using some comparison criteria.
[0178] The operation of searching for matching templates and recording block vectors BV here is similar to the operation of Intra TMP in the existing techniques described above. The difference is that Intra TMP Fusion selects and records multiple block vectors BVn based on this operation, obtains matching templates based on the block vectors BVn, i.e., based on the template offset amounts pXn and pYn, then calculates the template matching cost, records the BVs corresponding to N matching templates with relatively low costs, and here we refer to these N matching templates as candidate templates.
[0179] Here, the template matching cost may be one of the cost functions used to evaluate the mode, such as SAD, SATD, MSE, MAD, RDO, or correlation coefficient.
[0180] The matching cost comparison criterion adopted by this scheme is the Mean Absolute Difference (MAD), and its calculation formula is as follows:
[0181]
number
[0182] In the Intra TMP Fusion technology of the present invention, after obtaining block vectors BV corresponding to N candidate templates, N candidate reconstructed blocks are obtained via the BV, and then weighted fusion is performed on the N candidate reconstructed blocks to obtain a predicted block for the current encoded block. Referring to Figure 18, Figure 18 is a schematic diagram showing the predicted value determination flow of an arbitrarily selected Intra TMP Fusion mode according to an embodiment of the present invention, and as shown in Figure 18, the predicted value determination flow of the Intra TMP Fusion mode includes steps S61 to S63.
[0183] In step S61, N candidate reconstruction blocks are obtained.
[0184] After obtaining the block vector BV corresponding to the N candidate templates, based on BV n the candidate reconstruction block RefBlock n is obtained directly from the current image, where the horizontal offset amount of BV n is pX n and the vertical offset amount is pY n , and n = 0, 1,..., N - 1.
[0185] It is realized by simple translational copy. The specific operation is as follows for x = 0...nTbW - 1, y = 0...nTbH - 1.
[0186] RefBlock n [x][y] = recSamples[x + pXn][y + pYn] Here, recSamples represents the reconstructed pixels of the current frame.
[0187] In step S62, the weights of weighted fusion are determined.
[0188] After obtaining the N candidate reconstruction blocks RefBlock, it is necessary to calculate the weights W of the weighted fusion of the N candidate reconstruction blocks. The weights may be predefined fixed values, or values adaptively calculated using cost values, pixel values, etc.
[0189] In the Intra TMP Fusion technology in the embodiments of the present application, the weights of weighted fusion are derived by minimizing the MSE using the reconstruction values of the candidate template refT n and the pixel values of the template refpredT n to be predicted.
[0190] Specifically, the MSE minimization process takes the autocorrelation matrix of the first P matching reference samples refT and the cross-correlation vector between the first P matching reference samples refT and the adjacent template sample curT of the current coded block as input, and outputs the weight of the reconstructed block corresponding to each matching reference item.
[0191] In step S63, predicted values are generated by weighted fusion.
[0192] The predicted block is calculated based on each candidate reconstruction block and its corresponding weighted fusion weight. Specifically, the current predicted block (i.e., weighted prediction) is obtained by multiplying the value of each candidate reconstruction block by its corresponding weight and adding the results together. The calculation formula is as follows:
[0193] For x=0…nTbW-1 and y=0…nTbH-1, the formula for calculating the predicted value is as follows:
[0194]
number
[0195] In IntraTMP FLM mode, a linear filtering model is established using the optimal matching template found in the above steps and the current coded block template. This mainly involves two processes: determining the reconstruction region for calculating the filter coefficients, and calculating the filter coefficients.
[0196] The number of filter taps is defined as nTap. nTap may be a constant or a variable, for example, the number of filter taps can be dynamically adjusted based on the size of the block. Referring to Figures 19a to 19f, these are schematic diagrams showing six fixed-shape structures of an optional filter according to an embodiment of the present invention, and in the embodiment of the present invention, various filter shapes can be selected.
[0197] Based on the template type refTemplateType, the available reconstructed pixels are determined. Based on the available reconstructed pixels, the reconstruction region for calculating the filter coefficients is determined, and this region is called R. R usually includes all available reconstructed pixels in the template. Within the R region, the filter coefficients are derived by minimizing the MSE.
[0198] Each currently encoded block can be obtained using the above method, and the set of filter coefficients is c0, c1, c2, ..., c nTap-1 Next, based on the filter shape and filter coefficients, the optimal matching reconstruction block is filtered, that is, weighted addition is performed on the filter coefficients and the reference pixels at the corresponding positions to obtain the currently predicted pixel. Ref is defined as the optimal matching reconstruction block, as follows.
[0199]
number
[0200] The specific calculation process for the predicted values is as follows:
[0201] Assuming the filter has 5 taps (nTap), the shape of the filter is as shown in the left figure below, where c0 to c4 are the respective tap coefficients of the filter, and tap coefficient C0 corresponds to the yellow dot, and the currently predicted pixel Y pred [i][j] are the reconstructed pixels ref[i][j] of the corresponding positions in the optimal matching block, and the remaining brown dots are the reconstructed pixels adjacent to the current spatial position in the optimal matching reconstruction block. Referring to Figure 20, Figure 20 is a schematic diagram showing an arbitrarily selected TM-FLM prediction according to an embodiment of the present invention, and as shown in Figure 20, the dots in the prediction block are the obtained prediction pixels Y pred [i][j]
[0202] The specific calculation process for the predicted values is as follows:
[0203] For each currently predicted pixel (i,j), if we define the pixel position in the filter template as (k,l), then we define the corresponding reconstructed pixel of the optimal matching block during filtering as ref[i+k][j+l], and each filter coefficient at the (k,l) position in the filter template as c k,l This is how it is defined.
[0204] c k,l =c n (6) Here, n=0,...,nTap-1, and k and l are in the range from -1 to 1.
[0205] For i=0,…,nTbW-1 and j=0,…,nTbH-1, the following holds true.
[0206]
number
[0207]
number
number
[0208] The decoding method proposed in the embodiment of this application, combined with the intra-prediction portion, will be described in detail below.
[0209] The embodiments of the present application provide a decoding method, and with reference to Figure 21, an exemplary flowchart of an optional decoding method according to the embodiments of the present application is shown. As shown in Figure 21, the method may include the following steps.
[0210] In step S101, the bitstream is decoded and the prediction mode of the current block is determined.
[0211] The decoding method in the embodiment of this application is applied to a decoder. Furthermore, the decoding method may be a video intra-prediction method or a decoding method based on intra-block copy mode, and mainly improves upon intra-prediction algorithms in related technologies. It can avoid the problem of overlapping candidate BV ranges corresponding to the current block that can occur in the processes of video decoding based on IBC mode and video decoding based on non-IBC mode, thereby achieving a better intra-prediction effect and improving video decoding efficiency.
[0212] In the embodiments of this invention, the prediction mode based on intrablock copying is a block-level coding-decoding mode, and, similar to interframe techniques, the coding side performs motion search to find the optimal block vector (BV) for each coded block, where motion search can be understood as block matching, and the block vector is also called a motion vector (MV). The block vector is a vector that points from the current block to a reference block. The difference from interframe techniques is that the optimal block vector in IBC is obtained by searching in the reconstruction region of the frame in which the current coded block is located (i.e., the current coded frame), whereas the motion vector in interframe is obtained by searching in the adjacent reference frame in the time domain of the current coded frame.
[0213] In embodiments of the present invention, the decoder analyzes the bitstream and determines a first syntactic identifier, which is used to indicate whether the current block uses an intrablock copy (IBC) based predictive mode.
[0214] For example, the first syntactic identifier can be represented using pred_mode_ibc_flag.
[0215] In embodiments of the present application, if the first syntactic identifier is a first value, it is determined that the first syntactic identifier indicates that the current block uses an intrablock copy-based predictive mode; if the first syntactic identifier is a second value, it is determined that the first syntactic identifier indicates that the current block does not use an intrablock copy-based predictive mode.
[0216] In the embodiments of this application, the first and second values are different, and the first and second values may be in parameter form or numerical form. Specifically, the first syntactic identification information may be a parameter written in the profile or a flag value, and is not specifically limited here.
[0217] Exemplarily, for the first value and the second value, the first value may be set to 1 and the second value may be set to 0, or the first value may be set to 0 and the second value may be set to 1, or the first value may be set to true and the second value may be set to false, or the first value may be set to false and the second value may be set to true, but it is not specifically limited here.
[0218] Exemplarily, when pred_mode_ibc_flag is true or 1, it is determined that the current block uses a prediction mode based on intra-block copy.
[0219] In the embodiments of the present application, taking the flag written into the bitstream as an example, assuming that the first value is 0 (false) and the second value is 1 (true), when the value of the first syntax identification information is 0 (false), it can be determined that the current block uses a prediction mode based on intra-block copy, that is, there is no need to execute the decoding method described in the embodiments of the present application. When the value of the first syntax identification information is 1 (true), it can be determined that the current block does not use a prediction mode based on intra-block copy, and it is necessary to execute the decoding method described in the embodiments of the present application. <s>0000897< / s>
[0220] Note that the embodiments of the present application do not limit the expression forms of the first value and the second value.
[0221] In the embodiments of the present application, when the first syntax identification information indicates that the current block uses a prediction mode based on intra-block copy, the bitstream is analyzed to determine the second syntax identification information. Here, the second syntax identification information is used to indicate whether the current block uses a prediction mode based on intra-block merge (IBC merge).
[0222] Exemplarily, the second syntax identification information can be represented using general_merge_flag.
[0223] In embodiments of the present application, if the second syntactic identifier is a third value, it is determined that the second syntactic identifier indicates that the current block uses an intrablock merge-based predictive mode, and if the second syntactic identifier is a fourth value, it is determined that the second syntactic identifier indicates that the current block does not use an intrablock merge-based predictive mode.
[0224] In the embodiments of this application, the third and fourth values are different, and the third and fourth values may be in parameter form or numerical form. Specifically, the first syntactic identification information may be a parameter written in the profile or a flag value, and is not specifically limited here.
[0225] For example, regarding the third and fourth values, the third value may be set to 1 and the fourth value to 0, or the third value may be set to 0 and the fourth value to 1, or the third value may be set to true and the fourth value to false, or the third value may be set to false and the fourth value to true, but we will not specifically limit ourselves to these here.
[0226] In the embodiments of the present application, assuming that the flag written to the bitstream has a third value of 1 (true) and a fourth value of 0 (false), if the value of the second syntactic identifier is 0 (false), it can be determined that the current block does not use the predictive mode based on intrablock merging, and that is, it is not necessary to perform the decoding method described in the embodiments of the present application. If the value of the second syntactic identifier is 1 (true), it can be determined that the current block uses the predictive mode based on intrablock merging, and it is necessary to perform the decoding method described in the embodiments of the present application.
[0227] For example, if general_merge_flag is true or 1, the current block decides to use predictive mode based on intra-block merging.
[0228] Furthermore, the embodiments of this application do not limit the expression format of the third and fourth values.
[0229] Here, the prediction mode indicated by the second syntax identification information can be the prediction mode of the current block.
[0230] In step S102, if the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, then the first block vector candidate list for the current block is determined.
[0231] In embodiments of the present invention, a first block vector candidate list (merge list) for the current block is determined when the second syntactic identification information (prediction mode of the current block) indicates that the current block uses a prediction mode based on intra-block merging. In other words, if the decoder parses the prediction mode of the current block to be a mode based on intra-block merging, the decoder needs to construct a first block vector candidate list for the current block.
[0232] For example, in IBC mode, the process of obtaining the bvL (luminance block vector) of the current block requires establishing a block vector candidate list bvCandList (i.e., the first block vector candidate list), which contains multiple candidate items.
[0233] In the embodiments of the present invention, the first block vector candidate list includes Q first candidate block vectors, where Q is a positive integer greater than or equal to 1.
[0234] Note that the number of block vectors (i.e., the number of first candidate block vectors) in the block vector candidate list bvCandList (first block vector candidate list) for different modes may differ. For example, the first block vector candidate list for IBC merge mode may contain 6 first candidate block vectors, while the first block vector candidate list for IBC ABVP mode may contain 2 first candidate block vectors. Of course, in the embodiments of this application, the number of first candidate block vectors that the first block vector candidate list may contain may be Q, where Q is a positive integer greater than or equal to 1. The number of first candidate block vectors Q is set in advance, and the decoder and encoder agree or specify in advance the value of N corresponding to the number of first candidate block vectors corresponding to the current block. For example, if the decoder and encoder agree or specify that the value of N corresponding to the number of first candidate block vectors corresponding to the current block is 8, then in the process of encoding or decoding the current block, the number of candidate items included in the first block vector candidate list established by the decoder or encoder will be 8.
[0235] Furthermore, determining the current block's first block vector candidate list may include deriving spatial domain candidate items, adding the spatial domain candidate items to the candidate list, checking the number of valid items in the candidate list after adding the spatial domain candidate items to the candidate list, continuing the deriving, availability detection, and addition of historical candidate items if the candidate list has not reached the specified number of items, continuing the check of the number of valid items in the candidate list and adding other available candidate items until the specified number of items is reached, thereby obtaining the current block's first block vector candidate list. The step of determining the current block's first block vector candidate list can be described by referring to steps S211 to S215 described above and will not be repeated here.
[0236] In step S103, the first region range is determined, and the second block vector candidate list is determined based on the first block vector candidate list and the first region range.
[0237] In the embodiment of the present invention, the decoder removes block vectors belonging to the first region range from the first block vector candidate list to obtain a second block vector candidate list.
[0238] In embodiments of the present invention, if the second syntactic identification information indicates that the current block uses a predictive mode based on intrablock merging, the decoder removes block vectors belonging to a first region range in the current frame in which the current block is located, based on each first candidate block vector in the first block vector candidate list, thereby obtaining a second block vector candidate list.
[0239] In some embodiments of the present application, the first region range includes, but is not limited to, the size of the current coded tree unit, the size of the reconstructed region in the current frame, the size of the image boundary of the current block, and the search range of the Intra TMP mode.
[0240] The above-mentioned first region range is merely an example; the first region range may be any one of the above, or a combination of multiple first region ranges, and the decoder can first determine the first region range. This invention is not limited to this.
[0241] As can be understood, when the first region range is the search range of the Intra TMP mode, the decoder removes the block vectors within the search range of the Intra TMP mode based on the first block vector candidate list, and obtains the final second block vector candidate list. At this time, since there are no block vectors within the search range of the Intra TMP mode in the second block vector candidate list, there are no block vectors in the candidate list corresponding to the Intra TMP mode in the second block vector candidate list. Thereby, the problem of overlapping block vectors represented in the candidate lists of the IBC mode and the Intra TMP mode can be effectively avoided, thereby saving bits in the bitstream and ultimately improving the decoding efficiency of the video.
[0242] As can be understood, since there are no overlapping block vectors in the second block vector candidate list and the candidate list corresponding to the Intra TMP mode, when using the same bitstream, the embodiments of the present application can improve the diversity of block vectors and ultimately improve the decoding efficiency of the video.
[0243] Exemplarily, in the embodiments of the present application, when removing the block vectors belonging to the search range of the Intra TMP mode based on the first block vector candidate list to obtain the second block vector candidate list, the BV information redundantly represented between different modes can be removed, improving the expression efficiency of the header information, and thereby improving the overall decoding efficiency of the video.
[0244] In step S104, based on the second block vector candidate list, determine the predicted value of the current block.
[0245] In the embodiments of the present application, after determining the second block vector candidate list, the decoder determines the predicted value of the current block based on the second block vector candidate list.
[0246] In some embodiments of the present application, step S104 is: Decode the bitstream to determine the extended candidate block vector index information, Based on the extended candidate block vector index information and the second block vector candidate list, the first block vector is determined, This may include determining the reference block of the current block based on the first block vector, and determining the predicted value of the current block based on the reference block.
[0247] In the embodiments of the present invention, the decoder can determine the extension candidate block vector index information of the current block by analyzing the bitstream.
[0248] In the embodiments of the present invention, the extended candidate block vector index information may be a unique identifier for the first block vector in the second block vector candidate list.
[0249] In the embodiments of the present invention, the extended candidate block vector index information may be a pre-set index value of a block vector. That is, the extended candidate block vector index information is a block vector index value that is predetermined or agreed upon in both the encoder and the decoder.
[0250] In the embodiments of the present invention, each block vector included in the second block vector candidate list has unique index information.
[0251] In the embodiments of this application, the extended candidate block vector index information may be a parameter written to the profile, or it may be the value of a flag, and is not specifically limited to these.
[0252] Exemplary, the extended candidate block vector index information can be represented using a numerical format. For example, extended candidate block vector index information 0 can represent the first block vector in the second block vector candidate list, and the extended candidate block vector index information may also be represented in a different numerical base format, and the present application is not limited thereto.
[0253] In the embodiments of the present invention, the decoder determines a first block vector from a second block vector candidate list based on the extended candidate block vector index information of the current block, then uses the decoded block pointed to by the first block vector as the reference block of the current block, and determines the predicted value of the current block based on the reference block.
[0254] In some embodiments of this application, the method is Decode the bitstream and determine the predicted difference value of the current block, This further includes determining the reconstructed value of the current block based on the predicted value of the current block and the predicted difference value of the current block.
[0255] In the embodiments of this invention, if the current block has a predicted residual, the decoder determines the predicted residual of the current block by analyzing the bitstream, and performs weighting or other processing on the predicted value and the predicted difference value of the current block to obtain the reconstructed value of the current block. If the current block does not have a predicted residual, the decoder directly uses the predicted value of the current block as the reconstructed value of the current block.
[0256] In the embodiments of the present invention, the decoder first analyzes the bitstream to determine a first syntactic identifier, then determines a second syntactic identifier if the first syntactic identifier indicates that the current block uses a prediction mode based on intrablock copying, and determines a first block vector candidate list for the current block if the second syntactic identifier indicates that the current block uses a prediction mode based on intrablock merging. Subsequently, the decoder removes block vectors belonging to a first region range from the first block vector candidate list to obtain a second block vector candidate list, and finally, the decoder determines the predicted value of the current block based on the second block vector candidate list.
[0257] One aspect is that, when the decoder removes block vectors within the first region range based on the first block vector candidate list to obtain the final second block vector candidate list, the second block vector candidate list does not contain any block vectors within the first region range. This effectively avoids the problem of overlap between the IBC mode candidate list and the block vectors represented in the first region range, thereby saving bits in the bitstream and improving video decoding efficiency. Another aspect is that, since there are no overlapping block vectors between the second block vector candidate list and the first region range, when using the same bitstream, the embodiment of this application can improve the diversity of block vectors and thus improve video decoding efficiency. Yet another aspect is that, because the second block vector candidate list effectively removes block vector information within the first region range, it improves the efficiency of header information representation in the bitstream, thereby improving overall video decoding efficiency.
[0258] In some embodiments of this application, step S103 includes steps S1031 to S1033.
[0259] In step S1031, if it is determined that the current block uses a prediction mode based on IBC MBVD, the candidate block vector index information is determined.
[0260] In the embodiments of this invention, if the current block uses a prediction mode based on IBC MBVD, the decoder determines candidate block vector index information corresponding to the current block by analyzing the bitstream.
[0261] In the embodiments of the present invention, candidate block vector index information is used to indicate the first candidate block vector (basic candidate item) in the first block vector candidate list.
[0262] For example, in the IBC MBVD mode, let's assume the first block vector candidate list contains eight candidate items, and the first five of these eight candidate items are designated as the basic candidate items. The decoder analyzes the bitstream to obtain the candidate block vector index information for these five first candidate block vectors, and then, based on this candidate block vector index information, obtains the five first candidate block vectors indicated by the candidate block vector index information from the first block vector candidate list.
[0263] In step S1032, based on the first block vector candidate list, at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is determined.
[0264] In the embodiments of the present invention, after determining a first candidate block vector indicated by candidate block vector index information based on a first block vector candidate list, the decoder determines at least one first extended candidate block vector corresponding to each first candidate block vector.
[0265] In the embodiments of the present invention, the first extended candidate block vector is determined based on a distance set and a block vector prediction direction.
[0266] In some embodiments of the present application, step S1032 may include steps S10321 to S10323.
[0267] In step S10321, N first candidate block vectors (where N is an integer greater than or equal to 1) with the minimum template cost are determined from the first block vector candidate list.
[0268] In the embodiments of the present invention, before determining the first candidate block vector using candidate block vector index information, it is necessary to sort each candidate block vector in the first block vector candidate list to obtain a sorted first block vector candidate list, and then determine N first candidate block vectors having the minimum template cost from the sorted first block vector candidate list.
[0269] In the embodiments of the present invention, in the process of sorting each candidate block vector in the first block vector candidate list, a template matching cost calculation is performed for each candidate block vector in the first block vector candidate list, and then the template matching cost values of each candidate block vector are re-sorted, and the sorted candidate block vectors can be determined according to the order of the template matching cost values. In other words, each candidate item in the sorted IBC merge list is the first block vector candidate list sorted based on the template matching cost values.
[0270] In the process of sorting each candidate block vector in the first block vector candidate list, each candidate block vector may be sorted in descending order of template matching cost value, or in ascending order of template matching cost value, and the present application does not impose any limitations on this.
[0271] For example, if each candidate block vector is sorted in ascending order of template matching cost value, the first candidate block vector in the sorted list of candidate first block vectors will have the smallest template matching cost value.
[0272] In the embodiments of the present invention, N is set in advance, i.e., the decoder and encoder can pre-define or agree on the number of first candidate block vectors.
[0273] In the embodiments of this invention, N can also be obtained by analyzing the bitstream, in which case N is determined by the encoder.
[0274] In the embodiments of the present invention, if each candidate block vector in the first block vector candidate list is sorted in ascending order of template matching cost value, the first N candidate block vectors in the sorted first block vector candidate list are used to determine the N first candidate block vectors having the minimum template cost. If each candidate block vector in the first block vector candidate list is sorted in descending order of template matching cost value, the last N candidate block vectors in the sorted first block vector candidate list are used to determine the N first candidate block vectors having the minimum template cost.
[0275] For example, in IBC MBVD mode, N may be 8.
[0276] In step S10322, a first candidate block vector is determined from N first candidate block vectors based on the candidate block vector index information.
[0277] In the embodiment of the present invention, the decoder determines a first candidate block vector from N first candidate block vectors based on the acquired candidate block vector index information.
[0278] For example, the decoder determines one first candidate block vector that needs refinement from eight first candidate block vectors based on candidate block vector index information.
[0279] This example demonstrates that the decoder determines one first candidate block vector from N first candidate block vectors based on one candidate block vector index.
[0280] Therefore, when the decoder obtains multiple candidate block vector index information by analyzing the bitstream, for each candidate block vector index information, it determines the first candidate block vector corresponding to each candidate block vector index information from N first candidate block vectors.
[0281] In other words, assuming that the decoder analyzes the bitstream and determines that N is 8, and obtains 5 candidate block vector index pieces, the decoder uses these 5 candidate block vector index pieces to determine which of the 8 first candidate block vectors corresponds to the 5 candidate block vector index pieces.
[0282] In step S10323, the first candidate block vector is refined based on the distance set and the block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector.
[0283] In the embodiments of the present invention, the decoder determines a first candidate block vector based on candidate block vector index information, and then refines each first candidate block vector based on a predetermined set of distances and block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0284] In the embodiments of the present invention, multiple refinement positions of the first candidate block vector can be determined based on a pre-set distance set and a pre-defined direction set, thereby achieving refinement of the first candidate block vector.
[0285] In the embodiments of this invention, the distance set and block vector prediction direction are predetermined, i.e., defined or agreed upon by both the decoder and the encoder.
[0286] For example, in IBC MBVD mode, the distance set can be defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, where the distance set includes multiple pixel distances (e.g., 2pel).
[0287] For example, in IBC MBVD mode, the block vector prediction direction can be defined as two positive and negative horizontal directions and two positive and negative vertical directions. Therefore, the block vector prediction direction includes a total of four directions: two positive and negative horizontal directions and two positive and negative vertical directions. Furthermore, 20 distances and four directions can be used to determine 20 × 4 refined positions (i.e., the first extended candidate block vector).
[0288] In step S1033, at least one first candidate block vector for extension is removed from the first range of block vectors to obtain a second list of candidate block vectors.
[0289] In the embodiments of the present invention, after determining at least one first extended candidate block vector corresponding to each first candidate block vector, the decoder removes block vectors from the at least one first extended candidate block vector that belong to a first region range, thereby obtaining a second block vector candidate list.
[0290] To make it easier to understand, in the block decoding process, for intra-merge mode prediction scenarios, the decoder determines a second block vector candidate list based on a first block vector candidate list for the current block, by removing block vectors that overlap with, for example, intra-template matching prediction modes within a first domain range. The decoder then determines the predicted value of the current block based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when decoding using the block vectors from which redundancy has been removed, and ultimately improving the decoding efficiency of the video.
[0291] In some embodiments of this application, step S1033 is performed. For each first candidate block vector for extension, block vectors corresponding to reference blocks belonging to the first domain range are sequentially removed to obtain at least one selected first candidate block vector. This may include determining a list of candidate second block vectors based on at least one first candidate block vector selected.
[0292] In the embodiments of the present invention, for each first extension candidate block vector, if the first extension candidate block vector belongs to a block vector corresponding to a reference block in the first domain range, the first extension candidate block vector is removed; if the first extension candidate block vector does not belong to a block vector corresponding to a reference block in the first domain range, the first extension candidate block vector is added to the second block vector candidate list.
[0293] As an example, 20 × 4 first extension candidate block vectors corresponding to each first candidate block vector are sequentially selected, and the first extension candidate block vectors belonging to the first region range are removed, thereby obtaining at least one selected first extension candidate block vector. This selected at least one first extension candidate block vector is then added to the second block vector candidate list to determine the second block vector candidate list.
[0294] In some embodiments of the present application, for each first extension candidate block vector, block vectors corresponding to reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first extension candidate block vector. If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the horizontal range of a predetermined range, and the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first candidate extension block vectors is deemed to belong to the reference blocks of the first region range, This may include removing one of the first candidate extension block vectors and continuing the removal process on other first candidate extension block vectors to obtain at least one selected first candidate extension block vector.
[0295] In some embodiments of the present application, if the horizontal boundary position of a first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined horizontal range, or if the vertical boundary position of a first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined vertical range, then the first candidate reference block pointed to by any of the first extension candidate block vectors is deemed not to belong to the reference blocks of the first region range, and any of the first extension candidate block vectors is a single selected first extension candidate block vector corresponding to each candidate block vector.
[0296] In the embodiments of the present invention, the first region range may be a predetermined search range of the template in IntraTMP mode.
[0297] In the embodiments of this application, the horizontal range of a predetermined range can be represented by -searchRangeWidth and searchRangeWidth. Here, -searchRangeWidth represents the left boundary of the horizontal range of the predetermined range, and searchRangeWidth represents the right boundary of the horizontal range of the predetermined range. The vertical range of a predetermined range can be represented by -searchRangeHeight and searchRangeHeight. Here, -searchRangeHeight represents the lower boundary of the horizontal range of the predetermined range, and searchRangeHeight represents the upper boundary of the horizontal range of the predetermined range.
[0298] In the embodiments of the present invention, the horizontal and vertical boundary positions of the first candidate reference block pointed to by the first extension candidate block vector are determined, and if the horizontal and vertical boundary positions of the first candidate reference block fall within a predetermined horizontal and vertical range, the first extension candidate block vector is removed, that is, it is not allowed to participate in the subsequent sorting process.
[0299] In some embodiments of the present application, if the horizontal boundary position of a first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined horizontal range, or if the vertical boundary position of a first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined vertical range, then the first candidate reference block pointed to by any of the first extension candidate block vectors is deemed not to belong to the reference blocks of the first region range, and any of the first extension candidate block vectors is a single selected first extension candidate block vector corresponding to each candidate block vector.
[0300] For example, the process of determining the horizontal and vertical boundary positions of the first candidate reference block pointed to by the first candidate extension block vector can be expressed as follows:
[0301] (bvCand[x0][y0][disIdx][dirIdx][0]>-searchRangeWidth&&bvCand[x0][y0][disIdx][dirIdx][0]<searchRangeWidth&&bvCand[x0][y0][disIdx][dirIdx][1]> -searchRangeHeight&&bvCand[x0][y0][disIdx][dirIdx][1] <searchRangeHeight) Here, bvCand represents the first candidate reference block pointed to by the first extension candidate block vector, -searchRangeWidth represents the left boundary of the horizontal range of the given range, searchRangeWidth represents the right boundary of the horizontal range of the given range, -searchRangeHeight represents the lower boundary of the horizontal range of the given range, and searchRangeHeight represents the upper boundary of the horizontal range of the given range.
[0302] Exemplarily, in the embodiments of the present application, when (bvCand[x0][y0][disIdx][dirIdx][0] > -searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][0] < searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][1] > -searchRangeHeight && bvCand[x0][y0][disIdx][dirIdx][1] < searchRangeHeight) corresponding to the first candidate reference block pointed to by the first extended candidate block vector is true, the first extended candidate block vector is removed. When (bvCand[x0][y0][disIdx][dirIdx][0] > -searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][0] < searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][1] > -searchRangeHeight && bvCand[x0][y0][disIdx][dirIdx][1] < searchRangeHeight) corresponding to the first candidate reference block pointed to by the first extended candidate block vector is false, the first extended candidate block vector does not belong to the reference block in the first region range, and the first extended candidate block vector is used as one of the first extended candidate block vectors after sorting corresponding to the candidate block vector.
[0303] In some embodiments of the present application, determining the second block vector candidate list based on at least one first extended candidate block vector after sorting may include: determining M (M is an integer greater than or equal to 1) first extended candidate block vectors corresponding to the minimum template cost from at least one first extended candidate block vector after sorting; and constructing the second block vector candidate list based on the M first extended candidate block vectors.
[0304] In the embodiments of the present invention, after determining at least one selected first extension candidate block vector, the at least one first extension candidate block vector is subsequently sorted to obtain M sorted first extension candidate block vectors.
[0305] In the process of sorting the first extension candidate block vectors, each first extension candidate block vector may be sorted in descending order of template matching cost value, or in ascending order of template matching cost value, and the present application does not impose any limitations on this.
[0306] For example, if each first extension candidate block vector is sorted in ascending order of template matching cost value, the first first extension candidate block vector among the sorted first extension candidate block vectors will have the smallest template matching cost value.
[0307] In the embodiments of the present invention, M is set in advance, i.e., the decoder and encoder can pre-define or agree on the number of first extended candidate block vectors.
[0308] In the embodiments of this invention, M can also be obtained by analyzing the bitstream, in which case M is determined by the encoder.
[0309] In the embodiments of the present invention, if the first extension candidate block vectors are sorted in ascending order of template matching cost values, the first N candidate block vectors among the sorted first extension candidate block vectors are used to determine the M first extension candidate block vectors having the minimum template cost. If the first extension candidate block vectors are sorted in descending order of template matching cost values, the last M candidate block vectors among the sorted first extension candidate block vectors are used to determine the M first extension candidate block vectors having the minimum template cost.
[0310] In the embodiment of the present invention, M first extension candidate block vectors are added to a second block vector candidate list to obtain a second block vector candidate list.
[0311] In some embodiments of the present invention, if the number of at least one first extended candidate block vector after selection is less than M, other candidate block vectors are determined from the first block vector candidate list, and these other candidate block vectors are different from the N candidate block vectors.
[0312] Based on the other candidate block vectors and at least one selected first extended candidate block vector, M first extended candidate block vectors are determined.
[0313] In the embodiments of the present invention, if the number of at least one first extended candidate block vector after selection is less than M, other candidate block vectors are determined from the first block vector candidate list, and this process continues until the number of other candidate block vectors and at least one first extended candidate block vector after selection reaches M.
[0314] To make it easier to understand, the decoder removes redundant representations of BV information while simultaneously determining other first candidate block vectors from the first candidate block vector list. These other first candidate block vectors are different from the N first candidate block vectors, meaning they introduce options that could not originally be represented in the re-sorted list. This improves the representation range of the BV candidate list in the corresponding mode, increases the diversity of choices, and improves the video decoding efficiency.
[0315] In some embodiments of this application, step S1032 is performed. From the list of candidate first block vectors, determine the N first candidate block vectors (where N is an integer greater than or equal to 1) that have the minimum template cost, From the N first candidate block vectors, remove the block vectors belonging to the first region range to obtain a third block vector candidate list. This may further include determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information, based on the third block vector candidate list.
[0316] In the embodiments of the present invention, before determining the first candidate block vector using candidate block vector index information, it is necessary to sort each candidate block vector in the first block vector candidate list to obtain a sorted first block vector candidate list, and then determine N first candidate block vectors having the minimum template cost from the sorted first block vector candidate list.
[0317] In the embodiments of the present invention, in the process of sorting each candidate block vector in the first block vector candidate list, a template matching cost calculation is performed for each candidate block vector in the first block vector candidate list, and then the template matching cost values of each candidate block vector are re-sorted, and the sorted candidate block vectors can be determined according to the order of the template matching cost values. In other words, each candidate item in the sorted IBC merge list is the first block vector candidate list sorted based on the template matching cost values.
[0318] In the embodiments of the present invention, if each candidate block vector in the first block vector candidate list is sorted in ascending order of template matching cost value, the first N candidate block vectors in the sorted first block vector candidate list are used to determine the N first candidate block vectors having the minimum template cost. If each candidate block vector in the first block vector candidate list is sorted in descending order of template matching cost value, the last N candidate block vectors in the sorted first block vector candidate list are used to determine the N first candidate block vectors having the minimum template cost.
[0319] In the embodiment of the present invention, each of the N first candidate block vectors is sequentially evaluated, and the first candidate block vectors belonging to the first region range are removed to obtain a third block vector candidate list.
[0320] In the embodiments of the present invention, based on the candidate block vector index information, at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is determined from the third block vector candidate list.
[0321] To make it understandable, in the block decoding process, in a prediction mode scenario based on IBC MBVD, the decoder can perform deduplication based on at least one extended candidate block vector corresponding to N first candidate block vectors in the first block vector candidate list of the current block. For at least one extended candidate block vector, within a first region range, for example in intra-template matching prediction mode, duplicate block vectors are removed to determine a second block vector candidate list, and the predicted value of the current block is determined based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when decoding using the block vectors from which redundancy has been removed, and consequently improving the decoding efficiency of the video.
[0322] In some embodiments of the present application, determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is based on a third block vector candidate list. Based on the candidate block vector index information, the first candidate block vector is determined from the third block vector candidate list, The method includes refining a first candidate block vector based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector.
[0323] In the embodiments of the present invention, the decoder determines a first candidate block vector based on candidate block vector index information, and then refines each first candidate block vector based on a predetermined set of distances and block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0324] In the embodiments of the present invention, multiple refinement positions of the first candidate block vector can be determined based on a pre-set distance set and a pre-defined direction set, thereby achieving refinement of the first candidate block vector.
[0325] In the embodiments of this invention, the distance set and block vector prediction direction are predetermined, i.e., defined or agreed upon by both the decoder and the encoder.
[0326] For example, in IBC MBVD mode, the distance set can be defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, where the distance set includes multiple pixel distances (e.g., 2pel).
[0327] For example, in IBC MBVD mode, the block vector prediction direction can be defined as two positive and negative horizontal directions and two positive and negative vertical directions. Therefore, the block vector prediction direction includes a total of four directions: two positive and negative horizontal directions and two positive and negative vertical directions. Furthermore, 20 distances and four directions can be used to determine 20 × 4 refined positions (i.e., the first extended candidate block vector).
[0328] In some embodiments of this application, the decoding method is Decode the bitstream to determine the extended candidate block vector index information, Based on the extended candidate block vector index information, determine the first block vector from at least one first extended candidate block vector, This further includes determining the reference block of the current block based on the first block vector, and determining the predicted value of the current block based on the reference block.
[0329] In the embodiments of the present invention, the decoder determines the extended candidate block vector index information corresponding to the current block by analyzing the bitstream.
[0330] In the embodiments of the present invention, the decoder determines a first block vector corresponding to the extended candidate block vector index information from at least one first extended candidate block vector based on the extended candidate block vector index information.
[0331] In the embodiments of this invention, if the current block has a predicted residual, the decoder determines the predicted residual of the current block by analyzing the bitstream, and performs weighting or other processing on the predicted value and the predicted difference value of the current block to obtain the reconstructed value of the current block. If the current block does not have a predicted residual, the decoder directly uses the predicted value of the current block as the reconstructed value of the current block.
[0332] In some embodiments of the present application, obtaining a third block vector candidate list involves removing block vectors belonging to a first region range from among N first candidate block vectors. For each of the N first candidate block vectors, sequentially remove the block vectors corresponding to the reference block belonging to the first region range to obtain at least one selected first candidate block vector. This may include determining a list of candidate third block vectors based on at least one first candidate block vector after selection.
[0333] In the embodiments of the present invention, for each first candidate block vector, if the first candidate block vector belongs to a block vector corresponding to a reference block in the first domain range, the first candidate block vector is removed; if the first candidate block vector does not belong to a block vector corresponding to a reference block in the first domain range, the first candidate block vector is added to the third block vector candidate list.
[0334] Exemplary, the first candidate block vectors are sequentially selected, the first candidate block vectors belonging to the first region range are removed, thereby obtaining at least one selected first candidate block vector, and the at least one selected first candidate block vector is added to the third block vector candidate list to determine the third block vector candidate list.
[0335] In some embodiments of the present invention, for each of the N first candidate block vectors, block vectors corresponding to reference blocks belonging to a first region range are sequentially removed to obtain at least one selected first candidate block vector. The process involves sequentially offsetting the first candidate block vectors in N first candidate block vectors, and determining at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in at least one second candidate reference block pointed to by at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to that at least one second candidate block vector is deemed to belong to the block vectors of the first region range. This may include removing the first candidate block vector and continuing the removal process on other first candidate block vectors to obtain at least one selected first candidate block vector.
[0336] To make it understandable, in the block decoding process, in a prediction mode scenario based on IBC MBVD, the decoder can perform deduplication based on N first candidate block vectors in the first block vector candidate list of the current block. By removing duplicate block vectors within a first region range, for example in intra-template matching prediction mode, from the N first candidate block vectors, a third block vector candidate list is determined. The predicted value of the current block is then determined based on the block vectors from which redundancy has been removed in the third block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when decoding using the block vectors from which redundancy has been removed, and ultimately improving the video decoding efficiency.
[0337] In some embodiments of this application, the decoding method is If the maximum or minimum horizontal boundary position in at least one second candidate reference block pointed to by at least one second candidate block vector does not fall within a predetermined horizontal range, or if the maximum or minimum vertical boundary position in at least one second candidate reference block does not fall within a predetermined vertical range, then the candidate block vector corresponding to that at least one second candidate block vector shall not be considered to belong to the block vectors of the first region range, and the first candidate block vector corresponding to that at least one second candidate block vector shall be used as one selected first candidate block vector. The process further includes continuing the removal process for other first candidate block vectors until the processing of N first candidate block vectors is completed, or until N selected first candidate block vectors are obtained.
[0338] In the embodiments of the present invention, the first region range may be a predetermined search range of the template in IntraTMP mode.
[0339] In the embodiments of this application, the horizontal range of a predetermined range can be represented by -searchRangeWidth and searchRangeWidth. Here, -searchRangeWidth represents the left boundary of the horizontal range of the predetermined range, and searchRangeWidth represents the right boundary of the horizontal range of the predetermined range. The vertical range of a predetermined range can be represented by -searchRangeHeight and searchRangeHeight. Here, -searchRangeHeight represents the lower boundary of the horizontal range of the predetermined range, and searchRangeHeight represents the upper boundary of the horizontal range of the predetermined range.
[0340] In the embodiments of this application, the second candidate block vector is a candidate block vector obtained after offsetting the first candidate block vector. The first candidate block vector is offset by a predetermined offset pixel, where the predetermined offset pixel is set in advance. For example, the first candidate block vector is offset horizontally or vertically by a predetermined offset pixel (128pel).
[0341] In the embodiments of the present invention, the horizontal and vertical boundary positions of the second candidate reference block pointed to by the second candidate block vector are determined, and if the horizontal and vertical boundary positions of the second candidate reference block fall within a predetermined horizontal and vertical range, the second candidate block vector is removed, that is, it is not allowed to participate in the subsequent sorting process.
[0342] In some embodiments of the present application, if the horizontal boundary position of the second candidate reference block pointed to by any of the second candidate block vectors does not fall within a predetermined horizontal range, or if the vertical boundary position of the second candidate reference block pointed to by any of the second candidate block vectors does not fall within a predetermined vertical range, then the first candidate reference block pointed to by any of the second candidate block vectors is deemed not to belong to the reference blocks of the first region range, and any of the second candidate block vectors is a single selected first candidate block vector corresponding to each candidate block vector.
[0343] For example, the process of determining the horizontal and vertical boundary positions of the second candidate reference block pointed to by the second candidate block vector can be expressed as follows:
[0344] (bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_left][0]>-searchRangeWidth&&bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_right][0]<searchRangeWidth&&bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_up][dirHorIdx][1]> -searchRangeHeight&&bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_down][dirHorIdx][1] <searchRangeHeight) Here, bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_left][0] represents the horizontal boundary position of the first candidate reference block pointed to by the second candidate block vector, bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_up][dirHorIdx][1] represents the vertical boundary position of the first candidate reference block pointed to by the second candidate block vector, -searchRangeWidth represents the left boundary of the horizontal range of the given range, searchRangeWidth represents the right boundary of the horizontal range of the given range, -searchRangeHeight represents the lower boundary of the vertical range of the given range, and searchRangeHeight represents the upper boundary of the vertical range of the given range.
[0345] Exemplarily, when (bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_left][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_right][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_up][dirHorIdx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_down][dirHorIdx][1] < searchRangeHeight) corresponding to the candidate reference block pointed to by the second candidate block vector is true, the first candidate block vector corresponding to the second candidate block vector belongs to the block vector in the first region range, the first candidate block vector is removed, and the removal process is continued for other first candidate block vectors subsequently to obtain at least one first candidate block vector after screening.
[0346] Exemplarily, when (bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_left][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_right][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_up][dirHorIdx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_down][dirHorIdx][1] < searchRangeHeight) corresponding to the candidate reference block pointed to by the second candidate block vector is false, the candidate block vector corresponding to the second candidate block vector does not belong to the block vector in the first region range, and the first candidate block vector corresponding to the second candidate block vector is taken as one of the first candidate block vectors after screening.
[0347] To make it understandable, in the block decoding process, the decoder can perform deduplication based on N first candidate block vectors in the first block vector candidate list of the current block in a prediction mode scenario based on IBC MBVD. By removing duplicate block vectors from the N first candidate block vectors within a first domain range, for example in intra-template matching prediction mode, a third block vector candidate list is determined. The predicted value of the current block is determined based on the block vectors from which redundancy has been removed in the third block vector candidate list. Further deduplication is performed on at least one first extended candidate block vector corresponding to each first candidate block vector in the third block vector candidate list to obtain a second block vector candidate list, and the predicted value of the current block is determined based on the second block vector candidate list. By removing duplicate block vectors from at least one first extended candidate block vector within a first domain range, for example in intra-template matching prediction mode, the redundancy of the block vectors is further reduced. Therefore, when decoding using the block vectors from which redundancy has been removed, the representation efficiency of header information can be improved, and consequently, the video decoding efficiency can be improved.
[0348] In some embodiments of the present application, obtaining a second block vector candidate list involves removing block vectors belonging to a first region range from a first block vector candidate list. If it is determined that the current block uses a prediction mode based on template matching merge, then K third candidate block vectors (where K is an integer greater than or equal to 1) with the minimum template cost are determined from the first block vector candidate list, This may include removing block vectors belonging to the first region range from among K candidate third block vectors to obtain a list of candidate second block vectors.
[0349] In the embodiments of the present invention, if the current block uses a prediction mode based on template matching merge (IBC merge), the decoder determines K third candidate block vectors having the minimum template cost from the first block vector candidate list.
[0350] In the embodiments of the present invention, before determining the first candidate block vector using candidate block vector index information, it is necessary to sort each candidate block vector in the first block vector candidate list to obtain a sorted first block vector candidate list, and then determine the K first candidate block vectors having the minimum template cost from the sorted first block vector candidate list.
[0351] In the process of sorting each candidate block vector in the first block vector candidate list, each candidate block vector may be sorted in descending order of template matching cost value, or in ascending order of template matching cost value, and the present application does not impose any limitations on this.
[0352] For example, if each candidate block vector is sorted in ascending order of template matching cost value, the first candidate block vector in the sorted list of candidate first block vectors will have the smallest template matching cost value.
[0353] In the embodiments of the present invention, K is set in advance, i.e., the decoder and encoder can pre-define or agree on the number of first candidate block vectors.
[0354] In the embodiments of this application, K can also be obtained by analyzing the bitstream, in which case K is determined by the encoder.
[0355] In the embodiments of the present invention, if each candidate block vector in the first block vector candidate list is sorted in ascending order of template matching cost value, the first K candidate block vectors in the sorted first block vector candidate list are used to determine the K third candidate block vectors having the minimum template cost. If each candidate block vector in the first block vector candidate list is sorted in descending order of template matching cost value, the last K candidate block vectors in the sorted first block vector candidate list are used to determine the K third candidate block vectors having the minimum template cost.
[0356] In the embodiment of the present invention, after determining K third candidate block vectors, the decoder removes block vectors from the K third candidate block vectors that belong to the first region range for at least one first extended candidate block vector, thereby obtaining a second block vector candidate list.
[0357] In some embodiments of the present application, obtaining a list of candidate block vectors for the second block vector involves removing block vectors belonging to the first region range from among K candidate third block vectors. If, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is complete, or until K selected third candidate block vectors are obtained. This may include determining a list of candidate second block vectors based on at least one third candidate block vector after selection.
[0358] To make it easier to understand, in the block decoding process, in a prediction mode scenario based on template matching merge, the decoder can perform deduplication based on K third candidate block vectors in the first block vector candidate list of the current block. For the K third candidate block vectors, duplicate block vectors are removed within the first region, for example in intra-template matching prediction mode, to determine the second block vector candidate list. Further local refinement is then performed based on the block vectors from which redundancy has been removed in the second block vector candidate list, thereby determining the predicted value of the current block. As a result, the redundancy of the block vectors is reduced, improving the representation efficiency of header information when decoding using the block vectors from which redundancy has been removed, and consequently improving the video decoding efficiency.
[0359] In the embodiments of the present invention, the first region range may be a predetermined search range of the template in IntraTMP mode.
[0360] In the embodiments of this application, the horizontal range of a predetermined range can be represented by -searchRangeWidth and searchRangeWidth. Here, -searchRangeWidth represents the left boundary of the horizontal range of the predetermined range, and searchRangeWidth represents the right boundary of the horizontal range of the predetermined range. The vertical range of a predetermined range can be represented by -searchRangeHeight and searchRangeHeight. Here, -searchRangeHeight represents the lower boundary of the horizontal range of the predetermined range, and searchRangeHeight represents the upper boundary of the horizontal range of the predetermined range.
[0361] In the embodiments of the present invention, the horizontal and vertical boundary positions of the third candidate reference block pointed to by the third candidate block vector are determined, and if the horizontal and vertical boundary positions of the third candidate reference block fall within a predetermined horizontal and vertical range, the third candidate block vector is removed, that is, it is not allowed to participate in the subsequent sorting process.
[0362] For example, the process of determining the horizontal and vertical boundary positions of the third candidate reference block pointed to by the third candidate block vector can be expressed as follows:
[0363] (bvCand[x0][y0][merge_idx][0]>-searchRangeWidth&&bvCand[x0][y0][merge_idx][0]<searchRangeWidth&&bvCand[x0][y0][merge_idx][1]> -searchRangeHeight&&bvCand[x0][y0][merge_idx][1] <searchRangeHeight) Here, bvCand[x0][y0][merge_idx][0] represents the horizontal boundary position of the third candidate reference block pointed to by the third candidate block vector, bvCand[x0][y0][merge_idx][1] represents the vertical boundary position of the third candidate reference block pointed to by the third candidate block vector, -searchRangeWidth represents the left boundary of the horizontal range of the given range, searchRangeWidth represents the right boundary of the horizontal range of the given range, -searchRangeHeight represents the lower boundary of the vertical range of the given range, and searchRangeHeight represents the upper boundary of the horizontal range of the given range.
[0364] Exemplarily, when (bvCand[x0][y0][merge_idx][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] < searchRangeHeight) is true, the third candidate reference block pointed to by the third candidate block vector belongs to the reference blocks in the first region range. Remove the third candidate block vector of the reference blocks belonging to the first region range, and continue the removal process for other third candidate block vectors until the processing of the K third candidate block vectors is completed or until K sorted third candidate block vectors are obtained.
[0365] Exemplarily, when (bvCand[x0][y0][merge_idx][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] < searchRangeHeight) is false, the third candidate reference block pointed to by the third candidate block vector does not belong to the reference blocks in the first region range, and use the third candidate block vector as the sorted third candidate block vector.
[0366] In the embodiments of the present application, the second block vector candidate list is determined by adding at least one sorted third candidate block vector to the second block vector candidate list.
[0367] In some embodiments of the present application, obtaining the second block vector candidate list by removing the block vectors belonging to the first region range from the K third candidate block vectors is If, among the K third candidate block vectors, the first extended horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. Here, the first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are the search ranges defined in IBC TM merge mode. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is complete, or until K selected third candidate block vectors are obtained. This may include determining a list of candidate second block vectors based on at least one third candidate block vector after selection.
[0368] In the embodiments of the present invention, the first region range may be a predetermined search range of the template in IntraTMP mode.
[0369] In the embodiments of this application, the horizontal range of a predetermined range can be represented by -searchRangeWidth and searchRangeWidth. Here, -searchRangeWidth represents the left boundary of the horizontal range of the predetermined range, and searchRangeWidth represents the right boundary of the horizontal range of the predetermined range. The vertical range of a predetermined range can be represented by -searchRangeHeight and searchRangeHeight. Here, -searchRangeHeight represents the lower boundary of the horizontal range of the predetermined range, and searchRangeHeight represents the upper boundary of the horizontal range of the predetermined range.
[0370] In the embodiments of the present invention, the first extended horizontal boundary position and the first extended vertical boundary position of the third candidate reference block pointed to by the third candidate block vector are determined, and if the first extended horizontal boundary position and the first extended vertical boundary position of the third candidate reference block fall within a predetermined horizontal range and vertical range, the third candidate block vector is removed, that is, it is not allowed to participate in the subsequent sorting process.
[0371] For example, the process of determining the first extended horizontal boundary position and the first extended vertical boundary position of the third candidate reference block pointed to by the third candidate block vector can be expressed as follows:
[0372] (bvCand[x0][y0][merge_idx][0]-searchRangeWidthIBCTM>-searchRangeWidth&&bvCand[x0][y0][merge_idx][0]+searchRangeWidthIBCTM<searchRangeWidth&&bvCand[x0][y0][merge_idx][1]-searchRangeHeightIBCTM> -searchRangeHeight&&bvCand[x0][y0][merge_idx][1]+searchRangeHeightIBCTM <searchRangeHeight) Here, bvCand[x0][y0][merge_idx][0] - searchRangeWidthIBCTM represents the first extended horizontal boundary position of the third candidate reference block pointed to by the third candidate block vector, bvCand[x0][y0][merge_idx][1] - searchRangeHeightIBCTM represents the first extended vertical boundary position of the third candidate reference block pointed to by the third candidate block vector, -searchRangeWidth represents the left boundary of the horizontal range of a predetermined range, searchRangeWidth represents the right boundary of the horizontal range of a predetermined range, -searchRangeHeight represents the lower boundary of the vertical range of a predetermined range, and searchRangeHeight represents the upper boundary of the vertical range of a predetermined range. searchRangeWidthIBCTM and searchRangeHeightIBCTM are search ranges defined in the IBC TM merge mode (for example, the values of both searchRangeWidthIBCTM and searchRangeHeightIBCTM are 8 (for example, [-8, 8]).
[0373] Exemplarily, when (bvCand[x0][y0][merge_idx][0] - searchRangeWidthIBCTM > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] + searchRangeWidthIBCTM < searchRangeWidth && bvCand[x0][y0][merge_idx][1] - searchRangeHeightIBCTM > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] + searchRangeHeightIBCTM < searchRangeHeight) is true, the third candidate reference block pointed to by the third candidate block vector belongs to the reference block in the first region range, removes the third candidate block vector of the reference block belonging to the first region range, and continues the removal process for other third candidate block vectors until the processing of K third candidate block vectors is completed or K sorted third candidate block vectors are obtained.
[0374] Exemplarily, when (bvCand[x0][y0][merge_idx][0] - searchRangeWidthIBCTM > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] + searchRangeWidthIBCTM < searchRangeWidth && bvCand[x0][y0][merge_idx][1] - searchRangeHeightIBCTM > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] + searchRangeHeightIBCTM < searchRangeHeight) is false, the third candidate reference block pointed to by the third candidate block vector does not belong to the reference block in the first region range, and the third candidate block vector after screening the third candidate block vector is used as the third candidate block vector.
[0375] In an embodiment of the present application, the second block vector candidate list is determined by adding at least one third candidate block vector after screening to the second block vector candidate list.
[0376] In some embodiments of the present application, determining the predicted value of the current block based on the second block vector candidate list may include: performing template matching refinement on the second block vector candidate list to determine a fourth block vector candidate list; decoding the bitstream to determine candidate block vector index information; determining a first block vector based on the candidate block vector index information and the fourth block vector candidate list; determining a reference block of the current block based on the first block vector, and determining a predicted value of the current block based on the reference block.
[0377] In the embodiment of the present invention, template matching refinement is performed on each second block vector candidate in the second block vector candidate list, thereby determining the fourth block vector candidate list.
[0378] In the embodiment of the present invention, the decoder determines a first block vector corresponding to the candidate block vector index information from a fourth block vector candidate list based on the candidate block vector index information.
[0379] In the embodiments of this invention, if the current block has a predicted residual, the decoder determines the predicted residual of the current block by analyzing the bitstream, and performs weighting or other processing on the predicted value and the predicted difference value of the current block to obtain the reconstructed value of the current block. If the current block does not have a predicted residual, the decoder directly uses the predicted value of the current block as the reconstructed value of the current block.
[0380] To make it understandable, in the block decoding process, the decoder can perform deduplication based on N first candidate block vectors in the first block vector candidate list of the current block in a prediction mode scenario based on IBC MBVD. By removing duplicate block vectors from the N first candidate block vectors within a first domain range, for example in intra-template matching prediction mode, a third block vector candidate list is determined. The predicted value of the current block is determined based on the block vectors from which redundancy has been removed in the third block vector candidate list. Further deduplication is performed on at least one first extended candidate block vector corresponding to each first candidate block vector in the third block vector candidate list to obtain a second block vector candidate list, and the predicted value of the current block is determined based on the second block vector candidate list. By removing duplicate block vectors from at least one first extended candidate block vector within a first domain range, for example in intra-template matching prediction mode, the redundancy of the block vectors is further reduced. Therefore, when decoding using the block vectors from which redundancy has been removed, the representation efficiency of header information can be improved, and consequently, the video decoding efficiency can be improved.
[0381] In some embodiments of the present invention, in the process of determining the first block vector candidate list for the current block, a duplicate check operation is performed on the candidate block vectors in the first block vector candidate list.
[0382] In the embodiment of the present invention, in the IBC mode, in the process of determining the first block vector candidate list for the current block, a duplicate check operation is performed on the candidate block vectors in the first block vector candidate list.
[0383] In some embodiments of the present application, performing a duplicate check operation on candidate block vectors in the first block vector candidate list is: Determine the current candidate block vector to be added, Currently, the candidate block vector is compared with the candidate block vector in the first block vector candidate list, If the current candidate block vector does not overlap with any candidate block vectors in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list. This may include, if the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, skipping the current candidate block vector and continuing to perform the step of determining the next candidate block vector to add.
[0384] In the embodiment of the present invention, for the current candidate block vector to be added to the first block vector candidate list, it is determined whether the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. If the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, the current candidate block vector is skipped, that is, it is not added to the first block vector candidate list, and the execution of the step of determining the next candidate block vector to be added continues. If the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list.
[0385] In some embodiments of the present application, the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. Currently, the candidate block vector is exactly the same as the candidate block vector in the first block vector candidate list, or This may include the condition that the difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition.
[0386] In the embodiments of the present invention, two aspects can be considered when determining whether the current candidate block vector is exactly the same as a candidate block vector in the first block vector candidate list. The first aspect is that the current candidate block vector is exactly the same as a candidate block vector, for example, that the position information of the current candidate block vector and the candidate block vector are exactly the same. The second aspect is that the difference between the current candidate block vector and the candidate block vector satisfies a first predetermined condition, for example, that the difference in position information between the current candidate block vector and the candidate block vector is within a certain range, where the first predetermined condition is set in advance, that is, the first predetermined condition is defined or agreed upon in advance by both the encoder and the decoder.
[0387] For example, if the current candidate block vector is exactly the same as the candidate block vector (both its horizontal and vertical components are identical), it is considered a duplicate. The difference between the current candidate block vector and the candidate block vector may also be considered a duplicate if, after comparing the difference with a certain threshold, the difference is deemed too small (for example, the absolute values of the differences between the horizontal and vertical components are both 2 or less, or the absolute value of the difference between the horizontal components is less than 2 and the absolute value of the difference between the vertical components is less than 3).
[0388] To make it easier to understand, when constructing the first block vector candidate list, a deduplication operation is performed to remove some duplicate BVs, thereby reducing the redundancy of the block vectors during decoding. Consequently, when encoding and decoding using the block vectors after redundancy has been removed, the representation efficiency of header information can be improved, and ultimately, the decoding efficiency of the video can be improved.
[0389] The embodiments of the present application provide an encoding method, and with reference to Figure 22, an exemplary flowchart of an optional encoding method according to the embodiments of the present application is shown. As shown in Figure 22, the method may include the following steps.
[0390] In step S501, the prediction mode for the current block is determined.
[0391] In the embodiments of the present invention, in a scenario where a block is currently encoded, the encoder can perform template matching estimation by traversing different block prediction modes and determine the prediction mode having the minimum template cost, which is the prediction mode for the current block.
[0392] In the embodiments of this application, the prediction mode may include an intrablock prediction mode and an interblock prediction mode, where the intrablock vector prediction mode may further include an IBC mode and an IntraTMP mode, and the embodiments of this application are not limited thereto.
[0393] In step S502, if the prediction mode indicates that the current block uses a prediction mode based on intrablock merging, the first block vector candidate list for the current block is determined.
[0394] In step S503, the first region range is determined, and the second block vector candidate list is determined based on the first block vector candidate list and the first region range.
[0395] In the embodiment of the present invention, the encoder removes block vectors belonging to the first region range from the first block vector candidate list to obtain a second block vector candidate list.
[0396] In the embodiments of this application, the first region is defined as follows: Current size of coding tree unit, The size of the reconfigured region in the current frame, The current size of the image boundary of the block, and Includes one of the search ranges for Intra TMP mode.
[0397] Exemplary, in the embodiments of the present invention, when a second block vector candidate list is obtained by removing block vectors belonging to the search range of Intra TMP mode based on a first block vector candidate list, redundant representations of BV information between different modes can be removed, improving the representation efficiency of header information and thereby improving the overall video encoding efficiency.
[0398] In step S504, the predicted value of the current block is determined based on the second block vector candidate list.
[0399] In the embodiments of the present invention, the encoder determines a first block vector based on a second block vector candidate list, determines the reference block of the current block based on the first block vector, and determines the predicted value of the current block based on the reference block. Candidate block vector index information corresponding to the first block vector is written to the bitstream.
[0400] In some embodiments of the present invention, the encoder determines the original value of the current block and, based on the original value of the current block and the predicted value of the current block, determines the predicted difference value of the current block.
[0401] In the embodiment of the present invention, the encoder writes the predicted difference value to the bitstream.
[0402] The specific implementation of steps S502 to S504 is consistent with the implementation principle of the decoder, so it will not be explained again here.
[0403] To make it easier to understand, in the block encoding process, for intra-merge mode prediction scenarios, the encoder determines a second block vector candidate list based on a first block vector candidate list for the current block, by removing block vectors that overlap with, for example, intra-template matching prediction modes within a first domain range. The predicted value of the current block is then determined based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when encoding using the block vectors from which redundancy has been removed, and ultimately improving the encoding efficiency of the video.
[0404] Some embodiments of the present application further provide an encoding method, which, as shown in Figure 23, includes the following steps.
[0405] In step S501, the prediction mode for the current block is determined.
[0406] In step S502, if the prediction mode indicates that the current block uses a prediction mode based on intrablock merging, the first block vector candidate list for the current block is determined.
[0407] In step S5031, the first region range is determined.
[0408] In step S5032, if it is determined that the current block uses a prediction mode based on IBC MBVD, then at least one first extended candidate block vector corresponding to each first candidate block vector is determined based on the first block vector candidate list.
[0409] In some embodiments of the present invention, a third syntactic identifier is determined and written to the bitstream, the third syntactic identifier indicating whether the current block uses a predictive mode based on IBC MBVD.
[0410] In some embodiments of the present invention, the encoder determines, based on a first block vector candidate list, at least one first extended candidate block vector corresponding to each first candidate block vector, which includes determining N first candidate block vectors (where N is an integer greater than or equal to 1) having the minimum template cost from the first block vector candidate list, and refining each of the N first candidate block vectors based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0411] In some embodiments of the present invention, the encoder sequentially removes block vectors corresponding to reference blocks belonging to a first region range for each first candidate block vector and each first extended candidate block vector to obtain at least one selected first extended candidate block vector, as follows.
[0412] If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within a predetermined horizontal range, and the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within a predetermined vertical range, then the first candidate reference block pointed to by any of the first candidate extension block vectors belongs to the reference blocks of the first region range. In this case, any of the first candidate extension block vectors is removed, and the removal process is continued for the other first candidate extension block vectors corresponding to each first candidate extension block vector, thereby obtaining at least one selected first candidate extension block vector.
[0413] In some embodiments of the present application, if the horizontal boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the horizontal range of a predetermined range, or if the vertical boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first extension candidate block vectors does not belong to the reference blocks of the first region range, and any of the first extension candidate block vectors is one selected first extension candidate block vector corresponding to each candidate block vector.
[0414] The encoder then determines whether or not it is necessary to remove a BV by determining the first extended candidate block vector among the N first candidate block vectors determined after resorting, based on the first block vector candidate list.
[0415] In step S5033, a list of candidate block vectors for the second block vector is obtained by removing block vectors belonging to the first region range from among the at least one first extended candidate block vector corresponding to each first candidate block vector.
[0416] In some embodiments of the present invention, obtaining a second block vector candidate list by removing block vectors belonging to a first region range from among at least one first extended candidate block vector corresponding to each first candidate block vector may include, for each first candidate block vector, removing block vectors corresponding to reference blocks belonging to the first region range for each first extended candidate block vector to obtain at least one selected first extended candidate block vector, and determining a second block vector candidate list based on the selected at least one first extended candidate block vector corresponding to each first candidate block vector.
[0417] In some embodiments of the present invention, for each first candidate block vector, the encoder determines M first extension candidate block vectors corresponding to the minimum template cost from among the at least one selected first extension candidate block vector, where M is an integer greater than or equal to 1, and constructs a second block vector candidate list based on the M first extension candidate block vectors for each first candidate block vector.
[0418] In some embodiments of the present invention, for each first candidate block vector, if the number of at least one selected first extended candidate block vector is less than M, other first candidate block vectors are determined from the first block vector candidate list, and these other first candidate block vectors are different from the N first candidate block vectors, and M first extended candidate block vectors are determined based on the other first candidate block vectors and at least one selected first extended candidate block vector.
[0419] To make it easier to understand, the encoder removes redundant representations of BV information while simultaneously determining other first candidate block vectors from the first candidate block vector list. These other first candidate block vectors are different from the N first candidate block vectors, meaning they introduce choices that could not originally be represented in the re-sorted list. This improves the representation range of the BV candidate list in the corresponding mode, increases the diversity of choices, and improves the video encoding efficiency.
[0420] For example, in MBVD mode, during the process of building the MBVD candidate list, BVs that are within the IntraTMP search range are deleted. The specific method is as follows:
[0421] In IBC MBVD mode, similar to MMVD in VVC's interframe technology, one candidate item from the IBC merge list is used as a starting point, one candidate item is selected from a set of candidate points corresponding to a predefined set of distances and directions, and the corresponding block vector is used as the final BV.
[0422] For example, in IBC MBVD, the distance set is defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD direction is defined as two horizontal directions (positive and negative) and two vertical directions (positive and negative).
[0423] The base candidate items are selected from the top five candidate items in the re-sorted IBC merge list, and the refinement positions of all possible MBVDs for each base candidate (i.e., 20 × 4 candidate items) are re-sorted based on the SAD cost between the template and the reference of each refinement position. In this process, for the BVs of the 20 × 4 candidate items, it is first necessary to determine whether or not they are within the IntraTMP search range.
[0424] Finally, the first N refined positions having the minimum template SAD are retained, where N may be artificially preset, for example, as 8. If there are fewer than N, the BVs in the IBC candidate BV list are used to supplement and can be used for MBVD index coding. If N is 0, no IBC-MBVD is performed. Candidate items for IBC-MBVD do not inherit the inversion type from adjacent blocks coded with RR-IBC. The MBVD index (candidate block vector index information) is binarized by a Rice code with a parameter equal to 1, and the embodiments of this application are not limited to that coding scheme.
[0425] In step S504, the predicted value of the current block is determined based on the second block vector candidate list.
[0426] Steps S502, S5031-S5033, and S504 in the embodiment of this application are consistent with the implementation principle when the decoder decides that the current block will use a predictive mode based on IBC MBVD, and will not be described again here.
[0427] The difference is that the encoder constructs and removes the first extended candidate block vector for all N first candidate block vectors, whereas the decoder constructs and removes the first extended candidate block vector only for the first candidate block vector corresponding to the candidate block vector index information among the N first candidate block vectors. However, the principle of constructing its first extended candidate block vector for each first candidate block vector and removing block vectors belonging to the first region range is the same.
[0428] To make it understandable, in the block encoding process, in a prediction mode scenario based on IBC MBVD, the encoder can perform deduplication based on at least one extended candidate block vector corresponding to N first candidate block vectors in the first block vector candidate list of the current block. For at least one extended candidate block vector, within a first region range, for example in intra-template matching prediction mode, duplicate block vectors are removed to determine a second block vector candidate list, and the predicted value of the current block is determined based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when encoding using the block vectors from which redundancy has been removed, and consequently improving the encoding efficiency of the video.
[0429] Some embodiments of the present application further provide an encoding method, which, as shown in Figure 24, includes the following steps.
[0430] In step S501, the prediction mode for the current block is determined.
[0431] In step S502, if the prediction mode indicates that the current block uses a prediction mode based on intrablock merging, the first block vector candidate list for the current block is determined.
[0432] In step S505, N first candidate block vectors (where N is an integer greater than or equal to 1) with the minimum template cost are determined from the first block vector candidate list.
[0433] In step S506, block vectors belonging to the first region range are removed from the N first candidate block vectors to obtain a third block vector candidate list.
[0434] In some embodiments of the present invention, the encoder sequentially removes block vectors corresponding to reference blocks belonging to a first region range for each of the N first candidate block vectors to obtain at least one selected first candidate block vector, and determines a third block vector candidate list based on the at least one selected first candidate block vector.
[0435] In some embodiments of the present invention, the encoder sequentially offsets the first candidate block vectors in N first candidate block vectors to determine at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in at least one second candidate reference block pointed to by at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to that at least one second candidate block vector belongs to the block vectors of the first region range, and that first candidate block vector is removed. The removal process is then continued for the other first candidate block vectors to obtain at least one selected first candidate block vector.
[0436] In some embodiments of the present invention, if the maximum or minimum horizontal boundary position in at least one second candidate reference block pointed to by at least one second candidate block vector does not fall within a predetermined horizontal range, or if the maximum or minimum vertical boundary position in at least one second candidate reference block does not fall within a predetermined vertical range, the encoder determines that the candidate block vector corresponding to the at least one second candidate block vector does not belong to the block vectors of the first region range, and designates the first candidate block vector corresponding to the at least one second candidate block vector as one selected first candidate block vector. The encoder then continues the removal process for the other first candidate block vectors until processing of N first candidate block vectors is completed or until N selected first candidate block vectors are obtained.
[0437] In MBVD mode, the system evaluates the options in the merge list and ignores merge candidate items where all options after the offset are within the IntraTMP search range. The specific method is as follows:
[0438] In IBC MBVD mode, similar to MMVD in VVC's interframe technology, one candidate item from the IBC merge list is used as a starting point, one candidate item is selected from a set of candidate points corresponding to a predefined set of distances and directions, and the corresponding block vector is used as the final BV.
[0439] For example, in IBC MBVD, the distance set is defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD direction is defined as two horizontal directions (positive and negative) and two vertical directions (positive and negative).
[0440] The base candidate items are selected from the first N candidate items (N first candidate block vectors) in the re-sorted IBC merge list. First, the first N candidate items are offset, and then it is determined whether all options are within the IntraTMP search range. If all are within the IntraTMP search range, that candidate item (one of the N) is removed from the base candidate items. At this point, the merge_idx syntax element corresponds not to the number in the original IBC merge list, but to the number in the re-sorted list after removing the option where all offset options are within the IntraTMP search range. At this point, it is necessary to construct a new candidate item list MBVD_merge_cand_list specifically for MBVD. The first N items in the original IBC merge candidate item list IBC merge_cand_list are examined one by one, and if the condition that all offset items are within the IntraTMP search range is not met, that candidate item is added to MBVD_merge_cand_list; otherwise, it is not added, and this continues until there are no more candidate items or the number of candidate items (N) is met.
[0441] In step S507, based on the third block vector candidate list, at least one first extended candidate block vector corresponding to each first candidate block vector is determined.
[0442] In some embodiments of the present invention, the encoder refines each first candidate block vector in a third block vector candidate list based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0443] In step S508, a first block vector is determined from at least one first extension candidate block vector.
[0444] In step S509, the reference block of the current block is determined based on the first block vector, and the predicted value of the current block is determined based on the reference block.
[0445] In some embodiments of the present invention, the encoder writes candidate block vector index information and extended candidate block vector index information corresponding to a first block vector to a bitstream.
[0446] To make it understandable, in the block encoding process, the encoder can perform deduplication based on N first candidate block vectors in the first block vector candidate list of the current block, in a prediction mode scenario based on IBC MBVD. By removing duplicate block vectors within a first region range, for example in intra-template matching prediction mode, a third block vector candidate list is determined from the N first candidate block vectors. The predicted value of the current block is then determined based on the block vectors from which redundancy has been removed in the third block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when encoding using the block vectors from which redundancy has been removed, and ultimately improving the encoding efficiency of the video.
[0447] In step S5033, a list of candidate block vectors for the second block vector is obtained by removing block vectors belonging to the first region range from among the at least one first extended candidate block vector corresponding to each first candidate block vector.
[0448] In step S504, the predicted value of the current block is determined based on the second block vector candidate list.
[0449] To make it understandable, in the block encoding process, the encoder can perform deduplication based on N first candidate block vectors in the first block vector candidate list of the current block in a prediction mode scenario based on IBC MBVD. By removing duplicate block vectors from the N first candidate block vectors within a first domain range, for example in intra-template matching prediction mode, a third block vector candidate list is determined. The predicted value of the current block is determined based on the block vectors from which redundancy has been removed in the third block vector candidate list. Further deduplication is performed on at least one first extended candidate block vector corresponding to each first candidate block vector in the third block vector candidate list to obtain a second block vector candidate list, and the predicted value of the current block is determined based on the second block vector candidate list. By removing duplicate block vectors from at least one first extended candidate block vector within a first domain range, for example in intra-template matching prediction mode, the redundancy of the block vectors is further reduced. Therefore, when encoding using the block vectors from which redundancy has been removed, the representation efficiency of header information can be improved, and consequently, the encoding efficiency of the video can be improved.
[0450] Steps S502-S509, S502-S507, S5033, and S504 in the embodiments of this application are consistent with the implementation principle when the decoder decides that the current block will use a predictive mode based on IBC MBVD, and will not be described again here.
[0451] The difference is that in steps S5033 and S504, the encoder constructs and removes the first extended candidate block vector for all N first candidate block vectors, whereas the decoder constructs and removes the first extended candidate block vector only for the first candidate block vectors corresponding to the candidate block vector index information among the N first candidate block vectors. However, the principle of constructing its first extended candidate block vector for each first candidate block vector and removing block vectors belonging to the first region range remains the same.
[0452] In the embodiments of this application, steps S508-S509 and S5033-S504 after step S507 are two selectable realizations, and the embodiments of this application are not limited thereto.
[0453] Some embodiments of the present application further provide an encoding method, which, as shown in Figure 25, includes the following steps.
[0454] In step S501, the prediction mode for the current block is determined.
[0455] In step S510, if it is determined that the current block uses a prediction mode based on template matching merge, K third candidate block vectors (where K is an integer greater than or equal to 1) having the minimum template cost are determined from the first block vector candidate list.
[0456] In step S511, block vectors belonging to the first region range are removed from the K third candidate block vectors to obtain a second block vector candidate list.
[0457] In the embodiments of this application, the method by which the encoder removes block vectors belonging to the first region range from K third candidate block vectors to obtain a second block vector candidate list includes the following two methods.
[0458] Method 1 If, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference blocks of the first region range.
[0459] Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is complete, or until K selected third candidate block vectors are obtained.
[0460] Based on at least one third candidate block vector after selection, the list of candidate second block vectors is determined.
[0461] Method 2 If, among the K third candidate block vectors, the first extended horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference block of the first region range. Here, the first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are the search ranges defined in IBC TM merge mode.
[0462] Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is complete, or until K selected third candidate block vectors are obtained.
[0463] Based on at least one third candidate block vector after selection, the list of candidate second block vectors is determined.
[0464] In step S504, the predicted value of the current block is determined based on the second block vector candidate list.
[0465] Steps S502-S509, S502-S507, S5033, and S504 in the embodiments of this application are consistent with the implementation principle when the decoder decides that the current block will use a predictive mode based on template matching merge, and will not be described again here.
[0466] To make it easier to understand, the encoder can perform redundancy removal in the block encoding process, in a prediction mode scenario based on template matching merge, based on K third candidate block vectors in the first block vector candidate list of the current block. For the K third candidate block vectors, duplicate block vectors are removed within the first region, for example in intra-template matching prediction mode, to determine the second block vector candidate list. Further local refinement is then performed based on the redundancy-removed block vectors in the second block vector candidate list, thereby determining the predicted value of the current block. This reduces the redundancy of the block vectors, improving the representation efficiency of header information when encoding using the redundancy-removed block vectors, and ultimately improving the video encoding efficiency.
[0467] Furthermore, in this application, the encoding method further includes performing a duplicate check operation on candidate block vectors in the first block vector candidate list in the process of determining the first block vector candidate list for the current block.
[0468] In the embodiments of the present invention, the encoder performing a duplicate check operation on candidate block vectors in the first block vector candidate list includes: determining the current candidate block vector to be added; comparing the current candidate block vector with the candidate block vectors in the first block vector candidate list; adding the current candidate block vector to the first block vector candidate list if the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list; and skipping the current candidate block vector and continuing to perform the step of determining the next candidate block vector to be added if the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list.
[0469] In some embodiments of the present invention, the current candidate block vector is identical to the candidate block vector in the first block vector candidate list.
[0470] In some embodiments of the present application, the difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition.
[0471] To make it easier to understand, when constructing the first block vector candidate list, a deduplication operation is performed to remove some duplicate BVs, thereby reducing the redundancy of the block vectors during encoding. Consequently, when encoding using the block vectors after redundancy has been removed, the efficiency of representing header information can be improved, and ultimately, the efficiency of video encoding can be improved.
[0472] In some embodiments of the present application, if the current block uses an intrablock merge-based prediction mode, a first syntactic identifier is determined, a second syntactic identifier is determined, and these are written to the bitstream, the first syntactic identifier indicating whether the current block uses an intrablock copy prediction mode, and the second syntactic identifier indicating whether the current block uses an intrablock merge prediction mode.
[0473] The following specific embodiments will describe the above encoding and decoding methods in detail.
[0474] (1) Example 1 The embodiments of this application primarily address the case where the current block is in IBC MBVD mode (intra-block copy merge mode with BVD), where, similar to MMVD in VVC interframe technology, the IBC MBVD mode starts with one of the candidate items in the IBC merge list, selects one candidate item from a set of candidate points corresponding to a predefined set of distances and directions, and takes the corresponding block vector as the final BV. That is, an offset is performed with the current candidate item as the center point to obtain a set of candidate points, and then one candidate item is subsequently selected from this set of candidate points as the final BV.
[0475] Specifically, if a block is currently in IBC MBVD mode, the process of building the MBVD candidate list involves deleting BVs that are within the search range of IntraTMP (Intra-Template Matching Prediction), and the specific method for doing so is as follows:
[0476] If the block is currently in IBC MBVD mode, similar to MMVD in VVC's interframe technology, one candidate item from the IBC merge list (first block vector candidate list) is used as the starting point, one candidate item is selected from a set of candidate points corresponding to a predefined set of distances and directions, and the corresponding block vector is taken as the final BV.
[0477] Based on a pre-set distance set and a pre-defined direction set, multiple refinement positions for the basic candidate item can be determined, thereby achieving refinement of the basic candidate item.
[0478] For example, in IBC MBVD mode, the distance set is defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD directions are two positive and negative horizontal directions and two positive and negative vertical directions. Here, the direction set includes a total of four directions: positive and negative horizontal directions and positive and negative vertical directions. With 20 distances and 4 directions, 20 × 4 refinement positions (referring here to refinement positions of the base candidate item) can be determined.
[0479] First, it is necessary to determine the base candidate items from the candidate items in the sorted IBC merge list corresponding to the IBC MBVD mode. Here, the number of base candidate items is predetermined; that is, the decoder and encoder can pre-define or agree on the number of base candidate items.
[0480] The sorted IBC merge list is a list that has been re-sorted after calculating the template matching cost for each candidate item. In other words, each candidate item in the sorted IBC merge list is sorted based on the template matching cost value. Each candidate item may be sorted in descending order of template matching cost value, or in ascending order of template matching cost value, and this application does not limit this in any way.
[0481] For example, if each candidate item is sorted in ascending order of template matching cost value, the first candidate item in the sorted IBC merge list will have the lowest template matching cost value.
[0482] The basic candidate items (the first candidate block vector) are selected from the top 5 candidate items in the IBC merge list (the first block vector candidate list) after resorting, and based on the SAD cost between the template and the reference of the refinement position of each basic candidate item, the refinement positions of all possible MBVDs of each basic candidate item (i.e., 20×4 candidate items) are resorted. In this process, it is necessary to first determine whether the BV of the 20×4 candidate items of each basic candidate item is within the IntraTMP search range.
[0483] Exemplarily, when (bvCand[x0][y0][disIdx][dirIdx][0] > -searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][0] < searchRangeWidth && bvCand[x0][y0][disIdx][dirIdx][1] > -searchRangeHeight && bvCand[x0][y0][disIdx][dirIdx][1] < searchRangeHeight) is true, it means that the BV is within the IntraTMP range and does not participate in the resorting. Here, searchRangeWidth and searchRangeHeight represent the predetermined search range of the template in the IntraTMP mode.
[0484] Here, bvCand represents the position of the candidate item, and searchRangeWidth and searchRangeHeight represent the predetermined search range. The predetermined search range here includes at least one of the size of the CTU, the range of the reconstructed area, the current image area where the current block is located, etc., but the present application is not limited thereto.
[0485] After determining the IBC MBVD list for IBC MBVD mode, the first N refinement positions with the minimum template SAD are retained, where N may be artificially preset, for example, as 8. If there are fewer than N, the BVs in the IBC candidate BV list are used to supplement and can be used for MBVD index coding. If N is 0, no IBC-MBVD is performed. Candidate items for IBC-MBVD do not inherit the inversion type from adjacent blocks coded with RR-IBC. The MBVD index is binarized by a Rice code with a parameter equal to 1.
[0486] In the embodiments of this application, by removing BV information that is redundantly represented in different modes, the representation efficiency of header information can be improved, thereby improving the overall video encoding efficiency. At the same time as removing redundantly represented BV information, it is also possible to introduce options that could not originally be represented in the re-sorted list, improving the representation range of the BV candidate list in the corresponding mode, increasing the diversity of options, and improving the video encoding efficiency.
[0487] In the embodiments of this invention, in IBC mode, options within the BV representation range that can be covered by IntraTMP mode are removed from the list of candidate modes selected by sorting by template cost, thereby improving the representation efficiency of header information, increasing the diversity of options, and improving the encoding efficiency of video.
[0488] (ii), Example 2 Based on Example 1, when the current block is in IBC MBVD mode, the options in the merge list are determined, and merge candidate items in the list where all options after the offset are within the IntraTMP search range are ignored. The specific method is as follows:
[0489] In IBC MBVD mode, similar to MMVD in VVC's interframe technology, one candidate item from the IBC merge list is used as a starting point, one candidate item is selected from a set of candidate points corresponding to a predefined set of distances and directions, and the corresponding block vector is used as the final BV.
[0490] For example, in IBC MBVD mode, the distance set is defined as {1pel, 2pel, 4pel, 8pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD direction is defined as two horizontal directions (positive and negative) and two vertical directions (positive and negative).
[0491] The base candidate items are selected from the first N candidate items in the re-sorted IBC merge list. First, the first N candidate items are offset (for example, candidate points after offsetting by 128pel), and it is determined whether all options are within the IntraTMP search range. If all are within the IntraTMP search range, the candidate item is removed from the base candidate items. At this point, the merge_idx syntax element corresponds not to the number in the original IBC merge list, but to the number in the re-sorted list after removing the options where all offset options are within the IntraTMP search range. At this point, it is necessary to construct a new candidate item list MBVD_merge_cand_list specifically for MBVD. The first N items in the original IBC merge candidate item list IBC merge_cand_list are examined one by one, and if the condition that all offset items are within the IntraTMP search range is not met, the candidate item is added to MBVD_merge_cand_list; otherwise, it is not added, and this process continues until there are no more candidate items or the number of candidate items is predetermined (for example, 5).
[0492] Examples of the determination condition that all options after offset are within the IntraTMP search range are as follows.
[0493] When (bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_left][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx][dirHorIdx_right][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_up][dirHorIdx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][disIdx_max][dirVerIdx_down][dirHorIdx][1] < searchRangeHeight) is true.
[0494] After determining the IBC MBVD list in the IBC MBVD mode, the basic candidate items in subsequent operations are selected from the MBVD_merge_cand_list. At the same time, the meaning of the syntax element merge_idx also changes to the number in the MBVD_merge_cand_list. Here, searchRangeWidth and searchRangeHeight refer to the search range used by the TM refinement options in the TM merge mode and are set to a constant 8, for example.
[0495] Based on the SAD cost between the template and the reference of each refinement position, all possible MBVD refinement positions of each basic candidate (that is, 20 × 4 candidate items) are re-sorted. In this process, it is necessary to first determine whether the BV of the 20 × 4 candidate items is within the IntraTMP search range.
[0496] If (bvCand[x0][y0][merge_idx][disIdx][dirVerIdx][dirHorIdx][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx][dirVerIdx][dirHorIdx][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][disIdx][dirVerIdx][dirHorIdx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][disIdx][dirVerIdx][dirHorIdx][1] < searchRangeHeight) is true, the BV is within the IntraTMP range and does not participate in re-sorting. Here, searchRangeWidth and searchRangeHeight represent the predetermined search range of the template in the IntraTMP mode.
[0497] Finally, retain the top N refinement positions with the minimum template SAD. N may be artificially preset, for example, to 8. If it is less than N, supplement with BVs in the IBC candidate BV list and can be used for MBVD index encoding. The candidate items of IBC-MBVD do not inherit the inversion type from adjacent blocks encoded by RR-IBC. The MBVD index is binarized by a Rice code with a parameter equal to 1.
[0498] (3) Example 3 When the current block is in the IBC TM merge mode, based on the constructed merge list, ignore the BVs within the IntraTMP search range in the list, that is, establish a candidate list dedicated to the IBC TM merge mode, in which some BVs within the IntraTMP search range are removed. The specific implementation method is as follows, for example.
[0499] In the IBC TM merge mode, after obtaining bvL based on the above information, further refine BV locally using TM. The specific operation is to search within a narrow range centered on the obtained bvL, and select the optimal BV within this range as the final BV based on the criterion that the template matching cost is minimized.
[0500] Perform TM refinement on the candidate list in the IBC merge mode. One specific implementation process is as follows.
[0501] Construct a candidate list IBC_TM_merge_cand_list dedicated to the IBC TM merge mode, and verify each of the first N items in the original IBC merge candidate item list IBC merge_cand_list one by one. If the condition that it is within the IntraTMP search range is not met, put the candidate item into IBC_TM_merge_cand_list; otherwise, do not put it in. Continue until there are no candidate items or the predefined number of candidate items (for example, 6) is reached.
[0502] Examples of the judgment condition that all options after offset are within the IntraTMP search range are as follows.
[0503] When (bvCand[x0][y0][merge_idx][0] > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] < searchRangeWidth && bvCand[x0][y0][merge_idx][1] > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] < searchRangeHeight) is true. Here, searchRangeWidth and searchRangeHeight represent the predetermined search range of the template in the IntraTMP mode.
[0504] After determining the IBC TM merge list in IBC TM merge mode, the base candidate items for subsequent operations are selected from IBC_TM_merge_cand_list. At the same time, the meaning of the syntactic element merge_idx also changes to the number in IBC_TM_merge_cand_list.
[0505] When constructing candidate items, the inversion type will be set to "no inversion" by default.
[0506] In IBC TM merge mode, this specifies whether the transmitted syntactic elements undergo integer pixel-precision TM refinement. Both the refinement motion vector and the template position used in each refinement step must adhere to the constraints of the reference area.
[0507] The search is performed in the vicinity of the location pointed to by the candidate item, and the optimal location is determined by the size of the SAD between the template of the reference block and the template of the current block. The following search methods are included, but are not limited to them. The search range is set to [-8,8], and first, as shown in the upper left corner of the following diagram, a diamond search of integer pixels is performed to search for 8 points in the vicinity of the center position, with a maximum of 375 searches. The search continues even after the first optimal location is determined, and in the subsequent search process, 5 points are searched at even positions and 3 points at odd positions. Referring to Figures 7a and 7b, taking Figure 7b as an example, moving counterclockwise from the grid of circular points corresponds to the order of indices 0 to 7. Specifically, in the above process, if the red position is selected as the optimal location, the 5 or 3 points at the purple positions are searched next. After the diamond-shaped search process described above, a cross search of integer pixels is performed only once. That is, after the current optimal position is found by the diamond search, four positions located one pixel away from the current optimal position—below, to the right, above, and to the left—are checked to update the final optimal position, and thus the refined candidate list is updated.
[0508] (IV), Example 4 This method is similar to Example 3, but differs in that it removes candidate items that are completely contained within the IntraTMP search range, thereby ensuring that the search range is completely contained within the IntraTMP range. A specific implementation method is as follows:
[0509] In IBC TM merge mode, after obtaining bvL based on the above information, TM is used to further refine the BV locally. Specifically, a search is performed within a narrow range centered on the obtained bvL, and the optimal BV within that range is selected as the final BV based on the criterion of minimizing the template matching cost.
[0510] The TM refinement process for the candidate list in IBC merge mode is as follows:
[0511] A candidate list IBC_TM_merge_cand_list is constructed specifically for IBC TM merge mode. The first N items in the original IBC merge candidate item list IBC merge_cand_list are checked one by one. If the condition that the item is within the IntraTMP search range is not met, the candidate item is added to IBC_TM_merge_cand_list. Otherwise, it is not added, and this process continues until there are no more candidate items or the number of candidate items is limited to a predetermined number (e.g., 6).
[0512] Examples of conditions for determining that all options after the offset are within the IntraTMP search range include the following:
[0513] When (bvCand[x0][y0][merge_idx][0] - searchRangeWidthIBCTM > -searchRangeWidth && bvCand[x0][y0][merge_idx][0] + searchRangeWidthIBCTM < searchRangeWidth && bvCand[x0][y0][merge_idx][1] - searchRangeHeightIBCTM > -searchRangeHeight && bvCand[x0][y0][merge_idx][1] + searchRangeHeightIBCTM < searchRangeHeight) is true. Here, searchRangeWidth and searchRangeHeight represent the predetermined search range of the template in the IntraTMP mode, and searchRangeWidthIBCTM and searchRangeHeightIBCTM are the search ranges defined in the IBC TM merge mode (for example, the values of searchRangeWidthIBCTM and searchRangeHeightIBCTM are both 8 (for example, [-8, 8] listed below).
[0514] After determining the IBC TM merge list in the IBC TM merge mode, the basic candidate items in subsequent operations are selected from IBC_TM_merge_cand_list. At the same time, the meaning of the syntax element merge_idx also changes to the number in IBC_TM_merge_cand_list.
[0515] Note that when constructing candidate items, the inversion type is default non-inverted.
[0516] In IBC TM merge mode, it is specified whether the transmitted syntactic elements undergo integer pixel precision TM refinement. The refinement motion vector and the position of the template used in each refinement step must both adhere to the constraints of the reference area. A search is performed in the neighborhood of the position pointed to by the candidate item, and the optimal position is determined by the size of the SAD between the template of the reference block and the template of the current block. The following search methods are included, but are not limited to: The search range is set to [-8,8], and first, as shown in the upper left corner of the following diagram, an integer pixel diamond search is performed to find eight points in the neighborhood of the center position, with a maximum of 375 searches. The search continues even after the first optimal position is determined, and in the subsequent search process, five points are searched at even positions and three points at odd positions. Referring to Figures 7a and 7b, taking Figure 7b as an example, one full rotation counterclockwise from the grid circle points corresponds to the order of indices 0 to 7. Specifically, in the above process, if the red position is selected as the optimal position, the five or three points at the purple positions are searched next. After the diamond-shaped search process described above, a cross search of integer pixels is performed only once. That is, after the current optimal position is found by the diamond search, four positions located one pixel away from the current optimal position—below, to the right, above, and to the left—are checked to update the final optimal position, and thus the refined candidate list is updated.
[0517] (5) Example 5 The above-described prediction techniques for IBC™ merge and MBVD can be used in combination.
[0518] In other words, Examples 1 and 2, Examples 2 and 4, Examples 2 and 3, and Examples 1 and 4 can all be used in combination.
[0519] (vi), Example 6 In the process of establishing the TM merge candidate list or MBVD candidate list, further duplicate checking and removal can be performed.
[0520] When a BV is newly added to the list, it is compared with an existing BV in the list. If there is a duplicate, the BV is skipped, and the next candidate BV is checked. If there is no duplicate, the BV is added to the candidate list.
[0521] The criteria for duplication can be as follows:
[0522] If they are completely identical, they are considered to be duplicates (both the horizontal and vertical components are identical). After comparing the difference between BVs to a certain threshold, they may be considered to overlap if the difference is deemed too small (for example, if the absolute values of the differences between the horizontal and vertical components are both 2 or less, or if the absolute value of the difference between the horizontal components is less than 2 and the absolute value of the difference between the vertical components is less than 3).
[0523] Embodiments of the present application provide a bitstream, which is generated by bit encoding based on information to be encoded, where the information to be encoded is: The current block includes at least one of the following: predicted difference value of the current block, candidate block vector index information, extended candidate block vector index information, first syntax identifier information, second syntax identifier information, and third syntax identifier information. Here, the first syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock copying, the second syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock merging, and the third syntactic identifier is used to indicate whether the current block uses MBVD mode.
[0524] In another embodiment of the present application, based on the same inventive concept as the above embodiment, a schematic diagram illustrating the configuration of the decoder 1 according to the embodiment of the present application is shown with reference to Figure 26. As shown in Figure 26, the decoder 1 is A decoding unit 10 is configured to decode a bitstream and determine the prediction mode of the current block, If the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, the first determination unit 11 is configured to determine a first block vector candidate list of the current block and to determine a first region range, A first removal unit 12 is configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range, The system may include a first prediction unit 13 configured to determine a predicted value for the current block based on the second block vector candidate list.
[0525] In some embodiments of the present invention, the first removal unit 12 is further configured to remove block vectors belonging to the first region range from the first block vector candidate list to obtain a second block vector candidate list.
[0526] In some embodiments of the present application, the first removal unit 12 further determines candidate block vector index information if it determines that the current block uses a prediction mode based on IBC MBVD, Based on the first block vector candidate list, determine at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information. The system is configured to obtain the second block vector candidate list by removing block vectors belonging to the first region range from the at least one first extension candidate block vector.
[0527] In some embodiments of the present invention, the first determination unit 11 further determines N first candidate block vectors (where N is an integer greater than or equal to 1) having the minimum template cost from the first block vector candidate list, Based on the candidate block vector index information, a first candidate block vector is determined from the N first candidate block vectors. The system is configured to refine the first candidate block vector based on the distance set and the block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector.
[0528] In some embodiments of the present invention, the first determination unit 11 further sequentially removes block vectors corresponding to reference blocks belonging to the first region range for each first extension candidate block vector to obtain at least one selected first extension candidate block vector. The system is configured to determine the second block vector candidate list based on at least one first extended candidate block vector after the selection process.
[0529] In some embodiments of the present application, the first removal unit 12 further determines if the horizontal boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors falls within a predetermined vertical range, and the first candidate reference block pointed to by any of the first extension candidate block vectors falls within the reference blocks of the first region range. The system is configured to obtain at least one selected first extension candidate block vector by removing one of the first extension candidate block vectors and continuing the removal process on other first extension candidate block vectors.
[0530] In some embodiments of the present invention, the first removal unit 12 is further configured such that if the horizontal boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the horizontal range of a predetermined range, or if the vertical boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the vertical range of a predetermined range, the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the reference blocks of the first region range, and any of the first extension candidate block vectors is one selected first extension candidate block vector corresponding to each candidate block vector.
[0531] In some embodiments of the present invention, the first determination unit 11 further determines M first extension candidate block vectors (where M is an integer greater than or equal to 1) corresponding to the minimum template cost from the at least one first extension candidate block vector after selection, The system is configured to construct the second block vector candidate list based on the M first extension candidate block vectors.
[0532] In some embodiments of the present invention, the first determination unit 11 further determines other candidate block vectors from the first block vector candidate list if the number of at least one first extended candidate block vector after selection is less than M, and the other candidate block vectors are different from the N candidate block vectors. The system is configured to determine M first extended candidate block vectors based on the other candidate block vectors and the at least one selected first extended candidate block vector.
[0533] In some embodiments of the present application, the decoding unit 10 is further configured to decode the bitstream and determine extended candidate block vector index information. The first determination unit 11 is further configured to determine a first block vector based on the extended candidate block vector index information and the second block vector candidate list, and to determine the reference block of the current block based on the first block vector. The first prediction unit 13 is further configured to determine the predicted value of the current block based on the reference block.
[0534] In some embodiments of the present invention, the first determination unit 11 further determines N first candidate block vectors (where N is an integer greater than or equal to 1) having the minimum template cost from the first block vector candidate list, From the N first candidate block vectors, remove the block vectors belonging to the first region range to obtain the third block vector candidate list. Based on the third block vector candidate list, the system is configured to determine at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information.
[0535] In some embodiments of the present invention, the first determination unit 11 further determines a first candidate block vector from the third candidate block vector list based on the candidate block vector index information, The system is configured to refine the first candidate block vector based on the distance set and the block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector.
[0536] In some embodiments of the present application, the decoding unit 10 further decodes the bitstream to determine extended candidate block vector index information. Based on the aforementioned extended candidate block vector index information, a first block vector is determined from the at least one first extended candidate block vector. The system is configured to determine the reference block of the current block based on the first block vector, and to determine the predicted value of the current block based on the reference block.
[0537] In some embodiments of the present invention, the first removal unit 12 further sequentially removes block vectors corresponding to reference blocks belonging to the first region range from each of the N first candidate block vectors to obtain at least one selected first candidate block vector. The system is configured to determine the third block vector candidate list based on at least one first candidate block vector after the selection process.
[0538] In some embodiments of the present invention, the first removal unit 12 further sequentially offsets the first candidate block vectors in N first candidate block vectors and determines at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in the at least one second candidate reference block pointed to by the at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in the at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to the at least one second candidate block vector belongs to the block vector of the first region range. The system is configured to remove the first candidate block vector in question and then continue the removal process on other first candidate block vectors to obtain at least one selected first candidate block vector.
[0539] In some embodiments of the present application, the first removal unit 12 further determines if the maximum horizontal boundary position or minimum horizontal boundary position in at least one second candidate reference block pointed to by the at least one second candidate block vector does not fall within a predetermined horizontal range, or if the maximum vertical boundary position or minimum vertical boundary position in at least one second candidate reference block does not fall within a predetermined vertical range, then the candidate block vector corresponding to the at least one second candidate block vector does not belong to the block vectors of the first region range, and the first candidate block vector corresponding to the at least one second candidate block vector is used as one selected first candidate block vector. The system is configured to continue the removal process for other first candidate block vectors until processing of N first candidate block vectors is complete, or until N selected first candidate block vectors are obtained.
[0540] In some embodiments of the present invention, if the first removal unit 12 further determines that the current block uses a prediction mode based on template matching merge, it determines from the first block vector candidate list K third candidate block vectors (where K is an integer greater than or equal to 1) having the minimum template cost, The system is configured to obtain the second block vector candidate list by removing block vectors belonging to the first region range from the K third candidate block vectors.
[0541] In some embodiments of the present application, the first removal unit 12 further determines that if, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference blocks of the first region range. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed or until K selected third candidate block vectors are obtained. The system is configured to determine the second block vector candidate list based on at least one third candidate block vector after the selection process.
[0542] In some embodiments of the present application, the first removal unit 12 further determines that if the first extended horizontal boundary position of the third candidate reference block pointed to by any of the K third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference blocks of the first region range. Here, the first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are the search ranges defined in the prediction mode based on template matching merge. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed or until K selected third candidate block vectors are obtained. The system is configured to determine the second block vector candidate list based on at least one third candidate block vector after the selection process.
[0543] In some embodiments of the present invention, the first determination unit 11 is further configured to perform template matching refinement on the second block vector candidate list and determine a fourth block vector candidate list. The decoding unit 10 is further configured to decode the bitstream and determine candidate block vector index information. The first determination unit 11 is further configured to determine a first block vector based on the candidate block vector index information and the fourth block vector candidate list, and to determine the reference block of the current block based on the first block vector. The first prediction unit 13 is further configured to determine the predicted value of the current block based on the reference block.
[0544] In some embodiments of the present invention, the first removal unit 12 is further configured to perform a duplicate check operation on candidate block vectors in the first block vector candidate list in the process of determining the first block vector candidate list for the current block.
[0545] In some embodiments of the present application, the first removal unit 12 further determines the current candidate block vector to be added, The current candidate block vector is compared with the candidate block vector in the first block vector candidate list. If the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list. If the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, the system is configured to skip the current candidate block vector and continue executing the step of determining the next candidate block vector to be added.
[0546] In some embodiments of the present invention, the first removal unit 12 is further configured such that the current candidate block vector is identical to a candidate block vector in the first block vector candidate list.
[0547] In some embodiments of the present application, the first removal unit 12 is further configured such that the difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition.
[0548] In some embodiments of the present application, the decoding unit 10 is further configured to decode the bitstream and determine the predicted difference value of the current block. The first prediction unit 13 is further configured to determine the reconstruction value of the current block based on the predicted value of the current block and the predicted difference value of the current block.
[0549] In some embodiments of the present application, the first region is defined as follows: Current size of coding tree unit, The size of the reconfigured region in the current frame, The current size of the image boundary of the block, and Includes one of the search ranges for Intra TMP mode.
[0550] In some embodiments of the present application, the decoding unit 10 further decodes the bitstream to determine a first syntax identifier, the first syntax identifier is used to indicate whether the current block uses a predictive mode based on an intra-block copy. If the first syntactic identifier indicates that the current block uses an intrablock copy-based prediction mode, the system is configured to determine a second syntactic identifier, which indicates whether the current block uses an intrablock merge-based prediction mode to determine the predicted value of the current block.
[0551] In practical applications, the embodiments of the present application further provide a decoder, and referring to Figure 27, a schematic diagram of the specific hardware structure of decoder 1 according to the embodiments of the present application is shown.
[0552] As shown in Figure 27, Decoder 1 is The system may include a first communication interface 14, a first memory 15, and a first processor 16, with each component coupled to the others by a first bus system 17. To make this clear, the first bus system 17 is configured to facilitate communication between these components. In addition to the data bus, the first bus system 17 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in Figure 27, the various buses are labeled as the first bus system 17.
[0553] The first communication interface 14 is configured to send and receive signals in the process of sending and receiving information with other external network elements.
[0554] The first memory 15 is configured to store computer programs that can be executed by the first processor 16.
[0555] The first processor 16 is configured to execute the decoding method on the decoder side by executing the computer program.
[0556] To make it easier to understand, in the block decoding process, for intra-merge mode prediction scenarios, the decoder determines a second block vector candidate list based on a first block vector candidate list for the current block, by removing block vectors that overlap with, for example, intra-template matching prediction modes within a first domain range. The decoder then determines the predicted value of the current block based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when encoding and decoding using the block vectors from which redundancy has been removed, and ultimately improving the decoding efficiency of the video.
[0557] It should be understood that the first memory 15 in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Here, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) used as an external cache. To illustrate, without limiting the scope of this explanation, 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 linkage dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The first memory 15 in the systems and methods described herein includes, but is not limited to, these and any other suitable types of memory.
[0558] The first processor 16 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be performed by a hardware-type integrated logic circuit or a software-type instruction in the first processor 16. The first processor 16 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, or transistor logic devices, discrete hardware components, etc., which can implement or execute each method, step and logic block diagram disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of this application may be performed directly by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software module may be placed in a storage medium known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. The storage medium is placed in the first memory 15, and the first processor 16 reads the information in the first memory 15 and performs the steps of the method described above in combination with its hardware.
[0559] In another embodiment of the present application, based on the same inventive concept as the above embodiment, with reference to Figure 28, an exemplary structural diagram of the encoder 2 according to the embodiment of the present application is shown. As shown in Figure 28, the encoder 2 is A second determination unit 20 is configured to determine the prediction mode of the current block, and if the current block uses a prediction mode based on intrablock merging, to determine a first block vector candidate list for the current block and to determine a first region range. A second removal unit 21 is configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range, The system may also include a second prediction unit 22 configured to determine a predicted value for the current block based on the second block vector candidate list.
[0560] In some embodiments of the present invention, the second removal unit 21 is further configured to remove block vectors belonging to the first region range from the first block vector candidate list to obtain a second block vector candidate list.
[0561] In some embodiments of the present application, the second removal unit 21 further determines, based on the first block vector candidate list, at least one first extended candidate block vector corresponding to each first candidate block vector, if it is determined that the current block uses a prediction mode based on IBC MBVD, The system is configured to obtain the second block vector candidate list by removing block vectors belonging to the first region range from among the at least one first extended candidate block vector corresponding to each first candidate block vector.
[0562] In some embodiments of the present invention, the second determination unit 20 further determines N first candidate block vectors (where N is an integer greater than or equal to 1) having the minimum template cost from the first block vector candidate list, Based on the distance set and the block vector prediction direction, the system is configured to refine each of the N first candidate block vectors to determine at least one first extended candidate block vector corresponding to each of the first candidate block vectors.
[0563] In some embodiments of the present application, the second removal unit 21 further removes, for each first candidate block vector, block vectors corresponding to reference blocks belonging to the first region range from each first candidate extension block vector to obtain at least one selected first extension candidate block vector. The system is configured to determine the second block vector candidate list based on the selected first extended candidate block vector corresponding to each first candidate block vector.
[0564] In some embodiments of the present application, the second removal unit 21 further determines if the horizontal boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors falls within a predetermined vertical range, and the first candidate reference block pointed to by any of the first extension candidate block vectors falls within the reference blocks of the first region range. The system is configured to obtain at least one selected first extension candidate block vector by removing any of the first extension candidate block vectors and continuing the removal process for other first extension candidate block vectors corresponding to each of the first candidate block vectors.
[0565] In some embodiments of the present invention, the second removal unit 21 is further configured such that if the horizontal boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined horizontal range, or if the vertical boundary position of the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within a predetermined vertical range, the first candidate reference block pointed to by any of the first extension candidate block vectors does not fall within the first range of reference blocks, and any of the first extension candidate block vectors is one selected first extension candidate block vector corresponding to each candidate block vector.
[0566] In some embodiments of the present invention, the second determination unit 20 further determines, for each first candidate block vector, M first extension candidate block vectors (where M is an integer greater than or equal to 1) that correspond to the minimum template cost from among the at least one first extension candidate block vector selected, The system is configured to construct the second block vector candidate list based on N first candidate block vectors for each first candidate block vector.
[0567] In some embodiments of the present application, the second determination unit 20 further determines, for each of the first candidate block vectors, another first candidate block vector from the first block vector candidate list if the number of at least one selected first extended candidate block vector is less than M, and the other first candidate block vector is different from the N first candidate block vectors. Based on the other first candidate block vectors and the selected first extended candidate block vectors, the system is configured to determine M first extended candidate block vectors.
[0568] In some embodiments of the present invention, the second determination unit 20 further determines N first candidate block vectors (where N is an integer greater than or equal to 1) having the minimum template cost from the first block vector candidate list, From the N first candidate block vectors, remove the block vectors belonging to the first region range to obtain the third block vector candidate list. Based on the third block vector candidate list, the system is configured to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0569] In some embodiments of the present invention, the second determination unit 20 is further configured to refine each first candidate block vector in the third block vector candidate list based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector.
[0570] In some embodiments of the present invention, the second removal unit 21 further removes block vectors corresponding to reference blocks belonging to the first region range from each of the N first candidate block vectors to obtain at least one selected first candidate block vector. The system is configured to determine the third block vector candidate list based on at least one first candidate block vector after the selection process.
[0571] In some embodiments of the present invention, the second removal unit 21 further sequentially offsets the first candidate block vectors in N first candidate block vectors and determines at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in the at least one second candidate reference block pointed to by the at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in the at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to the at least one second candidate block vector belongs to the block vector of the first region range. The system is configured to remove the first candidate block vector in question and then continue the removal process on other first candidate block vectors to obtain at least one selected first candidate block vector.
[0572] In some embodiments of the present application, the second removal unit 21 further determines if the maximum horizontal boundary position or minimum horizontal boundary position in at least one second candidate reference block pointed to by the at least one second candidate block vector does not fall within a predetermined horizontal range, or if the maximum vertical boundary position or minimum vertical boundary position in at least one second candidate reference block does not fall within a predetermined vertical range, then the candidate block vector corresponding to the at least one second candidate block vector does not belong to the block vectors of the first region range, and the first candidate block vector corresponding to the at least one second candidate block vector is used as one selected first candidate block vector. The system is configured to continue the removal process for other first candidate block vectors until processing of N first candidate block vectors is complete, or until N selected first candidate block vectors are obtained.
[0573] In some embodiments of the present invention, if the second removal unit 21 has determined that the current block uses a prediction mode based on template matching merge, it determines from the first block vector candidate list K third candidate block vectors (where K is an integer greater than or equal to 1) having the minimum template cost, The system is configured to obtain the second block vector candidate list by removing block vectors belonging to the first region range from the K third candidate block vectors.
[0574] In some embodiments of the present application, the second removal unit 21 further determines that if, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference blocks of the first region range. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed or until K selected third candidate block vectors are obtained. The system is configured to determine the second block vector candidate list based on at least one third candidate block vector after the selection process.
[0575] In some embodiments of the present application, the second removal unit 21 further determines that if the first extended horizontal boundary position of the third candidate reference block pointed to by any of the K third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors belongs to the reference blocks of the first region range. Here, the first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are the search ranges defined in the prediction mode based on template matching merge. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed or until K selected third candidate block vectors are obtained. The system is configured to determine the second block vector candidate list based on at least one third candidate block vector after the selection process.
[0576] In some embodiments of the present invention, the second removal unit 21 is further configured to perform a duplicate check operation on candidate block vectors in the first block vector candidate list in the process of determining the first block vector candidate list of the current block.
[0577] In some embodiments of the present application, the second removal unit 21 further determines the current candidate block vector to be added, The current candidate block vector is compared with the candidate block vector in the first block vector candidate list. If the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list. If the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, the system is configured to skip the current candidate block vector and continue executing the step of determining the next candidate block vector to be added.
[0578] In some embodiments of the present invention, the second removal unit 21 is further configured such that the current candidate block vector is identical to the candidate block vector in the first block vector candidate list.
[0579] In some embodiments of the present application, the second removal unit 21 is further configured such that the difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition.
[0580] In some embodiments of the present application, the encoder 2 further comprises a writing unit 23, and the second determination unit 20 is further configured to determine a first syntax identification information and a second syntax identification information when the current block uses a prediction mode based on intrablock merging. The writing unit 23 is further configured to write a first syntax identifier and a second syntax identifier to the bitstream, the first syntax identifier indicating whether the current block uses the predictive mode of intrablock copying, and the second syntax identifier indicating whether the current block uses the predictive mode of intrablock merging.
[0581] In some embodiments of the present application, the second determination unit 20 is further configured to determine a third syntactic identification information. The writing unit 23 is further configured to write a third syntax identifier to the bitstream, which indicates whether the current block uses a predictive mode based on IBC MBVD.
[0582] In some embodiments of the present application, the second determination unit 20 is further configured to determine a first block vector based on the second block vector candidate list, and to determine a reference block of the current block based on the first block vector, The second prediction unit 22 is further configured to determine the predicted value of the current block based on the reference block.
[0583] In some embodiments of the present invention, the writing unit 23 is further configured to write candidate block vector index information corresponding to the first block vector to the bitstream.
[0584] In some embodiments of the present invention, the writing unit 23 is further configured to write candidate block vector index information and extended candidate block vector index information corresponding to the first block vector to the bitstream.
[0585] In some embodiments of the present application, the second prediction unit 22 is further configured to determine the original value of the current block and to determine the predicted difference value of the current block based on the original value of the current block and the predicted value of the current block.
[0586] In some embodiments of the present application, the first region is defined as follows: Current size of coding tree unit, The size of the reconfigured region in the current frame, The current size of the image boundary of the block, and Includes one of the search ranges for Intra TMP mode.
[0587] In practical applications, embodiments of the present application further provide an encoder, and referring to Figure 29, a schematic diagram of the specific hardware structure of encoder 2 according to embodiments of the present application is shown. As shown in Figure 29, encoder 2 is The system may include a second communication interface 24, a second memory 25, and a second processor 26, with each component coupled to the others by a second bus system 27. For clarity, the second bus system 27 is configured to facilitate communication between these components. In addition to the data bus, the second bus system 27 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in Figure 29, the various buses are labeled as the second bus system 27.
[0588] The second communication interface 24 is configured to send and receive signals in the process of sending and receiving information with other external network elements.
[0589] The second memory 25 is configured to store computer programs that can be executed by the second processor 26.
[0590] The second processor 26 is configured to execute the encoding method on the encoder side by executing the computer program.
[0591] To make it easier to understand, in the block encoding process, for intra-merge mode prediction scenarios, the encoder determines a second block vector candidate list based on a first block vector candidate list for the current block, by removing block vectors that overlap with, for example, intra-template matching prediction modes within a first domain range. The predicted value of the current block is then determined based on the block vectors from which redundancy has been removed in the second block vector candidate list. This reduces the redundancy of the block vectors, thereby improving the representation efficiency of header information when encoding using the block vectors from which redundancy has been removed, and ultimately improving the encoding efficiency of the video.
[0592] An embodiment of the present invention provides a computer-readable storage medium in which a computer program is stored that causes a first processor to execute a decoding method corresponding to a decoder, or a second processor to execute an encoding method corresponding to an encoder.
[0593] In another embodiment of the present application, with reference to Figure 30, an exemplary structural diagram of the configuration of the coding and decoding system according to an embodiment of the present application is shown. As shown in Figure 30, the coding and decoding system 3 may comprise an encoder 2 and a decoder 1.
[0594] In the embodiments of the present invention, encoder 2 may be an encoder described in any one of the above embodiments, and decoder 1 may be a decoder described in any one of the above embodiments.
[0595] In the embodiments of this application, the terms “equipment,” “includes,” or any other variation thereof are intended to be non-exclusive, meaning that a process, method, article, or apparatus comprising a set of elements includes not only those elements but also other elements not expressly enumerated, as well as elements inherent to that process, method, article, or apparatus. Unless otherwise specified, an element limited by the expression “includes one…” does not preclude the presence of other similar elements in a process, method, part, or apparatus comprising that element.
[0596] The above-mentioned numbering of the embodiments of this application is for illustrative purposes only and does not indicate any superiority or inferiority among the embodiments.
[0597] The methods disclosed in some embodiments of the methods provided herein can be arbitrarily combined without conflict to obtain new embodiments of the methods.
[0598] The features disclosed in the examples of some of the products provided in this application can be arbitrarily combined without conflict to obtain new examples of products.
[0599] The features disclosed in some of the examples of methods or apparatus provided herein can be arbitrarily combined without conflict to obtain new examples of methods or apparatus.
[0600] The foregoing describes only specific embodiments of the present application, and the scope of protection is not limited thereto. Any modifications or substitutions that a person skilled in the art could easily conceive within the technical scope disclosed herein should be included within the scope of protection. Therefore, the scope of protection shall be subject to the claims. [Industrial applicability]
[0601] In the embodiment of the present invention, in the encoding and decoding processes of a block, for an intra-merge mode prediction scenario, a second block vector candidate list is determined by removing block vectors that overlap with, for example, the intra-template matching prediction mode within a first region range, based on a first block vector candidate list of the current block. The predicted value of the current block is then determined based on the block vectors from which redundancy has been removed in the second block vector candidate list. As a result, the redundancy of the block vectors is reduced, and when encoding and decoding is performed using the block vectors from which redundancy has been removed, the representation efficiency of the header information can be improved, and consequently, the encoding and decoding efficiency of the video can be improved.
Claims
1. A decoding method applied to a decoder, Decrypting the bitstream and determining the prediction mode of the current block, If the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, then the first block vector candidate list of the current block is determined. Determine the first region range, and determine the second block vector candidate list based on the first block vector candidate list and the first region range. A decoding method comprising determining the predicted value of the current block based on the second block vector candidate list.
2. Determining a second block vector candidate list based on the first block vector candidate list and the first region range is: This includes removing block vectors belonging to a first region range from the first block vector candidate list to obtain a second block vector candidate list. The decoding method according to claim 1.
3. Obtaining a second block vector candidate list by removing block vectors belonging to the first region range from the first block vector candidate list is: If it is determined that the current block uses a prediction mode based on IBC MBVD (IBC Merge Mode with Block Vector Difference), then candidate block vector index information is determined, Based on the first block vector candidate list, determine at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information, The process includes removing block vectors belonging to a first region range from the at least one first extension candidate block vector to obtain the second block vector candidate list, The decoding method according to claim 2.
4. Based on the first block vector candidate list, determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is: From the aforementioned list of candidate first block vectors, determine N first candidate block vectors (where N is an integer greater than or equal to 1) that have the minimum template cost, Based on the candidate block vector index information, a first candidate block vector is determined from the N first candidate block vectors, The method includes refining the first candidate block vector based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector, The decoding method according to claim 3.
5. Obtaining the second block vector candidate list by removing block vectors belonging to the first region range from the at least one first extension candidate block vector is: For each first candidate extension block vector, block vectors corresponding to reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first candidate extension block vector. The process includes determining the second block vector candidate list based on at least one first extended candidate block vector after the selection, The decoding method according to claim 4.
6. For each first candidate extension block vector, sequentially removing block vectors corresponding to reference blocks belonging to the first region range to obtain at least one selected first candidate extension block vector is: If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the horizontal range of a predetermined range, and the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first candidate extension block vectors is deemed to belong to the reference block of the first region range, This includes removing one of the first candidate extension block vectors and continuing the removal process on other candidate extension block vectors to obtain at least one selected first candidate extension block vector, The decoding method according to claim 5.
7. The aforementioned decoding method is If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors does not fall within the horizontal range of a predetermined range, or if the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors does not fall within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first candidate extension block vectors is deemed not to belong to the reference blocks of the first region range, and any of the first candidate extension block vectors is deemed to be one selected first candidate extension block vector corresponding to each candidate block vector. The decoding method according to claim 5 or 6.
8. Determining the second block vector candidate list based on at least one first extended candidate block vector after the selection process is: From the at least one selected first extension candidate block vector, determine M first extension candidate block vectors (where M is an integer greater than or equal to 1) that correspond to the minimum template cost, This includes constructing the second block vector candidate list based on the M first extension candidate block vectors, The decoding method according to any one of claims 5 to 7.
9. The aforementioned decoding method is If the number of at least one first extended candidate block vector after selection is less than M, then another candidate block vector is determined from the first block vector candidate list, wherein the other candidate block vector is different from the N candidate block vectors. The further step is to determine M first extended candidate block vectors based on the other candidate block vectors and the at least one selected first extended candidate block vector, The decoding method according to claim 8.
10. Determining the predicted value of the current block based on the second block vector candidate list is: Decode the bitstream to determine the extended candidate block vector index information, Based on the extended candidate block vector index information and the second candidate block vector list, the first block vector is determined. This includes determining the reference block of the current block based on the first block vector, and determining the predicted value of the current block based on the reference block, The decoding method according to any one of claims 1 to 9.
11. Based on the first block vector candidate list, determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is: From the aforementioned list of candidate first block vectors, determine N first candidate block vectors (where N is an integer greater than or equal to 1) that have the minimum template cost, The third block vector candidate list is obtained by removing the block vectors belonging to the first region range from the N first candidate block vectors. The process includes determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information, based on the third block vector candidate list, The decoding method according to any one of claims 3 to 10.
12. Based on the third block vector candidate list, determining at least one first extended candidate block vector corresponding to the first candidate block vector indicated by the candidate block vector index information is: Based on the candidate block vector index information, a first candidate block vector is determined from the third candidate block vector list. The method includes refining the first candidate block vector based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to the first candidate block vector, The decoding method according to claim 11.
13. The aforementioned decoding method is Decode the bitstream to determine the extended candidate block vector index information, Based on the aforementioned extended candidate block vector index information, a first block vector is determined from the at least one first extended candidate block vector, The process further includes determining a reference block for the current block based on the first block vector, and determining a predicted value for the current block based on the reference block. The decoding method according to claim 11 or 12.
14. Obtaining the third block vector candidate list by removing the block vectors belonging to the first region range from the N first candidate block vectors is: For each of the N first candidate block vectors, block vectors corresponding to reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first candidate block vector. The process includes determining the third block vector candidate list based on at least one first candidate block vector after the selection, The decoding method according to any one of claims 11 to 13.
15. For each of the N first candidate block vectors, sequentially removing the block vectors corresponding to the reference block belonging to the first region range to obtain at least one selected first candidate block vector is: The process involves sequentially offsetting the first candidate block vectors in N first candidate block vectors, and determining at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in the at least one second candidate reference block pointed to by the at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in the at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to the at least one second candidate block vector is to be considered to belong to the block vector of the first region range. This includes removing the first candidate block vector and continuing the removal process on other first candidate block vectors to obtain at least one selected first candidate block vector, The decoding method according to claim 14.
16. The aforementioned decoding method is If the maximum horizontal boundary position or minimum horizontal boundary position in at least one second candidate reference block pointed to by the at least one second candidate block vector does not fall within the predetermined horizontal range, or if the maximum vertical boundary position or minimum vertical boundary position in at least one second candidate reference block does not fall within the predetermined vertical range, then the candidate block vector corresponding to the at least one second candidate block vector shall not be considered to belong to the block vectors of the first region range, and the first candidate block vector corresponding to the at least one second candidate block vector shall be used as one selected first candidate block vector. This further includes continuing the removal process for other first candidate block vectors until the processing of N first candidate block vectors is completed, or until N selected first candidate block vectors are obtained. The decoding method according to claim 14 or 15.
17. Obtaining a second block vector candidate list by removing block vectors belonging to the first region range from the first block vector candidate list is: If it is determined that the current block uses a prediction mode based on template matching merge, then K third candidate block vectors (where K is an integer greater than or equal to 1) having the minimum template cost are determined from the aforementioned list of first block vector candidates, This includes removing block vectors belonging to the first region range from the K third candidate block vectors to obtain the second block vector candidate list, The decoding method according to claim 2.
18. Obtaining the second block vector candidate list by removing the block vectors belonging to the first region range from the K third candidate block vectors is: If, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within the predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within the predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed, or until K selected third candidate block vectors are obtained. The process includes determining the list of candidate second block vectors based on at least one third candidate block vector after the selection, The decoding method according to claim 17.
19. Obtaining the second block vector candidate list by removing the block vectors belonging to the first region range from the K third candidate block vectors is: If, among the K third candidate block vectors, the first extended horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. The first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are search ranges defined in the prediction mode based on template matching merge. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed, or until K selected third candidate block vectors are obtained. The process includes determining the list of candidate second block vectors based on at least one third candidate block vector after the selection, The decoding method according to claim 17.
20. Determining the predicted value of the current block based on the second block vector candidate list is: The second block vector candidate list is subjected to template matching refinement to determine the fourth block vector candidate list, Decode the bitstream to determine candidate block vector index information, Based on the candidate block vector index information and the fourth block vector candidate list, the first block vector is determined, This includes determining the reference block of the current block based on the first block vector, and determining the predicted value of the current block based on the reference block, The decoding method according to any one of claims 17 to 19.
21. The aforementioned decoding method is The process of determining the first block vector candidate list for the current block further includes performing a duplicate check operation on the candidate block vectors in the first block vector candidate list. The decoding method according to any one of claims 1 to 20.
22. Performing a duplicate check operation on candidate block vectors in the first block vector candidate list means that Determine the current candidate block vector to be added, The current candidate block vector is compared with the candidate block vector in the first block vector candidate list, If the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list. If the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, the current candidate block vector is skipped, and the execution of the step of determining the next candidate block vector to be added is continued, including: The decoding method according to claim 21.
23. The current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. The current candidate block vector is identical to the candidate block vector in the first block vector candidate list, The decoding method according to claim 22.
24. The current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. The difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition, The decoding method according to claim 22.
25. The aforementioned decoding method is Decode the bitstream and determine the predicted difference value of the current block, The further includes determining the reconstruction value of the current block based on the predicted value of the current block and the predicted difference value of the current block, The decoding method according to any one of claims 1 to 22.
26. The first region range is, Current size of coding tree unit, The size of the reconfigured region in the current frame, The current size of the image boundary of the block, and The search range of Intra TMP mode, including one of the following: The decoding method according to claim 1.
27. The aforementioned decoding method is The bitstream is decoded to determine a first syntactic identifier, the first syntactic identifier is used to indicate whether the current block uses a predictive mode based on an intra-block copy, and If the first syntactic identifier indicates that the current block uses an intrablock copy-based prediction mode, then a second syntactic identifier is determined, wherein the second syntactic identifier indicates whether the current block uses an intrablock merge-based prediction mode to determine the predicted value of the current block. The decoding method according to claim 1.
28. An encoding method applied to an encoder, Currently, the prediction mode for the block is determined, If the prediction mode indicates that the current block uses a prediction mode based on intrablock merging, then determine the first block vector candidate list for the current block. Determine the first region range, and determine the second block vector candidate list based on the first block vector candidate list and the first region range. An encoding method comprising determining a predicted value for the current block based on the second block vector candidate list.
29. Determining a second block vector candidate list based on the first block vector candidate list and the first region range is: This includes removing block vectors belonging to a first region range from the first block vector candidate list to obtain a second block vector candidate list. The encoding method according to claim 28.
30. Obtaining a second block vector candidate list by removing block vectors belonging to the first region range from the first block vector candidate list is: If it is determined that the current block uses a prediction mode based on IBC MBVD, then, based on the first block vector candidate list, at least one first extended candidate block vector corresponding to each first candidate block vector is determined, The process includes obtaining the second block vector candidate list by removing block vectors belonging to the first region range from among the at least one first extended candidate block vector corresponding to each first candidate block vector, The encoding method according to claim 29.
31. Determining at least one first extended candidate block vector corresponding to each first candidate block vector based on the first block vector candidate list is: From the aforementioned list of candidate first block vectors, determine N first candidate block vectors (where N is an integer greater than or equal to 1) that have the minimum template cost, The method includes refining each of the N first candidate block vectors based on a distance set and a block vector prediction direction to determine at least one first extended candidate block vector corresponding to each of the N first candidate block vectors, The encoding method according to claim 30.
32. Obtaining the second block vector candidate list involves removing block vectors belonging to the first region range from the at least one first extended candidate block vector corresponding to each of the first candidate block vectors, For each first candidate block vector, block vectors corresponding to reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first candidate block vector. The process includes determining the second block vector candidate list based on the selected first extended candidate block vector corresponding to each first candidate block vector, The encoding method according to claim 31.
33. For each of the aforementioned first candidate block vectors, the block vectors corresponding to the reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first candidate block vector. If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the horizontal range of a predetermined range, and the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors falls within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first candidate extension block vectors is deemed to belong to the reference block of the first region range, The process includes removing any of the first candidate extension block vectors and continuing the removal process for other first candidate extension block vectors corresponding to each of the first candidate extension block vectors, thereby obtaining at least one selected first candidate extension block vector. The encoding method according to claim 32.
34. The aforementioned encoding method is If the horizontal boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors does not fall within the horizontal range of a predetermined range, or if the vertical boundary position of the first candidate reference block pointed to by any of the first candidate extension block vectors does not fall within the vertical range of a predetermined range, then the first candidate reference block pointed to by any of the first candidate extension block vectors is deemed not to belong to the reference blocks of the first region range, and any of the first candidate extension block vectors is deemed to be one selected first candidate extension block vector corresponding to each candidate block vector. The encoding method according to claim 32 or 33.
35. Determining the second block vector candidate list based on the selected first extended candidate block vector corresponding to each of the first candidate block vectors means that For each first candidate block vector, determine M first extension candidate block vectors (where M is an integer greater than or equal to 1) that correspond to the minimum template cost from among the at least one first extension candidate block vector selected above, This includes constructing the second block vector candidate list based on M first extended candidate block vectors for each first candidate block vector, The encoding method according to any one of claims 32 to 34.
36. The aforementioned encoding method is For each of the aforementioned first candidate block vectors, if the number of at least one selected first extended candidate block vector is less than M, then another first candidate block vector is determined from the first block vector candidate list, wherein the other first candidate block vector is different from the N first candidate block vectors. The process further includes determining M first extended candidate block vectors based on the other first candidate block vectors and the at least one selected first extended candidate block vector, The encoding method according to claim 35.
37. Determining at least one first extended candidate block vector corresponding to each first candidate block vector based on the first block vector candidate list is: From the aforementioned list of candidate first block vectors, determine N first candidate block vectors (where N is an integer greater than or equal to 1) that have the minimum template cost, The third block vector candidate list is obtained by removing the block vectors belonging to the first region range from the N first candidate block vectors. The process includes determining at least one first extended candidate block vector corresponding to each first candidate block vector based on the third candidate block vector list, The encoding method according to any one of claims 30 to 36.
38. Determining at least one first extended candidate block vector corresponding to each first candidate block vector based on the third block vector candidate list is: This includes refining each first candidate block vector in the third block vector candidate list based on the distance set and the block vector prediction direction to determine at least one first extended candidate block vector corresponding to each first candidate block vector. The encoding method according to claim 37.
39. Obtaining the third block vector candidate list by removing the block vectors belonging to the first region range from the N first candidate block vectors is: For each of the N first candidate block vectors, block vectors corresponding to reference blocks belonging to the first region range are sequentially removed to obtain at least one selected first candidate block vector. The process includes determining the third block vector candidate list based on at least one first candidate block vector after the selection, The encoding method according to claim 37 or 38.
40. For each of the N first candidate block vectors, sequentially removing the block vectors corresponding to the reference block belonging to the first region range to obtain at least one selected first candidate block vector is: The process involves sequentially offsetting the first candidate block vectors in N first candidate block vectors, and determining at least one second candidate block vector corresponding to each first candidate block vector. If the maximum horizontal boundary position and minimum horizontal boundary position in the at least one second candidate reference block pointed to by the at least one second candidate block vector fall within a predetermined horizontal range, and the maximum vertical boundary position and minimum vertical boundary position in the at least one second candidate reference block fall within a predetermined vertical range, then the first candidate block vector corresponding to the at least one second candidate block vector is to be considered to belong to the block vector of the first region range. This includes removing the first candidate block vector and continuing the removal process on other first candidate block vectors to obtain at least one selected first candidate block vector, The encoding method according to claim 39.
41. The aforementioned encoding method is If the maximum horizontal boundary position or minimum horizontal boundary position in at least one second candidate reference block pointed to by the at least one second candidate block vector does not fall within the predetermined horizontal range, or if the maximum vertical boundary position or minimum vertical boundary position in at least one second candidate reference block does not fall within the predetermined vertical range, then the candidate block vector corresponding to the at least one second candidate block vector shall not be considered to belong to the block vectors of the first region range, and the first candidate block vector corresponding to the at least one second candidate block vector shall be used as one selected first candidate block vector. This further includes continuing the removal process for other first candidate block vectors until the processing of N first candidate block vectors is completed, or until N selected first candidate block vectors are obtained. The encoding method according to claim 39 or 40.
42. Obtaining a second block vector candidate list by removing block vectors belonging to the first region range from the first block vector candidate list is: If it is determined that the current block uses a prediction mode based on template matching merge, then K third candidate block vectors (where K is an integer greater than or equal to 1) having the minimum template cost are determined from the aforementioned list of first block vector candidates, This includes removing block vectors belonging to the first region range from the K third candidate block vectors to obtain the second block vector candidate list, The encoding method according to claim 29.
43. Obtaining the second block vector candidate list by removing the block vectors belonging to the first region range from the K third candidate block vectors is: If, among the K third candidate block vectors, the horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within the predetermined horizontal range, and the vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within the predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed, or until K selected third candidate block vectors are obtained. The process includes determining the list of candidate second block vectors based on at least one third candidate block vector after the selection, The encoding method according to claim 42.
44. Obtaining the second block vector candidate list by removing the block vectors belonging to the first region range from the K third candidate block vectors is: If, among the K third candidate block vectors, the first extended horizontal boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined horizontal range, and the first extended vertical boundary position of the third candidate reference block pointed to by any of the third candidate block vectors falls within a predetermined vertical range, then the third candidate reference block pointed to by any of the third candidate block vectors is deemed to belong to the reference block of the first region range. The first extended horizontal boundary position is the horizontal boundary position after the horizontal boundary of the third candidate reference block has been extended by the first horizontal search range, the first extended vertical boundary position is the vertical boundary position after the vertical boundary of the third candidate reference block has been extended by the first vertical search range, and the first horizontal search range and the first vertical search range are search ranges defined in the prediction mode based on template matching merge. Remove any third candidate block vector belonging to the reference block in the first region range, and continue the removal process for other third candidate block vectors until processing of K third candidate block vectors is completed, or until K selected third candidate block vectors are obtained. The process includes determining the list of candidate second block vectors based on at least one third candidate block vector after the selection, The encoding method according to claim 42.
45. The aforementioned encoding method is The process of determining the first block vector candidate list for the current block further includes performing a duplicate check operation on the candidate block vectors in the first block vector candidate list. The encoding method according to any one of claims 28 to 44.
46. Performing a duplicate check operation on candidate block vectors in the first block vector candidate list means that Determine the current candidate block vector to be added, The current candidate block vector is compared with the candidate block vector in the first block vector candidate list, If the current candidate block vector does not overlap with a candidate block vector in the first block vector candidate list, the current candidate block vector is added to the first block vector candidate list. If the current candidate block vector overlaps with a candidate block vector in the first block vector candidate list, the current candidate block vector is skipped, and the execution of the step of determining the next candidate block vector to be added is continued, including: The encoding method according to claim 45.
47. The current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. The current candidate block vector is identical to the candidate block vector in the first block vector candidate list, The encoding method according to claim 46.
48. The current candidate block vector overlaps with a candidate block vector in the first block vector candidate list. The difference between the current candidate block vector and the candidate block vector in the first block vector candidate list satisfies a first predetermined condition, The encoding method according to claim 46.
49. The aforementioned encoding method is If the current block uses an intrablock merge-based prediction mode, the process further includes determining a first syntactic identifier, determining a second syntactic identifier, and writing it to a bitstream, wherein the first syntactic identifier indicates whether the current block uses an intrablock copy prediction mode, and the second syntactic identifier indicates whether the current block uses an intrablock merge prediction mode. The encoding method according to claim 28.
50. The aforementioned encoding method is The process further includes determining a third syntactic identifier and writing it to a bitstream, wherein the third syntactic identifier indicates whether the current block uses a predictive mode based on IBC MBVD. The encoding method according to claim 30 or 42.
51. Determining the predicted value of the current block based on the second block vector candidate list is: Based on the aforementioned list of candidate block vectors, the first block vector is determined, This includes determining the reference block of the current block based on the first block vector, and determining the predicted value of the current block based on the reference block, The encoding method according to any one of claims 28 to 50.
52. The aforementioned encoding method is The further step includes writing candidate block vector index information corresponding to the first block vector to a bitstream. The encoding method according to claim 51.
53. The aforementioned encoding method is The further includes writing candidate block vector index information and extended candidate block vector index information corresponding to the first block vector to a bitstream. The encoding method according to claim 30.
54. The aforementioned encoding method is Determining the original value of the current block, The further includes determining the predicted difference value of the current block based on the original value of the current block and the predicted value of the current block, The encoding method according to any one of claims 29 to 53.
55. The aforementioned encoding method is The first region range is, Current size of coding tree unit, The size of the reconfigured region in the current frame, The current size of the image boundary of the block, and The search range of Intra TMP mode, including one of the following: The encoding method according to claim 28.
56. A bitstream generated by performing bit encoding based on the information to be encoded, The information to be encoded is, The current block includes at least one of the following: predicted difference value of the current block, candidate block vector index information, extended candidate block vector index information, first syntax identifier information, second syntax identifier information, and third syntax identifier information. A bitstream in which the first syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock copying, the second syntactic identifier is used to indicate whether the current block uses the predictive mode of intrablock merging, and the third syntactic identifier is used to indicate whether the current block uses the MBVD mode.
57. It is a decoder, A decoding unit configured to decode a bitstream and determine the prediction mode of the current block, If the prediction mode of the current block indicates that the current block determines the predicted value of the current block using a prediction mode based on intrablock merging, the first determination unit is configured to determine a first block vector candidate list of the current block and determine a first region range. A first removal unit is configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range, A decoder comprising: a first prediction unit configured to determine a predicted value for the current block based on the second block vector candidate list.
58. It is a decoder, It comprises a first memory and a first processor, The first memory is configured to store a computer program that can be executed by the first processor. A decoder wherein the first processor is configured to execute the decoding method described in any one of claims 1 to 27 by executing the computer program.
59. It is an encoder, A second determination unit is configured to determine the prediction mode of the current block, and if the current block uses a prediction mode based on intrablock merging, to determine a first block vector candidate list for the current block and to determine a first region range. A second removal unit is configured to determine a second block vector candidate list based on the first block vector candidate list and the first region range, An encoder comprising: a second prediction unit configured to determine a predicted value for the current block based on the second block vector candidate list.
60. It is a codec, It comprises a second memory and a second processor, The second memory is configured to store a computer program that can be executed by the second processor. The second processor is configured to execute the encoding method described in any one of claims 28 to 55 by executing the computer program, and is a codec.
61. A computer-readable storage medium storing a computer program for implementing the decoding method described in any one of claims 1 to 27, or the encoding method described in any one of claims 28 to 55.