Video encoding method, apparatus, device, and storage medium

By expanding the search window and flexibly allocating the motion estimation engine, the problem of large motion estimation errors in existing systems is solved, thus improving video coding efficiency.

CN120639986BActive Publication Date: 2026-05-08RONG MING MICROELECTRONICS (JINAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RONG MING MICROELECTRONICS (JINAN) CO LTD
Filing Date
2025-07-17
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing motion estimation methods have large errors and low video coding efficiency.

Method used

By expanding the target search window and flexibly allocating motion estimation engines, multiple target motion estimation engines are used to perform motion search within the target search window of the target reference frame, thereby enhancing the accuracy of motion vector prediction.

Benefits of technology

It improves the efficiency and accuracy of video coding and reduces motion estimation errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120639986B_ABST
    Figure CN120639986B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video encoding method, device, equipment and storage medium. In some embodiments of the present disclosure, a current frame to be encoded and a reference frame available for the current frame are obtained; an initial search window is expanded for a target reference frame to obtain a target search window; wherein the target reference frame is an image frame in the reference frame allocated to a plurality of target motion estimation engines, and the target search window is smaller than a preset search range; motion search is performed in the target search window in the target reference frame by using the plurality of target motion estimation engines to obtain a target block matched with a current block of the current frame; the motion estimation resources are allocated to non-overlapping search areas or reference frames, thereby expanding the range of search, enhancing the accuracy of motion vector prediction, reducing the motion estimation error, and improving the video encoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video compression technology, and in particular to a video encoding method, apparatus, device and storage medium. Background Technology

[0002] Motion estimation is one of the most critical techniques in video coding, its main purpose being to improve coding efficiency by eliminating temporal redundancy in video sequences. Current mainstream video coding standards (such as H.264 / AVC, H.265 / HEVC, and the latest H.266 / VVC) typically employ a block-based hybrid coding framework. Motion estimation is responsible for finding the best-matching block in the reference frame for an image block in the current frame and recording the corresponding motion vectors and residual information. This approach significantly reduces the amount of data that needs to be transmitted, thereby improving overall compression performance.

[0003] Existing motion estimation methods mainly include full search, three-step search, four-step search, diamond search, and hierarchical motion estimation. Among them, hierarchical motion estimation is widely used due to its significant advantage in computational complexity. This method decomposes the image into multiple scales and performs coarse-to-fine motion searches at different levels, thereby significantly reducing the computational load while maintaining a certain level of accuracy. In addition, some improved hierarchical algorithms introduce prediction mechanisms or dynamic adjustment strategies to further improve search efficiency and accuracy.

[0004] Currently, existing motion estimation methods suffer from large motion estimation errors and low video coding efficiency. Summary of the Invention

[0005] This disclosure provides a video coding method, apparatus, device, and storage medium to at least solve the problems of large errors in existing motion estimation and low video coding efficiency.

[0006] The technical solution disclosed herein is as follows:

[0007] This disclosure provides a video encoding method, including:

[0008] Obtain the current frame to be encoded and the reference frames that can be used by the current frame;

[0009] For a target reference frame, the initial search window is expanded to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than a preset search range;

[0010] Motion search is performed using multiple target motion estimation engines in the target reference frame to obtain a target block that matches the current block of the current frame.

[0011] This disclosure provides a video encoding apparatus, including:

[0012] The acquisition module is used to acquire the current frame to be encoded and the reference frames that can be used by the current frame;

[0013] An extension module, for a target reference frame, is used to expand the initial search window to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than a preset search range;

[0014] The search module is used to perform motion search in the target reference frame using multiple target motion estimation engines to obtain a target block that matches the current block of the current frame.

[0015] This disclosure also provides an electronic device, including:

[0016] processor;

[0017] Memory used to store processor-executable instructions;

[0018] The processor is configured to execute instructions to implement the steps in the above method.

[0019] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0020] This disclosure also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described above.

[0021] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0022] In some embodiments of this disclosure, the current frame to be encoded and reference frames that can be used by the current frame are obtained; for the target reference frame, the initial search window is expanded to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are allocated, and the target search window is smaller than a preset search range; motion search is performed using the target search window of the multiple target motion estimation engines in the target reference frame to obtain a target block that matches the current block of the current frame; this disclosure allocates motion estimation resources to non-overlapping search areas or reference frames, thereby expanding the search range, enhancing the accuracy of motion vector prediction, reducing motion estimation errors, and improving video coding efficiency.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0025] Figure 1 A schematic diagram of a hierarchical motion estimation provided for an exemplary embodiment of this disclosure;

[0026] Figure 2 A flowchart illustrating a motion search process provided for an exemplary embodiment of this disclosure;

[0027] Figure 3 A schematic diagram illustrating the transmission of CME output to RME as an exemplary embodiment of this disclosure;

[0028] Figure 4 A flowchart illustrating a video encoding method provided for an exemplary embodiment of this disclosure;

[0029] Figure 5 A schematic diagram illustrating the allocation of a motion estimation engine as an exemplary embodiment of this disclosure;

[0030] Figure 6 A flowchart illustrating another video encoding method provided as an exemplary embodiment of this disclosure;

[0031] Figure 7 A schematic diagram illustrating a lateral search range expansion provided in an embodiment of this disclosure;

[0032] Figure 8 A schematic diagram illustrating a vertical search range expansion provided in an embodiment of this disclosure;

[0033] Figure 9 A schematic diagram illustrating a horizontal and vertical search range expansion provided in an embodiment of this disclosure;

[0034] Figure 10 A schematic diagram of an adaptive search provided for an exemplary embodiment of this disclosure;

[0035] Figure 11 A flowchart illustrating a video encoding method provided for an exemplary embodiment of this disclosure;

[0036] Figure 12 A schematic diagram of an EME architecture provided for an exemplary embodiment of this disclosure;

[0037] Figure 13A schematic diagram of the structure of a video encoding apparatus provided for an exemplary embodiment of this disclosure;

[0038] Figure 14 A schematic diagram of the structure of a video encoding apparatus provided for an exemplary embodiment of this disclosure;

[0039] Figure 15 A schematic diagram of the structure of a video encoding apparatus provided for an exemplary embodiment of this disclosure;

[0040] Figure 16 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this disclosure;

[0041] Figure 17 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this disclosure;

[0042] Figure 18 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this disclosure. Detailed Implementation

[0043] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0044] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.

[0045] It should be noted that the user information involved in this disclosure includes, but is not limited to, user device information and user personal information; the collection, storage, use, processing, transmission, provision and disclosure of user information in this disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0046] To address the aforementioned technical problems, in some embodiments of this disclosure, the following steps are taken: First, the current frame to be encoded is obtained. Second, reference frames that can be used for the current frame are determined based on a preset number of reference frames and the temporal position of the current frame. Third, a motion estimation engine is allocated to each reference frame according to the frame spacing between each reference frame and the current frame. Depending on the position of different reference frames, more important reference frames may be allocated more hardware resources. Fourth, the motion estimation engine allocated to each reference frame performs motion search on each reference frame to obtain a target block that matches the current block of the current frame. Fifth, the current frame is encoded based on the difference between the target block and the current block. This disclosure expands the search range of reference frames closer to the current frame, allowing for more candidate reference blocks for comparison and a higher probability of obtaining a more matching reference block, thereby improving the accuracy of motion estimation and increasing video encoding efficiency.

[0047] In this embodiment, hierarchical motion estimation includes the following levels: coarse motion estimation (CME), fine motion estimation (RME), and fractional motion estimation (FME).

[0048] Coarse motion estimation is the first step in hierarchical motion estimation. In this step, the original video resolution is reduced to one-quarter. Analyzing the reduced video images yields the approximate direction of object motion, effectively finding the approximate direction closest to the target block. While this search isn't the most accurate, it effectively captures the object's motion direction, thus identifying a region suitable for further precise analysis. CME's search has maximum scope limitations to avoid overly complex searches. Information from previous and adjacent blocks is provided to CME as MVP (Motion Vector Prediction). CME delineates a region centered on the MVP for searching and outputs the best MV (Motion Vector) to RME.

[0049] Fine-grained motion estimation (FME) is an intermediate step in the hierarchical motion estimation process. After finding a roughly similar block in the CME, a more precise and detailed search can be performed within this block. At this point, the resolution of the video image is increased from one-quarter to half of its original resolution, and then back to the original resolution. Higher resolution provides more information; therefore, precise analysis within a smaller region can optimize the results in the CME. The video image (MV) output from the CME to the RME appears as the MVP in the RME. The RME performs a precise search centered on the MVP to obtain new MV results, which are then output to the FME.

[0050] Fractional motion estimation (FME) is the final and most accurate step in hierarchical motion estimation. The output of RME provides a starting point for FME's search. The search is still performed at the original resolution, and to further improve accuracy, it uses 1 / 2 or 1 / 4 pixel accuracy to find the most similar reference block, thus further improving the accuracy of motion estimation and increasing coding efficiency.

[0051] Figure 1 This is a schematic diagram of a hierarchical motion estimation method provided as an exemplary embodiment of this disclosure. Figure 1 As shown, L2 corresponds to CME, L1 to RME, and L0 to FME. Each level of search is accompanied by an increase in resolution.

[0052] It's important to note that the purpose of motion search is to traverse all reference blocks within a given region and compare them one by one with the current block to find the most similar block as the output. Block similarity contributes to more efficient encoding; therefore, the result of motion search directly impacts the encoder's performance. During the search, the sum of absolute differences (SAD) is calculated by comparing each pixel in the reference block with each pixel in the current block. The smaller this SAD value, the more similar the two blocks are. After traversing all blocks, the reference block with the smallest SAD is the most similar block. To record the relative position of this reference block and the current block, motion vectors are used to represent their relative x and y coordinates. The difference between the reference block and the current block is called the residual, and the motion vector represents the coordinate difference between the current block and the reference block. The residual undergoes transformation, quantization, and entropy coding to reduce the amount of data required, thereby achieving video compression.

[0053] The search area is not infinite, as a larger search area means more blocks need to be traversed. In reality, moving objects in a video typically don't appear far away after one or two frames. Therefore, to reduce computational overhead, the search area is usually limited. MVP predicts the MV of the current block using prior information, such as information from neighboring or previous blocks. This is because when surrounding objects are moving in one direction, there's a high probability the current block will also move in that direction. In CME, the search is performed within a certain range centered on the position pointed to by the MVP. The search result, MV, serves as input to RME to guide the starting position of the precise motion estimation. The RME result is also transmitted to FME to guide the starting position of the fractional motion estimation.

[0054] Figure 2 This is a flowchart illustrating a motion search process provided as an exemplary embodiment of this disclosure. Figure 2As shown in the figure below, the steps of each layer in hierarchical motion estimation are illustrated. When performing motion estimation on a specific block (the current block), the MVP prior prediction information is first obtained to determine the starting search position, and comparisons are performed one by one within the allowable range. All comparison results are compared to find the most similar reference block, and their relative positions (MV) are recorded. This concludes the search at one level, and the result is passed to the next level as the MVP for that level.

[0055] Figure 3 This is a schematic diagram illustrating the transmission of CME output to RME as an exemplary embodiment of this disclosure. Figure 3 As shown in the diagram, the output from the CME is amplified and used as the MVP of the RME. Because the RME increases the resolution, the output of the CME also needs to be amplified accordingly. The same principle applies from the RME to the FME.

[0056] The technical solutions provided by the embodiments of this disclosure are described in detail below with reference to the accompanying drawings.

[0057] Figure 4 This is a flowchart illustrating a video encoding method provided as an exemplary embodiment of the present disclosure. Figure 4 As shown, the method includes:

[0058] S401: Obtain the current frame to be encoded;

[0059] S402: Determine the reference frames that can be used for the current frame based on the preset number of reference frames and the timing position of the current frame;

[0060] S403: Based on the relationship between the frame spacing of each reference frame and the current frame, the motion estimation engine is assigned to each reference frame;

[0061] S404: Use the motion estimation engine assigned to each reference frame to perform motion search on each reference frame to obtain the target block that matches the current block of the current frame;

[0062] S405: Encode the current frame based on the difference between the target block and the current block.

[0063] In this embodiment, the entity executing the above method can be a terminal device or a server.

[0064] The terminal device includes, but is not limited to, mobile stations (MS), mobile terminals, mobile phones, handsets, and portable equipment. This terminal device can communicate with one or more core networks via a radio access network (RAN). For example, the terminal device can be a mobile phone (or "cellular" phone), a computer with wireless communication capabilities, a computer with wireless transceiver capabilities, a virtual reality (VR) terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical care, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc. The operating systems installed on the terminal device include, but are not limited to, iOS, Android, Windows, Linux, and Mac OS. In different networks, terminals may be called by different names, such as: user equipment, mobile station, user unit, station, cellular phone, personal digital assistant, wireless modem, wireless communication device, handheld device, laptop, cordless phone, wireless local loop station, television, etc. For ease of description, this embodiment will simply refer to it as terminal device.

[0065] In this embodiment, the implementation form of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, or other server devices. The server mainly consists of a processor, hard disk, memory, system bus, and other common computer architecture types.

[0066] In this embodiment, the current frame to be encoded is obtained; reference frames that can be used for the current frame are determined according to the preset number of reference frames and the temporal position of the current frame; the motion estimation engine is allocated to each reference frame according to the relationship between the frame spacing of each reference frame and the current frame, and more important reference frames may be allocated more hardware resources according to the position of different reference frames; the motion estimation engine allocated to each reference frame is used to perform motion search on each reference frame to obtain a target block that matches the current block of the current frame; the current frame is encoded according to the difference between the target block and the current block. This disclosure expands the search range of reference frames that are closer to the current frame, has more candidate reference blocks for comparison, and has a higher probability of obtaining a more matching reference block, thereby improving the accuracy of motion estimation and improving video encoding efficiency.

[0067] In some embodiments of this disclosure, reference frames that can be used by the current frame are determined based on a preset number of reference frames and the temporal position of the current frame. One possible approach is to determine the historical frames corresponding to the current frame based on the temporal position of the current frame; if the number of historical frames is greater than the preset number of reference frames, select a preset number of image frames from the historical frames in ascending order of the frame interval between each historical frame and the current frame, and use them as reference frames that can be used by the current frame; if the number of historical frames is less than or equal to the preset number of reference frames, use all historical frames as reference frames that can be used by the current frame. Specifically, the temporal sequence number of the current frame in the video sequence is identified; all decoded image frames preceding the current frame are collected as historical frames. If the number of historical frames is greater than the preset number of reference frames, reference frames need to be selected from the historical frames; if the number of historical frames is less than or equal to the preset number of reference frames, all historical frames are used as reference frames. It should be noted that this disclosure does not limit the preset number of reference frames; the preset number of reference frames can be 2 frames, 4 frames, or 6 frames, etc. For example, if the preset number of reference frames is 4 frames, and the current frame is the second frame, then the historical frame is the first frame, and the first frame is used as the reference frame; if the current frame is the tenth frame, then the sixth, seventh, eighth and ninth frames that are closest to the tenth frame are selected as reference frames.

[0068] In the above embodiments, a preset number of image frames as reference frames are selected from the historical frames according to the ascending order of the frame interval between each historical frame and the current frame. One possible approach is to calculate the frame interval between each historical frame and the current frame; sort the historical frames according to the ascending order of the frame interval; and select the top N historical frames as the reference frame set for the current frame (where N is the preset number of reference frames). This disclosure, through a frame interval-based sorting mechanism, prioritizes selecting historical frames that are temporally closest to the current frame as reference frames, which helps improve the accuracy of tasks such as inter-frame prediction and motion estimation, especially when the video content changes rapidly. Compared to traditional methods that require traversing all historical frames for matching analysis, this disclosure can complete the selection of reference frames through simple frame interval calculation and sorting, greatly reducing computational overhead and improving system operating efficiency.

[0069] In this invention, the enhanced design for motion estimation involves adjustments to the motion estimation architecture. The aim is to make the motion estimation process more efficient, flexible, and adaptive. To achieve this, the data flow and processing modules have been adjusted and rebuilt to support the expanded search scope and more flexible adaptive search.

[0070] This disclosure employs a more flexible allocation logic for the motion estimation engine (ME engine). It can more rationally distribute N motion estimation engines across each reference frame. In existing motion estimation hardware designs, each reference frame often uses the same hardware resources for motion search and computation. However, in this disclosure, the hardware resources used by each reference frame can vary based on its position and importance, achieving better coding efficiency. Taking low-latency coding of two reference frames as an example, if the two reference frames of the current frame are on the same side, the closest reference frame is most similar to the current reference frame and has a greater probability of finding the best-matching reference block. Therefore, the hardware resources (motion estimation engines) that were originally evenly distributed between the two reference frames are now allocated more to the closest reference frame. The search range of the closest reference frame is expanded, with more candidate reference blocks for comparison, resulting in a higher probability of obtaining a more matching reference block, thereby improving motion estimation accuracy and coding efficiency.

[0071] In the above embodiments, motion estimation engines are allocated to each reference frame based on the distance between each reference frame and the current frame. One possible approach is to allocate motion estimation engines to each reference frame in ascending order of the distance between the reference frame and the current frame, and in descending order of the number of motion estimation engines to be allocated. It should be noted that reference frames with smaller distances between them and the current frame are allocated more motion estimation engines, while reference frames with larger distances between them are allocated fewer motion estimation engines.

[0072] Figure 5 This is a schematic diagram illustrating the allocation of a motion estimation engine as an exemplary embodiment of this disclosure. Figure 5 The diagram illustrates how dynamically allocating hardware resources can improve coding efficiency. There are four reference frames and N motion estimation engines. With N motion estimation engines, each reference frame would be evenly distributed among N / 4 engines. After applying dynamic motion estimation engine allocation, N / 2 engines are assigned to the nearest reference frame, N / 4 engines to the second nearest reference frame, and the remaining reference frames are distributed among N / 8 engines.

[0073] In one example embodiment, the current frame is the second frame, the historical frame is the first frame, and there are multiple preset reference frames. In this case, the first frame is used as the reference frame that the current frame can use, and all motion estimation engines are assigned to the first frame.

[0074] It should be noted that in actual encoding, not all reference frames are available at every moment. Taking four-reference-frame low-latency coding as an example, when performing inter-frame motion estimation on the second frame, only the first frame is available as a reference frame. If N engines are evenly distributed across the four reference frames, then 3 / 4N engines will be idle when performing inter-frame motion estimation on the second frame. Therefore, this disclosure introduces dynamic motion engine allocation. When an idle motion engine appears, its computing power is automatically applied to an available area, that is, it is assigned to an unsearched region within an available reference frame for motion estimation search. When there is only one reference frame, all N motion estimation engines will be assigned to a unique reference frame, thereby greatly expanding the search range of a single reference frame and increasing the probability of obtaining more accurate motion estimation results.

[0075] For a set of N motion estimation engines, their allocation can be adjusted based on the number of available reference frames, with each engine capable of adjusting its position within a preset range. If there is only one reference frame, all N motion estimation engines will target it, with each engine having a unique search center offset. This adjustment moves the entire search window, ensuring that the search areas of the N motion estimation engines do not overlap. Deploying N motion estimation engines increases the total search coverage by a factor of N compared to using a single motion estimation engine to perform motion search on a single reference frame. This expansion increases the likelihood of identifying the best match at a lower cost, thereby improving coding efficiency.

[0076] When two reference frames are available, N motion estimation engines can be allocated, with N / 2 engines dedicated to each frame. Considering that the probability of finding the best match in the most recent frame is generally higher, more motion estimation engines can be assigned to the frame closest to the current block, giving it more than N / 2 engines. When the total number of reference frames is K, assuming the total number of motion estimation engines N exceeds the total number of reference frames K, the excess N - K motion estimation engines can be strategically reallocated to certain frames to further expand the motion search area.

[0077] Figure 6 A flowchart illustrating another video encoding method provided as an exemplary embodiment of this disclosure. Figure 6 As shown, the method includes:

[0078] S601: Obtain the current frame to be encoded and the reference frames that can be used by the current frame;

[0079] S602: For the target reference frame, the initial search window is expanded to obtain the target search window; wherein, the target reference frame is the image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than the preset search range;

[0080] S603: Use multiple target motion estimation engines to perform motion search in the target search window in the target reference frame to obtain the target block that matches the current block of the current frame.

[0081] In this embodiment, the execution subject of the above method is a terminal device or a server. For details regarding the specific form of the terminal device or server, please refer to the description in the foregoing embodiments; further elaboration will not be repeated here.

[0082] In this embodiment, the specific methods for obtaining the current frame to be encoded and the reference frames that the current frame can use can be found in the descriptions of the foregoing embodiments, and will not be repeated here.

[0083] In this embodiment, the current frame to be encoded and the reference frames that can be used by the current frame are obtained; for the target reference frame, the initial search window is expanded to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are allocated, and the target search window is smaller than a preset search range; motion search is performed using the target search windows of multiple target motion estimation engines in the target reference frame to obtain a target block that matches the current block of the current frame; this disclosure allocates motion estimation resources to non-overlapping search areas or reference frames, thereby expanding the search range, enhancing the accuracy of motion vector prediction, reducing motion estimation errors, and improving video coding efficiency.

[0084] In some embodiments of this disclosure, a novel method is proposed to expand the lateral and longitudinal motion search range during motion estimation. When more motion estimation hardware resources are available, these resources can be better utilized to expand the search range and enhance the accuracy of motion vector prediction by allocating them to non-overlapping search regions or reference frames. Specifically, the initial search window is expanded to obtain the target search window, including but not limited to the following expansion methods:

[0085] Method 1: Expand the initial search window horizontally to obtain the target search window;

[0086] The second expansion method involves expanding the initial search window vertically to obtain the target search window.

[0087] The third expansion method involves expanding the initial search window horizontally and vertically to obtain the target search window.

[0088] In the first expansion method described above, the initial search window is expanded horizontally to obtain the target search window. One possible approach is to determine a first and a second horizontal search center based on the initial motion search center and the horizontal offset of the initial search window; wherein the horizontal offset is half the length of the initial search window; and the initial search window is expanded based on the first and second horizontal search centers to obtain the target search window. The horizontal expansion search window method provided in this disclosure, by expanding the initial search window horizontally during motion estimation, can more effectively cover the potential matching area of ​​the target block in the reference frame. By using the initial motion search center as a reference and setting the horizontal offset based on half the length of the initial search window, two new horizontal search centers are determined, thereby achieving horizontal expansion of the initial search window. This embodiment is applicable to situations where the target object moves rapidly horizontally in a video sequence, significantly enhancing the adaptability to large-range horizontal displacements. Horizontal expansion expands the search area, effectively reducing the matching omission problem caused by an excessively small initial search window. Compared to the global search strategy, this embodiment makes limited extensions in key directions, which improves search accuracy while controlling computational complexity and improving the overall operating efficiency of the system.

[0089] Figure 7 This is a schematic diagram illustrating a lateral search range expansion provided in an embodiment of this disclosure. For example... Figure 7As shown, the lateral motion estimation range can be expanded by adding an offset x1 to the left and right of the motion search center (x, y). The search range of each motion engine is fixed, so expanding the search range can be viewed as shifting the fixed search range left and right. Taking two motion searches on the same reference frame as an example, the centers of the two motion searches are set at (x – x1, y) and (x + x1, y) respectively, thus achieving the effect of expanding the motion search range. Here, x1 is half the length of the search range and is a fixed value, ensuring that different search ranges do not overlap, maximizing the use of all hardware resources.

[0090] In the second expansion method described above, the initial search window is expanded vertically to obtain the target search window. One possible approach is to determine a first and a second vertical search center based on the initial motion search center and vertical offset of the initial search window; wherein the vertical offset is half the height of the initial search window; and the initial search window is expanded based on the first and second vertical search centers to obtain the target search window. The vertical expansion search window method provided in this embodiment improves the matching accuracy of the target block along the vertical motion path by expanding the initial search window in the vertical direction. This embodiment determines two new vertical search centers based on the initial motion search center and the vertical offset (i.e., half the height of the initial search window), thereby completing the vertical expansion of the search window. This embodiment is particularly suitable for scenarios where the target moves frequently up and down in the image or has a large vertical displacement, effectively improving the robustness of vertical motion estimation; through vertical expansion, the search window is made closer to the actual motion trajectory, reducing the search blind spot caused by the fixed window position; by increasing the search range in the vertical dimension, it helps to find better matching blocks, thereby improving prediction accuracy and video reconstruction quality.

[0091] Figure 8 This is a schematic diagram illustrating a vertical search range expansion provided in an embodiment of this disclosure. For example... Figure 8 As shown, the vertical search range expansion is similar to the horizontal range expansion. An offset y1 is added above and below the motion search center (x, y) to translate the fixed search center to (x, y + y1) and (x, y – y1). Here, y1 is half the height of the search area and is a fixed value to ensure that there are no overlapping areas in the vertical search range.

[0092] In the third expansion method described above, the initial search window is expanded using a horizontal and vertical expansion method to obtain the target search window. One possible approach is to determine a third horizontal search center, a fourth horizontal search center, a third vertical search center, and a fourth vertical search center based on the initial motion search center, horizontal offset, and vertical offset of the initial search window; wherein the horizontal offset is half the length of the initial search window, and the vertical offset is half the height of the initial search window; based on the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center, the initial search window is expanded to obtain the target search window. The horizontal and vertical joint expansion search window method provided in this disclosure comprehensively considers the possible motion paths of the target block in both horizontal and vertical directions, and expands the initial search window bidirectionally to form a more comprehensive target search window. This method combines horizontal and vertical offsets to determine multiple expansion search centers, thereby constructing a larger search area. This disclosure supports motion estimation in both horizontal and vertical directions, and is also applicable to motion modes along oblique or complex paths, significantly improving the flexibility and accuracy of motion estimation. In complex scenarios with occlusion, deformation, or multiple objects moving in opposite directions, expanding the search window can improve the ability to identify true matching blocks and reduce the false matching rate. Compared with traditional large-scale search methods, this method adopts a directional expansion strategy, which reasonably controls computational overhead and memory usage while ensuring search quality, making it suitable for application scenarios that prioritize both high performance and low power consumption.

[0093] Whether expanding horizontally or vertically, the ultimate effect is to double the search range. This number will further increase linearly with the number of motion estimation engines as more hardware resources are utilized. With more computational resources allocated to motion estimation, the search range expansion is no longer limited to a single direction; it can be expanded both horizontally and vertically simultaneously. Different combinations of these methods can be used to stitch together the search region based on the characteristics of the currently encoded video.

[0094] Figure 9 This is a schematic diagram illustrating a horizontal and vertical search range expansion provided in an embodiment of this disclosure. For example... Figure 9 As shown, taking a fourfold search range as an example, expanding both horizontally and vertically simultaneously is more efficient than simple unidirectional expansion. In this case, with the motion search center (x, y) as the center, the new motion search centers are (x – x1, y + y1), (x – x1, y – y1), (x + x1, y + y1), and (x + x1, y – y1). Here, x1 and y1 are half the length and half the width of the search range, respectively. Within the new search range, there are no overlapping regions, increasing the number of candidate most similar blocks and thus improving coding efficiency.

[0095] Another core change in this open-source dataflow enhancement is the introduction of a motion pre-analysis mechanism. This mechanism uses a motion estimation engine as a tool for motion pre-analysis, evaluating the motion direction of the motion estimate before formal encoding, also known as Global Motion Estimation (GME). Obtaining the motion direction before formal encoding allows for a more informed and efficient selection of the search range expansion direction, thereby reducing computational overhead and improving encoding performance.

[0096] The expansion direction of the search window can be changed frame by frame, switching between horizontal and vertical expansion at any time. Without prior information, it is not very effective to reasonably select the horizontal or vertical search range expansion based on the motion direction of the entire frame.

[0097] In the above embodiments, the selection methods for horizontal expansion and vertical expansion include, but are not limited to, the following:

[0098] Option 1 is selected, which defaults to vertically expanding the search window. During video encoding, the initial search window is expanded vertically by default. Since the standard motion search range is typically twice its width, vertically expanding the initial search window doubles its width, transforming the entire search area from a rectangle to a square. This square search window can more evenly cover potential motion vectors from all directions. Compared to the traditional rectangular search window, the square structure is better suited to multi-directional motion, especially in scenarios where the target motion path is unclear or highly variable.

[0099] Option two involves selecting an expansion method based on prior knowledge. For example, when the video content is known to have specific motion characteristics (e.g., the camera captures video with a left-right rotating perspective), the system can proactively expand the initial search window horizontally based on this prior knowledge. That is, using the initial motion search center as a reference, combined with a horizontal offset (half the initial window length), a new horizontal search center is determined, and the search area is expanded accordingly. Given the known motion trend, horizontal expansion significantly improves the ability to capture horizontal motion, thereby increasing encoding efficiency and image quality.

[0100] Option 3 is chosen: an adaptively expanded search window based on two encoding steps. The system employs a two-stage encoding process to determine the final expansion method. During the first encoding, the original video resolution is scaled down to one-quarter for rapid, lower-precision initial encoding to analyze inter-frame motion trends. Based on the motion direction statistics obtained from the first encoding (such as average motion vector distribution), it is determined whether the main motion direction in the video is horizontal or vertical. During the second encoding, the corresponding expansion method (horizontal or vertical expansion) is selected based on this analysis result for high-quality, accurate encoding. Obtaining motion trends through low-resolution pre-encoding guides the search window expansion method in the high-resolution main encoding stage, significantly improving overall encoding efficiency.

[0101] Option 4 involves obtaining the motion vectors of each reference block in the target reference frame; based on the motion vectors, determining the target expansion method for the initial search window. One possible approach is to count the first number of motion vectors whose horizontal component is greater than their vertical component, and the second number of motion vectors whose horizontal component is less than their vertical component; if the first number is greater than the second number, the target expansion method for the initial search window is determined to be a horizontal expansion of the search window; if the first number is less than or equal to the second number, the target expansion method for the initial search window is determined to be a vertical expansion of the search window. This embodiment introduces global motion estimation, guiding the expansion direction of the search range by pre-analyzing the current block at low resolution. In the motion pre-estimation, the motion vectors of each block are counted at low resolution. If the horizontal component (mv.x) of most motion vectors in the frame exceeds their vertical component (mv.y), then a horizontal expansion of the search window is more favorable for EME. On the other hand, if the vertical component (mv.y) of most motion vectors in the frame exceeds their horizontal component (mv.x), then a vertical expansion of the search window is more favorable for EME. The reason for choosing low resolution is that only a rough estimate of the motion direction of the entire frame is needed.

[0102] To further optimize the motion estimation process, this disclosure introduces an adaptive search mechanism. During the CME stage, the adaptive search mechanism increases the search around the current block location center (0,0), compares the search results using the motion vector prediction (MVP) as the search center with those using the current block location center (0,0), and selects the optimal result to further improve coding efficiency. The adaptive search optimizes the search process by dynamically selecting a more suitable search center based on the characteristics of the current frame.

[0103] For a specific block, the larger the search range for motion estimation, the higher the computational complexity. Therefore, a maximum search range limit is set during motion estimation, and no search will exceed this range. However, not every location within this maximum range will be considered as a candidate block for motion estimation. To save computational complexity and resources, only a portion of the area is selected as a reference for motion estimation. Therefore, accurately selecting a specific region within the maximum search range as the actual search area is crucial, as this selection directly affects the accuracy of motion estimation.

[0104] It should be noted that using the Motion Vector Prediction (MVP) as the search center means taking the position pointed to by the endpoint of the MVP as the center of the motion search; using the center of the current block position (0,0) as the search center means taking the position of the current block as the center of the motion search. The initial search window includes: the Motion Vector Prediction search window and the current block search window, and the target search window includes: the first search window and the second search window.

[0105] In each layer of hierarchical motion estimation, there is an initial value, with the position pointed to by the endpoint of the MVP as the center of the motion search. The MVP is generated based on prior information of the surrounding blocks, predicting the approximate direction of the surrounding blocks. However, within the maximum search range, the best-matching block is not necessarily within the search range around the MVP. Another area where the best-matching block has a high probability of appearing is the area around the current block, that is, the search range centered on the current block's position center (0,0).

[0106] In some embodiments of this disclosure, the initial search window is expanded to obtain a target search window. One possible approach is to expand the motion vector prediction search window horizontally or vertically to obtain a first search window; and to expand the current block search window horizontally or vertically to obtain a second search window. The adaptive search centers the search on the position of the current block. The adaptive search range is the same as the search range centered on the MVP, and can perform horizontal or vertical searches to increase the probability of finding the best-matching block. For the horizontally expanded search range, its width is doubled while its height remains unchanged. For the vertically expanded search range, its height is doubled while its width remains unchanged.

[0107] To accommodate the enhanced data flow and flexible expansion of the search range, this disclosure decouples the configuration and control of the motion estimation process from the main encoder core. This decoupling allows the EME to operate more dynamically and programmably, thereby enhancing its adaptability to different coding scenarios and requirements.

[0108] It should be noted that the search window centered on the MVP and the search window centered on the current block location (0,0) do not need to extend in the same direction simultaneously. The following combination can be used:

[0109] Expand the search window horizontally to be centered on the MVP and to be centered on the current block location (0,0);

[0110] Expand the search window vertically to include the MVP and the current block location center (0, 0).

[0111] Expand the search window horizontally to the MVP and vertically to the current block's center (0, 0).

[0112] Expand the search window vertically to the MVP and horizontally to the center of the current block (0,0).

[0113] This disclosure utilizes multiple target motion estimation engines to perform motion search within a target search window of a target reference frame to obtain a target block that matches the current block of the current frame. One possible implementation involves using multiple target motion estimation engines to calculate a predicted motion vector based on information about the current block and its surrounding blocks. The position pointed to by the predicted motion vector is used as the initial search center. Motion search is then performed in a first search window using the initial search center to obtain a first matching block. A motion search is then performed in a second search window using the current block's position as the center to obtain a second matching block. Finally, a target block is selected from the first and second matching blocks. Specifically, this disclosure utilizes multiple target motion estimation engines to calculate an accurate predicted motion vector value based on information about the current block and its surrounding blocks. The position pointed to by this predicted motion vector is set as the initial search center to guide subsequent motion search processes, thereby improving search efficiency and matching accuracy. Further, after obtaining the initial search center, a motion search is first performed within the first search window around the initial search center to obtain the first matching block. Simultaneously, an independent motion search is also performed within the second search window centered on the current block's position to obtain the second matching block. The design of two search windows can focus on rapidly approaching the optimal match and ensuring global search capability, thus balancing speed and quality. After obtaining two candidate matching blocks, the optimal target block is selected from the first and second matching blocks as the final matching result. This disclosure can dynamically adjust the weights according to the characteristics of the current video content, achieving effective adaptation to scenarios with different motion complexity. By introducing multiple motion estimation engines to generate prediction vectors and combining a dual-window search strategy and intelligent selection mechanism, this disclosure can significantly improve the accuracy of motion matching while ensuring coding efficiency, thereby effectively improving the overall compression performance of video coding and the quality of image reconstruction.

[0114] Figure 10 This is a schematic diagram illustrating an adaptive search method provided as an exemplary embodiment of this disclosure. For example... Figure 10 The diagram illustrates a horizontally expanding adaptive search. The current block's center (0, 0) marks its position, and the endpoint (x, y) pointed to by the MVP serves as the search center. The search range is horizontally expanded. The original length is 2x1, and after shifting the original search range left and right by x1, a non-overlapping horizontal search range of length 4x1 is achieved, while the height remains unchanged. Similarly, near the current block's center (0, 0), a horizontal expansion of the search range near the current block's center (0, 0) is achieved by shifting the 2x1 length search range left and right.

[0115] In some embodiments of this disclosure, a target block is selected from a first matching block and a second matching block. One possible approach is to calculate a first absolute difference sum based on each pixel of the first matching block and each pixel of the current block; calculate a second absolute difference sum based on each pixel of the second matching block and each pixel of the current block; and select the matching block with the smallest absolute difference sum from the first and second matching blocks as the target block. Specifically, selecting the matching block with the smaller absolute difference sum among the two matching blocks ensures a higher similarity between the selected matching block and the current block. Embodiments of this disclosure effectively improve the accuracy of matching block selection during motion estimation while avoiding complex rate-distortion cost calculations, thus reducing implementation complexity. By directly comparing pixel-domain differences, not only is search efficiency improved, but good robustness and practicality are also demonstrated in dynamic scenes and low-latency coding applications, contributing to improved overall video coding performance.

[0116] For example, the search range centered on MVP yields the best-matching block within that range, with MV1 being (x1, y1) and a distortion of cost1. The search range centered on the current block's center (0, 0) yields the best-matching block MV2 being (x2, y2) and a distortion of cost2. At the end of the CME phase, the distortions of MV1 and MV2 are compared, and the block with the smaller distortion is selected as the best-matching block obtained throughout the entire CME phase. By adding the range around the current block to the search and automatically comparing the search results, the entire process is an adaptive search.

[0117] Figure 11 This is a flowchart illustrating a video encoding method provided as an exemplary embodiment of the present disclosure. Figure 11 As shown, the method includes:

[0118] S1101: In each layer of the hierarchical motion estimation, at least two independent motion vector searches are performed on the current block to obtain at least two first motion vectors; wherein each first motion vector corresponds to a different region of the target search window;

[0119] S1102: Input at least two first motion vectors as predicted motion vectors into the next layer, and perform multiple motion estimation operations corresponding to the predicted motion vectors in the next layer respectively;

[0120] S1103: In the last layer of hierarchical motion estimation, output at least two second motion vectors;

[0121] S1104: Encode the current frame based on at least two second motion vectors.

[0122] In this embodiment, the execution subject of the above method is a terminal device or a server. For details regarding the specific form of the terminal device or server, please refer to the description in the foregoing embodiments; further elaboration will not be repeated here.

[0123] In this embodiment, the specific methods for obtaining the current frame to be encoded and the reference frames that the current frame can use can be found in the descriptions of the foregoing embodiments, and will not be repeated here.

[0124] In this embodiment, in each layer of hierarchical motion estimation, at least two independent motion vector searches are performed on the current block to obtain at least two first motion vectors; wherein each first motion vector corresponds to a different region of the target search window; the at least two first motion vectors are respectively used as predicted motion vectors and input into the next layer, and multiple motion estimation operations corresponding to the predicted motion vectors are performed in the next layer; in the last layer of hierarchical motion estimation, at least two second motion vectors are output; based on the at least two second motion vectors, the current frame is encoded; this disclosure improves the accuracy of motion estimation and improves video coding efficiency by using hierarchical motion estimation and outputting at least two motion vectors for motion estimation.

[0125] In one embodiment, each layer of the hierarchical motion estimation can output multiple motion vectors. Specifically, there are two first motion vectors, which correspond to the left and right regions of the target search window, respectively.

[0126] In some embodiments of this disclosure, the current frame is encoded based on at least two second motion vectors. One possible approach is to generate multiple candidate rate-distortions (RDDs) based on at least two second motion vectors; select a target RDD from the multiple candidate RDDs; and encode the current frame based on the target RDD. Optionally, the rate-distortion cost corresponding to each candidate RDD is calculated based on the distortion and bit rate; and the target RDD with the minimum rate-distortion cost is selected from the multiple candidate RDDs. The rate-distortion cost calculation formula is as follows:

[0127] cost = D + λ * R;

[0128] Where cost is the rate-distortion cost, D is the distortion, R is the bit rate, and λ is the Lagrange multiplier.

[0129] In some embodiments of this disclosure, the target search window is divided into at least two sub-regions; a first motion vector is selected from each sub-region. This disclosure does not limit the method of dividing the target search window; it can be divided horizontally or vertically, and the number of sub-regions corresponds one-to-one with the number of motion vectors.

[0130] Figure 12 This is a schematic diagram of an EME architecture provided for an exemplary embodiment of this disclosure. (As shown...) Figure 12 As shown, this disclosure focuses on enhancing data flow capabilities to optimize the movement and processing of data within the EME architecture. This includes introducing new data paths and control mechanisms to effectively support proposed architectural modifications.

[0131] The most significant change in the data flow within this disclosed EME architecture is that the inputs and outputs of each layer of hierarchical motion estimation are doubled. Taking CME as an example, instead of selecting only one optimal MV in the horizontally expanded search window, two MVs are retained: one from the left portion of the search window and one from the right portion. Both MVs are passed to the next layer, providing the search center location as the MVP for that layer. Because two values ​​are passed, two complete searches are performed in the new layer, each using one of the two passed-in MVs as the search center. At each layer of hierarchical motion estimation, an additional MV is output per frame.

[0132] The final layer of FME in hierarchical motion estimation outputs additional MVs to subsequent processing. Based on these additional MVs, additional RDO candidates (rate-distortion candidates) are generated and competed for based on their distortion and rate. The main purpose of the additional inputs and outputs in each layer of hierarchical motion estimation is to increase the chances of finding better RDO candidates. For example, the first layer has two best-matching MVs, MV1 and MV2, with rate-distortion costs of Cost1 and Cost2, respectively. The result of MV1 is finding an RDO candidate cand1 with a rate-distortion cost of rdo_cost1, while the result of MV2 is finding an RDO candidate cand2 with a cost of rdo_cost2. Even if Cost1 in the first layer is greater than Cost2, rdo_cost1 can still be lower than rdo_cost2. In other words, the higher-cost MV in the first layer can also yield a better, lower-cost RDO candidate after undergoing detailed motion estimation.

[0133] In hierarchical motion estimation, the distortion and bit rate calculations for each layer are rough estimates, while the corresponding calculations in RDO are much more precise. Therefore, the new data stream in EME helps to find MVs that might be discarded in motion estimation but can find lower-cost RDO candidates.

[0134] For hardware, there is a very long time between issuing a memory (DRAM) data read request and obtaining the actual data; this time will be referred to as memory read latency. This time is much longer than the time required to read from hardware local registers.

[0135] To ensure pixel search speed, a large amount of pixel reference information needs to be pre-stored from memory into local registers. This ensures that most data that needs to be repeatedly read can be obtained in the shortest possible time. As the pixel search area increases, the amount of data required for the search also increases, ultimately leading to an increase in the size of the local registers. Since the data transfer speed of each memory (DRAM) chip is limited, the number of memory chips cannot be increased at will to increase the transfer speed. Therefore, to fill more local registers, the hardware needs to wait longer to fill the local registers from memory. To optimize memory data transfer, one approach is to maximize the utilization efficiency of register data to reduce unnecessary memory data requests.

[0136] In one approach, during the pixel search process of the ME engine, for each reference original data block, it is necessary to translate and traverse all reference original data blocks in two-dimensional space, and search for the best matching pixel position near it as the center point. Local registers are responsible for storing the pixel information to be searched. Since the new data that must be retrieved from memory (DRAM) each time the reference original data block position is translated in two dimensions is only a relatively small portion, most of the data can reuse the data already existing in the local registers. This allows for minimizing the number of memory read requests by only updating the new data, ultimately saving memory bandwidth. To implement this algorithm, a method called logical memory is used. Logical memory refers to using general memory in conjunction with special address-related logic. When the upper-level logic passes in a memory address, this memory address is translated into the actual memory address along with additional input parameters (such as the row and column number of the current original data block in two-dimensional space). Therefore, the value of the actual memory address can be changed by only changing the additional input parameters, while keeping the passed memory address unchanged. By dividing the registers storing data into many logical register blocks, each time the original data coordinates are translated and updated, the register data in the two-dimensional space does not need to be repeatedly read from memory. Only a minimum amount of new data needs to be retrieved, and the existing data will be logically mapped to the new corresponding input address. Ultimately, each memory (DRAM) data request only needs to retrieve a small portion of new data. Therefore, the DRAM bandwidth utilization can be significantly improved.

[0137] A typical search engine has only one pixel search window center, but this center has a limited range because the actual search center is a combination of the search center origin and the predicted search center vector (a two-dimensional vector starting from the origin). To cover all possible search center ranges, more data than the actual number of pixels being searched is retrieved from memory. This results in a significant delay between issuing a memory read request for new data and receiving a response from memory. This delay is typically longer than the time required to search all locally stored pixels. To maximize the utilization of this memory read latency, additional search centers are added. These new search centers are used to search the origin of the current search center again after the normal search center has been completed. Because the search center positions are different before and after, the total area of ​​pixels actually searched is further expanded. All the data waiting time before new data arrives is used for further pixel searches, ultimately improving memory bandwidth utilization efficiency.

[0138] To mitigate the risk of excessive bandwidth consumption, particularly in pre-analysis mode, this disclosure proposes a compression technique for raw image transmission. This method optimizes the data stream, reduces bandwidth requirements, and does not compromise the quality of motion estimation.

[0139] This disclosure successfully integrates each CME module into a general-purpose module by redesigning the module input. Data dependencies between CME modules are managed, coordinated, and synchronized uniformly through a dedicated module. This design allows for flexible increases / decreases in the number of CME modules. The search area can be further increased or decreased based on actual hardware design and customer needs. Simultaneously, the input of the CME modules is controlled via firmware as much as possible. It is even possible to achieve irregular search areas or multiple search area regions (each region being non-adjacent) solely through firmware design.

[0140] Figure 13 This is a schematic diagram of the structure of a video encoding apparatus 130 provided for an exemplary embodiment of this disclosure. (See diagram below.) Figure 13 As shown, the video encoding device 130 includes: an acquisition module 1301, a determination module 1302, an allocation module 1303, a search module 1304, and an encoding module 1305.

[0141] The acquisition module 1301 is used to acquire the current frame to be encoded.

[0142] The determining module 1302 is used to determine the reference frames that can be used for the current frame based on the preset number of reference frames and the timing position of the current frame;

[0143] The allocation module 1303 is used to allocate the motion estimation engine to each reference frame according to the relationship between the frame spacing of each reference frame and the current frame;

[0144] The search module 1304 is used to perform motion search on each reference frame using the motion estimation engine assigned to each reference frame, and obtain the target block that matches the current block of the current frame.

[0145] The encoding module 1305 is used to encode the current frame based on the difference between the target block and the current block.

[0146] Optionally, when determining the reference frames that can be used for the current frame based on the preset number of reference frames and the timing position of the current frame, the determining module 1302 is used to:

[0147] Determine the historical frame corresponding to the current frame based on the temporal position of the current frame;

[0148] If the number of historical frames is greater than the number of preset reference frames, select a preset number of image frames from the historical frames in ascending order of the frame spacing between each historical frame and the current frame, and use them as reference frames that can be used in the current frame.

[0149] If the number of historical frames is less than or equal to the number of preset reference frames, all historical frames are used as reference frames for the current frame.

[0150] Optionally, the current frame is the second frame, the historical frame is the first frame, and there are multiple preset reference frames. When the number of historical frames is less than or equal to the preset number of reference frames, the determining module 1302 uses all historical frames as reference frames that can be used for the current frame, and performs the following:

[0151] Use the first frame as the reference frame that can be used in the current frame;

[0152] Based on the frame interval relationship between each reference frame and the current frame, the motion estimation engine is assigned to each reference frame, including:

[0153] Allocate all motion estimation engines to the first frame.

[0154] Optionally, when allocating the motion estimation engine to each reference frame based on the frame spacing relationship between each reference frame and the current frame, the allocation module 1303 is used to:

[0155] Motion estimation engines are assigned to each reference frame in ascending order of the inter-frame spacing between each reference frame and the current frame, and in descending order of the number of motion estimation engines assigned.

[0156] Optionally, when the search module 1304 performs motion search on each reference frame using the motion estimation engine assigned to each reference frame, it is used to:

[0157] For the target reference frame, the initial search window is expanded to obtain the target search window; where the target reference frame is the image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than the preset search range;

[0158] Motion search is performed in the target search window within the target reference frame.

[0159] Optionally, when the search module 1304 expands the initial search window to obtain the target search window, it includes any of the following expansion methods:

[0160] The initial search window is expanded horizontally to obtain the target search window;

[0161] The initial search window is expanded vertically to obtain the target search window;

[0162] The initial search window is expanded using a horizontal and vertical expansion method to obtain the target search window.

[0163] Optionally, when the search module 1304 expands the initial search window using a horizontally expanding search window method to obtain the target search window, it is used to:

[0164] Based on the initial motion search center and lateral offset of the initial search window, determine the first lateral search center and the second lateral search center; wherein, the lateral offset is half the length of the initial search window;

[0165] Based on the first and second horizontal search centers, the initial search window is expanded to obtain the target search window.

[0166] Optionally, when the search module 1304 expands the initial search window using a vertically expanding search window method to obtain the target search window, it is used to:

[0167] Based on the initial motion search center and vertical offset of the initial search window, determine the first vertical search center and the second vertical search center; wherein, the vertical offset is half the height of the initial search window;

[0168] Based on the first and second vertical search centers, the initial search window is expanded to obtain the target search window.

[0169] Optionally, when the search module 1304 expands the initial search window using a horizontal and vertical expansion method to obtain the target search window, it is used to:

[0170] Based on the initial motion search center, horizontal offset, and vertical offset of the initial search window, determine the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center; wherein, the horizontal offset is half the length of the initial search window, and the vertical offset is half the height of the initial search window;

[0171] Based on the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center, the initial search window is expanded to obtain the target search window.

[0172] Optionally, when expanding the initial search window to obtain the target search window, the search module 1304 is used to:

[0173] Obtain the motion vector of each reference block in the target reference frame;

[0174] Based on the motion vector, determine the target expansion method for the initial search window;

[0175] The initial search window is expanded using a target expansion method to obtain the target search window.

[0176] Optionally, the target expansion method includes: horizontal expansion of the search window and vertical expansion of the search window. When determining the target expansion method for the initial search window based on the motion vector, the search module 1304 is used to:

[0177] The first number of motion vectors whose horizontal component is greater than their vertical component is counted, and the second number of motion vectors whose horizontal component is less than their vertical component is counted.

[0178] If the first number is greater than the second number, then the target expansion method for the initial search window is determined to be a horizontal expansion of the search window;

[0179] If the first quantity is less than or equal to the second quantity, then the target expansion method for the initial search window is determined to be a vertical expansion of the search window.

[0180] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0181] Figure 14 This is a schematic diagram of the structure of a video encoding apparatus 140 provided for an exemplary embodiment of this disclosure. Figure 14 As shown, the video encoding device 140 includes: an acquisition module 1401, an expansion module 1402, and a search module 1403.

[0182] The acquisition module 1401 is used to acquire the current frame to be encoded and the reference frames that can be used by the current frame;

[0183] Extension module 1402 is used to expand the initial search window for the target reference frame to obtain the target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than the preset search range;

[0184] The search module 1403 is used to perform motion search in the target search window of the target reference frame using multiple target motion estimation engines to obtain the target block that matches the current block of the current frame.

[0185] Optionally, when the extension module 1402 extends the initial search window to obtain the target search window, it includes any of the following extension methods:

[0186] The initial search window is expanded horizontally to obtain the target search window;

[0187] The initial search window is expanded vertically to obtain the target search window;

[0188] The initial search window is expanded using a horizontal and vertical expansion method to obtain the target search window.

[0189] Optionally, when the expansion module 1402 expands the initial search window using a horizontally expanded search window method to obtain the target search window, it is used to:

[0190] Based on the initial motion search center and lateral offset of the initial search window, determine the first lateral search center and the second lateral search center; wherein, the lateral offset is half the length of the initial search window;

[0191] Based on the first and second horizontal search centers, the initial search window is expanded to obtain the target search window.

[0192] Optionally, when the expansion module 1402 expands the initial search window using a vertically expanding search window method to obtain the target search window, it is used to:

[0193] Based on the initial motion search center and vertical offset of the initial search window, determine the first vertical search center and the second vertical search center; wherein, the vertical offset is half the height of the initial search window;

[0194] Based on the first and second vertical search centers, the initial search window is expanded to obtain the target search window.

[0195] Optionally, when the expansion module 1402 expands the initial search window using a horizontal and vertical expansion method to obtain the target search window, it is used to:

[0196] Based on the initial motion search center, horizontal offset, and vertical offset of the initial search window, determine the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center; wherein, the horizontal offset is half the length of the initial search window, and the vertical offset is half the height of the initial search window;

[0197] Based on the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center, the initial search window is expanded to obtain the target search window.

[0198] Optionally, when expanding the initial search window to obtain the target search window, the extension module 1402 is used for:

[0199] Obtain the motion vector of each reference block in the target reference frame;

[0200] Based on the motion vector, determine the target expansion method for the initial search window;

[0201] The initial search window is expanded using a target expansion method to obtain the target search window.

[0202] Optionally, the target expansion method includes: horizontal expansion of the search window and vertical expansion of the search window. When determining the target expansion method for the initial search window based on the motion vector, the expansion module 1402 is used to:

[0203] The first number of motion vectors whose horizontal component is greater than their vertical component is counted, and the second number of motion vectors whose horizontal component is less than their vertical component is counted.

[0204] If the first number is greater than the second number, then the target expansion method for the initial search window is determined to be a horizontal expansion of the search window;

[0205] If the first quantity is less than or equal to the second quantity, then the target expansion method for the initial search window is determined to be a vertical expansion of the search window.

[0206] Optionally, the initial search window includes a motion vector prediction search window and a current block search window, and the target search window includes a first search window and a second search window. When expanding the initial search window to obtain the target search window, the extension module 1402 is used for:

[0207] The motion vector prediction search window is expanded by either horizontal or vertical expansion to obtain the first search window;

[0208] The current block search window is expanded by either horizontal or vertical expansion to obtain a second search window.

[0209] Optionally, when the search module 1403 performs motion search in the target search window of the target reference frame using multiple target motion estimation engines to obtain a target block that matches the current block of the current frame, it is used to:

[0210] Using multiple target motion estimation engines, motion vector predictions are calculated based on information about the current block and its surrounding blocks. The location pointed to by the motion vector predictions is used as the initial search center.

[0211] Using the initial search center, perform a motion search in the first search window to obtain the first matching block;

[0212] Using the current block's center as the starting point, perform a motion search in the second search window to obtain the second matching block;

[0213] Select the target block from the first matching block and the second matching block.

[0214] Optionally, when selecting a target block from the first matching block and the second matching block, the search module 1403 is used to:

[0215] Calculate the first absolute difference sum based on each pixel of the first matching block and each pixel of the current block;

[0216] Calculate the second absolute difference sum based on each pixel of the second matching block and each pixel of the current block;

[0217] Select the matching block with the smallest absolute difference from the first matching block and the second matching block as the target block.

[0218] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0219] Figure 15 This is a schematic diagram of the structure of a video encoding apparatus 150 provided for an exemplary embodiment of this disclosure. Figure 15 As shown, the video encoding device 150 includes: a search module 1501, an execution module 1502, an output module 1503, and an encoding module 1504.

[0220] The search module 1501 is used to perform at least two independent motion vector searches on the current block in each layer of the hierarchical motion estimation to obtain at least two first motion vectors; wherein each first motion vector corresponds to a different region of the target search window.

[0221] The execution module 1502 is used to input at least two first motion vectors as predicted motion vectors into the next layer, and to perform multiple motion estimation operations corresponding to the predicted motion vectors in the next layer.

[0222] Output module block 1503 is used to output at least two second motion vectors in the last layer of hierarchical motion estimation;

[0223] The encoding module 1504 is used to encode the current frame based on at least two second motion vectors.

[0224] Optionally, when encoding the current frame based on at least two second motion vectors, the encoding module 1504 is used to:

[0225] Multiple candidate rate distortions are generated based on at least two second motion vectors;

[0226] Select the target rate distortion from multiple candidate rate distortions;

[0227] The current frame is encoded based on the target rate distortion.

[0228] Optionally, when selecting the target rate-distortion from multiple candidate rate-distortions, the encoding module 1504 is used to:

[0229] Calculate the rate-distortion cost for each candidate rate-distortion based on the distortion and bit rate;

[0230] Select the target rate distortion with the lowest rate distortion cost from multiple candidate rate distortions.

[0231] Optionally, the encoding module 1504 can also be used for:

[0232] Divide the target search window into at least two sub-regions;

[0233] Select a first motion vector from each sub-region.

[0234] Optionally, there are two first motion vectors, which correspond to the left and right regions of the target search window, respectively.

[0235] Optionally, the hierarchical motion estimation includes coarse motion estimation, fine motion estimation, and fractional motion estimation connected in series.

[0236] Optionally, the encoding module 1504 can also be used for:

[0237] For the target reference frame, the initial search window is expanded to obtain the target search window; where the target reference frame is the image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than the preset search range;

[0238] Multiple target motion estimation engines are used to perform motion search in the target search window in the target reference frame to obtain the target block that matches the current block in the current frame.

[0239] Optionally, when the encoding module 1504 expands the initial search window to obtain the target search window, it includes any of the following expansion methods:

[0240] The initial search window is expanded horizontally to obtain the target search window;

[0241] The initial search window is expanded vertically to obtain the target search window;

[0242] The initial search window is expanded using a horizontal and vertical expansion method to obtain the target search window.

[0243] Optionally, when the encoding module 1504 expands the initial search window using a horizontally expanding search window method to obtain the target search window, it is used to:

[0244] Based on the initial motion search center and lateral offset of the initial search window, determine the first lateral search center and the second lateral search center; wherein, the lateral offset is half the length of the initial search window;

[0245] Based on the first and second horizontal search centers, the initial search window is expanded to obtain the target search window.

[0246] Optionally, when the encoding module 1504 expands the initial search window using a vertically expanding search window method to obtain the target search window, it is used to:

[0247] Based on the initial motion search center and vertical offset of the initial search window, determine the first vertical search center and the second vertical search center; wherein, the vertical offset is half the height of the initial search window;

[0248] Based on the first and second vertical search centers, the initial search window is expanded to obtain the target search window.

[0249] Optionally, when the encoding module 1504 expands the initial search window using a horizontal and vertical expansion method to obtain the target search window, it is used to:

[0250] Based on the initial motion search center, horizontal offset, and vertical offset of the initial search window, determine the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center; wherein, the horizontal offset is half the length of the initial search window, and the vertical offset is half the height of the initial search window;

[0251] Based on the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center, the initial search window is expanded to obtain the target search window.

[0252] Figure 16 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present disclosure. For example... Figure 16 As shown, the electronic device includes a memory 161 and a processor 162. Additionally, the electronic device also includes a power supply component 163 and a communication component 164.

[0253] Memory 161 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.

[0254] The memory 161 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0255] Communication component 164 is used for data transmission with other devices.

[0256] The processor 162 can execute computer instructions stored in the memory 161 to: acquire the current frame to be encoded; determine the reference frames that can be used for the current frame according to the preset number of reference frames and the temporal position of the current frame; allocate the motion estimation engine to each reference frame according to the relationship between the frame spacing of each reference frame and the current frame; perform motion search on each reference frame using the motion estimation engine allocated to each reference frame to obtain the target block that matches the current block of the current frame; and perform encoding operation on the current frame according to the difference between the target block and the current block.

[0257] Accordingly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores a computer program, and the computer program is executed by one or more processors, it causes one or more processors to perform... Figure 4 Each step in the method embodiment.

[0258] Accordingly, embodiments of this disclosure also provide a computer program product, which includes a computer program / instructions that are executed by a processor. Figure 4 Each step in the method embodiment.

[0259] Figure 17 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present disclosure. For example... Figure 17 As shown, the electronic device includes a memory 171 and a processor 172. Additionally, the electronic device also includes a power supply component 173 and a communication component 174.

[0260] Memory 171 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.

[0261] The memory 171 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0262] Communication component 174 is used for data transmission with other devices.

[0263] The processor 172 can execute computer instructions stored in the memory 171 to: acquire the current frame to be encoded and reference frames that can be used by the current frame; expand the initial search window for the target reference frame to obtain a target search window; wherein the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than a preset search range; perform motion search using the target search window in the target reference frame by the multiple target motion estimation engines to obtain a target block that matches the current block of the current frame.

[0264] Accordingly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores a computer program, and the computer program is executed by one or more processors, it causes one or more processors to perform... Figure 6 Each step in the method embodiment.

[0265] Accordingly, embodiments of this disclosure also provide a computer program product, which includes a computer program / instructions that are executed by a processor. Figure 6 Each step in the method embodiment.

[0266] Figure 18 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present disclosure. For example... Figure 18 As shown, the electronic device includes a memory 181 and a processor 182. Additionally, the electronic device also includes a power supply component 183 and a communication component 184.

[0267] Memory 181 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.

[0268] The memory 181 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0269] Communication component 184 is used for data transmission with other devices.

[0270] The processor 182 is executable computer instructions stored in the memory 181 for: performing at least two independent motion vector searches on the current block in each layer of hierarchical motion estimation to obtain at least two first motion vectors; wherein each first motion vector corresponds to a different region of the target search window; inputting the at least two first motion vectors as predicted motion vectors into the next layer, and performing multiple motion estimation operations corresponding to the predicted motion vectors in the next layer; outputting at least two second motion vectors in the last layer of hierarchical motion estimation; and performing encoding operations on the current frame based on the at least two second motion vectors.

[0271] Accordingly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores a computer program, and the computer program is executed by one or more processors, it causes one or more processors to perform... Figure 11 Each step in the method embodiment.

[0272] Accordingly, embodiments of this disclosure also provide a computer program product, which includes a computer program / instructions that are executed by a processor. Figure 11 Each step in the method embodiment.

[0273] The above Figure 16 , Figure 17 , Figure 18 The communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0274] The above Figure 16 , Figure 17 , Figure 18 The power supply component provides power to the various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which it resides.

[0275] The aforementioned electronic devices also include a display screen and audio components.

[0276] The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions, but also the duration and pressure associated with the touch or swipe operation.

[0277] An audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals may be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0278] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0279] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0280] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0281] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0282] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0283] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0284] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0285] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0286] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A video encoding method, characterized in that, include: Obtain the current frame to be encoded and the reference frames that can be used by the current frame; For a target reference frame, the initial search window is expanded to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than a preset search range; Motion search is performed using multiple target motion estimation engines in the target reference frame to obtain a target block that matches the current block of the current frame; The initial search window includes a motion vector prediction search window and a current block search window; the target search window includes a first search window and a second search window; expanding the initial search window to obtain the target search window includes: The motion vector prediction search window is expanded by either horizontal or vertical expansion to obtain the first search window; The current block search window is expanded using either a horizontal or vertical expansion method to obtain the second search window; The step of using multiple target motion estimation engines to perform motion search in the target search window of the target reference frame to obtain the target block that matches the current block of the current frame includes: Using multiple target motion estimation engines, motion vector predictions are calculated based on information about the current block and its surrounding blocks. The location pointed to by the motion vector predictions is used as the initial search center. Using the initial search center, perform a motion search in the first search window to obtain the first matching block; Using the current block's center as the starting point, perform a motion search in the second search window to obtain the second matching block; Select the target block from the first matching block and the second matching block.

2. The method according to claim 1, characterized in that, The expansion of the initial search window to obtain the target search window includes any of the following expansion methods: The initial search window is expanded horizontally to obtain the target search window; The initial search window is expanded using a vertically expanding search window method to obtain the target search window; The initial search window is expanded using a horizontal and vertical expansion method to obtain the target search window.

3. The method according to claim 2, characterized in that, The expansion of the initial search window using a horizontally expanding search window method to obtain the target search window includes: Based on the initial motion search center and lateral offset of the initial search window, a first lateral search center and a second lateral search center are determined; wherein, the lateral offset is half the length of the initial search window; Based on the first horizontal search center and the second horizontal search center, the initial search window is expanded to obtain the target search window.

4. The method according to claim 2, characterized in that, The initial search window is expanded using a vertically expanding search window method to obtain the target search window, including: Based on the initial motion search center and vertical offset of the initial search window, a first vertical search center and a second vertical search center are determined; wherein, the vertical offset is half the height of the initial search window; The initial search window is expanded based on the first vertical search center and the second vertical search center to obtain the target search window.

5. The method according to claim 2, characterized in that, The expansion of the initial search window using a horizontal and vertical expansion method to obtain the target search window includes: Based on the initial motion search center, horizontal offset, and vertical offset of the initial search window, a third horizontal search center, a fourth horizontal search center, a third vertical search center, and a fourth vertical search center are determined; wherein, the horizontal offset is half the length of the initial search window, and the vertical offset is half the height of the initial search window; The initial search window is expanded based on the third horizontal search center, the fourth horizontal search center, the third vertical search center, and the fourth vertical search center to obtain the target search window.

6. The method according to claim 1, characterized in that, The process of expanding the initial search window to obtain the target search window includes: Obtain the motion vector of each reference block in the target reference frame; Based on the motion vector, determine the target expansion method for the initial search window; The initial search window is expanded using the target expansion method to obtain the target search window.

7. The method according to claim 6, characterized in that, The target expansion method includes: horizontal expansion of the search window and vertical expansion of the search window. Determining the target expansion method for the initial search window based on the motion vector includes: The first number of motion vectors whose horizontal component is greater than their vertical component is counted, and the second number of motion vectors whose horizontal component is less than their vertical component is counted. If the first quantity is greater than the second quantity, then the target expansion method for the initial search window is determined to be the horizontal expansion search window; If the first quantity is less than or equal to the second quantity, then the target expansion method for the initial search window is determined to be the vertically expanded search window.

8. The method according to claim 1, characterized in that, The step of using multiple target motion estimation engines to perform motion search in the target reference frame through target search windows to obtain a target block that matches the current block of the current frame includes: Using multiple target motion estimation engines, motion vector predictions are calculated based on information about the current block and its surrounding blocks. The position pointed to by the motion vector predictions is used as the initial search center. Using the initial search center, a motion search is performed in the first search window to obtain the first matching block; A motion search is performed in the second search window with the current block position center to obtain the second matching block; The target block is selected from the first matching block and the second matching block.

9. The method according to claim 8, characterized in that, Selecting the target block from the first matching block and the second matching block includes: Calculate the first absolute difference sum based on each pixel of the first matching block and each pixel of the current block; Calculate the second absolute difference sum based on each pixel of the second matching block and each pixel of the current block; The matching block with the smallest absolute difference between the first matching block and the second matching block is selected as the target block.

10. A video encoding device, characterized in that, include: The acquisition module is used to acquire the current frame to be encoded and the reference frames that can be used by the current frame; An extension module, for a target reference frame, is used to expand the initial search window to obtain a target search window; wherein, the target reference frame is an image frame in the reference frame to which multiple target motion estimation engines are assigned, and the target search window is smaller than a preset search range; The search module is used to perform motion search in the target reference frame using multiple target motion estimation engines to obtain a target block that matches the current block of the current frame. The initial search window includes a motion vector prediction search window and a current block search window, and the target search window includes a first search window and a second search window; When the expansion module expands the initial search window to obtain the target search window, it is also used to: The motion vector prediction search window is expanded by either horizontal or vertical expansion to obtain the first search window; The current block search window is expanded using either a horizontal or vertical expansion method to obtain the second search window; When the search module performs motion search in the target search window of the target reference frame using multiple target motion estimation engines to obtain the target block that matches the current block of the current frame, it is also used to: Using multiple target motion estimation engines, motion vector predictions are calculated based on information about the current block and its surrounding blocks. The location pointed to by the motion vector predictions is used as the initial search center. Using the initial search center, perform a motion search in the first search window to obtain the first matching block; Using the current block's center as the starting point, perform a motion search in the second search window to obtain the second matching block; Select the target block from the first matching block and the second matching block.

11. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute instructions to implement the steps of the method as described in any one of claims 1-10.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.

13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Motion estimation core of video system

    CN101146222A

  • Limited memory access window for motion vector correction

    CN115243050A