Video coding method, video decoding method, device, equipment, medium and product

By constructing initial motion vector pairs and filtering candidate motion vector pairs, the problems of inaccurate motion vector candidate screening and small refine range in the prior art are solved, and more efficient video encoding is achieved.

CN119402639APending Publication Date: 2025-02-07BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411524933.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, the screening and subdivision of motion vector candidates is not accurate enough, and the candidate refine range is small, resulting in low encoding efficiency.

Method used

By constructing the initial motion vector pair, the candidate motion vector pair is filtered based on the motion estimation cost, and the motion search process is performed within the specified search range to obtain the target motion vector pair for encoding.

Benefits of technology

Improve the accuracy of motion information refinement, save the motion information transmitted in the code stream, and improve the encoding efficiency and compression rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402639A_ABST
    Figure CN119402639A_ABST
Patent Text Reader

Abstract

The invention provides a video coding method and device, a video decoding method and device, electronic equipment, a computer readable storage medium and a computer program product, and relates to the technical field of video processing. The method comprises the following steps: acquiring a current block of a to-be-coded frame, and constructing an initial motion vector pair of the current block; determining a candidate motion vector pair according to the motion estimation cost of the initial motion vector pair; performing motion search processing on the candidate motion vector pair to obtain a target motion vector pair; and carrying out coding processing on the current block based on the target motion vector pair to obtain a coding code stream. According to the invention, through constructing the construction and refinement process of the motion vector, the similarity between the refinement process and the original pixel is considered, the refinement accuracy is improved, the candidate motion vector pair is searched in combination with the motion estimation cost, and the complexity is not increased too much while the refinement precision of the motion information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of video processing technology, and in particular to a video encoding method, a video decoding method, a video encoding device, a video decoding device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] The Versatile Video Coding (VVC / H.266) standard is the latest generation of video codec standard, and its compression rate is reduced by about 40% based on the High Efficiency Video Coding (HEVC / H.265) standard.

[0003] The normal fusion mode (Merge) technology is an MV prediction technology in the coding standard, which uses the motion vector (Motion Vector, MV) of the adjacent blocks in the time domain or spatial domain to predict the MV of the current block. The merge mode in VVC can establish a motion information candidate list for the current coding unit (Coding Unit, CU). There are 5 candidate motion information in the list. Each candidate motion information contains information such as MV, prediction direction, reference frame index and motion vector accuracy. By traversing these 5 candidate motion information, the candidate motion information with the lowest rate distortion cost is calculated as the candidate motion information of the current CU. There is no need to transmit any motion information (such as reference frame index, motion vector accuracy index and prediction direction, etc.) in the bitstream. Only the index of the optimal candidate motion information in the list needs to be transmitted.

[0004] Advanced Motion Vector Prediction (AMVP) technology builds a list of MV candidates based on Merge, and then uses the best candidate as the search starting point to further search within a certain range of the reference frame. The best search MV is obtained by calculating the rate-distortion cost. The difference between the search MV and the candidate starting MV is the motion vector difference (MVD). In addition to transmitting the best candidate index, the bitstream also needs to transmit information such as the reference frame index, MVD, and motion vector accuracy. When the motion of the current CU block in the image is inconsistent with that of the adjacent CU in the spatial domain, the AMVP technology has higher compression efficiency than the Merge technology. Summary of the invention

[0005] The present disclosure provides a video encoding method, a video decoding method, a video encoding device, a video decoding device, an electronic device, a computer-readable storage medium, and a computer program product to at least solve the problem that the screening and refinement of motion vector candidates in the related art are not accurate enough and the candidate refinement range is small. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of the present disclosure, a video encoding method is provided, comprising: obtaining a current block of a frame to be encoded, and constructing an initial motion vector pair of the current block; determining a candidate motion vector pair according to a motion estimation cost of the initial motion vector pair; performing motion search processing on the candidate motion vector pair to obtain a target motion vector pair; and encoding the current block based on the target motion vector pair to obtain an encoded bit stream.

[0007] In an exemplary embodiment of the present disclosure, constructing the initial motion vector pair of the current block includes: performing motion estimation on the current block based on a bilateral matching inter-frame prediction mode to obtain a first initial motion vector, wherein the first initial motion vector includes a unidirectional optimal motion vector or a bidirectional optimal motion vector; constructing a first motion vector list according to the first initial motion vector; constructing a second motion vector list, wherein the second motion vector list includes second initial motion vectors obtained by motion estimation of motion vectors of adjacent blocks in the time domain or the spatial domain; selecting a second initial motion vector that meets specified conditions from the second motion vector list; and constructing the initial motion vector pair according to the first initial motion vector and the selected second initial motion vector.

[0008] In an exemplary embodiment of the present disclosure, determining a candidate motion vector pair based on the motion estimation cost of the initial motion vector pair includes: grouping the initial motion vector pair according to the prediction direction of the second initial motion vector to obtain a grouped motion vector pair; determining the grouped motion estimation cost of the grouped motion vector pair; and determining the candidate motion vector pair from the grouped motion vector pair based on the grouped motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector.

[0009] In an exemplary embodiment of the present disclosure, the motion search processing is performed on the candidate motion vector pair to obtain the target motion vector pair, including: determining a motion information search range centered on the first candidate motion vector; based on the motion information search range, searching the second candidate motion vector to determine a refined motion vector pair; and determining the target motion vector pair and a reference motion vector list of the target motion vector pair based on the motion estimation cost of the refined motion vector pair.

[0010] In an exemplary embodiment of the present disclosure, encoding the current block based on the target motion vector to obtain an encoded bitstream includes: obtaining predefined encoding syntax information, the encoding syntax information including a coding mode identifier and the reference motion vector list; encoding the coding mode identifier to obtain a coding mode identifier value; encoding the reference motion vector list to obtain reference motion information; and generating the encoded bitstream based on the coding mode identifier value and the reference motion information.

[0011] According to a second aspect of the present disclosure, a video decoding method is provided, including: obtaining a coded bitstream, parsing the coded bitstream to obtain a first initial motion vector; constructing an initial motion vector pair based on the first initial motion vector and a corresponding second initial motion vector; searching and refining the initial motion vector pair to obtain a target motion vector pair; and reconstructing a current block based on the target motion vector pair.

[0012] In an exemplary embodiment of the present disclosure, the encoded code stream includes reference motion information, and the parsing of the encoded code stream to obtain the first initial motion vector includes: decoding the encoding mode identification bit in the encoded code stream to obtain a coding mode identification value; when the coding mode identification value is a specified identification value, parsing motion information in the direction of the first motion vector in the reference motion information to obtain the first motion information; and determining the first initial motion vector according to the first motion information.

[0013] In an exemplary embodiment of the present disclosure, determining the first initial motion vector based on the first motion information includes: determining motion reference information corresponding to the first motion information, the motion reference information including one or more of a reference frame index, a motion vector prediction index, a motion vector difference and a motion accuracy; determining the first initial motion vector based on the motion reference information.

[0014] In an exemplary embodiment of the present disclosure, constructing an initial motion vector pair based on the first initial motion vector and the corresponding second initial motion vector includes: constructing a second motion vector list, the second motion vector list including second initial motion vectors obtained by motion estimation using motion vectors of adjacent blocks in the time domain or spatial domain; based on the first initial motion vector, selecting a second initial motion vector that meets specified conditions from the second motion vector list to construct the initial motion vector pair.

[0015] In an exemplary embodiment of the present disclosure, the initial motion vector pair is searched and refined to obtain a target motion vector pair, including: determining an initial motion estimation cost of the initial motion vector pair; determining a candidate motion vector pair from the initial motion vector pair based on the initial motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector; determining a motion information search range with the first candidate motion vector as the center; and based on the motion information search range, searching and refining the second candidate motion vector to obtain the target motion vector pair.

[0016] According to a third aspect of the present disclosure, a video encoding device is provided, including: an initial vector pair construction module, used to obtain a current block of a frame to be encoded, and construct an initial motion vector pair of the current block; a candidate vector pair determination module, used to determine a candidate motion vector pair according to a motion estimation cost of the initial motion vector pair; a target vector pair determination module, used to perform motion search processing on the candidate motion vector pair to obtain a target motion vector pair; and an encoding module, used to perform encoding processing on the current block based on the target motion vector pair to obtain an encoded bit stream.

[0017] In an exemplary embodiment of the present disclosure, the initial vector pair construction module includes an initial vector pair construction unit, which is used to: perform motion estimation on the current block based on a bilateral matching inter-frame prediction mode to obtain a first initial motion vector, wherein the first initial motion vector includes a unidirectional optimal motion vector or a bidirectional optimal motion vector; construct a first motion vector list based on the first initial motion vector; construct a second motion vector list, wherein the second motion vector list includes a second initial motion vector obtained by motion estimation of motion vectors of adjacent blocks in the time domain or the spatial domain; select a second initial motion vector that meets specified conditions from the second motion vector list; and construct the initial motion vector pair based on the first initial motion vector and the selected second initial motion vector.

[0018] In an exemplary embodiment of the present disclosure, the candidate vector pair determination module includes a candidate vector pair determination unit, which is used to: group the initial motion vector pair according to the prediction direction of the second initial motion vector to obtain a grouped motion vector pair; determine the grouped motion estimation cost of the grouped motion vector pair; and determine the candidate motion vector pair from the grouped motion vector pair according to the grouped motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector.

[0019] In an exemplary embodiment of the present disclosure, the target vector pair determination module includes a target vector pair determination unit, which is used to: determine a motion information search range centered on a first candidate motion vector; search and process a second candidate motion vector based on the motion information search range to determine a refined motion vector pair; determine the target motion vector pair and a reference motion vector list of the target motion vector pair based on the motion estimation cost of the refined motion vector pair.

[0020] In an exemplary embodiment of the present disclosure, the encoding module includes an encoding unit, which is used to: obtain pre-defined encoding syntax information, the encoding syntax information includes a coding mode identifier and the reference motion vector list; encode the coding mode identifier to obtain a coding mode identifier value; encode the reference motion vector list to obtain reference motion information; and generate the encoding bitstream based on the coding mode identifier value and the reference motion information.

[0021] According to a fourth aspect of the present disclosure, a video decoding device is provided, including: an initial vector parsing module, used to obtain a coded code stream, parse the coded code stream, and obtain a first initial motion vector; a first vector pair construction module, used to construct an initial motion vector pair based on the first initial motion vector and the corresponding second initial motion vector; a second vector pair determination module, used to search and refine the initial motion vector pair to obtain a target motion vector pair; and a decoding module, used to reconstruct a current block based on the target motion vector pair.

[0022] In an exemplary embodiment of the present disclosure, the encoded code stream includes reference motion information, and the initial vector parsing module includes an initial vector parsing unit, which is used to: decode the encoding mode identification bit in the encoded code stream to obtain a coding mode identification value; when the coding mode identification value is a specified identification value, parse the motion information of the first motion vector direction in the reference motion information to obtain the first motion information; and determine the first initial motion vector according to the first motion information.

[0023] In an exemplary embodiment of the present disclosure, the initial vector parsing unit includes an initial vector parsing sub-unit, which is used to: determine motion reference information corresponding to the first motion information, the motion reference information including one or more of a reference frame index, a motion vector prediction index, a motion vector difference and a motion accuracy; determine the first initial motion vector according to the motion reference information.

[0024] In an exemplary embodiment of the present disclosure, the first vector pair construction module includes a first vector pair construction unit, which is used to: construct a second motion vector list, the second motion vector list including second initial motion vectors obtained by motion estimation of motion vectors of adjacent blocks in the time domain or spatial domain; based on the first initial motion vector, select a second initial motion vector that meets specified conditions from the second motion vector list to construct the initial motion vector pair.

[0025] In an exemplary embodiment of the present disclosure, the second vector pair determination module includes a target vector determination unit, which is used to: determine an initial motion estimation cost of the initial motion vector pair; determine a candidate motion vector pair from the initial motion vector pair based on the initial motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector; determine a motion information search range with the first candidate motion vector as the center; and perform search refinement processing on the second candidate motion vector based on the motion information search range to obtain the target motion vector pair.

[0026] According to a fifth 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 video encoding methods or to implement any one of the above-described video decoding methods.

[0027] According to a sixth 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 above-mentioned video encoding methods or implement any one of the above-mentioned video decoding methods.

[0028] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements any one of the above-described video encoding methods or any one of the above-described video decoding methods.

[0029] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0030] On the one hand, according to the motion estimation cost of the initial motion vector pair, the candidate motion vector pairs are screened out, and then the candidate motion vector pairs are searched and processed, which can improve the precision of motion information refinement without increasing too much complexity. On the other hand, only one-way motion information needs to be transmitted in the bitstream, and the motion information in the other direction can be implicitly obtained at the decoding end, saving the encoding performance in one direction, achieving the purpose of saving syntax and improving compression efficiency.

[0031] 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

[0032] 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.

[0033] Figure 1 It is a schematic diagram of MVD in the AMVP technology in the related art.

[0034] Figure 2 It is a schematic diagram of the bilateral matching process in the BM AMVP-Merge technology in the related art.

[0035] Figure 3 The figure is a flowchart of a video encoding method according to an exemplary embodiment.

[0036] Figure 4 The figure is a flowchart of a video decoding method according to an exemplary embodiment.

[0037] Figure 5 The invention is a block diagram of a video encoding device according to an exemplary embodiment.

[0038] Figure 6 The invention is a block diagram of a video decoding device according to an exemplary embodiment.

[0039] Figure 7 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0040] 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.

[0041] 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.

[0042] AMVP technology is a prediction model based on Merge. Figure 1 , Figure 1 It is a schematic diagram of MVD in AMVP technology in related technologies. In AMVP mode, MVs in bidirectional AMVP are all AMVP MVs. Enhanced Compression Model (ECM) is the next generation standard code development platform under development after VVC. Among them, bilateral matching based AMVP-Merge (BM AMVP-Merge) technology based on AMVP and Merge is an important technology adopted in the ECM inter-frame prediction module. Reference Figure 2 , Figure 2 It is a schematic diagram of the bilateral matching process in the BMAMVP-Merge technology in the related art.

[0043] Different from the bidirectional AMVP in VVC, where all MVs are AMVP MVs, BM AMVP-Merge combines AMVP MVs and Merge MVs in pairs according to different reference directions, performs bilateral matching search, and selects a combination with the smallest bilateral matching distortion (BM cost) as the final mode. Only unidirectional AMVP information needs to be transmitted in the bitstream, and the motion information in the other direction is implicitly obtained by repeating the bilateral matching process at the decoding end. The performance comes from omitting the MV information encoding in one direction, thus saving syntax and improving compression efficiency. The specific implementation steps include the following:

[0044] (1) Construct an AMVP-Merge pair MV candidate list. The L0 and L1 directions are used as the Merge list, and the other direction is used as the AMVP list. The AMVP index (refIdx) is traversed to construct an AMVP candidate list and a Merge candidate list that meets the bilateral matching conditions, that is, the conditions such as the equidistant between the previous and next reference frame image playback order (Picture Order Count, POC) and the current frame POC are met. The candidates in the Merge and AMVP candidate lists are combined in pairs and added to the AMVP-Merge pair MV candidate list.

[0045] (2) AMVP-Merge pair MV refinement and screening. For each pair MV in the AMVP-Merge pair MV candidate list, bilateral matching MV refine is performed within a 3x3 range based on BM cost, and the refined pair MV with the smallest BM cost when the Mergelist is L0 and L1 is selected respectively, and finally two pair MV candidates (MergeMV-AMVP MV, AMVP MV-Merge MV) are obtained.

[0046] The bilateral matching process is as follows Figure 2 As shown, Figure 2 MV0 and MV1 in the figure are the forward and backward MVs to be refined. Within a certain range, the offset MV is superimposed on MV0. diff , while superimposing the symmetric offset -MV on MV1 diff , get MV′0 and MV′1 respectively, calculate the Sum of Absolute Differences (SAD) of the two predicted blocks (dark shadow marked blocks) corresponding to MV′0 and MV′1 to get the BM cost, MV diff Traverse all positions within the search range, and the position with the smallest BM cost is the optimal refine MV.

[0047] (3) AMVP MV motion estimation. For the two pair MV candidates obtained in step (2), the Merge MV is fixed and motion estimation is performed on the AMVP MV, including integer-pixel motion estimation and sub-pixel motion estimation. The best AMVP-Merge MV is selected through rate-distortion optimization (RDO) to obtain the best Merge List.

[0048] (4) Syntax transmission: Encode the AMVP-Merge flag and Merge List information, and skip the reference frame index, motion vector prediction index (Motion Vector Prediction idx, MVP idx) and MVD information in the Merge List direction.

[0049] However, the above scheme has the following problems: (1) The screening (refining) of AMVP Merge pair MV candidates is not accurate enough. The existing BM AMVP-Merge performs bidirectional MV refine based on BM cost (bilateral matching distortion) on each candidate in the constructed AMVP-Merge pair MV candidate list, and selects the candidate with the smallest BM cost. The bilateral matching method minimizes the cost between the front and rear prediction blocks, but since there is no comparison with the original pixel information, the refined MV may become less accurate, and the inaccurate base MV may lead to an inaccurate local optimum in the final search MV.

[0050] (2) The refinement range of AMVP-Merge MV candidates is small. The existing BM AMVP-Merge performs BM cost based refinement within a 3x3 range on all candidates in the AMVP-Merge pairMV candidate list. Increasing the refine search range may result in a better pair MV, but since all candidates need to be refined, directly increasing the search range will bring higher complexity. At the same time, since there is no comparison with the original pixel information, the MV after increasing the refine search range will be less accurate in some cases.

[0051] Based on this, according to the embodiments of the present disclosure, a video encoding method, a video decoding method, a video encoding device, a video decoding device, an electronic device, a computer-readable storage medium, and a computer program product are proposed.

[0052] Figure 3 is a flowchart of a video encoding method according to an exemplary embodiment. Figure 3 As shown, the video encoding method is applied to the encoding end, and the video encoding 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 is illustrated by the application of the method to a computer device. 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.

[0053] In step S310, a current block of a frame to be encoded is obtained, and an initial motion vector pair of the current block is constructed.

[0054] In an exemplary embodiment of the present disclosure, the current block may be a block to be encoded, the current block may be a macroblock or a block; wherein a macroblock may be further subdivided into a plurality of blocks. The initial motion vector pair may be a motion vector pair constructed based on the bilateral matching technology of AMVP-Merge.

[0055] In the video encoding process, the frame to be encoded includes multiple blocks to be encoded. The current block is obtained from the multiple blocks to be encoded, and the initial motion vector pair of the current block is constructed. Figure 1 and Figure 2It can be seen that in the process of bilateral matching, for the current block, the MV list (i.e., Merge list) is obtained based on the prediction of the ordinary merge mode in the direction L0, and the MV list (i.e., AMVP list) is obtained based on the prediction of the AMVP mode in the direction L1; or the direction L0 is used as the AMVP list, and the direction L1 is used as the Merge list.

[0056] The motion vector obtained by motion estimation in the AMVP mode is selected as the AMVP MV of the AMVP-Merge MV pair (AMVP-Merge pair MV); for the other MV in the AMVP-Merge pair MV, it can be obtained from a variety of different MV candidate lists, and then the MVs that meet the bilateral matching conditions with the AMVP MV are combined into an AMVP MV-Merge MV as the initial motion vector pair.

[0057] In step S320, a candidate motion vector pair is determined according to the motion estimation cost of the initial motion vector pair.

[0058] In an exemplary embodiment of the present disclosure, the motion estimation cost may be a coding cost generated by the initial motion vector pair in the bilateral matching process, which may be recorded as BM cost. The candidate motion vector pair may be a candidate motion vector pair with a minimum motion estimation cost.

[0059] For the constructed initial motion vector pairs, the motion estimation costs of all initial motion vector pairs are calculated. Since the Merge MV list in the initial motion vector pairs has two values, 0 or 1, the motion vector pairs with the smallest BM cost in each group can be determined according to the motion estimation cost grouping as candidate motion vector pairs.

[0060] In step S330, motion search processing is performed on the candidate motion vector pairs to obtain a target motion vector pair.

[0061] In an exemplary embodiment of the present disclosure, the motion search process may be a process of calculating all possible rate-distortion costs corresponding to candidate motion vector pairs within a specified search range. The target motion vector pair may be the optimal motion vector pair selected based on the rate-distortion cost, i.e., AMVP-Merge MV.

[0062] After determining the candidate motion vector pair, refine processing can be further performed based on the candidate motion vector pair. One of the MVs of the candidate motion vector pair is fixed, and the other MV is searched within a specified search range. The rate-distortion cost of the two candidate motion vector pairs is calculated, and the optimal AMVP-Merge MV is screened out based on the rate-distortion cost as the target motion vector pair and its corresponding Merge List.

[0063] In step S340, the current block is coded based on the target motion vector to obtain a coded bit stream.

[0064] In an exemplary embodiment of the present disclosure, after obtaining the target motion vector pair, consistent with the existing BMAMVP-Merge technology, during the encoding process, the current block is encoded based on the target motion vector pair, for example, the Merge List information of the target motion vector pair is encoded, the AMVP-Merge flag and the reference frame index, MVP idx and MVD information in the Merge List direction are skipped.

[0065] According to the video encoding method in this example embodiment, on the one hand, according to the motion estimation cost of the initial motion vector pair, the candidate motion vector pair is screened out, and then the candidate motion vector pair is searched and processed, which can improve the precision of motion information refinement without increasing too much complexity. On the other hand, only one-way motion information needs to be transmitted in the bitstream, and the motion information in the other direction can be implicitly obtained at the decoding end, saving the encoding performance in one direction, achieving the purpose of saving syntax and improving compression efficiency.

[0066] The video encoding method in this exemplary embodiment will be further described below.

[0067] In an exemplary embodiment of the present disclosure, for step S310, constructing an initial motion vector pair of the current block includes: performing motion estimation on the current block based on a bilateral matching inter-frame prediction mode to obtain a first initial motion vector, the first initial motion vector including a unidirectional optimal motion vector or a bidirectional optimal motion vector; constructing a first motion vector list based on the first initial motion vector; constructing a second motion vector list, the second motion vector list including a second initial motion vector obtained by motion estimation of motion vectors of adjacent blocks in the time domain or the spatial domain; selecting a second initial motion vector that meets specified conditions from the second motion vector list; and constructing an initial motion vector pair based on the first initial motion vector and the selected second initial motion vector.

[0068] Among them, the first initial motion vector may be a motion vector predicted based on the first inter-frame prediction mode, for example, the first inter-frame prediction mode may be an AMVP mode. The first motion vector list may be a list consisting of the first initial motion vector and related information. The second initial motion vector may be a motion vector obtained from a pre-constructed motion vector candidate list, the motion vector candidate list may be a time domain or spatial domain MV candidate list, the motion vector candidate list may also be a Merge MV candidate list predicted based on the Merge mode, and the motion vector candidate list may also be an MVP candidate list predicted based on the AMVP. The second motion vector list may be a list consisting of the second initial motion vector and related information.

[0069] When constructing the initial motion vector pair, for different prediction directions, different types of MVs are selected to form lists, for example, the L0 direction is used as the Merge list, and the other direction (i.e., the L1 direction) is used as the AMVP list. In other exemplary embodiments of the present disclosure, the MV types in the two prediction directions can be swapped, and the MV types in different prediction directions can be configured according to encoding requirements.

[0070] Taking the L0 direction as the Merge list and the L1 direction as the AMVP list as an example, the unidirectional best motion vector (best MV) or the bidirectional best motion vector (best MV) obtained by motion estimation (ME) in the AMVP mode is selected, and the MV in the AMVP list direction is used as the AMVP MV of the AMVP-Merge pair MV, that is, the first initial motion vector. Multiple first initial motion vectors can constitute the first motion vector list.

[0071] Then, a temporal and spatial motion vector candidate list is constructed, and an MV that satisfies the bilateral matching condition with the AMVP MV is selected from the temporal and spatial MV candidate list as the second initial motion vector. Similarly, multiple second initial motion vectors can constitute the second motion vector list.

[0072] The first initial motion vector and the second initial motion vector that meets the bilateral matching condition form an AMVP MV-Merge MV candidate pair as the initial motion vector pair, and the constructed initial motion vector pair is added to the AMVP-Mergepair MV candidate list. The present disclosure uses the unidirectional or bidirectional optimal MV obtained by ME in the AMVP mode as the AMVP MV to construct the initial motion vector pair, taking into account the similarity between the predicted pixels and the original pixels, which can improve the accuracy of the subsequent refinement process.

[0073] In some other exemplary embodiments of the present disclosure, the second initial motion vector (ie, Merge MV candidate) may be constructed without separate temporal and spatial domain construction, and may be directly obtained from the Merge MV candidate predicted based on the Merge mode or the MVP candidate predicted based on the AMVP mode.

[0074] In an exemplary embodiment of the present disclosure, for step S320, a candidate motion vector pair is determined based on the motion estimation cost of the initial motion vector pair, including: grouping the initial motion vector pair according to the prediction direction of the second initial motion vector to obtain a grouped motion vector pair; determining the grouped motion estimation cost of the grouped motion vector pair; and determining a candidate motion vector pair from the grouped motion vector pair based on the grouped motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector.

[0075] The grouped motion vector pairs may be motion vector pairs obtained by grouping the initial motion vector pairs according to different prediction directions.

[0076] For all the initial motion vector pairs (AMVP-Merge pairMV) in the AMVP-Merge pair MV candidate list, they can be grouped according to the prediction direction of the second initial motion vector, such as dividing the initial motion vector pairs into two groups according to whether the Merge MV list is 0 or 1, as grouped motion vector pairs. For each group of pair MVs, the motion estimation cost (ie, BM cost) of each initial motion vector pair is directly calculated (no search is performed in this step), and the pair MV with the smallest BM cost in each group of pari MVs is selected as a candidate motion vector pair.

[0077] Since the value of Merge MV list is 0 or 1, through the above motion cost estimation calculation, two pair MVs with Merge MVlist of 0 and 1 are finally obtained. After constructing multiple initial motion vector pairs, the candidate motion vector pairs with the minimum motion estimation cost are screened out, and only the candidate motion vector pairs are searched subsequently, which can avoid bilateral matching search processing for each initial motion vector pair, reduce invalid search processes, and effectively improve coding efficiency.

[0078] In an exemplary embodiment of the present disclosure, for step S330, motion search processing is performed on the candidate motion vector pairs to obtain a target motion vector pair, including: determining a motion information search range centered on the first candidate motion vector; based on the motion information search range, searching the second candidate motion vector to determine a refined motion vector pair; and determining a target motion vector pair and a reference motion vector list of the target motion vector pair based on the motion estimation cost of the refined motion vector pair.

[0079] The first candidate motion vector may be the AMVP MV in the candidate motion vector pair (AMVP-Merge MV), and the second candidate motion vector may be the Merge MV in the candidate motion vector pair.

[0080] For the two candidate motion vector pairs obtained by screening, fix the AMVP MV respectively, and perform unidirectional refinement based on BM cost on the Merge MV within the specified search range. For example, determine the motion information search range (such as 9*9) with the AMVP MV as the center, and perform unidirectional refinement based on BM cost on the Merge MV within the 9*9 range. Finally, calculate the rate-distortion cost of the two refined pair MVs, and screen out the optimal AMVP-Merge MV and its corresponding Merge List. Since the candidate motion vector pair is already the MV pair with the minimum motion estimation cost, fixing the AMVP MV for refinement during the search process can ensure that the refined Merge MV is more accurate.

[0081] Since the present disclosure first performs a rough screening based on BM cost on all candidates, and then performs a more detailed refinement on the two groups of candidate motion vector pairs obtained by the rough screening, the accuracy of refinement is improved without increasing too much complexity. In some other exemplary embodiments of the present disclosure, the BM refine search range can be any range belonging to 2n+1 (n>0), such as 5x5, 7x7, 9x9, etc. The present disclosure does not have any special limitation on the size of the motion information search range.

[0082] In an exemplary embodiment of the present disclosure, for step S340, encoding the current block based on the target motion vector to obtain an encoded bitstream includes: obtaining pre-defined encoding syntax information, the encoding syntax information includes a coding mode identification bit and a reference motion vector list; encoding the coding mode identification bit to obtain a coding mode identification value; encoding the reference motion vector list to obtain reference motion information; and generating an encoded bitstream based on the coding mode identification value and the reference motion information.

[0083] The coding mode flag may be a flag used to indicate whether the current video coding adopts a specific coding mode. The reference motion vector list may be a motion information list corresponding to the target motion vector pair.

[0084] The encoding process disclosed in the present invention is consistent with the existing BM AMVP-Merge technology, which encodes the encoding mode identification bit AMVP-Merge flag and the reference motion vector list (Merge List information) to generate the encoded code stream skipping the reference frame index, MVP idx and MVD information in the MergeList direction. Only unidirectional AMVP information is transmitted in the code stream, and the motion information in the other direction is implicitly obtained by repeating the bilateral matching process at the decoding end, which omits the MV information encoding in one direction, thereby saving syntax and improving compression efficiency.

[0085] Using the video coding scheme disclosed in the present invention, 100 sequences in the test sequence set are tested when the constant rate factor (CRF) is 24, 26, 28, and 30. The objective benefit is the rate-distortion performance index ( -Delta rate, BD-Rate) Structural Similarity (SSIM) 611: -0.45%, BD-Rate Peak signal-to-noise ratio (PSNR) 611: -0.41%, BD-Rate Video Multimethod Assessment Fusion (VMAF) 611: -0.39%, and the encoding time increased by 6%; where the 611 in the performance index refers to the color coding model YUV components with a ratio of 6:1:1, Y indicates brightness, U indicates blue chrominance component, and V indicates red chrominance component. In comparison, the objective benefits of the original BM AMVP-Merge in ECM in this scheme are BD-Rate SSIM 611: -0.15%, BD-Rate PSNR 611: -0.11%, BD-Rate VMAF 611: -0.10%, and the encoding time increased by 2%.

[0086] In summary, the video encoding method disclosed in the present invention obtains the current block of the frame to be encoded, constructs the initial motion vector pair of the current block; determines the candidate motion vector pair according to the motion estimation cost of the initial motion vector pair; performs motion search processing on the candidate motion vector pair to obtain the target motion vector pair; and performs encoding processing on the current block based on the target motion vector pair to obtain the encoded code stream. On the one hand, in the motion search process, the accuracy of motion information refinement can be improved by taking into account the similarity with the original pixel. On the other hand, according to the motion estimation cost of the initial motion vector pair, the candidate motion vector pair is screened out, and then the candidate motion vector pair is searched and processed, which can improve the accuracy of motion information refinement without increasing too much complexity. On the other hand, the present invention only refines the best candidate, and the refine range is increased from the original search range to a larger search range, which improves the refinement accuracy without increasing complexity.

[0087] Figure 4 is a flowchart of a video decoding method according to an exemplary embodiment. Figure 4 As shown, the video decoding method is applied to the decoding end, and the video decoding method can be used in a computer device. 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.

[0088] In step S410, a coded bitstream is acquired, and the coded bitstream is parsed to obtain a first initial motion vector.

[0089] In an exemplary embodiment of the present disclosure, after the decoding end obtains the encoded bitstream, it parses the encoded bitstream. Since the encoded bitstream contains reference motion information corresponding to the target motion vector, the first initial motion vector, i.e., AMVP MV, is derived according to the relevant syntax information and the reference motion information.

[0090] In step S420, an initial motion vector pair is constructed based on the first initial motion vector and the corresponding second initial motion vector.

[0091] In an exemplary embodiment of the present disclosure, after obtaining the first initial motion vector (AMVP MV), an MV that satisfies the bilateral matching condition with the AMVP MV is selected, that is, (the second initial motion vector), and an initial motion vector pair is constructed based on the first initial motion vector and the corresponding second initial motion vector.

[0092] In step S430, the initial motion vector pair is searched and refined to obtain a target motion vector pair.

[0093] In an exemplary embodiment of the present disclosure, after obtaining an initial motion vector pair, a search refinement process is performed on the initial motion vector pair, such as first directly calculating the motion estimation cost of the initial motion vector pair. For the motion vector pair with the minimum motion estimation cost, a search refinement process is performed within a specified search range, and finally a second target motion vector is obtained, and the motion vector pair where the second target motion vector is located has the optimal bilateral matching cost.

[0094] In step S440, the current block is reconstructed based on the target motion vector pair.

[0095] In an exemplary embodiment of the present disclosure, after obtaining the second target motion vector, the decoding end repeats the bilateral matching process according to the second target motion vector to implicitly obtain motion information in another direction, and reconstructs the current block of the video frame for subsequent use.

[0096] According to the video decoding method in this example embodiment, the decoding end receives the encoded bitstream sent by the encoding end, which includes unidirectional motion vector information, implicitly obtains the motion information in the other direction by repeating the bilateral matching process, and reconstructs the video frame.

[0097] The video decoding method in this exemplary embodiment will be further described below.

[0098] In an exemplary embodiment of the present disclosure, for step S410, the encoded bitstream includes reference motion information, and the encoded bitstream is parsed to obtain a first initial motion vector, including: decoding the encoding mode identification bit in the encoded bitstream to obtain a coding mode identification value; when the coding mode identification value is a specified identification value, parsing motion information in the direction of the first motion vector in the reference motion information to obtain the first motion information; and determining the first initial motion vector according to the first motion information.

[0099] After receiving the coded bitstream, the decoder parses the coding mode identifier (BM AMVP-Mergeflag) in the coded bitstream. If the BM AMVP-Merge flag is true, it continues to parse the reference motion information in the coded bitstream, such as the Merge list information of the target motion vector pair, and skips the reference frame index, MVP idx, MVD and other motion information in the Merge list direction, and only parses the motion information in the AMVP list direction as the first motion information. Then, the first initial motion vector is derived from the first motion information. The decoder only needs to parse and process the unidirectional AMVP information, which can effectively improve the performance of the decoder.

[0100] In an exemplary embodiment of the present disclosure, determining a first initial motion vector based on first motion information includes: determining motion reference information corresponding to the first motion information, the motion reference information including one or more of a reference frame index, a motion vector prediction index, a motion vector difference and a motion accuracy; determining the first initial motion vector based on the motion reference information.

[0101] The reference frame index may be a reference video frame used for motion information prediction. The motion vector prediction index may be an identifier of a reference motion vector in a motion vector list used for motion vector prediction. The motion vector prediction index may include a unidirectional reference frame index or a bidirectional reference frame index.

[0102] After parsing the first motion information, the decoding end can determine the motion reference information contained in the first motion information, for example, the reference frame index, MVP idx, MVD, adaptive motion vector accuracy (Advanced Motion Vector Resolution, AMVR accuracy and other syntax information of the parsed AMVP MV are used as motion reference information, and the AMVP MV is derived according to the above motion reference information as the first initial motion vector. The decoding end can parse the first initial motion vector transmitted in the encoded bitstream based on the same syntax information as the encoding end, and then perform subsequent decoding operations based on the first initial motion vector.

[0103] In an exemplary embodiment of the present disclosure, for step S420, an initial motion vector pair is constructed based on the first initial motion vector and the corresponding second initial motion vector, including: constructing a second motion vector list, the second motion vector list including second initial motion vectors obtained by motion estimation of motion vectors of adjacent blocks in the time domain or spatial domain; based on the first initial motion vector, selecting a second initial motion vector that meets specified conditions from the second motion vector list to construct an initial motion vector pair.

[0104] After obtaining the first initial motion vector, the temporal and spatial MV candidate lists are constructed in the same manner as the second motion vector list constructed by the encoding end as described above, as the second motion vector list. From the constructed MV candidate list, an MV that satisfies the bilateral matching condition with the first initial motion vector (AMVP MV) is selected, that is, a second initial motion vector that meets the specified condition is selected, and an initial motion vector pair is formed with the first initial motion vector, that is, an AMVP MV-Merge MV candidate pair, and the pair is added to the AMVP-Merge pair MV candidate list, so as to implicitly obtain motion information in another direction according to the constructed AMVP-Merge pair MV candidate list.

[0105] Similarly, similar to the encoding end, the second motion vector list can be directly obtained from the Merge MV candidate based on the Merge prediction mode or the MVP candidate based on the AMVP prediction mode without separate time domain and spatial domain construction, which will not be elaborated in this disclosure.

[0106] In an exemplary embodiment of the present disclosure, for step S430, the initial motion vector pair is searched and refined to obtain a target motion vector pair, including: determining an initial motion estimation cost of the initial motion vector pair; determining a candidate motion vector pair from the initial motion vector pair based on the initial motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector; determining a motion information search range with the first candidate motion vector as the center; and based on the motion information search range, performing a search and refinement process on the second candidate motion vector to obtain a target motion vector pair.

[0107] After constructing the initial motion vector pair and adding it to the AMVP-Merge pair MV candidate list, for each pair MV candidate in the AMVP-Merge pair MV candidate list, first directly calculate (without searching) and obtain a candidate with the smallest BMcost as the candidate motion vector pair. The candidate motion vector pair includes a first candidate motion vector and a second candidate motion vector. For example, the first candidate motion vector can be an AMVP MV, and the second candidate motion vector can be a Merge MV.

[0108] For the determined candidate motion vector pair, the first candidate motion vector in the candidate motion vector pair is fixed, i.e., the AMVP MV, and the second candidate motion vector (Merge MV) is searched and refined within the motion information search range, for example, a unidirectional refinement based on the BM cost is performed within the 9x9 range to obtain the target motion vector pair, and finally the refined Merge MV is obtained from the target motion vector pair, i.e., the second target motion vector. Through the above steps, the decoding end can implicitly obtain the motion information in another direction based on the motion information in one direction.

[0109] In summary, in the video decoding method disclosed herein, after the decoding end receives the encoded bitstream, it implicitly obtains the motion information in the other direction by repeating the bilateral matching process. The decoding end and the encoding end only need to use the same syntax information and prediction mode, which can simplify the configuration information of the decoding end.

[0110] Figure 5 FIG. 1 is a block diagram of a video encoding device according to an exemplary embodiment. Figure 5The video encoding device 500 includes: an initial vector pair construction module 510, a candidate vector pair determination module 520, a target vector pair determination module 530 and an encoding module 540.

[0111] Specifically, the initial vector pair construction module 510 is used to obtain the current block of the frame to be encoded and construct the initial motion vector pair of the current block; the candidate vector pair determination module 520 is used to determine the candidate motion vector pair according to the motion estimation cost of the initial motion vector pair; the target vector pair determination module 530 is used to perform motion search processing on the candidate motion vector pair to obtain the target motion vector pair; the encoding module 540 is used to encode the current block based on the target motion vector pair to obtain the encoded code stream.

[0112] In an exemplary embodiment of the present disclosure, the initial vector pair construction module 510 includes an initial vector pair construction unit, which is used to: perform motion estimation on the current block based on the bilateral matching inter-frame prediction mode to obtain a first initial motion vector, the first initial motion vector includes a unidirectional optimal motion vector or a bidirectional optimal motion vector; construct a first motion vector list based on the first initial motion vector; construct a second motion vector list, the second motion vector list includes a second initial motion vector obtained by motion estimation of motion vectors of adjacent blocks in the time domain or the spatial domain; select a second initial motion vector that meets specified conditions from the second motion vector list; and construct an initial motion vector pair based on the first initial motion vector and the selected second initial motion vector.

[0113] In an exemplary embodiment of the present disclosure, the candidate vector pair determination module 520 includes a candidate vector pair determination unit, which is used to: group the initial motion vector pairs according to the prediction direction of the second initial motion vector to obtain grouped motion vector pairs; determine the grouped motion estimation cost of the grouped motion vector pairs; and determine the candidate motion vector pairs from the grouped motion vector pairs according to the grouped motion estimation cost, the candidate motion vector pairs including the first candidate motion vector and the second candidate motion vector.

[0114] In an exemplary embodiment of the present disclosure, the target vector pair determination module 530 includes a target vector pair determination unit, which is used to: determine a motion information search range centered on a first candidate motion vector; search and process a second candidate motion vector based on the motion information search range to determine a refined motion vector pair; determine a target motion vector pair and a reference motion vector list of the target motion vector pair based on a motion estimation cost of the refined motion vector pair.

[0115] In an exemplary embodiment of the present disclosure, the encoding module 540 includes an encoding unit, which is used to: obtain pre-defined encoding syntax information, the encoding syntax information includes a coding mode identifier and a reference motion vector list; encode the coding mode identifier to obtain a coding mode identifier value; encode the reference motion vector list to obtain reference motion information; and generate an encoding bitstream based on the coding mode identifier value and the reference motion information.

[0116] Figure 6 is a block diagram of a video decoding device according to an exemplary embodiment. Figure 6 The video decoding device 600 includes: an initial vector parsing module 610, a first vector pair construction module 620, a second vector pair determination module 630 and a decoding module 640.

[0117] Specifically, the initial vector parsing module 610 is used to obtain the encoded code stream, parse the encoded code stream, and obtain the first initial motion vector; the first vector pair construction module 620 is used to construct an initial motion vector pair based on the first initial motion vector and the corresponding second initial motion vector; the second vector pair determination module 630 is used to search and refine the initial motion vector pair to obtain a target motion vector pair; the decoding module 640 is used to reconstruct the current block based on the target motion vector pair.

[0118] In an exemplary embodiment of the present disclosure, the encoded bitstream includes reference motion information, and the initial vector parsing module 610 includes an initial vector parsing unit, which is used to: decode the encoding mode identification bit in the encoded bitstream to obtain the encoding mode identification value; when the encoding mode identification value is a specified identification value, parse the motion information of the first motion vector direction in the reference motion information to obtain the first motion information; and determine the first initial motion vector according to the first motion information.

[0119] In an exemplary embodiment of the present disclosure, the initial vector parsing unit includes an initial vector parsing sub-unit, which is used to: determine motion reference information corresponding to the first motion information, the motion reference information including one or more of a reference frame index, a motion vector prediction index, a motion vector difference and a motion accuracy; determine the first initial motion vector according to the motion reference information.

[0120] In an exemplary embodiment of the present disclosure, the first vector pair construction module 620 includes a first vector pair construction unit, which is used to: construct a second motion vector list, the second motion vector list including a second initial motion vector obtained by motion estimation of motion vectors of adjacent blocks in the time domain or spatial domain; based on the first initial motion vector, select a second initial motion vector that meets specified conditions from the second motion vector list to construct an initial motion vector pair.

[0121] In an exemplary embodiment of the present disclosure, the second vector pair determination module 630 includes a target vector determination unit, which is used to: determine an initial motion estimation cost of an initial motion vector pair; determine a candidate motion vector pair from the initial motion vector pair based on the initial motion estimation cost, the candidate motion vector pair including a first candidate motion vector and a second candidate motion vector; determine a motion information search range with the first candidate motion vector as the center; and perform search refinement processing on the second candidate motion vector based on the motion information search range to obtain a target motion vector pair.

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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.

[0126] 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 .

[0127] 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.

[0128] 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.

[0129] 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.

[0130] 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 video encoding method and video decoding 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.

[0131] In an exemplary embodiment, a computer program product is further provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned video encoding methods or any one of the above-mentioned video decoding methods.

[0132] 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.

[0133] 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 video encoding method, characterized in that: include: Obtaining a current block of a frame to be encoded, and constructing an initial motion vector pair of the current block; Determining a candidate motion vector pair according to the motion estimation cost of the initial motion vector pair; Performing motion search processing on the candidate motion vector pair to obtain a target motion vector pair; The current block is encoded based on the target motion vector to obtain an encoded bit stream.

2. The method according to claim 1, characterized in that The constructing the initial motion vector pair of the current block comprises: Performing motion estimation on the current block based on a bilateral matching inter-frame prediction mode to obtain a first initial motion vector, where the first initial motion vector includes a unidirectional optimal motion vector or a bidirectional optimal motion vector; Constructing a first motion vector list according to the first initial motion vector; Constructing a second motion vector list, wherein the second motion vector list includes second initial motion vectors obtained by performing motion estimation based on motion vectors of adjacent blocks in the temporal domain or the spatial domain; Selecting a second initial motion vector that meets a specified condition from the second motion vector list; The initial motion vector pair is constructed according to the first initial motion vector and the selected second initial motion vector.

3. The method according to claim 2, characterized in that The step of determining a candidate motion vector pair according to the motion estimation cost of the initial motion vector pair includes: performing grouping processing on the initial motion vector pairs according to the prediction direction of the second initial motion vector to obtain grouped motion vector pairs; determining a grouped motion estimation cost for the grouped motion vector pairs; The candidate motion vector pair is determined from the grouped motion vector pairs according to the grouped motion estimation cost, wherein the candidate motion vector pair includes a first candidate motion vector and a second candidate motion vector.

4. The method according to claim 1 or 3, characterized in that: The performing motion search processing on the candidate motion vector pair to obtain a target motion vector pair includes: Determine a motion information search range with the first candidate motion vector as the center; Based on the motion information search range, searching the second candidate motion vector to determine a refined motion vector pair; The target motion vector pair and a reference motion vector list of the target motion vector pair are determined according to the motion estimation cost of the refined motion vector pair.

5. The method according to claim 4, characterized in that The encoding process of the current block based on the target motion vector to obtain an encoded bit stream includes: Acquire predefined coding syntax information, where the coding syntax information includes a coding mode flag and the reference motion vector list; Encoding the coding mode identification bit to obtain a coding mode identification value; Encoding the reference motion vector list to obtain reference motion information; The encoding bitstream is generated based on the encoding mode identification value and the reference motion information.

6. A video decoding method, characterized in that: include: Acquire a coded bitstream, and parse the coded bitstream to obtain a first initial motion vector; constructing an initial motion vector pair based on the first initial motion vector and the corresponding second initial motion vector; Performing search and refinement processing on the initial motion vector pair to obtain a target motion vector pair; The current block is reconstructed based on the target motion vector pair.

7. The method according to claim 6, characterized in that The coded code stream includes reference motion information, and the parsing process of the coded code stream to obtain the first initial motion vector includes: Decoding the coding mode identification bit in the coded bit stream to obtain a coding mode identification value; When the encoding mode identification value is a specified identification value, parsing the motion information in the first motion vector direction in the reference motion information to obtain first motion information; The first initial motion vector is determined according to the first motion information.

8. The method according to claim 7, characterized in that The determining the first initial motion vector according to the first motion information includes: Determine motion reference information corresponding to the first motion information, where the motion reference information includes one or more of a reference frame index, a motion vector prediction index, a motion vector difference, and a motion accuracy; The first initial motion vector is determined according to the motion reference information.

9. The method according to claim 6, characterized in that The constructing an initial motion vector pair based on the first initial motion vector and the corresponding second initial motion vector comprises: Constructing a second motion vector list, wherein the second motion vector list includes second initial motion vectors obtained by performing motion estimation based on motion vectors of adjacent blocks in the temporal domain or the spatial domain; Based on the first initial motion vector, a second initial motion vector meeting a specified condition is selected from the second motion vector list to construct the initial motion vector pair.

10. The method according to claim 6 or 9, characterized in that: The searching and refining process is performed on the initial motion vector pair to obtain the target motion vector pair, including: determining an initial motion estimation cost for the initial motion vector pair; Determine, according to the initial motion estimation cost, a candidate motion vector pair from the initial motion vector pair, the candidate motion vector pair comprising a first candidate motion vector and a second candidate motion vector; Determine a motion information search range with the first candidate motion vector as the center; Based on the motion information search range, the second candidate motion vector is searched and refined to obtain the target motion vector pair.

11. A video encoding device, characterized in that: include: An initial vector pair construction module, used to obtain a current block of a frame to be encoded and construct an initial motion vector pair of the current block; A candidate vector pair determination module, configured to determine a candidate motion vector pair according to a motion estimation cost of the initial motion vector pair; A target vector pair determination module, configured to perform motion search processing on the candidate motion vector pair to obtain a target motion vector pair; The encoding module is used to encode the current block based on the target motion vector to obtain an encoded bit stream.

12. A video decoding device, characterized in that: include: An initial vector parsing module, used for acquiring a coded bitstream, parsing the coded bitstream, and obtaining a first initial motion vector; A first vector pair construction module, configured to construct an initial motion vector pair based on the first initial motion vector and a corresponding second initial motion vector; A second vector pair determination module is used to perform search and refinement processing on the initial motion vector pair to obtain a target motion vector pair; A decoding module is used to reconstruct a current block based on the target motion vector pair.

13. 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 video encoding method according to any one of claims 1 to 5, or to implement the video decoding method according to any one of claims 6 to 10.

14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the video encoding method as described in any one of claims 1 to 5, or implement the video decoding method as described in any one of claims 6 to 10.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the video encoding method according to any one of claims 1 to 5 is implemented, or the video decoding method according to any one of claims 6 to 10 is implemented.