Inter-frame prediction method, video encoding method, video decoding method and apparatus
By constructing a motion vector candidate list under various inter prediction modes and fusing motion vector information for inter prediction, the problem of insufficient flexibility of motion vector information in the prior art is solved, and the accuracy of inter prediction is improved.
Patent Information
- Application Number
- CN202111531688.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The existing inter prediction methods have insufficient flexibility in determining and using motion vector information, which affects the accuracy of inter prediction.
By constructing a motion vector candidate list in at least two inter prediction modes, the fusion vector combination is determined, and each motion vector information is fused to obtain the fusion motion vector information in the preset direction to perform inter prediction.
The flexibility of determining motion vector information in inter prediction is improved, and the effective information in various inter prediction modes is fully utilized, thereby improving the accuracy of inter prediction.
Smart Images

Figure CN114339261B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of video coding and decoding, and in particular, to an inter-frame prediction method, a video coding method, a video decoding method, and an apparatus therefor. Background Art
[0002] Since the amount of video image data is relatively large, it usually needs to be encoded and compressed. The compressed data is called a video bitstream. The video bitstream is transmitted to the user side through a wired or wireless network and then decoded for viewing.
[0003] The entire video coding process includes processes such as prediction, transformation, quantization, and entropy coding. Among them, prediction is divided into two parts: intra-frame prediction and inter-frame prediction. Inter-frame prediction uses the temporal correlation between image frames to compress the image. The inventors of the present application have found in the long-term research and development process that the current inter-frame prediction method still has certain limitations, which also affect the accuracy of inter-frame prediction to a certain extent. Summary of the Invention
[0004] The present application provides an inter-frame prediction method, a video coding method, a video decoding method, and an apparatus therefor, which can improve the accuracy of inter-frame prediction.
[0005] To achieve the above object, the present application provides an inter-frame prediction method, which includes:
[0006] Constructing a motion vector candidate list for each of at least two inter-frame prediction modes of a current block to obtain at least two motion vector candidate lists of the current block;
[0007] Determining at least one fusion vector combination of the current block based on the at least two motion vector candidate lists, where at least two motion vector information in the fusion vector combination come from different motion vector candidate lists respectively, and the reference frame directions of all motion vector information in the fusion vector combination are preset directions;
[0008] Fusing all motion vector information in each fusion vector combination to obtain at least one fusion motion vector information in the preset direction of the current block;
[0009] Performing inter-frame prediction on the current block in the preset direction based on at least one fusion motion vector information to obtain a target fusion prediction block in the preset direction of the current block.
[0010] Wherein, the step of constructing a motion vector candidate list for each of at least two inter-frame prediction modes of a current block to obtain at least two motion vector candidate lists of the current block includes:
[0011] Construct an original motion vector candidate list for each of at least two inter-frame prediction modes of the current block;
[0012] Construct a unidirectional motion vector candidate list in the preset direction for each mode of the current block from the original motion vector candidate list for each mode;
[0013] The step of determining at least one combined vector combination of the current block based on the at least two motion vector candidate lists includes:
[0014] Determine at least one combined vector combination of the current block based on the unidirectional motion vector candidate lists in at least two preset directions of the current block.
[0015] Wherein, the step of constructing a unidirectional motion vector candidate list in the preset direction for each mode of the current block from the original motion vector candidate list for each mode includes:
[0016] Split each bidirectional motion vector information in the original motion vector candidate list for each mode to obtain split motion vector information in at least one preset direction;
[0017] The unidirectional motion vector candidate list in the preset direction for each mode of the current block is composed of all motion vector information in the preset direction in the original motion vector candidate list for each mode and all split motion vector information obtained based on the original motion vector candidate list for each mode.
[0018] Wherein, the step of splitting each bidirectional motion vector information in the original motion vector candidate list for each mode to obtain split motion vector information in at least one preset direction includes:
[0019] Split each bidirectional motion vector information in the original motion vector candidate list for each mode into a first split motion vector information and a second split motion vector information, the reference frame direction of the first split motion vector information is the preset direction, and the reference frame direction of the second split motion vector information is the opposite direction of the preset direction;
[0020] Convert the second split motion vector information into motion vector information in the preset direction;
[0021] The step of the unidirectional motion vector candidate list in the preset direction for each mode of the current block being composed of all motion vector information in the preset direction in the original motion vector candidate list for each mode and all split motion vector information obtained based on the original motion vector candidate list for each mode includes:
[0022] Convert each opposite motion vector information in the original motion vector candidate list in each mode into motion vector information in the preset direction to obtain converted motion vector information; wherein, the reference frame direction of the opposite motion vector information is the opposite direction of the preset direction.
[0023] The unidirectional motion vector candidate list in the preset direction in each mode of the current block is composed of all motion vector information in the preset direction in the original motion vector candidate list in each mode, all split motion vector information obtained based on the original motion vector candidate list in each mode, and all converted motion vector information.
[0024] Wherein, the step of converting each opposite motion vector information in the original motion vector candidate list in each mode into motion vector information in the preset direction includes:
[0025] Convert the reference frame of the opposite motion vector information to a preset reference frame, and reverse the motion vector of the opposite motion vector information to obtain the converted motion vector information.
[0026] Wherein, the first difference and the second difference are the same. The first difference is the difference between the picture order number of the reference frame of the opposite motion vector information and the picture order number of the picture frame to which the current block belongs, and the second difference is the difference between the picture order number of the picture frame to which the current block belongs and the preset reference frame.
[0027] Wherein, the step of constructing the unidirectional motion vector candidate list in the preset direction in each mode of the current block from the original motion vector candidate list in each mode includes:
[0028] During the process of constructing the unidirectional motion vector candidate list, check for duplicate entries between the motion vector information to be filled in and the existing motion vector information in the unidirectional motion vector candidate list.
[0029] If the check for duplicates passes, fill the motion vector information to be filled in into the unidirectional motion vector candidate list.
[0030] If the check for duplicates fails, do not fill the motion vector information to be filled in into the unidirectional motion vector candidate list.
[0031] Wherein, the step of checking for duplicate entries between the motion vector information to be filled in and the existing motion vector information in the unidirectional motion vector candidate list includes:
[0032] If the motion vector and the reference frame of the motion vector information to be filled in are the same as any of the existing motion vector information in the unidirectional motion vector candidate list, the motion vector information to be filled in fails the check for duplicate entries.
[0033] Among them, the at least two inter-frame prediction modes include a first inter-frame prediction mode and a second inter-frame prediction mode, and the step of determining at least one combined fusion vector of the current block based on the at least two motion vector candidate lists includes:
[0034] Based on the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode, at least one combined fusion vector of the current block is determined.
[0035] Among them, the step of determining at least one combined fusion vector of the current block based on the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode includes:
[0036] Optimizing the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode, and based on the optimized motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode, determining at least one combined fusion vector of the current block; or,
[0037] Optimizing the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode, and based on the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the optimized motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode, determining at least one combined fusion vector of the current block; or,
[0038] Optimizing the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode, and optimizing the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode; based on the optimized motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the optimized motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode, determining at least one combined fusion vector of the current block.
[0039] Among them, the step of determining at least one combined fusion vector of the current block based on the at least two motion vector candidate lists includes:
[0040] Determine at least one combined vector combination of the current block based on at least one optimal motion vector information of each in at least a partial motion vector candidate list and the remaining partial motion vector candidate list.
[0041] Wherein, the step of determining at least one combined vector combination of the current block based on at least one optimal motion vector information of each in at least a partial motion vector candidate list and the remaining partial motion vector candidate list includes:
[0042] Optimize each motion vector information in each motion vector candidate list in at least a partial motion vector candidate list;
[0043] Perform cost comparison on all optimized motion vector information of each motion vector candidate list;
[0044] Use at least one optimized motion vector information with the minimum cost value in each motion vector candidate list as at least one optimal motion vector information in each motion vector candidate list.
[0045] Wherein: The method further includes:
[0046] Optimize the motion vector information through a merging mode, a template matching mode or a motion search method with a motion vector information difference.
[0047] Wherein, after the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the combined motion vector information, it includes:
[0048] Encode the index of the optimization method adopted by the motion vector information of each inter-frame prediction mode to obtain an encoded bitstream.
[0049] Wherein, the step of fusing all motion vector information in each combined vector combination to obtain at least one combined motion vector information of the current block in the preset direction includes:
[0050] When there is third motion vector information in each combined vector combination, scale the third motion vector information based on the reference frame in the preset direction of the current block, wherein the reference frame of the third motion vector information is different from the reference frame in the preset direction of the current block;
[0051] Fuse the scaled third motion vector information in each combined vector combination and the motion vector information other than the third motion vector information to obtain the combined motion vector information of the current block in each preset direction.
[0052] Among them, the reference frame in the preset direction of the current block is the image frame closest to the current block in the preset direction.
[0053] Among them, the step of fusing the scaled third motion vector information and the motion vector information other than the third motion vector information in each of the fusion vector combinations includes:
[0054] Weight the scaled third motion vector information and the motion vector information other than the third motion vector information in each of the fusion vector combinations.
[0055] Among them, the current block is a bi-prediction block;
[0056] Taking the forward direction as the preset direction, execute the steps of constructing a motion vector candidate list for each mode in at least two inter-frame prediction modes of the current block, obtaining at least two motion vector candidate lists of the current block, determining at least one fusion vector combination of the current block based on the at least two motion vector candidate lists, fusing all the motion vector information in each of the fusion vector combinations to obtain at least one fusion motion vector information in the preset direction of the current block, and performing inter-frame prediction on the current block in the preset direction based on at least one of the fusion motion vector information, to obtain the forward target fusion prediction block of the current block;
[0057] Taking the backward direction as the preset direction, execute the steps of constructing a motion vector candidate list for each mode in at least two inter-frame prediction modes of the current block, obtaining at least two motion vector candidate lists of the current block, determining at least one fusion vector combination of the current block based on the at least two motion vector candidate lists, fusing all the motion vector information in each of the fusion vector combinations to obtain at least one fusion motion vector information in the preset direction of the current block, and performing inter-frame prediction on the current block in the preset direction based on at least one of the fusion motion vector information, to obtain the backward target fusion prediction block of the current block;
[0058] Weight the forward target fusion prediction block and the backward target fusion prediction block of the current block to obtain the bi-prediction block of the current block.
[0059] Among them, after the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the fusion motion vector information includes:
[0060] Encode the index information of each motion vector information in the fusion vector combination corresponding to the target fusion prediction block in the preset direction of the current block to obtain an encoded bitstream.
[0061] After the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the fusion motion vector information, the following steps are included:
[0062] Set the value of a preset syntax element in the encoded bitstream, where different values of the preset syntax element represent whether to enable the inter-frame prediction method.
[0063] To achieve the above object, the present application further provides a video encoding method, and the method includes:
[0064] Determine a target fusion prediction block of a current block of a current encoded frame in a video based on the above inter-frame prediction method;
[0065] Encode the current block based on the target fusion prediction block.
[0066] To achieve the above object, the present application further provides a video decoding method, and the method includes:
[0067] Determine a target fusion prediction block of a current block of a current decoded frame in a video based on the above inter-frame prediction method;
[0068] Decode the current block based on the target fusion prediction block.
[0069] To achieve the above object, the present application further provides an encoder, and the encoder includes a processor; the processor is configured to execute instructions to implement the above method.
[0070] To achieve the above object, the present application further provides a decoder, and the decoder includes a processor; the processor is configured to execute instructions to implement the above method.
[0071] To achieve the above object, the present application further provides a computer-readable storage medium, which is used to store instructions / program data, and the instructions / program data can be executed to implement the above method.
[0072] In the inter-frame prediction method of the present application, during the process of determining a prediction block in one direction of the current block, the motion vector information of at least two inter-frame prediction modes is simultaneously used for inter-frame prediction, which improves the flexibility of determining the motion vector information in inter-frame prediction, and the valid information obtained from at least two inter-frame prediction modes will be utilized, thereby improving the accuracy of inter-frame prediction. Description of the Drawings
[0073] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:
[0074] Figure 1It is a schematic flowchart of an embodiment of the inter-frame prediction method of the present application;
[0075] Figure 2 It is a schematic diagram of the selection of spatial motion vector information in the inter-frame prediction method of the present application;
[0076] Figure 3 It is a schematic diagram of the selection of temporal motion vector information in the inter-frame prediction method of the present application;
[0077] Figure 4 It is a schematic diagram of the scaling of motion vector information in the inter-frame prediction method of the present application;
[0078] Figure 5 It is a schematic diagram of the template matching optimization method in the inter-frame prediction method of the present application;
[0079] Figure 6 It is a schematic diagram of inter-frame prediction in the first embodiment of the inter-frame prediction method of the present application;
[0080] Figure 7 It is a schematic diagram of bidirectional inter-frame prediction in the second embodiment of the inter-frame prediction method of the present application;
[0081] Figure 8 It is a schematic flowchart of an embodiment of the video encoding method of the present application;
[0082] Figure 9 It is a schematic flowchart of an embodiment of the video decoding method of the present application;
[0083] Figure 10 It is a schematic structural diagram of an embodiment of the encoder of the present application;
[0084] Figure 11 It is a schematic structural diagram of an embodiment of the decoder of the present application;
[0085] Figure 12 It is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. Specific Embodiments
[0086] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application. Additionally, unless otherwise specified (e.g., "or alternatively" or "or in an alternative"), the term "or" as used herein refers to a non-exclusive "or" (i.e., "and / or"). And, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments can be combined with one or more other embodiments to form new embodiments.
[0087] In the prior art, only in the case of bidirectional prediction, the predicted motion vector information in one direction comes from AMVP, and the predicted motion vector information in the other direction can come from Merge. This is not flexible enough and affects the prediction accuracy.
[0088] Based on this, in the process of determining the prediction block in one direction of the current block, the present application performs inter-frame prediction by simultaneously using the motion vector information of at least two inter-frame prediction modes, which improves the flexibility of determining the motion vector information in inter-frame prediction, and will utilize all the effective information obtained from at least two inter-frame prediction modes, thereby improving the accuracy of inter-frame prediction.
[0089] Specifically, as Figure 1 shown, the inter-frame prediction method of this embodiment includes the following steps. It should be noted that the following step numbers are only used for simplified description and are not intended to limit the execution order of the steps. Each step of this embodiment can be arbitrarily changed in the execution order without violating the technical idea of the present application.
[0090] S101: Construct a motion vector candidate list for each of at least two inter-frame prediction modes of the current block, and obtain at least two motion vector candidate lists of the current block.
[0091] First, a motion vector candidate list for each of at least two inter-frame prediction modes of the current block can be constructed to obtain at least two motion vector candidate lists of the current block, so as to perform inter-frame prediction by simultaneously using the motion vector information in at least two motion vector candidate lists subsequently.
[0092] Optionally, at least two inter-frame prediction modes of the present application may include two, three or more inter-frame prediction modes among the conventional Merge (merge) mode, AMVP (Advanced Motion Vector Prediction) mode, extended Merge mode, and other inter-frame prediction modes.
[0093] The motion vector candidate list under the above inter-frame prediction mode may refer to the original motion vector candidate list under the inter-frame prediction mode, or may refer to the unidirectional motion vector candidate list under the inter-frame prediction mode constructed from the original motion vector candidate list.
[0094] Among them, under the conventional Merge mode, the construction method of the original motion vector candidate list of the current block is as follows:
[0095] In the conventional Merge mode, the length of the original motion vector candidate list is 6. The original motion vector candidate list for the current block will be constructed in the following order until there are 6 motion vector (MV) information in the candidate list.
[0096] (1) Spatial MV
[0097] In the conventional Merge mode, the spatial domain provides at most 4 candidate MVs, that is, at most use the motion information of 4 out of the 5 candidate blocks in Figure 2 . The list is established in the order of A1 - B1 - B0 - A0 - (B2). Among them, B2 is a substitute. When at least one of A1, B1, B0, A0 does not exist and the motion information of B2 is different from that of both A1 and B1, the motion information of B2 needs to be used.
[0098] (2) Temporal MV
[0099] When the size of the current block is larger than 4x4, 8x4, and 4x8, temporal MVs can be added. The temporal domain provides at most 1 candidate MV. As Figure 3 shown, the temporal MV added to the candidate list can be obtained by scaling the MV of the co-located block (col_PU) at the C0 position in the co-located frame (col_pic). If the co-located PU at the C0 position is not available, it is replaced by the co-located PU at the C1 position. Among them, C0 is located at the lower right corner of the current block (current PU), and C1 is located at the center of the current block.
[0100] (3) HMVP
[0101] If the candidate list is not yet full, the motion vector information in the HMVP (History-based Motion Vector Prediction) list needs to be filled in. HMVP refers to the MV of the previously encoded block. When filling, the motion vector information in the HMVP list needs to be compared with the motion vectors of A1 and B1 in the spatial domain in turn, and the different motion vector information is filled into the candidate list until the candidate list is full.
[0102] (4) Average MV
[0103] If the candidate list is not yet full, next, the average value of at least two motion vector information in the Merge original motion vector candidate list can be filled into the Merge original motion vector candidate list. For example, the average value of the first two MVs in the Merge original motion vector candidate list can be filled into the Merge original motion vector candidate list. When calculating the average value of the motion vector information, forward and forward are averaged, and backward and backward are averaged.
[0104] (5) Zero MV
[0105] If the number of candidate MVs in the current candidate list is still less than 6, zero MVs can be used to fill it up to the specified number.
[0106] In the conventional AMVP mode, the construction method of the original motion vector candidate list of the current block is as follows:
[0107] In the conventional AMVP mode, the length of the original motion vector candidate list is 2. The MV candidate list will be constructed for each reference frame in the following order until there are 2 MVs in the candidate list.
[0108] (1) Spatial MV
[0109] As Figure 2 shown, one candidate MV is generated on the left and above the current prediction unit (PU). The selection order on the left is A0 -> A1 -> scaled A0 -> scaled A1 (scaled means scaling the obtained spatial MV), and the selection order above is B0 -> B1 -> B2 (-> scaled B0 -> scaled B1 -> scaled B2). Among them, when the adjacent block and the current block have the same reference frame, the MV of the adjacent block is directly added to the candidate list; when the reference frames are different, the MV of the adjacent block needs to be scaled before being added to the candidate list, and the scaling method is the same as that of the following temporal MV. The three scaled MVs above are only selected when both A0 and A1 are unavailable or both are in non-inter-frame modes. When the first available MV is detected on the left (or above), this MV is directly added to the MV candidate list, skipping the remaining steps of the left (or above) check.
[0110] (2) Temporal MV
[0111] When the size of the current block is larger than 4x4, 8x4, and 4x8, temporal MVs can be added. At most only 1 candidate MV is provided in the temporal domain, which is obtained by scaling the MV of the co-located block (col_PU) at the C0 position in the co-located frame (col_pic). If the co-located PU at the C0 position is unavailable, it is replaced by the co-located PU at the C1 position. Figure 3 The scaling schematic diagram of the obtained original temporal MV is as
[0112] shown. cur_PU represents the current PU, col_PU is its co-located PU, and td and tb represent the distances between the current image cur_pic, the co-located image col_pic and their reference images cur_ref, col_ref respectively. The scaling method of the temporal candidate MV of the current PU is: Figure 4
[0113] curMV=(td / tb)*colMV;
[0114] Among them, colMV is the MV of the co-located PU, and curMV is the final time domain MV.
[0115] The reference frame cur_pic in AMVP can be selected by traversing the frames in the reference frame list, finally comparing the cost values, and selecting the reference frame with the smallest cost value, or taking the frame in the reference frame list closest to the current frame as the reference frame of the current block.
[0116] (3) HMVP (Historical Coded Block MV)
[0117] If the candidate list is not full, HMVP needs to be filled in. The coded block here refers to the coded inter-frame block in the current CTU (coding tree units), and the reference frame of the current block and the coded block is the same frame. Then the MVs in the MV lists of the last four coded blocks are filled into the candidate list until the candidate list is full.
[0118] (4) Zero MV
[0119] If the candidate list is not full yet, fill the remaining MVs in the candidate list with zero MVs.
[0120] After the original motion vector candidate list in each inter prediction mode is obtained based on the above method, a unidirectional motion vector candidate list in a preset direction in each mode of the current block can be constructed based on the original motion vector candidate list in each mode of the current block.
[0121] Among them, the original motion vector candidate list in a mode of the current block can be constructed into a unidirectional motion vector candidate list in a preset direction in the mode of the current block in multiple ways, as shown below.
[0122] First, the unidirectional motion vector candidate list in the preset direction corresponding to the original motion vector candidate list may be composed of the motion vector information in all preset directions in the original motion vector candidate list.
[0123] Specific implementation procedures can be as follows: The motion vector information in the preset direction in the original motion vector candidate list is filled into the unidirectional motion vector candidate list (which initially has no motion vector information) in sequence. After all the motion vector information in the preset direction is filled, the unidirectional motion vector candidate list corresponding to the preset direction of the original motion vector candidate list is obtained. For example, assume that the preset direction is forward, and assume that the conventional Merge original motion vector candidate list of the current block includes six motion vector information: forward motion vector information 1, backward motion vector information 2, forward motion vector information 3, bidirectional motion vector information 4, backward motion vector information 5, and bidirectional motion vector information 6. The two motion vector information, namely forward motion vector information 1 and forward motion vector information 3, can be filled into the unidirectional motion vector candidate list in sequence to obtain the forward motion vector candidate list in the conventional Merge mode of the current block, where the unidirectional motion vector candidate list initially has no motion vector information.
[0124] In other embodiments, the specific implementation procedures of this method can also be: all the motion vector information in the original motion vector candidate list with reference frame directions different from the preset direction is deleted; after deletion, the unidirectional motion vector candidate list corresponding to the preset direction of the original motion vector candidate list can be obtained.
[0125] Second, the unidirectional motion vector candidate list corresponding to the preset direction of the original motion vector candidate list can be composed of the motion vector information in all preset directions in the original motion vector candidate list and the motion vector information in the preset direction among all bidirectional motion vector information. There can be various specific implementation procedures for this method. Specifically, reference can be made to the first construction method of the unidirectional motion vector candidate list, and details are not described here.
[0126] Specifically, this method mainly includes: splitting each bidirectional motion vector information in the original motion vector candidate list into a first split motion vector information, where the reference frame direction of the first split motion vector information is the preset direction; then, the unidirectional motion vector candidate list corresponding to the preset direction of the original motion vector candidate list is composed of the motion vector information in all preset directions in the original motion vector candidate list and all split motion vector information (i.e., all the first split motion vector information in this embodiment) obtained based on the original motion vector candidate list.
[0127] For example, assume that the preset direction is backward, and assume that the conventional AMVP original motion vector candidate list of the current block includes two motion vector information, namely backward motion vector information 1 and bi-directional motion vector information 2; the backward motion vector information 1 and the backward motion vector information in the bi-directional motion vector information 2 can be filled into the unidirectional motion vector candidate list in sequence to obtain the backward original motion vector candidate list in the conventional AMVP mode of the current block.
[0128] Thirdly, the unidirectional motion vector candidate list in the preset direction corresponding to the original motion vector candidate list can be composed of the motion vector information in all preset directions in the original motion vector candidate list, the motion vector information in the preset direction converted from all motion vector information with the reference frame direction opposite to the preset direction, the motion vector information in the preset direction in all bi-directional motion vector information, and the motion vector information in the preset direction converted from the motion vector information in the reference frame direction opposite to the preset direction in all bi-directional motion vector information.
[0129] Specifically, this method mainly includes: splitting each bi-directional motion vector information in the original motion vector candidate list into a first split motion vector information and a second split motion vector information, where the reference frame direction of the first split motion vector information is the preset direction, and the reference frame direction of the second split motion vector information is opposite to the preset direction; converting the second split motion vector information into the motion vector information in the preset direction; converting each opposite motion vector information in the original motion vector candidate list into the motion vector information in the preset direction to obtain the converted motion vector information; then, the unidirectional motion vector candidate list in the preset direction corresponding to the original motion vector candidate list is composed of all the motion vector information in the preset direction in the original motion vector candidate list, all the split motion vector information obtained based on the original motion vector candidate list (including all the first split motion vector information in this embodiment and the motion vector information in the preset direction converted from all the second split motion vector information), and all the converted motion vector information. Among them, the "each opposite motion vector information in the original motion vector candidate list" refers to each motion vector information in the original motion vector candidate list with the reference frame direction opposite to the preset direction.
[0130] The specific implementation process of this method may include: sequentially reading a motion vector information from the original motion vector candidate list; when the read motion vector information is the motion vector information in the preset direction, adding the motion vector information to the unidirectional motion vector candidate list; when the reference frame direction of the read motion vector information is opposite to the preset direction, converting the motion vector information into the motion vector information in the preset direction, and then adding the converted motion vector information in the preset direction to the unidirectional motion vector candidate list; when the read motion vector information is bidirectional motion vector information, splitting the bidirectional motion vector information into the motion vector information in the preset direction and the motion vector information whose reference frame direction is opposite to the preset direction, then converting the motion vector information whose reference frame direction is opposite to the preset direction into the motion vector information in the preset direction, and then adding the motion vector information in the preset direction in the bidirectional motion vector information and the motion vector information obtained by converting the motion vector information whose reference frame direction is opposite to the preset direction to the unidirectional motion vector candidate list.
[0131] For example, assume that the preset direction is backward, and assume that the conventional Merge original motion vector candidate list of the current block includes 6 motion vector information: forward motion vector information 1, backward motion vector information 2, forward motion vector information 3, bidirectional motion vector information 4, backward motion vector information 5, and bidirectional motion vector information 6; the forward motion vector information 1 can be first converted into backward motion vector information to obtain backward motion vector information 1', and fill the backward motion vector information 1' into the unidirectional motion vector candidate list; then fill the backward motion vector information 2 into the unidirectional motion vector candidate list; then convert the forward motion vector information 3 into backward motion vector information to obtain backward motion vector information 3', and fill the backward motion vector information 3' into the unidirectional motion vector candidate list; then split the bidirectional motion vector information 4 into forward motion vector information 4A and backward motion vector information 4B, and also convert the forward motion vector information 4A into backward motion vector information 4A', and fill the backward motion vector information 4A' and the backward motion vector information 4B into the unidirectional motion vector candidate list; fill the backward motion vector information 5 into the unidirectional motion vector candidate list; then split the bidirectional motion vector information 6 into forward motion vector information 6A and backward motion vector information 6B, and also convert the forward motion vector information 6A into backward motion vector information 6A', and fill the backward motion vector information 6A' and the backward motion vector information 6B into the unidirectional motion vector candidate list.
[0132] In other embodiments, this construction method may also have other implementation processes. For details, reference may be made to the first construction method, which will not be elaborated here.
[0133] The step of "converting the motion vector information with the reference frame direction opposite to the preset direction (i.e., the above-mentioned "second split motion vector information" or "opposite motion vector information") into the motion vector information in the preset direction" may include: converting the reference frame in the direction opposite to the preset direction in the motion vector information into the reference frame in the preset direction; and converting the motion vector in the motion vector information based on the reference frame before conversion and the reference frame after conversion, and finally obtaining the motion vector information in the preset direction.
[0134] Taking the step of converting the opposite motion vector information into the converted motion vector information as an example, this step may specifically include: converting the reference frame of the opposite motion vector information into the preset reference frame, and taking the opposite of the motion vector of the opposite motion vector information to obtain the converted motion vector information; wherein, the first difference and the second difference are the same, the first difference is the difference between the picture order number of the reference frame of the opposite motion vector information and the picture order number of the picture frame to which the current block belongs, and the second difference is the difference between the picture order number of the picture frame to which the current block belongs and the preset reference frame.
[0135] For example, the preset direction is forward, the poc (Picture Order Count) of the picture to which the current frame belongs is 157, the reference frame in the backward motion vector information B is the picture frame with poc of 160, and the motion vector in the backward motion vector information B is (2, 4). The reference frame of this motion vector information can be converted into the picture frame with poc of 154, and then the motion vector of the motion vector information is taken as the opposite (-2, -4). Thus, the backward motion vector [poc—160, (2, 4)] can be converted into the forward motion vector information [poc—154, (-2, -4)].
[0136] Among them, during the implementation of the above-mentioned various methods for constructing the unidirectional motion vector candidate list, duplicate checking is required. When multiple motion vector information is the same, the duplicate motion vector information needs to be deleted to reduce duplicate work in the subsequent prediction process. Among them, two pieces of motion vector information being the same means that the motion vectors in these two pieces of motion vector information are the same and the reference frames are also the same. Specifically, in the case of constructing the unidirectional motion vector candidate list corresponding to the original motion vector candidate list by filling in the unidirectional motion vector candidate list, during the process of constructing the unidirectional motion vector candidate list, duplicate checking can be performed on the motion vector information to be filled in and the existing motion vector information in the unidirectional motion vector candidate list; if the duplicate checking passes, the motion vector information to be filled in is filled into the unidirectional motion vector candidate list; if the duplicate checking fails, the motion vector information to be filled in is not filled into the unidirectional motion vector candidate list. Among them, during duplicate checking, if the motion vector and the reference frame of the motion vector information to be filled in are both the same as any existing motion vector information in the unidirectional motion vector candidate list, the motion vector information to be filled in fails the duplicate checking; otherwise, the motion vector information to be filled in passes the duplicate checking.
[0137] In addition, the order of the motion vector information in the unidirectional motion vector candidate list can be the same as that in the original motion vector candidate list, so that the priorities of each piece of motion vector information can be kept roughly the same.
[0138] S102: Determine at least one combined fusion vector of the current block based on at least two motion vector candidate lists.
[0139] After constructing the motion vector candidate lists for at least two inter-frame prediction modes respectively (i.e., at least two motion vector candidate lists of the current block) based on the above steps, at least one combined fusion vector of the current block can be determined based on the at least two motion vector candidate lists of the current block, so that all the motion vector information in each combined fusion vector can be fused subsequently to obtain at least one combined fusion motion vector information of the current block in a preset direction. Then, based on the at least one combined fusion motion vector information, inter-frame prediction of the current block can be performed in the preset direction to obtain the target combined fusion prediction block of the current block. In this way, the determination of the motion vector information is more flexible, and the effective information obtained from at least two inter-frame prediction modes can be utilized, thereby improving the accuracy of inter-frame prediction.
[0140] In an implementable manner, when the motion vector candidate list obtained in step S101 is the original motion vector candidate list of the current block, at least one motion vector information can be directly selected from each motion vector candidate list obtained in step S101; when the reference direction of the selected motion vector information is different from the preset direction, the selected motion vector information is converted into the motion vector information in the preset direction; after the conversion is completed, finally, all the motion vector information in the preset direction and all the motion vector information in the preset direction obtained by conversion are combined to obtain at least one fusion vector combination. For example, assuming that the preset direction is forward, a conventional Merge original motion vector candidate list and a conventional AMVP original motion vector candidate list of the current block are constructed based on step S101; in step S102, three motion vector information, namely motion vector information A, motion vector information C, and motion vector information R, are selected from the conventional Merge original motion vector candidate list, and two motion vector information, namely motion vector information 1 and motion vector information 10, are selected from the conventional AMVP original motion vector candidate list. Among them, motion vector information C and motion vector information 10 are forward motion vector information, motion vector information A is backward motion vector information, and motion vector information R and motion vector information 1 are bidirectional motion vector information; then motion vector information A, motion vector information R, and motion vector information 1 should be respectively converted into forward motion vector information to obtain motion vector information A', motion vector information R', and motion vector information 1'; then motion vector information A', motion vector information C, motion vector information R', motion vector information 1', and motion vector information 10 are combined to obtain at least one fusion vector.
[0141] In another implementable manner, when the motion vector candidate list obtained in step S101 is the unidirectional motion vector candidate list in the preset direction of the current block, at least one motion vector information can be first selected from at least two unidirectional motion vector candidate lists of the current block; all the selected motion vector information is combined to obtain at least one fusion vector combination. For example, assuming that the preset direction is backward, an extended Merge backward motion vector candidate list and a conventional AMVP backward motion vector candidate list of the current block are constructed based on step S101; at least one motion vector information selected from the backward motion vector candidate list in the extended Merge mode of the current block and at least one motion vector information selected from the backward motion vector candidate list in the conventional AMVP mode of the current block are combined to obtain at least one fusion vector combination of the current block.
[0142] In the above two implementable manners, at least one motion vector information can be selected from the motion vector candidate list according to the position or the cost value, and the specific method is as follows:
[0143] A. At least one motion vector information can be selected from a preset position range in the motion vector candidate list. Among them, the preset position range in the motion vector candidate list can include one, two, or multiple motion vector information. The preset position range can be determined according to the actual situation and is not limited here. For example, the preset position range can be at least one motion vector information at the front of the motion vector candidate list, that is, the closer the position, the higher the priority. Another example is that the preset position range can be all the motion vector information in the motion vector candidate list. And the preset position ranges corresponding to different motion vector candidate lists can be the same or different, which can be specifically determined according to the actual situation.
[0144] B. The cost value of each motion vector information in the motion vector candidate list can be calculated, and at least one motion vector information is selected from the motion vector information whose cost value ranks within a first preset range. Among them, the first preset range in the motion vector candidate list can include one, two, or multiple motion vector information. The first preset range can be determined according to the actual situation and is not limited here. And the first preset ranges corresponding to different motion vector candidate lists can be the same or different, which can be specifically determined according to the actual situation. Preferably, at least one motion vector information with the smallest cost value is selected as the optimal at least one motion vector information in the motion vector candidate list. In this way, the fusion vector combination composed of motion vector information with smaller cost values is also better.
[0145] C. Each motion vector in the motion vector candidate list can be optimized, and the cost values of all the optimized motion vectors are compared; at least one motion vector information is selected from the motion vector information whose cost value ranks within a second preset range. Among them, the second preset range in the motion vector candidate list can include one, two, or multiple motion vector information. The second preset range can be determined according to the actual situation and is not limited here. And the second preset ranges corresponding to different motion vector candidate lists can be the same or different, which can be specifically determined according to the actual situation. Preferably, at least one optimized motion vector information with the smallest cost value is selected as the optimal at least one motion vector information in the motion vector candidate list. In this way, the fusion vector combination composed of optimized motion vector information with smaller cost values is also better. The specific optimization method in the above "optimizing each motion vector in the motion vector candidate list" can be a merge mode with motion vector difference (MMVD, Merge with MVD), a template matching mode (TM, Template matching), or a motion search method, etc., which is not limited here.
[0146] After selecting at least one motion vector information from each motion vector candidate list in the above manner, all the selected motion vector information can be combined to obtain at least one fusion vector combination, and there are at least two motion vector information in the fusion vector combination that come from different motion vector candidate lists respectively. In addition, each fusion vector combination does not necessarily contain the motion vector information under all inter-frame prediction modes. For example, in step S101, the motion vector candidate lists under three inter-frame prediction modes of the current block are obtained, and in step S102, at least one fusion vector combination containing only the motion vector information under two inter-frame prediction modes can be determined, or at least one fusion vector combination containing the motion vector information under three inter-frame prediction modes can be determined.
[0147] In an application scenario, all the motion vector lists selected from at least two motion vector candidate lists this time can be combined into a fusion vector combination, and then the steps of "fusing all the motion vector information in the fusion vector combination to obtain the fused motion vector information" and "performing inter-frame prediction on the current block based on the fused motion vector information to obtain the fused prediction block in the preset direction of the current block" are executed in sequence; then return to execute step S102 to obtain a fusion vector combination different from the previous one, and then continue to perform motion vector information fusion and prediction with the newly obtained fusion vector combination to obtain another fused prediction block of the current block until all the fusion vector combinations have been listed and the prediction is completed; finally, the fused prediction block with the smallest cost value among all the fused prediction blocks in the preset direction of the current block is used as the target fused prediction block in the preset direction of the current block.
[0148] In another application scenario, all selectable motion vector information in each motion vector candidate list can be selected according to the above-mentioned multiple selection methods such as A, B, and C, and then all the selectable motion vector information is combined to list all the fusion vector combinations, so as to subsequently obtain each fusion motion vector information based on each fusion vector combination, and then obtain the fusion prediction block corresponding to each fusion motion vector information, and further determine the target fusion prediction block of the current block based on the fusion prediction blocks corresponding to all the fusion motion vector information. Among them, the combination method is not limited here. For example, it can be one-to-one combination, two-to-one combination or two-to-two combination, or all the motion vector lists selected from at least two motion vector candidate lists can be combined into a fusion vector combination. In addition, in the case of selecting motion vector information from a motion vector candidate list using the A selection method, the above-mentioned "all selectable motion vector information in the motion vector candidate list" can refer to all the motion vector information within the preset position range of the motion vector candidate list; in the case of selecting motion vector information from a motion vector candidate list using the B selection method, the above-mentioned "all selectable motion vector information in the motion vector candidate list" can refer to all the motion vector information whose cost value ranks within the first preset range; in the case of selecting motion vector information from a motion vector candidate list using the C selection method, the above-mentioned "all selectable motion vector information in the motion vector candidate list" can refer to all the motion vector information whose cost value ranks within the second preset range.
[0149] For example, assuming the preset direction is forward, motion vector information A, motion vector information B, and motion vector information C are selected from the forward motion vector candidate list in the normal Merge mode of the current block, and motion vector information 1 and motion vector information 2 are selected from the forward motion vector candidate list in the normal AMVP mode of the current block; motion vector information A and motion vector information 1 can be combined into a fusion vector combination, motion vector information B and motion vector information 1 can be combined into a fusion vector combination, motion vector information C and motion vector information 1 can be combined into a fusion vector combination, motion vector information A and motion vector information 2 can be combined into a fusion vector combination, motion vector information B and motion vector information 2 can be combined into a fusion vector combination, and motion vector information C and motion vector information 2 can be combined into a fusion vector combination.
[0150] In addition, in the above two application scenarios and even in the application scenarios of other combinations of motion vector information, the method for selecting motion vector information in different motion vector candidate lists may be the same. For example, assuming that at least two inter-frame prediction modes include a first inter-frame prediction mode and a second inter-frame prediction mode, at least one combined fusion vector of the current block may be determined based on the motion vectors within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vectors within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode. That is, the above Method A is used to select motion vector information from the motion vector candidate lists under the first inter-frame prediction mode and the second inter-frame prediction mode for combination. Another example is to determine at least one combined fusion vector of the current block based on the respective optimal at least one motion vector information in all the motion vector candidate lists.
[0151] In other alternative embodiments, the method for selecting motion vector information in different motion vector candidate lists may also be different. For example, at least one combined fusion vector of the current block may be determined based on the respective optimal at least one motion vector in a partial motion vector candidate list and the remaining partial motion vector candidate list. That is, the above Method C is used to select at least one motion vector information from each of the partial motion vector candidate lists, and the above Method A or Method B is used to select at least one motion vector information from each of the remaining motion vector candidate lists.
[0152] Optionally, if there is motion vector information in the combined fusion vector that is selected by a selection method other than Method C, at least part of the motion vector information selected by this selection method other than Method C may be optimized to make this part of the motion vector information more accurate.
[0153] For example, in the solution of "determining at least one combined vector combination of the current block based on the motion vectors in the first preset position range in the motion vector candidate list under the first inter prediction mode and the motion vectors in the second preset position range in the motion vector candidate list under the second inter prediction mode": The motion vector information in the first preset position range in the motion vector candidate list under the first inter prediction mode can be optimized, and at least one combined vector combination of the current block can be determined based on the optimized motion vector information in the first preset position range in the motion vector candidate list under the first inter prediction mode and the motion vector information in the second preset position range in the motion vector candidate list under the second inter prediction mode; or, the motion vector information in the second preset position range in the motion vector candidate list under the second inter prediction mode can be optimized, and at least one combined vector combination of the current block can be determined based on the motion vector information in the first preset position range in the motion vector candidate list under the first inter prediction mode and the optimized motion vector information in the second preset position range in the motion vector candidate list under the second inter prediction mode; or, the motion vector information in the first preset position range in the motion vector candidate list under the first inter prediction mode can be optimized, and the motion vector information in the second preset position range in the motion vector candidate list under the second inter prediction mode can be optimized; and at least one combined vector combination of the current block can be determined based on the optimized motion vector information in the first preset position range in the motion vector candidate list under the first inter prediction mode and the optimized motion vector information in the second preset position range in the motion vector candidate list under the second inter prediction mode.
[0154] Optionally, the motion vectors can be optimized by a merge mode with motion vector difference, a template matching mode, or a motion search method.
[0155] Specifically, the merge mode with motion vector difference can be only applied to the Merge mode, and its function is to further optimize and adjust some of the motion vector information in the Merge motion vector candidate list to make the prediction more accurate.
[0156] Among them, the specific approach of MMVD is to offset the end position pointed to by the selected motion vector information. The offset directions are up, down, left, and right, and several offset step sizes are set. All offset directions and offset step sizes are traversed, and through rate-distortion cost comparison, an optimal offset position is found, and finally the motion vector is adjusted to point to the optimal offset position.
[0157] Such as Figure 5 As shown, the template matching mode is to first find the partially encoded pixel regions (i.e., Template) on the left and above the current block and make a prediction for this template.
[0158] In addition, the above prediction direction may refer to the current prediction direction of the current block. For example, if forward prediction is currently being performed on the current block, the preset direction is forward. Another example is that if backward prediction is currently being performed on the current block, the prediction direction is backward.
[0159] S103: Fuse all the motion vector information in each combined fusion vector.
[0160] After obtaining the combined fusion vector of the current block based on the above steps, all the motion vector information in each combined fusion vector can be fused to obtain each combined motion vector information, so as to subsequently perform prediction based on each combined motion vector information to obtain a combined prediction block corresponding to each combined motion vector information.
[0161] In step S103, the reference frames of all the motion vector information in the combined fusion vector can be first uniformly processed into the same reference frame; then all the unified motion vector information is fused to obtain the combined motion vector information in the prediction direction of the current block.
[0162] Among them, the step of "uniformly processing the reference frames of all the motion vector information in the combined fusion vector into the same reference frame" may include: when there is a third motion vector in the combined fusion vector, scaling the third motion vector based on the reference frame in the preset direction of the current block, where the reference frame corresponding to the third motion vector is different from the reference frame in the preset direction of the current block. Correspondingly, the step of "fusing all the unified motion vector information" may include: fusing the scaled third motion vector in each combined fusion vector and the motion vectors other than the third motion vector to obtain the combined motion vector in each preset direction of the current block.
[0163] The reference frame in the preset direction of the current block may be the image frame closest to the current block in the preset direction. Generally speaking, the similarity between two adjacent image frames is relatively high. In this way, the inter-frame prediction of the image can be performed using the adjacent image frames with relatively high similarity to improve the accuracy of inter-frame prediction. For example, if the POC of the current frame in the image is 160, the forward reference frame of the current block may be the image frame with POC of 159, and the backward reference frame of the current block may be the image frame with POC of 161.
[0164] Specifically, the step of fusing all the unified motion vector information may refer to: weighting all the unified motion vector information. Among them, the weighting coefficient of each motion vector information can be set according to the actual situation and is not limited here. For example, the weighting coefficient of each motion vector information can be 1. Another example is that the weighting coefficient of each motion vector information can be 1 / n, where n is the total amount of motion vector information in the fusion vector combination. In a specific example, the step of fusing all the unified motion vector information may refer to: adding the motion vectors in all the unified motion vector information to obtain the fused motion vector information. In a more specific example, the POC of the reference frame in the preset direction of the current block is 3, the fusion vector combination includes the Merge motion vector information [poc—3, (1,1)] and the AMVP motion vector information [poc—3, (-4,2)], then the motion vectors in the Merge motion vector information and the AMVP motion vector information can be added to obtain the motion vector (-3,3) of the fused motion vector information, and the reference frame of the fused motion vector information is the reference frame in the preset direction of the current block (the image frame with POC of 3).
[0165] S104: Based on at least one piece of fused motion vector information, perform inter-frame prediction on the current block in the preset direction.
[0166] After obtaining the fused motion vector information of the current block based on the above steps, inter-frame prediction can be performed on the current block in the preset direction to obtain the fused prediction blocks in the preset direction corresponding to each piece of fused motion vector information of the current block; then, the target fused prediction block in the preset direction of the current block can be determined based on the fused prediction blocks corresponding to all the fused motion vector information of the current block.
[0167] In addition, before step S104, encoding can be performed based on the target fused prediction block of the current block. During the encoding process, the indexes of all the motion vector information in the fusion vector combination corresponding to the target fused prediction block can be encoded so that the decoding end can know which motion vector information needs to be fused and predicted to obtain the target fused prediction block. For example, if the fusion vector combination corresponding to the target fused prediction block of the current block is obtained by using the 2nd MV in the Merge single list and the 1st MV in the AMVP single list, then it is necessary to transmit the index value of the Merge single list as 1 and the index value of the AMVP single list as 0.
[0168] In addition, during the process of performing inter-frame prediction using the inter-frame prediction method of the present application, if the motion vector information has been optimized, during the encoding process, the index of the optimization method adopted for each inter-frame prediction mode should be encoded so that the decoding end can know. For example, during the process of performing inter-frame prediction using the inter-frame prediction method of the present application, the conventional Merge mode adopts the MMVD optimization method, and the conventional AMVP mode adopts the TM optimization method; during encoding, it is necessary to encode the index of the MMVD optimization method adopted by the conventional Merge mode and the index of the TM optimization method adopted by the conventional AMVP mode.
[0169] Optionally, the present application can also set the value of a preset syntax element in the encoded bitstream, where different values of the preset syntax element represent whether to enable the inter-frame prediction method of the present application. For example, a syntax element COMBINE_AMVP_Merge can be defined to control the switch of the inter-frame prediction mode proposed by the present application. When COMBINE_AMVP_Merge = 1, it represents enabling the inter-frame prediction method of the present application, and when COMBINE_AMVP_Merge = 0, it represents disabling the inter-frame prediction method of the present application.
[0170] It can be understood that the inter-frame prediction method of the present application can be applied to the inter-frame prediction of unidirectional prediction blocks. For unidirectional prediction blocks, the preset direction is the prediction direction of the unidirectional prediction block.
[0171] Of course, the inter-frame prediction method of the present application can also be applied to the inter-frame prediction of bi-directional prediction blocks. For bi-directional prediction blocks, when determining the forward prediction block of the current block, the preset direction is forward; when determining the backward prediction block of the current block, the prediction direction is backward. Specifically, the steps of determining the bi-directional prediction block of the current block may include: taking forward as the preset direction, performing the step of constructing a candidate list of motion vectors in each of at least two inter-frame prediction modes of the current block, obtaining at least two candidate lists of motion vectors of the current block, determining at least one combination of fusion vectors of the current block based on the at least two candidate lists of motion vectors, fusing all the motion vector information in each of the combinations of fusion vectors to obtain at least one piece of fused motion vector information in the preset direction of the current block, and performing inter-frame prediction on the current block in the preset direction based on at least one piece of the fused motion vector information to obtain a target fused prediction block in the forward direction of the current block; taking backward as the preset direction, performing the step of constructing a candidate list of motion vectors in each of at least two inter-frame prediction modes of the current block, obtaining at least two candidate lists of motion vectors of the current block, determining at least one combination of fusion vectors of the current block based on the at least two candidate lists of motion vectors, fusing all the motion vector information in each of the combinations of fusion vectors to obtain at least one piece of fused motion vector information in the preset direction of the current block, and performing inter-frame prediction on the current block in the preset direction based on at least one piece of the fused motion vector information to obtain a backward target fused prediction block of the current block; weighting the forward target fused prediction block and the backward target fused prediction block of the current block to obtain the bi-directional prediction block of the current block.
[0172] The following provides the following specific embodiments of inter-frame prediction for better illustrating the inter-frame prediction method of the present application:
[0173] Embodiment 1
[0174] Build a Merge unidirectional motion vector candidate list. Let the original Merge motion vector candidate list be: {(1, 1), (2, 2), [(3, 3), (4, 4)], (3, 3), (5, 5), (6, 6)}. Among them, [(3, 3), (4, 4)] represents a bidirectional motion vector, and the reference frame of (3, 3) in [(3, 3), (4, 4)] is the same as that of (3, 3). The bidirectional motion vector [(3, 3), (4, 4)] can be split into two unidirectional motion vectors. Among them, (4, 4) is negated to (-4, -4) and filled into the list, and the subsequent motion vector (3, 3) is removed by duplicate checking. Then, the adjusted Merge unidirectional motion vector candidate list from the original motion vector candidate list can be: {(1, 1), (2, 2), (3, 3), (-4, -4), (5, 5), (6, 6)}, and the reference frame of all MVs is the first forward reference frame. And the reference frame of all MVs is the same as the forward reference frame of the current block.
[0175] Build the AMVP unidirectional list as: {(-4, 2), (-2, 3)}; the reference frame of (-4, 2) is the second forward reference frame (scaling is required), and the reference frame of (-2, 3) is the first forward reference frame.
[0176] The preset direction is forward. Only take the first two MVs of the Merge unidirectional motion vector candidate list [i.e., (1, 1), (2, 2)] and the first MV of the AMVP unidirectional motion vector candidate list [i.e., (-4, 2)] to perform the MV selection process for fusion prediction.
[0177] After tuning the Merge unidirectional MV with MMVD, it is found that the Merge MV (1, 1) needs to be offset 1 pixel to the right and becomes (2, 1); the Merge MV (2, 2) needs to be offset 2 pixels downward and becomes (2, 4).
[0178] The AMVP MV (-4, 2) needs to be scaled from the second reference frame to the first. According to the POC distance, (-4, 2) / 2 = (-2, 1).
[0179] Add the two tuned Merge MVs and the scaled AMVP MV (-2, 1) respectively: (2, 1) + (-2, 1) = (0, 2), (2, 4) + (-2, 1) = (0, 5).
[0180] Predict with (0, 2) and (0, 5) respectively. Assume that the cost value of (0, 5) is smaller than that of (0, 2), then the best fusion prediction MV of the current block is (0, 5).
[0181] Among them, Figure 6The method shown uses (0, 5) to perform inter-frame prediction on the current block to determine the merged prediction block of the current block.
[0182] Embodiment 2
[0183] The current block performs bidirectional prediction. Since it is bidirectional prediction, it is first split into two unidirectional predictions.
[0184] Let the Merge forward unidirectional motion vector candidate list be: {(1, 1), (2, 2), (3, 3)}, and the reference frame of all MVs is the first forward reference frame. The backward unidirectional motion vector candidate list is: {(4, 4), (5, 5), (6, 6)}, and the reference frame of all MVs is the first backward reference frame; the AMVP forward unidirectional motion vector candidate list is: {(-4, 2), (0, 0)}, and the reference frame is the first forward reference frame. The backward unidirectional motion vector candidate list is {(-2, 3), (0, 0)}, and the reference frame is the first backward reference frame.
[0185] For each direction, only the first MV in the Merge unidirectional motion vector candidate list is taken. That is, only (1, 1) is taken for Merge forward, and only (4, 4) is taken for Merge backward; for each direction, only the first MV in the AMVP unidirectional motion vector candidate list is taken. That is, only (-4, 2) is taken for AMVP forward, and only (-2, 3) is taken for AMVP backward.
[0186] As Figure 7 shown, the current block first performs forward prediction, and uses the Merge MV (1, 1) and the AMVP MV (-4, 2) for merged prediction. (1, 1) + (-4, 2) = (-3, 3), and uses the forward merged motion vector information (-3, 3) for prediction to obtain the forward merged prediction block.
[0187] As Figure 7 shown, the current block then performs backward prediction, and uses the Merge MV (4, 4) and the AMVP MV (-2, 3) for merged prediction. (4, 4) + (-2, 3) = (2, 7), and uses the backward merged motion vector information (2, 7) for prediction to obtain the backward merged prediction block.
[0188] Finally, the values of all corresponding position pixel points in the forward merged prediction block and the backward merged prediction block are weighted one by one to obtain the final prediction block.
[0189] In other embodiments, the current block can also first perform backward prediction and then forward prediction.
[0190] Please refer to Figure 8 , Figure 8 is a schematic flowchart of an implementation manner of the video encoding method of the present application. It should be noted that if there are substantially the same results, this embodiment does notFigure 8 It is limited to the shown process sequence. In this embodiment, the video encoding method includes the following steps:
[0191] S201: Determine the target fusion prediction block of the current block of the current encoding frame in the video based on any of the above inter-frame prediction methods.
[0192] S202: Encode the current block based on the target fusion prediction block.
[0193] Please refer to Figure 9 , Figure 9 which is a schematic flowchart of an embodiment of the video decoding method of this application. It should be noted that if there are substantially the same results, this embodiment is not limited to Figure 9 the shown process sequence. In this embodiment, the video decoding method includes the following steps:
[0194] S301: Determine the target fusion prediction block of the current block of the current decoding frame in the video based on any of the above inter-frame prediction methods.
[0195] S302: Decode the current block based on the target fusion prediction block.
[0196] Please refer to Figure 10 , Figure 10 which is a schematic structural diagram of an embodiment of the encoder of this application. This encoder 10 includes a processor 12, and the processor 12 is used to execute instructions to implement the above inter-frame prediction method and video encoding method. For the specific implementation process, please refer to the description of the above embodiment, which will not be elaborated here.
[0197] The processor 12 can also be called a CPU (Central Processing Unit, central processing unit). The processor 12 may be an integrated circuit chip with signal processing capabilities. The processor 12 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor 12 can also be any conventional processor, etc.
[0198] The encoder 10 may further include a memory 11 for storing instructions and data required for the operation of the processor 12.
[0199] The processor 12 is used to execute instructions to implement any embodiment and any non-conflicting combination of the above inter-frame prediction method and video encoding method provided by this application.
[0200] Please refer to Figure 11 , Figure 11It is a schematic structural diagram of an embodiment of the decoder of the present application. The decoder 20 includes a processor 22, and the processor 22 is used to execute instructions to implement the above-mentioned inter-frame prediction method and video decoding method. For the specific implementation process, please refer to the description of the above-mentioned embodiment, which will not be elaborated here.
[0201] The processor 22 can also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 22 may be an integrated circuit chip with signal processing capabilities. The processor 22 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor 22 can also be any conventional processor, etc.
[0202] The decoder 20 may further include a memory 21 for storing instructions and data required for the operation of the processor 22.
[0203] The processor 22 is used to execute instructions to implement the method provided by any embodiment and any non-conflicting combination of the above-mentioned inter-frame prediction method and video decoding method of the present application.
[0204] Please refer to Figure 12 , Figure 12 It is a schematic structural diagram of the computer-readable storage medium in the embodiment of the present application. The computer-readable storage medium 30 of the embodiment of the present application stores instructions / program data 31, and when the instructions / program data 31 are executed, the method provided by any embodiment and any non-conflicting combination of the inter-frame prediction method, video decoding method and video encoding method of the present application is implemented. Among them, the instructions / program data 31 can form a program file and be stored in the above-mentioned storage medium 30 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor can execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium 30 includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0205] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.
[0206] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0207] It should also be noted that the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity, or device. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, commodity, or device including the element.
[0208] The above is only the implementation mode of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. An inter-frame prediction method, characterized in that, the method includes: Constructing a motion vector candidate list for each of at least two inter-frame prediction modes of the current block, obtaining at least two motion vector candidate lists of the current block; Determining at least one fusion vector combination of the current block based on the at least two motion vector candidate lists, at least two motion vector information respectively from different motion vector candidate lists exist in the fusion vector combination, and the reference frame directions of all motion vector information in the fusion vector combination are preset directions; Fusing all motion vector information in each fusion vector combination to obtain at least one fusion motion vector information in the preset direction of the current block; Based on at least one fusion motion vector information, performing inter-frame prediction on the current block in the preset direction to obtain a target fusion prediction block in the preset direction of the current block.
2. The method according to claim 1, characterized in that, the step of constructing a motion vector candidate list for each of at least two inter-frame prediction modes of the current block, obtaining at least two motion vector candidate lists of the current block includes: Constructing an original motion vector candidate list for each of at least two inter-frame prediction modes of the current block; Constructing a unidirectional motion vector candidate list in the preset direction of each mode of the current block from the original motion vector candidate list of each mode; The step of determining at least one fusion vector combination of the current block based on the at least two motion vector candidate lists includes: Determining at least one fusion vector combination of the current block based on at least two unidirectional motion vector candidate lists in the preset direction of the current block.
3. The method according to claim 2, characterized in that, the step of constructing a unidirectional motion vector candidate list in the preset direction of each mode of the current block from the original motion vector candidate list of each mode includes: Splitting each bidirectional motion vector information in the original motion vector candidate list of each mode to obtain at least one split motion vector information in the preset direction; Composing a unidirectional motion vector candidate list in the preset direction of each mode of the current block from all motion vector information in the preset direction in the original motion vector candidate list of each mode and all split motion vector information obtained based on the original motion vector candidate list of each mode.
4. The method according to claim 3, characterized in that, the step of splitting each bidirectional motion vector information in the original motion vector candidate list of each mode to obtain at least one split motion vector information in the preset direction includes: Split each bidirectional motion vector information in the original motion vector candidate list in each of the modes into a first split motion vector information and a second split motion vector information, where the reference frame direction of the first split motion vector information is the preset direction, and the reference frame direction of the second split motion vector information is the opposite direction of the preset direction; Convert the second split motion vector information into motion vector information in the preset direction; The step of forming the unidirectional motion vector candidate list in the preset direction in each of the modes of the current block from all the motion vector information in the preset direction in the original motion vector candidate list in each of the modes and all the split motion vector information obtained based on the original motion vector candidate list in each of the modes includes: Convert each reverse motion vector information in the original motion vector candidate list in each of the modes into motion vector information in the preset direction to obtain converted motion vector information; wherein, the reference frame direction of the reverse motion vector information is the opposite direction of the preset direction; Form the unidirectional motion vector candidate list in the preset direction in each of the modes of the current block from all the motion vector information in the preset direction in the original motion vector candidate list in each of the modes, all the split motion vector information obtained based on the original motion vector candidate list in each of the modes, and all the converted motion vector information.
5. The method according to claim 4, wherein, the step of converting each reverse motion vector information in the original motion vector candidate list in each of the modes into motion vector information in the preset direction includes: Convert the reference frame of the reverse motion vector information into a preset reference frame, and take the opposite of the motion vector of the reverse motion vector information to obtain the converted motion vector information; wherein, the first difference and the second difference are the same, the first difference is the difference between the picture order number of the reference frame of the reverse motion vector information and the picture order number of the picture frame to which the current block belongs, and the second difference is the difference between the picture order number of the picture frame to which the current block belongs and the preset reference frame.
6. The method according to claim 3, wherein, the step of constructing the unidirectional motion vector candidate list in the preset direction in each of the modes of the current block from the original motion vector candidate list in each of the modes includes: During the process of constructing the unidirectional motion vector candidate list, check for duplicates between the motion vector information to be filled in and the existing motion vector information in the unidirectional motion vector candidate list; If the duplicate check passes, fill the motion vector information to be filled in into the unidirectional motion vector candidate list.
7. The method according to claim 6, wherein, the step of checking for duplicates between the motion vector information to be filled in and the existing motion vector information in the unidirectional motion vector candidate list includes: If the motion vector information to be filled in is the same as the motion vector and reference frame of any existing motion vector information in the unidirectional motion vector candidate list, the motion vector information to be filled in fails the duplicate check; otherwise, the motion vector information to be filled in passes the duplicate check.
8. The method according to claim 1, wherein, the at least two inter-frame prediction modes include a first inter-frame prediction mode and a second inter-frame prediction mode, and the step of determining at least one combined vector combination of the current block based on the at least two motion vector candidate lists includes: Determining at least one combined vector combination of the current block based on the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode.
9. The method according to claim 8, wherein, the step of determining at least one combined vector combination of the current block based on the motion vector information within a first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within a second preset position range in the motion vector candidate list under the second inter-frame prediction mode includes: Optimizing the motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode, and determining at least one combined vector combination of the current block based on the optimized motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the motion vector information within the second preset position range in the motion vector candidate list under the second inter-frame prediction mode; or, Optimizing the motion vector information within the second preset position range in the motion vector candidate list under the second inter-frame prediction mode, and determining at least one combined vector combination of the current block based on the motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the optimized motion vector information within the second preset position range in the motion vector candidate list under the second inter-frame prediction mode; or, Optimizing the motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode, and optimizing the motion vector information within the second preset position range in the motion vector candidate list under the second inter-frame prediction mode; determining at least one combined vector combination of the current block based on the optimized motion vector information within the first preset position range in the motion vector candidate list under the first inter-frame prediction mode and the optimized motion vector information within the second preset position range in the motion vector candidate list under the second inter-frame prediction mode.
10. The method according to claim 1, wherein, the step of determining at least one combined vector combination of the current block based on the at least two motion vector candidate lists includes: Determine at least one fusion vector combination of the current block based on at least one optimal motion vector information of each in at least a part of the motion vector candidate list and the remaining part of the motion vector candidate list.
11. The method according to claim 10, wherein, the step of determining at least one fusion vector combination of the current block based on at least one optimal motion vector information of each in at least a part of the motion vector candidate list and the remaining part of the motion vector candidate list includes: Optimize each motion vector information in each motion vector candidate list in at least a part of the motion vector candidate list; Perform cost comparison on all optimized motion vector information of each motion vector candidate list; Use at least one optimized motion vector information with the smallest cost value in each motion vector candidate list as at least one optimal motion vector information in each motion vector candidate list.
12. The method according to claim 9 or 11, wherein: The method further includes: Optimize the motion vector information through a merge mode, a template matching mode or a motion search method with a motion vector information difference.
13. The method according to claim 12, wherein, after the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the fusion motion vector information includes: Encode the index of the optimization method adopted by the motion vector information of each inter-frame prediction mode to obtain an encoded bitstream.
14. The method according to claim 1, wherein, the step of fusing all motion vector information in each of the fusion vector combinations to obtain at least one fusion motion vector information of the current block in the preset direction includes: When there is third motion vector information in each of the fusion vector combinations, scale the third motion vector information based on the reference frame in the preset direction of the current block, wherein the reference frame of the third motion vector information is different from the reference frame in the preset direction of the current block; Fuse the scaled third motion vector information in each of the fusion vector combinations and the motion vector information other than the third motion vector information to obtain the fusion motion vector information of the current block in each preset direction.
15. The method according to claim 14, wherein, the reference frame in the preset direction of the current block is the image frame closest to the current block in the preset direction.
16. The method according to claim 14, wherein, the step of fusing the scaled third motion vector information in each of the fusion vector combinations and the motion vector information other than the third motion vector information includes: Weight the scaled third motion vector information in each of the fusion vector combinations and the motion vector information other than the third motion vector information.
17. The method according to claim 1, wherein, the current block is a bi-predictive block; Taking the forward direction as the preset direction, execute the motion vector candidate list in each of at least two inter-frame prediction modes for constructing the current block, to obtain at least two motion vector candidate lists for the current block, determine at least one fusion vector combination for the current block based on the at least two motion vector candidate lists, fuse all the motion vector information in each of the fusion vector combinations to obtain at least one fused motion vector information in the preset direction of the current block, and perform inter-frame prediction on the current block in the preset direction based on at least one of the fused motion vector information, to obtain the forward target fused prediction block of the current block; Taking the backward direction as the preset direction, execute the motion vector candidate list in each of at least two inter-frame prediction modes for constructing the current block, to obtain at least two motion vector candidate lists for the current block, determine at least one fusion vector combination for the current block based on the at least two motion vector candidate lists, fuse all the motion vector information in each of the fusion vector combinations to obtain at least one fused motion vector information in the preset direction of the current block, and perform inter-frame prediction on the current block in the preset direction based on at least one of the fused motion vector information, to obtain the backward target fused prediction block of the current block; Weight the forward target fused prediction block and the backward target fused prediction block of the current block to obtain the bidirectional prediction block of the current block.
18. The method according to claim 1, wherein, after the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the fused motion vector information includes: Encoding the index information of each motion vector information in the fusion vector combination corresponding to the target fused prediction block in the preset direction of the current block to obtain an encoded bitstream.
19. The method according to claim 1, wherein, after the step of performing inter-frame prediction on the current block in the preset direction based on at least one of the fused motion vector information includes: Setting the value of a preset syntax element in the encoded bitstream, where different values of the preset syntax element represent whether to enable the inter-frame prediction method.
20. A video encoding method, wherein, the method includes: Determining the target fused prediction block of the current block of the current encoded frame in the video based on the inter-frame prediction method according to any one of claims 1-19; Encoding the current block based on the target fused prediction block.
21. A video decoding method, wherein, the method includes: Determining the target fused prediction block of the current block of the current decoded frame in the video based on the inter-frame prediction method according to any one of claims 1-19; Decoding the current block based on the target fused prediction block.
22. An encoder, wherein, the encoder includes a processor; the processor is configured to execute instructions to implement the steps of the method according to any one of claims 1-20.
23. A decoder, Characterized in that, the decoder includes a processor; the processor is configured to execute instructions to implement the steps of the method according to any one of claims 1-19 and 21.
24. A computer-readable storage medium, on which a program and / or instructions are stored, Characterized in that, when the program and / or instructions are executed, the steps of the method according to any one of claims 1-19 or 20 or 21 are implemented.
Citation Information
Patent Citations
Inter-frame prediction method based on triangular mode, video coding method and equipment
CN110312130A
Inter-frame prediction method and device
CN111432219A