Motion vector list construction method and device, electronic equipment and program product
By constructing a motion vector candidate list containing unidirectional and bidirectional prediction information, the problem of low accuracy of GPM prediction results is solved, and more efficient video encoding is achieved.
Patent Information
- Application Number
- CN202411846052.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-21
AI Technical Summary
The inter-prediction scheme of the geometric division mode (GPM) can only use prediction information in one direction to predict, reducing the accuracy of the GPM prediction results.
By constructing an initial motion vector candidate list, it contains one-way predicted motion information and two-way predicted motion information, and constructs a target motion vector candidate list based on the direction prediction type for video encoding.
It improves the accuracy of the prediction results, reduces the coding cost of motion vectors, and improves the overall coding efficiency of video sequences.
Smart Images

Figure CN119676440A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video processing technology, and in particular to a motion vector list construction method, a motion vector list construction device, an electronic device, and a computer program product. Background Art
[0002] As a core module in the hybrid video coding framework, inter-frame prediction plays an extremely important role in most video coding and decoding systems. Based on the temporal correlation of video sequences, inter-frame prediction uses the information in the encoded video frames to predict the unknown information in the current frame. The encoded frames are called the reference frames of the current frames, which can effectively remove the temporal redundant information in the video.
[0003] The inter-frame prediction process in video coding can be roughly summarized into three modules: (1) Motion information estimation: According to a motion prediction model, the corresponding position of the current block to be predicted in the reference frame is located, that is, a hypothetical estimate of the possible motion of the current block relative to the reference frame is made, and finally the reference block in one or more reference frames is obtained as the prediction block. (2) Motion vector coding: After the first step of estimation, an estimated motion vector is obtained, which needs to be marked in the bitstream and transmitted to the decoder. (3) Motion compensation: Decode the motion information at the decoder and perform motion alignment according to the predefined motion prediction model. Summary of the invention
[0004] The present disclosure provides a motion vector list construction method, device, electronic device, computer-readable storage medium and computer program product to at least solve the problem that the inter-frame prediction scheme of the geometric partitioning mode (GPM) in the related art can only use the prediction information of one direction for prediction, which reduces the accuracy of the GPM prediction result. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a motion vector list construction method is provided, comprising: obtaining a frame to be encoded, and determining a current coding unit based on the frame to be encoded; constructing an initial motion vector candidate list of the current coding unit according to motion information of a prediction unit corresponding to the current coding unit, the motion information of the prediction unit including unidirectional prediction motion information and bidirectional prediction motion information; determining a directional prediction type of a first candidate motion vector in the initial motion vector candidate list; and constructing a target motion vector candidate list based on the directional prediction type and the first candidate motion vector, the target motion vector candidate list being used for video encoding of the frame to be encoded.
[0006] In an exemplary embodiment of the present disclosure, constructing an initial motion vector candidate list of the current coding unit according to the motion information of the prediction unit corresponding to the current coding unit includes: obtaining the motion information of the prediction unit, the motion information of the prediction unit including a first predicted motion vector and a second predicted motion vector; obtaining a pre-configured maximum length of the initial list; and constructing the initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector, and the second predicted motion vector.
[0007] In an exemplary embodiment of the present disclosure, obtaining the motion information of the prediction unit includes: taking a coding unit that is spatially adjacent to the current coding unit as a spatial prediction unit; taking a motion vector corresponding to the spatial prediction unit as the first predicted motion vector; taking a coding unit that is temporally adjacent to the current coding unit as a temporal prediction unit; and taking a motion vector corresponding to the spatial prediction unit as the second predicted motion vector.
[0008] In an exemplary embodiment of the present disclosure, constructing the initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector includes: filling the first predicted motion vector and the second predicted motion vector into the initial motion vector candidate list; determining a first current list length of the initial motion vector candidate list after the motion vector filling operation; when the first current list length is less than the maximum length of the initial list, filling the initial motion vector candidate list with a specified motion vector until the first current list length is equal to the maximum length of the initial list, thereby obtaining the initial motion vector candidate list.
[0009] In an exemplary embodiment of the present disclosure, constructing a target motion vector candidate list based on the directional prediction type and the first candidate motion vector includes: obtaining a pre-configured target list maximum length; and constructing a target motion vector candidate list based on the target list maximum length, the directional prediction type and the first candidate motion vector.
[0010] In an exemplary embodiment of the present disclosure, constructing a target motion vector candidate list according to the maximum length of the target list, the directional prediction type and the first candidate motion vector includes: when the directional prediction type is a unidirectional prediction motion vector, using the first candidate motion vector as the second candidate motion vector; when the directional prediction type is a bidirectional prediction motion vector, splitting the first candidate motion vector to obtain two unidirectional prediction motion vectors; using the obtained unidirectional prediction motion vector as the second candidate motion vector; and constructing the target motion vector candidate list based on the second candidate motion vector and the maximum length of the target list.
[0011] In an exemplary embodiment of the present disclosure, constructing the target motion vector candidate list based on the second candidate motion vector and the maximum length of the target list includes: determining an existing candidate motion vector currently existing in the target motion vector candidate list; when the second candidate motion vector is the same as the existing candidate motion vector, discarding the second candidate motion vector; when the second candidate motion vector is different from the existing candidate motion vector, filling the target motion vector candidate list with the second candidate motion vector; determining a second current list length of the target motion vector candidate list after the motion vector filling operation; when the second current list length is less than the maximum length of the target list, filling the target motion vector candidate list with a specified motion vector until the second current list length is equal to the maximum length of the target list, thereby obtaining the target motion vector candidate list.
[0012] In an exemplary embodiment of the present disclosure, the above method also includes: obtaining the candidate motion vectors contained in the target motion vector candidate list; determining the rate-distortion cost corresponding to each of the candidate motion vectors; determining the target candidate motion vector from multiple candidate motion vectors based on the rate-distortion cost, and transmitting the target index corresponding to the target candidate motion vector to the decoding end.
[0013] According to a second aspect of an embodiment of the present disclosure, a motion vector list construction device is provided, comprising: a current coding unit determination module, used to obtain a frame to be encoded, and determine a current coding unit based on the frame to be encoded; an initial list construction module, used to construct an initial motion vector candidate list of the current coding unit according to motion information of a prediction unit corresponding to the current coding unit, the motion information of the prediction unit including unidirectional prediction motion information and bidirectional prediction motion information; a direction type determination module, used to determine a direction prediction type of a first candidate motion vector in the initial motion vector candidate list; a target list construction module, used to construct a target motion vector candidate list based on the direction prediction type and the first candidate motion vector, the target motion vector candidate list being used for video encoding of the frame to be encoded.
[0014] In an exemplary embodiment of the present disclosure, the initial list construction module includes an initial list construction unit, which is used to: obtain motion information of the prediction unit, the motion information of the prediction unit includes a first predicted motion vector and a second predicted motion vector; obtain a pre-configured maximum length of the initial list; and construct the initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector.
[0015] In an exemplary embodiment of the present disclosure, the initial list construction unit includes a reference information determination subunit, which is used to: use a coding unit that is spatially adjacent to the current coding unit as a spatial prediction unit; use a motion vector corresponding to the spatial prediction unit as the first predicted motion vector; use a coding unit that is temporally adjacent to the current coding unit as a temporal prediction unit; and use the motion vector corresponding to the spatial prediction unit as the second predicted motion vector.
[0016] In an exemplary embodiment of the present disclosure, the initial list construction unit includes an initial list construction sub-unit, which is used to: fill the first predicted motion vector and the second predicted motion vector into the initial motion vector candidate list; determine a first current list length of the initial motion vector candidate list after the motion vector filling operation; when the first current list length is less than the maximum length of the initial list, fill the initial motion vector candidate list with a specified motion vector until the first current list length is equal to the maximum length of the initial list, so as to obtain the initial motion vector candidate list.
[0017] In an exemplary embodiment of the present disclosure, the target list construction module includes a target list construction unit, which is used to: obtain a pre-configured maximum length of the target list; and construct a target motion vector candidate list according to the maximum length of the target list, the directional prediction type and the first candidate motion vector.
[0018] In an exemplary embodiment of the present disclosure, the target list construction unit includes a target list construction sub-unit, which is used to: when the directional prediction type is a unidirectional prediction motion vector, use the first candidate motion vector as the second candidate motion vector; when the directional prediction type is a bidirectional prediction motion vector, split the first candidate motion vector to obtain two unidirectional prediction motion vectors; use the obtained unidirectional prediction motion vector as the second candidate motion vector; and construct the target motion vector candidate list based on the second candidate motion vector and the maximum length of the target list.
[0019] In an exemplary embodiment of the present disclosure, the target list construction subunit is configured to perform: determining an existing candidate motion vector currently existing in the target motion vector candidate list; when the second candidate motion vector is the same as the existing candidate motion vector, discarding the second candidate motion vector; when the second candidate motion vector is different from the existing candidate motion vector, filling the second candidate motion vector into the target motion vector candidate list; determining a second current list length of the target motion vector candidate list after the motion vector filling operation; when the second current list length is less than the maximum length of the target list, filling the target motion vector candidate list with a specified motion vector until the second current list length is equal to the maximum length of the target list, thereby obtaining the target motion vector candidate list.
[0020] In an exemplary embodiment of the present disclosure, the above-mentioned motion vector list construction device also includes a target index determination module, which is used to: obtain the candidate motion vectors contained in the target motion vector candidate list; determine the rate-distortion cost corresponding to each of the candidate motion vectors; determine the target candidate motion vector from multiple candidate motion vectors according to the rate-distortion cost, and transmit the target index corresponding to the target candidate motion vector to the decoding end.
[0021] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement any one of the above-described motion vector list construction methods.
[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the motion vector list construction methods described above.
[0023] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which implements any one of the above-mentioned motion vector list construction methods when executed by a processor.
[0024] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0025] On the one hand, the process of constructing the motion vector candidate list of the GPM mode is optimized, the bidirectional prediction motion information is retained, and it is added to the GPM motion vector candidate list in sequence, which improves the accuracy of the prediction results and reduces the encoding cost of the motion vector. On the other hand, the constructed target motion vector candidate list is used for video encoding, which can improve the overall encoding efficiency of the video sequence.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0028] Figure 1 It is a schematic diagram of the reference block and motion information of the current frame in the reference frame in inter-frame prediction.
[0029] Figure 2 It is a schematic diagram of deriving the Merge candidate list of the GPM mode according to the relevant scheme.
[0030] Figure 3 The figure is a flowchart of a method for constructing a motion vector list according to an exemplary embodiment.
[0031] Figure 4 The figure is a schematic diagram of deriving motion information of adjacent blocks in the spatiotemporal domain in the Merge mode according to an exemplary embodiment.
[0032] Figure 5 It is a schematic diagram of a Merge candidate list filling rule in a GPM mode according to an exemplary embodiment.
[0033] Figure 6 The figure is a block diagram of a device for constructing a motion vector list according to an exemplary embodiment.
[0034] Figure 7 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0035] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0037] In inter-frame prediction, reference Figure 1 , Figure 1 It is a schematic diagram of the reference block and motion information of the current frame in the reference frame in inter-frame prediction. Figure 1 One or more prediction blocks of the current block can be determined by Figure 1 It can be seen from the inter-frame prediction process that the motion vector obtained in motion estimation plays a very important role in the entire inter-frame prediction. More accurate motion vector prediction can bring more accurate pixel prediction values and lower encoding costs. The relevant scheme uses two modes for motion vectors: Merge mode and Advanced Motion Vector Prediction (AMVP) mode.
[0038] Relevant video coding standards often use rectangular partitioning to obtain non-overlapping coding blocks, and use the rectangular block as a maximum unit for prediction and reconstruction coding. Although rectangular block partitioning based on binary trees, ternary trees and quadtrees is flexible and efficient, it is difficult for rectangular partitioning to describe the real boundary of irregular moving objects through a motion vector, resulting in insufficient expression of the edges of irregular moving objects and difficulty in adapting to complex video content. Therefore, the geometric partitioning mode GPM is further proposed.
[0039] GPM divides a coding block into two sub-blocks P0 and P1 by a straight line, and this straight line is represented by angle parameters and distance parameters. However, the GPM mode only supports unidirectional prediction, the purpose is to divide the two sub-areas into unidirectional predictions respectively, to achieve a similar purpose as bidirectional prediction. Figure 2 , Figure 2 This is a schematic diagram of the Merge candidate list export of the GPM mode according to the relevant scheme. GPM divides the current block into two non-rectangular sub-regions. Each sub-region uses the inter-frame prediction Merge mode to export its own motion vector candidate, and then performs motion compensation to obtain two prediction blocks, which is equivalent to the two sub-blocks after the division having independent prediction values. However, the motion vector candidates exported by the Merge mode are unidirectional and bidirectional. The GPM mode is actually composed of two unidirectional predictions to form a bidirectional prediction. Therefore, for the GPM mode, the motion information of one direction of the Merge bidirectional candidate will be taken according to certain rules to fill the GPM candidate list.
[0040] After obtaining the motion vector from the motion vector candidate list, if it is a bidirectional motion information, the unidirectional information will be taken according to certain rules for prediction. In fact, the advantage of bidirectional prediction is that it utilizes the information of multiple reference frames, which can alleviate the error of unidirectional prediction and has higher prediction accuracy. Therefore, taking only the prediction information in one direction does not give full play to the advantages of the motion vector candidate, and reduces the accuracy of the GPM prediction result. Especially when the candidate ranked first is a bidirectional prediction, discarding part of the motion information has a greater impact on the prediction accuracy and motion vector encoding cost.
[0041] Based on this, according to the embodiments of the present disclosure, a motion vector list construction method, a motion vector list construction device, an electronic device, a computer-readable storage medium, and a computer program product are proposed.
[0042] Figure 3 is a flowchart of a method for constructing a motion vector list according to an exemplary embodiment. Figure 3 As shown, the motion vector list construction method can be used in a computer device, wherein the computer device described in the present disclosure may include mobile terminal devices such as mobile phones, tablet computers, laptops, PDAs, and fixed terminal devices such as desktop computers. This exemplary embodiment uses the method applied to a computer device as an example, and it can be understood that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. Specifically, the following steps are included.
[0043] Step S310: obtaining a frame to be encoded, and determining a current coding unit based on the frame to be encoded.
[0044] Step S320 , constructing an initial motion vector candidate list of the current coding unit according to the motion information of the prediction unit corresponding to the current coding unit, where the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information.
[0045] Step S330 , determining the directional prediction type of the first candidate motion vector in the initial motion vector candidate list.
[0046] Step S340: construct a target motion vector candidate list based on the directional prediction type and the first candidate motion vector.
[0047] According to the motion vector list construction method in this example embodiment, on the one hand, the motion vector candidate list construction process of the GPM mode is optimized, the bidirectional prediction motion information is retained, and it is added to the GPM motion vector candidate list in sequence, which improves the accuracy of the prediction result and reduces the encoding cost of the motion vector. On the other hand, the constructed target motion vector candidate list is used for video encoding, which can improve the overall encoding efficiency of the video sequence.
[0048] Next, the motion vector list construction method in this exemplary embodiment will be further described.
[0049] In step S310, a frame to be encoded is obtained, and a current coding unit is determined based on the frame to be encoded.
[0050] In an exemplary embodiment of the present disclosure, the frame to be encoded may be a video frame to be encoded, and the current encoding unit may be a encoding unit currently being encoded in the frame to be encoded.
[0051] In the video encoding process, the frame to be encoded can be obtained from the sequence of video frames to be encoded. Since the encoding process is performed in blocks, after the frame to be encoded is obtained, the current coding unit is determined from the frame to be encoded. For example, the current coding unit can be a coding unit (Coding Unit, CU); or a smaller unit obtained by dividing the coding unit; or a macroblock; or a sub-block obtained by dividing the macroblock, etc. In the actual encoding process, the size of the coding unit can be determined according to the encoding requirements.
[0052] In step S320, an initial motion vector candidate list of the current coding unit is constructed according to the motion information of the prediction unit corresponding to the current coding unit, where the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information.
[0053] In an exemplary embodiment of the present disclosure, the prediction unit may be a reference unit corresponding to the current coding unit, such as the prediction unit may be a reference block adjacent to the current coding unit in the spatial domain or the temporal domain, and the size of the prediction unit is the same as the size of the current coding unit. The motion information of the prediction unit may be the motion information of the reference block of the current frame in the reference frame determined by motion information estimation during the inter-frame prediction process. The initial motion vector candidate list may be a candidate motion vector list constructed based on the motion information of the prediction unit. The unidirectional prediction motion information may be the unidirectional motion information predicted in the motion information estimation process, such as if the current block only has a prediction block in a single direction, in this case only the unidirectional prediction motion information is determined. The bidirectional prediction motion information may be the bidirectional motion information predicted in the motion information estimation process, such as if the current block has prediction blocks in two directions, in this case the bidirectional prediction motion information can be determined.
[0054] For the current coding unit, the motion information of the prediction unit corresponding to the current coding unit can be determined. After the motion information is estimated, the motion information of the prediction unit obtained is an estimated motion vector, and the motion information of the prediction unit can be derived to derive the motion vector prediction value (Motion Vector Prediction, MVP), which is used to construct the initial motion vector candidate list. Taking the Merge mode as an example, through the inter-frame prediction process, the motion of the prediction unit can include unidirectional prediction motion information and bidirectional prediction motion information.
[0055] In an exemplary embodiment of the present disclosure, for step S320, an initial motion vector candidate list of the current coding unit is constructed according to the motion information of the prediction unit corresponding to the current coding unit, including: obtaining the motion information of the prediction unit, the motion information of the prediction unit including a first predicted motion vector and a second predicted motion vector; obtaining a pre-configured maximum length of the initial list; and constructing an initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector, and the second predicted motion vector.
[0056] The first predicted motion vector may be a motion vector determined based on motion information of a spatial prediction unit corresponding to the current coding unit. The second predicted motion vector may be a motion vector determined based on motion information of a temporal prediction unit corresponding to the current coding unit. The maximum length of the initial list may be the maximum length set by the initial motion vector candidate list, which may be represented by L1.
[0057] Since inter-frame prediction utilizes the correlation in the video time domain or the video space domain and uses the pixels of the adjacent encoded images to predict the pixels of the current image, for the prediction unit of the current coding unit, the motion information of the prediction unit obtained includes a first predicted motion vector determined based on the spatial domain correlation and a second predicted motion vector determined based on the temporal domain correlation.
[0058] Before constructing the candidate list, a preset maximum length L1 of the initial list can be obtained, and the first predicted motion vector and the second predicted motion vector are sequentially filled into the initial motion vector candidate list to construct an initial motion vector candidate list of length L1. The initial motion vector candidate list constructed by the above steps includes a unidirectional predicted motion vector and a bidirectional predicted motion vector, which serves as a basis for constructing a target motion vector candidate list.
[0059] In an exemplary embodiment of the present disclosure, obtaining motion information of a prediction unit includes: taking a coding unit that is spatially adjacent to a current coding unit as a spatial prediction unit; taking a motion vector corresponding to the spatial prediction unit as a first prediction motion vector; taking a coding unit that is temporally adjacent to the current coding unit as a temporal prediction unit; and taking a motion vector corresponding to the spatial prediction unit as a second prediction motion vector.
[0060] The spatial prediction unit may be a prediction unit that is spatially adjacent to the current coding unit, and the temporal prediction unit may be a prediction unit that is temporally adjacent to the current coding unit.
[0061] In inter-frame prediction, two modes are used for motion vectors: Merge mode and AMVP mode. Compared with AMVP mode, Merge mode mainly derives MVP based on some spatial information and co-located temporal information. After deriving the motion vector prediction value, it can be directly used for motion compensation, and no additional transmission of motion vector difference (Motion Vector Difference, MVD) is required. Therefore, the encoding cost is lower and the utilization rate is higher in the encoding process. In this embodiment, the Merge mode is taken as an example to describe the construction process of the initial motion vector candidate list.
[0062] refer to Figure 4 , Figure 4 The figure is a schematic diagram of deriving motion information of adjacent blocks in the spatiotemporal domain in the Merge mode according to an exemplary embodiment. Figure 4 In the figure, A1, B1, A0, B0 and B2 are all adjacent blocks of the current coding unit (current block). Therefore, A1, B1, A0, B0 and B2 can be used as the spatial prediction units corresponding to the current coding unit, and the motion vector corresponding to the spatial prediction unit can be obtained as the first predicted motion vector. For example, in Merge mode, the MVP information of the spatial prediction unit can be derived as the first predicted motion vector.
[0063] Continue to refer Figure 4 When determining the temporal neighboring blocks, the reference frame corresponding to the current frame where the current block is located can be determined first, and then the reference block (i.e., the temporal prediction unit) corresponding to the current block can be determined from the reference frame. Figure 4 For the current block C1 in the reference frame, the temporal neighboring block of C1 or C1 in the reference frame can be used as the temporal prediction unit. After the temporal prediction unit is determined, the motion vector corresponding to the temporal prediction unit is obtained as the second predicted motion vector. Through inter-frame prediction, the candidate motion vector for constructing the initial motion vector candidate list can be determined, and the last predicted motion vector includes unidirectional candidate motion information and bidirectional candidate motion information.
[0064] In an exemplary embodiment of the present disclosure, an initial motion vector candidate list is constructed according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector, including: filling the first predicted motion vector and the second predicted motion vector into the initial motion vector candidate list; determining a first current list length of the initial motion vector candidate list after the motion vector filling operation; when the first current list length is less than the maximum length of the initial list, filling the initial motion vector candidate list with a specified motion vector until the first current list length is equal to the maximum length of the initial list, thereby obtaining the initial motion vector candidate list.
[0065] The first current list length may be the length of the initial motion vector candidate list after the list filling operation is performed based on the first predicted motion vector and the second predicted motion vector. The specified motion vector may be a pre-configured motion vector of a specified type, for example, the specified motion vector may be a zero vector, the specified motion vector may also be a motion vector of another type, and the specified motion vector may be configured according to the filling requirements.
[0066] After the first predicted motion vector and the second predicted motion vector are determined, the above motion vectors can be sequentially filled into the initial motion vector candidate list. Figure 4 , Merge mode can add the motion information of the spatial neighboring blocks of the current block (i.e., the first predicted motion vector) to the initial motion vector candidate list in the order of B1->A1->B1->A0->B2. Then, the motion vector of the temporal neighboring block at position C1 or C1 in the reference frame (i.e., the second predicted motion vector) is added to the initial motion vector candidate list.
[0067] In the above process, unidirectional candidates and bidirectional candidates are not distinguished, and they can be filled into the list in the above order. If the length of the initial motion vector candidate list is less than L1 after the first predicted motion vector and the second predicted motion vector are filled, the specified motion vector (such as a zero vector) can be continued to be filled until the length of the candidate list reaches L1. Through the above steps, an initial motion vector candidate list containing unidirectional candidate motion information and bidirectional candidate motion information can be constructed.
[0068] It should be noted that, in this embodiment, only one (such as B1->A1->B1->A0->B2) motion vector filling order is given. In some other exemplary embodiments of the present disclosure, other filling orders can also be used to fill the above-mentioned predicted motion vector into the initial motion vector candidate list. The present disclosure does not make any special limitation on the filling order of the motion vector.
[0069] In step S330, the directional prediction type of the first candidate motion vector in the initial motion vector candidate list is determined.
[0070] In an exemplary embodiment of the present disclosure, the first candidate motion vector may be a candidate motion vector included in the initial motion vector candidate list. The directional prediction type may be a directional prediction type corresponding to the first candidate motion vector, including a unidirectional prediction motion vector and a bidirectional prediction motion vector.
[0071] After constructing the initial motion vector candidate list (i.e., the initial Merge candidate list), the directional prediction type of each first candidate motion vector in the list can be obtained, and then the target motion vector candidate list will be constructed based on the initial motion vector candidate list, such as converting the initial motion vector candidate list into a unidirectionally predicted target motion vector candidate list.
[0072] In step S340, a target motion vector candidate list is constructed based on the directional prediction type and the first candidate motion vector, and the target motion vector candidate list is used for video encoding of the frame to be encoded.
[0073] In an exemplary embodiment of the present disclosure, the target motion vector candidate list may be a motion vector candidate list constructed by performing unidirectional prediction conversion on motion information in the initial motion vector candidate list.
[0074] In order to address the problem that in the GPM mode, only the motion information in one direction is used to fill the GPM candidate list, which leads to the failure to fully utilize the advantages of the motion vector candidates and reduces the accuracy of the GPM prediction results, the present invention optimizes the filling method of the GPM candidate list. After obtaining the initial motion vector candidate list constructed based on the Merge mode, the candidate motion vectors of the initial motion vector candidate list are converted, and the bidirectional Merge candidate motion vectors are converted into continuous unidirectional candidate motion vectors to fill the GPM candidate list, and finally the target motion vector candidate list is obtained. Subsequently, video encoding of the frame to be encoded will be performed based on the constructed target motion vector candidate list.
[0075] In an exemplary embodiment of the present disclosure, for step S340, constructing a target motion vector candidate list based on the directional prediction type and the first candidate motion vector includes: obtaining a pre-configured maximum length of the target list; constructing a target motion vector candidate list according to the maximum length of the target list, the directional prediction type and the first candidate motion vector. The maximum length of the target list may be the maximum length set by the target motion vector candidate list, which may be represented by L2.
[0076] In this embodiment, the length of the target motion vector candidate list (GPM candidate list) is defined as the maximum length of the target list L2, and then the constructed initial motion vector candidate list is converted into the target motion vector candidate list (i.e., the GPM unidirectional prediction candidate list). Specifically, it is necessary to determine the direction prediction type of the first candidate motion vector in the initial motion vector candidate list, convert the bidirectional prediction motion vectors in the initial motion vector candidate list into unidirectional prediction motion vectors, and then fill them into the target motion vector candidate list.
[0077] In an exemplary embodiment of the present disclosure, a target motion vector candidate list is constructed according to the maximum length of the target list, the directional prediction type and the first candidate motion vector, including: when the directional prediction type is a unidirectional prediction motion vector, the first candidate motion vector is used as the second candidate motion vector; when the directional prediction type is a bidirectional prediction motion vector, the first candidate motion vector is split to obtain two unidirectional prediction motion vectors; the obtained unidirectional prediction motion vector is used as the second candidate motion vector; and the target motion vector candidate list is constructed based on the second candidate motion vector and the maximum length of the target list.
[0078] The unidirectional prediction motion vector may be a motion vector obtained by selecting only one direction of reference frames for motion estimation. The bidirectional prediction motion vector may be a motion vector obtained by selecting only two directions of reference frames for motion estimation. The second candidate motion vector may be a candidate motion vector used to fill the target motion vector candidate list.
[0079] refer to Figure 5 , Figure 5 The present invention is a schematic diagram of the Merge candidate list filling rule of the GPM mode according to an exemplary embodiment. When constructing the target motion vector candidate list, the initial Merge list is scanned in sequence to obtain the first candidate motion vector in the initial motion vector candidate list, and the direction prediction type of the first candidate motion vector is determined one by one. If the first candidate motion vector is a unidirectional prediction candidate, the first candidate motion vector is directly used as the second candidate motion vector. If the first candidate motion vector is a bidirectional prediction candidate, the first candidate motion vector of the bidirectional prediction candidate is split into two unidirectional prediction motion vectors as two second candidate motion vectors.
[0080] After the first candidate motion vector is split based on the directional prediction type to generate the second candidate motion vector, the second candidate motion vectors can be sequentially filled into the new list until the new list is filled, that is, the maximum length of the target list is reached, and the target motion vector candidate list is obtained. The target motion vector candidate list constructed by the above steps can retain the motion information of the two directions of the bidirectional candidate, avoiding discarding part of the motion information.
[0081] In an exemplary embodiment of the present disclosure, a target motion vector candidate list is constructed based on a second candidate motion vector and a maximum length of a target list, including: determining an existing candidate motion vector currently existing in the target motion vector candidate list; when the second candidate motion vector is the same as the existing candidate motion vector, discarding the second candidate motion vector; when the second candidate motion vector is different from the existing candidate motion vector, filling the second candidate motion vector into the target motion vector candidate list; determining a second current list length of the target motion vector candidate list after a motion vector filling operation; when the second current list length is less than the maximum length of the target list, filling the target motion vector candidate list with a specified motion vector until the second current list length is equal to the maximum length of the target list, thereby obtaining the target motion vector candidate list.
[0082] The existing candidate motion vector may be a candidate motion vector currently existing in the target motion vector candidate list. The second current list length may be the length of the target motion vector candidate list after the list filling operation is performed using the second candidate motion vector.
[0083] Continue to refer Figure 5 Before filling the second candidate motion vector into the target motion vector candidate list, the existing candidate motion vector currently in the new list can be obtained to determine whether the second candidate motion vector to be filled is the same as the existing candidate motion vector. If the second candidate motion vector to be filled is the same as the existing candidate motion vector, the second candidate motion vector is discarded; if the second candidate motion vector is different from the existing candidate motion vector, the second candidate motion vector is filled into the target motion vector candidate list. In other words, when constructing a new target list, each time a candidate MV is filled, it is necessary to check for duplicates with the existing candidate MVs in the list to determine whether the same MV already exists in the list. If there are duplicate candidates in the list, the candidate is discarded and scanning and filling are continued until the length of the target motion vector candidate list reaches L2. By checking the candidate motion information for duplicates, the target motion vector candidate list can contain more different candidate MVs, so that the candidate motion vectors have differences for subsequent rate-distortion cost calculations.
[0084] After all the second candidate motion vectors are filled into the target motion vector candidate list, the current length of the target motion vector candidate list (i.e., the second current list length) after the motion vector filling operation can be determined. If the second current list length is less than the target list maximum length, a specified motion vector (such as a zero vector) can be filled into the target motion vector candidate list until the second current list length is equal to the target list maximum length L2, thereby obtaining the target motion vector candidate list.
[0085] For example, in Figure 5 In the list, candidates with the same filling pattern are repeated candidates, and candidates without filling are invalid motion information. The motion vector with index 0 in the Merge list is a bidirectional candidate motion vector, which is composed of candidate motion vector 0 and candidate motion vector 1. According to the list construction method disclosed in the present invention, when candidate motion vectors 0 and 1 are both filled into the GPM list, they need to be split into separate unidirectional predicted motion vectors 0 and unidirectional predicted motion vector 1; candidate motion vector 2 with index 1 is a unidirectional candidate motion vector and can be directly filled into the GPM list. However, since candidate motion vector 2 and candidate motion vector 1 are repeated, candidate motion vector 2 is discarded. Similarly, candidate motion vector 5 in the Merge list is repeated with candidate motion vector 0, so candidate motion vector 5 is discarded; candidate motion vector 7 is repeated with candidate motion vector 3, so candidate motion vector 7 is discarded, and the final result is as follows. Figure 5 The GPM list is shown.
[0086] It should be noted that the above embodiment only provides a Merge list filling order after retaining the bidirectional candidate information. Specifically, it is filled in the order of the original Merge candidate list. If it is unidirectional information, the information in that direction is directly taken for filling. If it is bidirectional prediction candidate motion information, it will be split into two unidirectional motion information and filled in sequence.
[0087] In addition to following the original Merge order, all bidirectional prediction candidates may be used to fill in first, and after the bidirectional prediction candidates are filled in, if the candidate list is not full, the unidirectional prediction candidates may be used to fill in. Similarly, all unidirectional candidates may be used to fill in first, and if the candidate list is not full, the bidirectional prediction candidates may be used to fill in. The present disclosure does not impose any restrictions on the filling order of the target motion vector candidate list.
[0088] In an exemplary embodiment of the present disclosure, candidate motion vectors included in a target motion vector candidate list are obtained; a rate-distortion cost corresponding to each candidate motion vector is determined; a target candidate motion vector is determined from multiple candidate motion vectors based on the rate-distortion cost, and a target index corresponding to the target candidate motion vector is transmitted to a decoding end.
[0089] The candidate motion vector may be a plurality of candidate MVs currently included in the target motion vector candidate list. The target candidate motion vector may be a motion vector with the smallest rate-distortion cost among the plurality of candidate motion vectors. The target index may be a list index corresponding to the target candidate motion vector.
[0090] After constructing the target motion vector candidate list, the candidate motion vectors in the target motion vector candidate list are used for GPM unidirectional prediction, and the rate-distortion cost corresponding to each candidate motion vector in the list is determined. The rate-distortion cost of each candidate motion vector is compared through rate-distortion optimization (RDO), and the candidate motion vector with the smallest cost is selected from multiple candidate motion vectors based on the rate-distortion cost as the target candidate motion vector (i.e., the optimal GPM Merge candidate), and the target index corresponding to the target candidate motion vector is determined, and the target index is transmitted to the decoding end, so that the motion vector with the smallest rate-distortion cost can be used for video encoding and decoding later.
[0091] In summary, the motion vector list construction method disclosed in the present invention obtains a frame to be encoded, determines the current coding unit based on the frame to be encoded; constructs an initial motion vector candidate list of the current coding unit according to the motion information of the prediction unit corresponding to the current coding unit, and the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information; determines the direction prediction type of the first candidate motion vector in the initial motion vector candidate list; constructs a target motion vector candidate list based on the direction prediction type and the first candidate motion vector, and the target motion vector candidate list is used for video encoding of the frame to be encoded. On the one hand, the motion vector candidate list construction process of the GPM mode is optimized, the bidirectional prediction motion information is retained, and it is added to the GPM motion vector candidate list in sequence, which improves the accuracy of the prediction result and reduces the encoding cost of the motion vector. On the other hand, the constructed target motion vector candidate list is used for video encoding, which can improve the overall encoding efficiency of the video sequence. On the other hand, when constructing the target motion vector candidate list, the candidate motion vector is checked for duplicate processing, which can ensure the difference of the candidate motion vectors in the list, thereby improving the accuracy of the subsequent rate-distortion cost calculation results.
[0092] Figure 6 FIG. 1 is a block diagram of a motion vector list construction device according to an exemplary embodiment. Figure 6 The motion vector list construction device 600 includes: a current coding unit determination module 610, an initial list construction module 620, a direction type determination module 630 and a target list construction module 640.
[0093] Specifically, the current coding unit determination module 610 is used to obtain the frame to be encoded and determine the current coding unit based on the frame to be encoded; the initial list construction module 620 is used to construct an initial motion vector candidate list of the current coding unit according to the motion information of the prediction unit corresponding to the current coding unit, and the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information; the direction type determination module 630 is used to determine the direction prediction type of the first candidate motion vector in the initial motion vector candidate list; the target list construction module 640 is used to construct a target motion vector candidate list based on the direction prediction type and the first candidate motion vector, and the target motion vector candidate list is used for video encoding of the frame to be encoded.
[0094] In an exemplary embodiment of the present disclosure, the initial list construction module 620 includes an initial list construction unit, which is used to: obtain motion information of a prediction unit, the motion information of the prediction unit including a first predicted motion vector and a second predicted motion vector; obtain a pre-configured maximum length of the initial list; and construct an initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector.
[0095] In an exemplary embodiment of the present disclosure, the initial list construction unit includes a reference information determination subunit, which is used to: use a coding unit that is spatially adjacent to a current coding unit as a spatial prediction unit; use a motion vector corresponding to the spatial prediction unit as a first prediction motion vector; use a coding unit that is temporally adjacent to the current coding unit as a temporal prediction unit; and use a motion vector corresponding to the spatial prediction unit as a second prediction motion vector.
[0096] In an exemplary embodiment of the present disclosure, an initial list construction unit includes an initial list construction sub-unit, which is used to: fill the first predicted motion vector and the second predicted motion vector into the initial motion vector candidate list; determine the first current list length of the initial motion vector candidate list after the motion vector filling operation; when the first current list length is less than the maximum length of the initial list, fill the specified motion vector into the initial motion vector candidate list until the first current list length is equal to the maximum length of the initial list, so as to obtain the initial motion vector candidate list.
[0097] In an exemplary embodiment of the present disclosure, the target list construction module 640 includes a target list construction unit, which is used to: obtain a preconfigured maximum length of the target list; and construct a target motion vector candidate list according to the maximum length of the target list, the direction prediction type and the first candidate motion vector.
[0098] In an exemplary embodiment of the present disclosure, a target list construction unit includes a target list construction sub-unit, which is used to: when the directional prediction type is a unidirectional prediction motion vector, use the first candidate motion vector as the second candidate motion vector; when the directional prediction type is a bidirectional prediction motion vector, split the first candidate motion vector to obtain two unidirectional prediction motion vectors; use the obtained unidirectional prediction motion vector as the second candidate motion vector; and construct a target motion vector candidate list based on the second candidate motion vector and the maximum length of the target list.
[0099] In an exemplary embodiment of the present disclosure, the target list construction subunit is configured to perform: determining an existing candidate motion vector currently existing in the target motion vector candidate list; when the second candidate motion vector is the same as the existing candidate motion vector, discarding the second candidate motion vector; when the second candidate motion vector is different from the existing candidate motion vector, filling the second candidate motion vector into the target motion vector candidate list; determining a second current list length of the target motion vector candidate list after the motion vector filling operation; when the second current list length is less than the maximum length of the target list, filling the target motion vector candidate list with a specified motion vector until the second current list length is equal to the maximum length of the target list, thereby obtaining the target motion vector candidate list.
[0100] In an exemplary embodiment of the present disclosure, the above-mentioned motion vector list construction device 600 also includes a target index determination module, which is used to: obtain the candidate motion vectors included in the target motion vector candidate list; determine the rate-distortion cost corresponding to each candidate motion vector; determine the target candidate motion vector from multiple candidate motion vectors according to the rate-distortion cost, and transmit the target index corresponding to the target candidate motion vector to the decoding end.
[0101] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0102] Reference below Figure 7 hereinafter describes an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0104] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0105] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0106] The storage unit 720 may include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0107] Bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0108] The electronic device 700 may also communicate with one or more external devices 770 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0109] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of a device to complete the above motion vector list construction method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0110] In an exemplary embodiment, a computer program product is further provided, comprising a computer program, and when the computer program is executed by a processor, the motion vector list construction method described in any one of the above is implemented.
[0111] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0112] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for constructing a motion vector list, characterized in that: include: Acquire a frame to be encoded, and determine a current encoding unit based on the frame to be encoded; Constructing an initial motion vector candidate list of the current coding unit according to motion information of a prediction unit corresponding to the current coding unit, wherein the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information; Determine a directional prediction type of a first candidate motion vector in the initial motion vector candidate list; A target motion vector candidate list is constructed based on the directional prediction type and the first candidate motion vector, and the target motion vector candidate list is used for video encoding of the frame to be encoded.
2. The method according to claim 1, characterized in that The constructing an initial motion vector candidate list of the current coding unit according to the motion information of the prediction unit corresponding to the current coding unit includes: Acquire motion information of the prediction unit, where the motion information of the prediction unit includes a first prediction motion vector and a second prediction motion vector; Get the pre-configured maximum length of the initial list; The initial motion vector candidate list is constructed according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector.
3. The method according to claim 2, characterized in that The obtaining the motion information of the prediction unit includes: Using a coding unit that is spatially adjacent to the current coding unit as a spatial prediction unit; Using the motion vector corresponding to the spatial prediction unit as the first predicted motion vector; Using a coding unit that is temporally adjacent to the current coding unit as a temporal prediction unit; The motion vector corresponding to the spatial prediction unit is used as the second predicted motion vector.
4. The method according to claim 2, characterized in that: The constructing the initial motion vector candidate list according to the maximum length of the initial list, the first predicted motion vector and the second predicted motion vector comprises: Filling the first predicted motion vector and the second predicted motion vector into the initial motion vector candidate list; Determine a first current list length of the initial motion vector candidate list after the motion vector filling operation; When the length of the first current list is less than the maximum length of the initial list, the initial motion vector candidate list is filled with specified motion vectors until the length of the first current list is equal to the maximum length of the initial list, so as to obtain the initial motion vector candidate list.
5. The method according to claim 1, characterized in that The constructing a target motion vector candidate list based on the directional prediction type and the first candidate motion vector includes: Get the pre-configured maximum length of the target list; The target motion vector candidate list is constructed according to the maximum length of the target list, the directional prediction type and the first candidate motion vector.
6. The method according to claim 5, characterized in that The constructing the target motion vector candidate list according to the maximum length of the target list, the directional prediction type and the first candidate motion vector includes: When the directional prediction type is a unidirectional prediction motion vector, using the first candidate motion vector as a second candidate motion vector; When the directional prediction type is a bidirectional prediction motion vector, splitting the first candidate motion vector to obtain two unidirectional prediction motion vectors; Using the obtained unidirectional prediction motion vector as the second candidate motion vector; The target motion vector candidate list is constructed based on the second candidate motion vector and the maximum length of the target list.
7. The method according to claim 6, characterized in that The constructing the target motion vector candidate list based on the second candidate motion vector and the maximum length of the target list includes: Determine an existing candidate motion vector currently existing in the target motion vector candidate list; When the second candidate motion vector is the same as the existing candidate motion vector, discarding the second candidate motion vector; When the second candidate motion vector is different from the existing candidate motion vector, filling the second candidate motion vector into the target motion vector candidate list; Determine a second current list length of the target motion vector candidate list after the motion vector filling operation; When the second current list length is less than the maximum length of the target list, the target motion vector candidate list is filled with specified motion vectors until the second current list length is equal to the maximum length of the target list, thereby obtaining the target motion vector candidate list.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Obtaining candidate motion vectors included in the target motion vector candidate list; Determining a rate-distortion cost corresponding to each of the candidate motion vectors; A target candidate motion vector is determined from a plurality of candidate motion vectors according to the rate-distortion cost, and a target index corresponding to the target candidate motion vector is transmitted to a decoding end.
9. A motion vector list construction device, characterized in that: include: A current coding unit determination module, used to obtain a frame to be encoded, and determine a current coding unit based on the frame to be encoded; An initial list construction module, configured to construct an initial motion vector candidate list of the current coding unit according to motion information of a prediction unit corresponding to the current coding unit, wherein the motion information of the prediction unit includes unidirectional prediction motion information and bidirectional prediction motion information; A direction type determination module, used to determine the direction prediction type of the first candidate motion vector in the initial motion vector candidate list; The target list construction module is used to construct a target motion vector candidate list based on the directional prediction type and the first candidate motion vector, and the target motion vector candidate list is used for video encoding of the frame to be encoded.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the motion vector list construction method as described in any one of claims 1 to 8.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the motion vector list construction method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method of bi-prediction video coding based on motion vectors from uni-prediction and merge candidate
CN107113424A
Method and device for video processing and medium
CN117795960A
Inter prediction method, encoder, decoder, and storage medium
US20230042640A1