Method and device for determining optimal motion vector, equipment and storage medium
By obtaining the RDO cost of partial search directions in video encoding and using the initial motion vector as the optimal motion vector, the problem of high complexity in GPM-MMVD is solved, and more efficient motion vector prediction is achieved, suitable for video encoding scenarios with low latency and high transmission efficiency.
Patent Information
- Application Number
- CN202410177374.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2025-08-08
AI Technical Summary
Existing GPM-MMVDs are more complex in predicting the optimal motion vector, especially in the video encoding process, which requires a lot of rate distortion optimization (RDO) cost calculations, resulting in excessive delay and complexity.
By obtaining the rate distortion optimization (RDO) cost of part of the search directions in the preset direction set, and when the initial RDO cost is greater than or equal to the initial RDO cost corresponding to the initial motion vector, the initial motion vector is used as the optimal motion vector to reduce the calculation amount of the RDO cost.
It reduces the prediction complexity of the optimal motion vector during video encoding and improves prediction efficiency. It is suitable for video encoding scenarios with low latency and high transmission efficiency such as game broadcasting and live network broadcasting.
Smart Images

Figure CN120455706A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video coding technology, and in particular to a method, apparatus, device, and storage medium for determining an optimal motion vector. Background Art
[0002] As video scenes become more diverse, the amount of video data also increases. In order to improve the transmission efficiency of video, it is usually necessary to perform video encoding processes such as acquisition, prediction, transformation and entropy coding on video data to reduce the amount of video data.
[0003] Currently, predictive coding modes for video images generally include the conventional Merge mode, the Merge with Motion Vector Difference (MMVD) mode applied to the Merge mode, and the Geometric Partitioning Mode (GPM-MMVD) mode, which applies MMVD to the GPM mode. The predictive coding process for video images requires predicting the optimal motion vector (MV) for the current pixel block, and then performing encoding based on this optimal motion vector.
[0004] However, the existing GPM-MMVD has 8 search directions and 9 search distances, traversing a total of 72 candidate MVs. In addition, both partitioned regions of GPM need to traverse 72 candidate MVs, for a total of 144 combinations. This requires GPM-MMVD to determine the rate distortion optimization (RDO) cost 144 times in the process of predicting the best MV, resulting in a high prediction complexity for the best MV in GPM-MMVD. Summary of the Invention
[0005] The embodiments of the present disclosure provide a method, apparatus, device, and storage medium for determining an optimal motion vector, which are used to solve the problem of high prediction complexity of the optimal MV in GPM-MMVD.
[0006] In one aspect, a method for determining an optimal motion vector is provided. The method includes obtaining a first direction set, the first direction set including some search directions from a preset direction set. A rate-distortion optimization (RDO) cost for each search direction in the first direction set for a target pixel block is determined to obtain multiple first RDO costs. If all of the multiple first RDO costs are greater than or equal to an initial RDO cost corresponding to an initial motion vector MV of the target pixel block, the initial MV is determined as the optimal MV for the target pixel block.
[0007] On the other hand, a device for determining an optimal motion vector is provided. The device includes: an acquisition module and a processing module.
[0008] An acquisition module is configured to acquire a first direction set, the first direction set including some search directions in a preset direction set. A processing module is configured to determine a rate-distortion optimization (RDO) cost for each search direction of a target pixel block in the first direction set to obtain a plurality of first RDO costs. The processing module is further configured to, if all of the plurality of first RDO costs are greater than or equal to an initial RDO cost corresponding to an initial motion vector MV of the target pixel block, select the initial MV as the optimal MV for the target pixel block.
[0009] In another aspect, a network device is provided, comprising: a memory and a processor. The memory and the processor are coupled. The memory is configured to store a computer program. When the processor executes the computer program, the method for determining an optimal motion vector according to any of the above embodiments is implemented.
[0010] On the other hand, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for determining the optimal motion vector of any of the above embodiments is implemented.
[0011] In yet another aspect, a computer program product is provided. The computer program product includes computer program instructions, and when the computer program instructions are executed by a processor, the method for determining an optimal motion vector according to any one of the above embodiments is implemented.
[0012] In an embodiment of the present disclosure, when predictive encoding is performed on a pixel block, the RDO costs for some search directions in a preset direction set can be first determined. Subsequently, the RDO costs for these search directions can be compared with the initial RDO costs corresponding to the initial MV of the pixel block. When the RDO costs for these search directions are all greater than or equal to the initial RDO costs, the initial MV of the pixel block is used as the optimal MV for the pixel block. This allows the optimal MV to be obtained by simply determining the RDO costs for some search directions. This reduces the computational effort required to calculate the RDO costs for the pixel block, thereby improving the efficiency of predicting the optimal MV for the pixel block. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the present disclosure, the following briefly introduces the drawings required for use in some embodiments of the present disclosure. Obviously, the drawings described below are only drawings of some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0014] Figure 1 A framework flow chart of video encoding provided for some embodiments of the present disclosure;
[0015] Figure 2 A schematic diagram of a system architecture of an electronic device provided in some embodiments of the present disclosure;
[0016] Figure 3 A schematic flow chart of a method for determining an optimal motion vector provided in some embodiments of the present disclosure;
[0017] Figure 4 A schematic flow chart of another method for determining an optimal motion vector provided in some embodiments of the present disclosure;
[0018] Figure 5 A schematic diagram of an example of a method for determining an optimal motion vector provided in some embodiments of the present disclosure;
[0019] Figure 6 A schematic structural diagram of a device for determining an optimal motion vector provided in some embodiments of the present disclosure;
[0020] Figure 7 A schematic structural diagram of a device for determining an optimal motion vector provided in some embodiments of the present disclosure. DETAILED DESCRIPTION
[0021] The following will clearly and completely describe the technical solutions of this disclosure in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this disclosure, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of this disclosure without making any creative efforts shall fall within the scope of protection of this disclosure.
[0022] It should be noted that in this disclosure, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this disclosure as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0023] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0024] In the description of this disclosure, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" in this document simply describes an association relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exists simultaneously, and B exists alone. Furthermore, "at least one" means one or more, and "a plurality" means two or more.
[0025] Before introducing in detail the method for determining the optimal motion vector provided by the embodiment of the present disclosure, the implementation environment and application scenarios of the embodiment of the present disclosure are first introduced.
[0026] First, the application scenarios of the embodiments of the present disclosure are introduced.
[0027] As video scenes become increasingly diverse, traditional square coding units (CUs) are no longer able to accurately predict the image. This is why GPM was developed. GPM allows for multi-angle segmentation, which adapts to more complex textures and allows for better encoding of certain areas. GPM-MMVD applies MMVD to the GPM model, aiming to further improve MV accuracy, resulting in more accurate predicted images and smaller residuals for encoding.
[0028] exist Figure 1 In the framework flow chart of existing video coding, the original luminance and chrominance (YUV) image (or video) can be coded and compressed through several key functional modules: prediction, transformation, quantization, entropy coding, rate control, and post-processing. Image (or video) coding and compression are primarily implemented from the perspectives of temporal redundancy and spatial redundancy. Specifically, temporal redundancy is achieved by comparing the similarities and differences between two frames over time and transmitting the differences between them, primarily through the inter-frame prediction module. Spatial redundancy is achieved by coding and compressing data within the same frame, primarily through the intra-frame prediction module. The difference between the predicted reconstructed image and the original image, i.e., the residual, is transformed and quantized to further reduce redundancy, and then binary encoded through entropy coding. Finally, post-processing modules such as deblocking filtering and sample adaptive offset are used to eliminate blocking artifacts.
[0029] However, the latest generation of enhanced compression model (ECM) video coding uses the GPM technology from the previous generation versatile video coding (VVC) to specifically address the issue of inaccurate prediction for some square CUs. ECM further optimizes GPM using a fast machine learning-based geometric partitioning mode with merge motion vector differences (GPM-MMVD). However, the high complexity of GPM-MMVD significantly increases the complexity of this part.
[0030] In other words, there's no fast algorithm for GPM-MMVD. Existing GPM-MMVD is extremely complex due to its eight search directions, nine candidate distances, and the traversal of a total of 72 candidate MVs. Both GPM partitions require traversing 72 candidate MVs, resulting in 144 combinations and 144 RDO cost calculations. This complexity is unsuitable for applications requiring low-latency, real-time transmission.
[0031] To address the aforementioned issues, the present invention provides a method for determining an optimal motion vector. This method is applicable to scenarios where the optimal MV is determined in GPM-MMVD, such as game broadcasts and live webcasts, where low latency, high transmission efficiency, or a large number of GPM partitioning modes (i.e., high encoder complexity) are required. Specifically, an early termination method is employed for the eight search directions. The four candidate directions (upper, lower, left, and right) are first traversed. If a candidate direction with a low RDO cost is found among these four candidate directions, the remaining four candidate directions (upper left, upper right, lower left, and lower right) are traversed after these four candidate directions are traversed. During the traversal of the nine candidate distances for a particular candidate direction, relevant features are first extracted and input into a binary classification network. Based on the network output, only sub-pixels (1 / 4 pixel, 1 / 2 pixel) or whole pixels (1 pixel, 2 pixels, 3 pixels, 4 pixels, 6 pixels, 8 pixels, and 16 pixels) are traversed. In this way, most of the redundant RDO calculation process can be omitted, reducing the prediction complexity of determining the optimal MV in GPM-MMVD.
[0032] The implementation environment of the embodiments of the present disclosure is introduced below.
[0033] like Figure 2, which is a schematic diagram of a system architecture of an electronic device provided by an embodiment of the present disclosure. The electronic device 200 may include: a prediction module 201, a transformation module 202, a quantization module 203, an encoding module 204, a control module 205 and a post-processing module 206.
[0034] The transform module 202 may divide the original YUV in the input image signal into coding tree units (CTUs), and perform luminance mapping, transformation and inverse transformation, scaling, and chroma scaling on the divided CTUs.
[0035] The prediction module 201 can perform inter-frame estimation, inter-frame prediction, intra-frame prediction, intra-frame / inter-frame joint prediction and motion estimation on the output result of the transformation module 202 through mode selection to obtain corresponding intra-frame prediction data and motion data.
[0036] The quantization module 203 may perform quantization processing on the output result of the transformation module 202 to obtain a corresponding quantization coefficient.
[0037] The post-processing module can perform inverse luminance mapping and loop filtering on the output of the transform module 202 through filter control analysis to obtain corresponding filter control data. The loop filtering process can be implemented based on a deblocking filter (DBK), a sample adaptive offset (SAO), and / or an adaptive loop filter (ALF).
[0038] The control module 205 may perform rate control on the output result of the transformation module 202 to obtain corresponding rate control data.
[0039] Based on the rate control data, quantization coefficients, intra-frame prediction data, filter control data, and motion data from the aforementioned modules, the encoding module 204 generates a header-formatted bitstream using context-adaptive binary arithmetic coding (CABAC) entropy coding to achieve image signal encoding and compression. Furthermore, the encoding module 204 can output a video signal by caching the decoded image.
[0040] In the embodiment of the present disclosure, the electronic device 200 can Figure 1 The video encoding framework process shown is used to encode and compress the video.
[0041] It should be noted that the embodiment of the present disclosure does not limit the electronic device 200. For example, the electronic device 200 may be a terminal, or the electronic device 200 may be a server.
[0042] The terminal may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook computer, or other device with transceiver functions. The embodiments of the present disclosure do not impose any particular restrictions on the specific form of the terminal. The terminal may interact with the user through one or more methods such as a keyboard, touchpad, touch screen, remote control, voice interaction, or handwriting device.
[0043] The server can be a single physical server, or a server cluster consisting of multiple servers. Alternatively, the server cluster can be a distributed cluster. Alternatively, the server can be a cloud server. The embodiments of this disclosure do not limit the specific implementation of the server.
[0044] After introducing the application scenario and implementation environment of the embodiment of the present disclosure, the method for determining the optimal motion vector provided by the embodiment of the present disclosure is described in detail below in combination with the above implementation environment.
[0045] The embodiment of the present disclosure provides a method for determining an optimal motion vector, such as Figure 3 As shown, the method for determining the optimal motion vector may include: S301-S304.
[0046] S301: Obtain a first direction set.
[0047] The first direction set includes some search directions in the preset direction set.
[0048] As a possible implementation manner, the preset direction set may include all search directions of GPM-MMVD.
[0049] That is to say, in the process of predictive coding of pixel blocks, predictive coding is performed by using the search direction of GPM-MMVD, aiming to further improve the MV accuracy of the pixel blocks, thereby obtaining more accurate prediction results and reducing the residual error of the pixel blocks in predictive coding.
[0050] It should be noted that, in the embodiment of the present disclosure, the search direction of the GPM-MMVD can be divided into a forward direction and an oblique direction.
[0051] As a possible implementation manner, the first direction set may include all forward directions in the preset direction set.
[0052] Exemplarily, all search directions of GPM-MMVD may include four forward directions: up, down, left, and right, and four oblique directions: upper left, upper right, lower left, and lower right. Then the first direction set may include four directions: up, down, left, and right.
[0053] It can be understood that when predicting a pixel block, the primary search direction (i.e., the forward direction) is selected from all search directions in GPM-MMVD to provide a reference for predicting the optimal MV of subsequent pixel blocks. This avoids calculating the RDO cost for the secondary search direction, omitting most of the redundant RDO cost calculation process in GPM-MMVD and reducing the computational complexity of GPM-MMVD.
[0054] As a possible implementation manner, the first direction set may be obtained by receiving a search direction in the first direction set input by a user.
[0055] As another possible implementation manner, the first direction set may be obtained from a storage space that pre-stores the first direction set.
[0056] That is, the embodiment of the present disclosure does not limit the method for obtaining the first direction set. In this way, the operability of obtaining the first direction set can be improved.
[0057] S302: Determine a rate-distortion optimization cost of the target pixel block in each search direction in the first direction set to obtain a plurality of first rate-distortion optimization costs.
[0058] As a possible implementation, multiple preset search distances are stored. Based on the first search direction in the first direction set and each preset search distance, an RDO cost of the target pixel block in the first search direction from among the multiple first RDO costs can be calculated to obtain multiple third RDO costs corresponding to the first search direction. Each third RDO cost corresponds to a preset search distance.
[0059] Exemplarily, the stored multiple preset search distances include: 1 pixel, 2 pixels, 3 pixels, 4 pixels, 6 pixels, and 8 pixels. If the first search direction is the lower left direction, multiple third RDO costs corresponding to the lower left direction can be determined: RDO cost A, RDO cost B, RDO cost C, RDO cost D, RDO cost E, and RDO cost F. Among them, RDO cost A is the RDO cost of the target pixel block in the lower left direction of 1 pixel, RDO cost B is the RDO cost of the target pixel block in the lower left direction of 2 pixels, RDO cost C is the RDO cost of the target pixel block in the lower left direction of 3 pixels, RDO cost D is the RDO cost of the target pixel block in the lower left direction of 4 pixels, RDO cost E is the RDO cost of the target pixel block in the lower left direction of 6 pixels, and RDO cost F is the RDO cost of the target pixel block in the lower left direction of 8 pixels.
[0060] It should be noted that when calculating the RDO cost for a pixel block in a search direction, the RDO cost is typically calculated based on each preset search distance in that search direction. That is, a search direction corresponds to multiple preset search distances, and each search distance contributes to the calculation of the RDO cost for that search direction. The number of RDO costs for a pixel block in a search direction is equal to the number of preset search distances in that search direction. This increases the computational complexity of the RDO cost when there are a large number of preset search distances, leading to a higher computational complexity for GPM-MMVD.
[0061] As a possible implementation, multiple pixel block feature information of a target pixel block in a target search direction can be obtained, and multiple target search distances in the target search direction can be determined based on the multiple pixel block feature information. Next, for each target search distance, a first RDO cost of the target pixel block in the target search direction and target search distance can be determined based on the target search distance and the target search direction to obtain multiple first RDO costs of the target pixel block in the target search direction. The target search direction is any search direction in the first direction set, and each target search distance corresponds to one first RDO cost.
[0062] It is understood that when calculating the RDO cost of a pixel block in each search direction, a portion of the search distances in the corresponding search direction can be selected based on the pixel block feature information in each search direction. Then, based on each search direction and the selected portion of the search distance in each search direction, the RDO cost of the pixel block in each search direction and the selected search distance is calculated. This reduces the computational complexity of the RDO cost of the pixel block and lowers the computational complexity of GPM-MMVD.
[0063] It should be noted that, in the embodiment of the present disclosure, the feature information of the multiple pixel blocks may include at least one of the following information: gradient value, standard deviation, and absolute error.
[0064] In other words, by obtaining characteristic information such as the gradient value, standard deviation, and absolute error of the sub-pixel block of the pixel block in a search direction, a reference can be provided for selecting a partial search distance in the search direction, thereby improving the accuracy of the selected search distance and providing an accurate RDO cost reference for the subsequent determination of the optimal MV of the pixel block.
[0065] As a possible implementation, a trained binary classification network model is deployed. In the process of determining multiple target search distances in a target search direction based on multiple pixel block feature information, the multiple pixel block feature information can be input into the trained binary classification network model to obtain multiple target search distances.
[0066] It can be understood that by training the binary classification network model, an association between pixel block feature information and search directions is established, providing a basis for subsequently selecting partial search distances for the pixel block in the search direction, thereby improving the accuracy of the selected search distances. Furthermore, since the binary classification network model outputs only two categories of results, the multiple search distances determined by the trained binary classification network model are all of the same type. This ensures that all RDO costs for a pixel block in a search direction are calculated based on the same type of search distance, thereby reducing the variability in the RDO costs of pixel blocks in the search direction.
[0067] It should be noted that, in the embodiment of the present disclosure, the multiple target search distances are all based on the integer pixel accuracy of GPM-MMVD, or the multiple target search distances are all based on the sub-pixel accuracy of GPM-MMVD.
[0068] That is, the type of search distance may be determined based on pixel accuracy.
[0069] S303: Determine whether there is a first rate-distortion optimization cost among the multiple first rate-distortion optimization costs that is smaller than the initial rate-distortion optimization cost corresponding to the initial motion vector of the target pixel block.
[0070] In some embodiments, if it is determined that the plurality of first RDO costs are all greater than or equal to the initial RDO cost, S304 is executed.
[0071] S304: Use the initial motion vector as the optimal motion vector of the target pixel block.
[0072] It is understood that when predictively encoding a pixel block, the RDO costs for some search directions in a preset set of directions can be first determined. Subsequently, the RDO costs for these search directions can be compared with the initial RDO costs corresponding to the initial MV of the pixel block. When the RDO costs for these search directions are all greater than or equal to the initial RDO costs, the initial MV of the pixel block is used as the optimal MV for the pixel block. This allows the optimal MV to be obtained by simply determining the RDO costs for some search directions. This reduces the computational effort required to calculate the RDO costs for the pixel block, thereby improving the efficiency of predicting the optimal MV for the pixel block.
[0073] In some embodiments, as Figure 4 As shown, after S303 , in the case where it is determined that there is a first RDO cost smaller than the initial RDO cost among the multiple first RDO costs, the method for determining the optimal motion vector may further include: S401 - S404 .
[0074] S401: Acquire a second direction set.
[0075] The second direction set includes at least one search direction in the preset direction set except the first direction set.
[0076] As a possible implementation manner, the second direction set may include all oblique directions in the preset direction set.
[0077] It can be understood that when it is determined that the main search direction selected in GPM-MMVD is difficult to provide a reference for the prediction of the optimal MV of the pixel block, the secondary search direction (i.e., the oblique direction) in GPM-MMVD can be selected to provide more references for the prediction of the optimal MV of the pixel block, so as to improve the accuracy of the predicted optimal MV of the pixel block.
[0078] S402: Determine a rate-distortion optimization cost of the target pixel block in each search direction in the second direction set to obtain a plurality of second rate-distortion optimization costs.
[0079] It should be noted that, for the process of determining the rate-distortion optimization cost of the target pixel block in each search direction in the second direction set to obtain multiple second rate-distortion optimization costs, reference can be made to the introduction of determining the first RDO cost of the target pixel block in S302 above, which will not be repeated here.
[0080] S403: Determine a target rate-distortion optimization cost from a plurality of first rate-distortion optimization costs and a plurality of second rate-distortion optimization costs.
[0081] The target RDO cost is the minimum RDO cost among the multiple first RDO costs and the multiple second RDO costs.
[0082] S404 : Determine the optimal motion vector of the target pixel block based on the search direction corresponding to the target rate-distortion optimization cost.
[0083] It is understandable that when some of the selected search directions are insufficient to provide a reference for predicting the optimal MV for a pixel block, the remaining search directions can be selected to provide more references for predicting the optimal MV for the pixel block, and the search direction with the lowest RDO cost among all the selected search directions can be used as the optimal MV for the pixel block. In this way, by performing RDO cost calculations on all search directions in batches, the computational complexity of the RDO costs for the pixel block can be reduced while ensuring the accuracy of predicting the optimal MV for the pixel block.
[0084] The following describes the method for determining the optimal motion vector provided by the embodiment of the present disclosure with reference to specific examples. Figure 5 As shown, the candidate directions of the pixel block include 8 search directions, and each search direction has 9 candidate distances, for a total of 72 combinations.
[0085] Specifically, first traverse the four candidate directions of up, down, left, and right (i.e., the search directions in the first direction set);
[0086] When traversing each candidate direction, there are a total of 9 candidate distances to choose from. Relevant features (i.e., pixel block feature information) are extracted and input into the binary classification network (trained binary classification network model). Based on the network output, it is determined whether to traverse only sub-pixels (1 / 4 pixel, 1 / 2 pixel) or whole pixels (1 pixel, 2 pixels, 3 pixels, 4 pixels, 6 pixels, 8 pixels, 16 pixels).
[0087] If there is a direction among the four candidate directions of up, down, left, and right that makes the RDO cost lower (that is, there is a first RDO cost among the multiple first RDO costs that is smaller than the initial RDO cost), then continue to traverse the remaining four candidate directions of upper left, upper right, lower left, and lower right. Otherwise, terminate the traversal directly until the optimal subsequent MV (that is, the best MV) is determined.
[0088] It is understood that the disclosed embodiments can effectively reduce encoding complexity while keeping decoding complexity unchanged, and at the same time, do not need to transmit corresponding indexes to the decoding end, thereby improving the prediction efficiency of the optimal MV of a pixel block.
[0089] It is understandable that, in order to achieve the above functions, the optimal motion vector includes hardware structures and / or software modules that perform the corresponding functions. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments of the present disclosure, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.
[0090] The embodiment of the present disclosure can divide the functional modules of the optimal motion vector according to the above-mentioned method embodiment. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one functional module. The above-mentioned integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical functional division. In actual implementation, there may be other division methods. The following is an example of dividing each functional module corresponding to each function.
[0091] Figure 6 This is a schematic diagram of the structure of an apparatus for determining an optimal motion vector provided by an embodiment of the present disclosure. The apparatus for determining an optimal motion vector 600 can execute the above method embodiment. Figure 3 or Figure 4 The method for determining the optimal motion vector is shown in FIG. Figure 6 As shown, the device 600 for determining the optimal motion vector includes: an acquisition module 601 and a processing module 602 .
[0092] An acquisition module 601 is configured to acquire a first direction set, the first direction set including some search directions from a preset direction set. A processing module 602 is configured to determine a rate-distortion optimization (RDO) cost for each search direction in the first direction set for a target pixel block, thereby obtaining multiple first RDO costs. Processing module 602 is further configured to, if all of the multiple first RDO costs are greater than or equal to the initial RDO cost corresponding to the initial motion vector MV of the target pixel block, select the initial MV as the optimal MV for the target pixel block.
[0093] Optionally, the acquisition module 601 is further configured to acquire a second direction set when a first RDO cost less than the initial RDO cost exists among the multiple first RDO costs, the second direction set including at least one search direction in the preset direction set other than the first direction set. The processing module 602 is further configured to determine the RDO cost of each search direction of the target pixel block in the second direction set to obtain multiple second RDO costs. The processing module 602 is further configured to determine a target RDO cost from the multiple first RDO costs and the multiple second RDO costs, the target RDO cost being the minimum RDO cost among the multiple first RDO costs and the multiple second RDO costs. The processing module 602 is further configured to determine an optimal MV for the target pixel block based on the search direction corresponding to the target RDO cost.
[0094] Optionally, acquisition module 601 is specifically configured to acquire multiple pixel block feature information of a target pixel block in a target search direction, where the target search direction is any search direction in the first direction set. Processing module 602 is further configured to determine multiple target search distances in the target search direction based on the multiple pixel block feature information. Processing module 602 is further configured to determine a first RDO cost for the target pixel block in the target search direction and the target search distance based on the target search distance and the target search direction.
[0095] Optionally, the processing module 602 is specifically configured to input feature information of multiple pixel blocks into a trained binary classification network model to obtain multiple target search distances.
[0096] Optionally, the multiple target search distances are all integer pixel precisions of a geometric partitioning mode GPM-MMVD based on motion vector offset, or the multiple target search distances are all fractional pixel precisions of GPM-MMVD.
[0097] Optionally, the plurality of pixel block feature information includes at least one of the following information: gradient value, standard deviation, and absolute error.
[0098] Optionally, the preset direction set includes all search directions of GPM-MMVD.
[0099] Optionally, the first direction set specifically includes all forward directions in the preset direction set, and the second direction set specifically includes all oblique directions in the preset direction set.
[0100] In the case of implementing the functions of the above-mentioned integrated modules in the form of hardware, the embodiment of the present disclosure provides another possible network device structure of the device for determining the optimal motion vector involved in the above-mentioned embodiment. Figure 7As shown, the optimal motion vector determination device 700 includes: a processor 702 and a bus 704. Optionally, the optimal motion vector determination device 700 may further include a memory 701; and optionally, the optimal motion vector determination device 700 may further include a communication interface 703.
[0101] Processor 702 may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of this disclosure. Processor 702 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of this disclosure. Processor 702 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.
[0102] The communication interface 703 is used to connect to other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0103] The memory 701 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0104] As a possible implementation, the memory 701 may exist independently of the processor 702. The memory 701 may be connected to the processor 702 via a bus 704 and used to store instructions or program codes. When the processor 702 calls and executes the instructions or program codes stored in the memory 701, the method for determining the optimal motion vector provided in the embodiment of the present disclosure can be implemented.
[0105] In another possible implementation, the memory 701 and the processor 702 may also be integrated together.
[0106] The bus 704 may be an extended industry standard architecture (EISA) bus, etc. The bus 704 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0107] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method for determining the optimal motion vector as described in any of the above embodiments.
[0108] Exemplarily, the computer-readable storage media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.). The various computer-readable storage media described in the present disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0109] An embodiment of the present disclosure provides a computer program product comprising instructions. When the computer program product is run on a computer, the computer is enabled to execute the method for determining the optimal motion vector described in any one of the above embodiments.
[0110] The above is only a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed in the present disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A method for determining an optimal motion vector, characterized in that: The method comprises: Acquire a first direction set, where the first direction set includes some search directions in a preset direction set; determining a rate-distortion optimization (RDO) cost of the target pixel block in each search direction in the first direction set to obtain a plurality of first RDO costs; In a case where the plurality of first RDO costs are all greater than or equal to the initial RDO cost corresponding to the initial motion vector MV of the target pixel block, the initial MV is used as the optimal MV of the target pixel block.
2. The method according to claim 1, characterized in that The method further comprises: When there is a first RDO cost less than the initial RDO cost among the multiple first RDO costs, acquiring a second direction set, where the second direction set includes at least one search direction in the preset direction set except the first direction set; determining an RDO cost of the target pixel block in each search direction in the second direction set to obtain a plurality of second RDO costs; Determine a target RDO cost from the plurality of first RDO costs and the plurality of second RDO costs, wherein the target RDO cost is the minimum RDO cost among the plurality of first RDO costs and the plurality of second RDO costs. An optimal MV of the target pixel block is determined based on a search direction corresponding to the target RDO cost.
3. The method according to claim 1, characterized in that Determining the RDO cost of the target pixel block in each search direction in the first direction set to obtain a plurality of first RDO costs includes: Acquire feature information of multiple pixel blocks of the target pixel block in a target search direction, where the target search direction is any search direction in the first direction set; determining a plurality of target search distances in the target search direction according to the plurality of pixel block feature information; Determine, according to the target search distance and the target search direction, a first RDO cost of the target pixel block in the target search direction and the target search distance.
4. The method according to claim 3, characterized in that The determining the multiple target search distances according to the multiple pixel block feature information includes: The plurality of pixel block feature information is input into a trained binary classification network model to obtain the plurality of target search distances.
5. The method according to claim 4, characterized in that The multiple target search distances are all integer pixel precisions of the geometric partitioning mode GPM-MMVD based on motion vector offset, or, The multiple target search distances are all at the sub-pixel accuracy of GPM-MMVD.
6. The method according to claim 3, characterized in that The plurality of pixel block feature information includes at least one of the following information: gradient value, standard deviation, and absolute error sum.
7. The method according to claim 1, characterized in that The preset direction set includes all search directions of GPM-MMVD.
8. The method according to claim 1, characterized in that The first direction set specifically includes all forward directions in the preset direction set, and the second direction set specifically includes all oblique directions in the preset direction set.
9. An electronic device, characterized in that: include: memory and processor; Memory and processor coupling; The memory is used to store instructions executable by the processor; When the processor executes the instructions, the method according to any one of claims 1 to 8 is performed.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Optimal motion vector determination method and apparatus, and device and storage medium
EP4773608A1
Optimal motion vector determination method and apparatus, and device and storage medium
WO2025167303A1