Image unit motion estimation method and device, storage medium and electronic device

By adjusting the search range within the reference image range, motion estimation is achieved within a smaller range, which improves efficiency and accuracy and solves the problem of low efficiency of motion estimation in the prior art.

CN114173129BActive Publication Date: 2025-10-03BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010955436.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-11
Publication Date
2025-10-03
Estimated Expiration
2040-09-11

AI Technical Summary

Technical Problem

In the prior art, when the resolution of the image to be encoded is large, the motion estimation method based on a special position takes a long time to estimate the motion, resulting in low efficiency.

Method used

A reference unit matching the first image unit is searched within a first image range of the reference image, and when the distance is less than or equal to a target distance threshold, the search range is adjusted to a second image range, thereby reducing resource consumption by performing motion estimation within a smaller range.

Benefits of technology

The efficiency and accuracy of motion estimation are improved, and the problem of low efficiency of motion estimation is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114173129B_ABST
    Figure CN114173129B_ABST
Patent Text Reader

Abstract

The present application provides a method and apparatus, storage medium, and electronic device for motion estimation of an image unit, wherein the method comprises: searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit in an image to be encoded for motion estimation; when the distance between a boundary of the first reference unit and a boundary of the first image range is less than or equal to a target distance threshold, adjusting the search range corresponding to the first image unit from the first image range to a second image range; and searching for a second reference unit matching the first image unit within the second image range. This application solves the problem of low motion estimation efficiency in motion estimation methods in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image coding and decoding, and in particular to a method and device for motion estimation of an image unit, a storage medium, and an electronic device. Background Art

[0002] Motion estimation is a crucial step in video coding. By effectively characterizing motion in the video, the encoder significantly simplifies the representation cost of each image frame, thereby improving compression efficiency by hundreds of times. However, for videos with common resolutions, motion estimation based on brute-force search is impractical due to limited computing power. Therefore, various fast motion estimation strategies are commonly used in video encoders.

[0003] Fast motion estimation algorithms in related technologies generally rely on the local continuity of similar image blocks, establishing certain fast motion estimation rules on a reference image. These algorithms typically begin by searching for specific locations on the reference image frame and then performing some fine-tuning to obtain the motion estimation results.

[0004] However, in the above-mentioned motion estimation method based on a specific position, when the resolution of the image to be encoded is relatively high, the time required for motion estimation is still relatively long, resulting in a problem of low efficiency of motion estimation. Summary of the Invention

[0005] The present application provides a method and device for motion estimation of an image unit, a storage medium, and an electronic device, so as to at least solve the problem of low efficiency of motion estimation in motion estimation methods in related arts.

[0006] According to one aspect of an embodiment of the present application, a method for motion estimation of an image unit is provided, comprising: searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit to be motion estimated in an image to be encoded; when the distance between a boundary of the first reference unit and a boundary of the first image range is less than or equal to a target distance threshold, adjusting the search range corresponding to the first image unit from the first image range to a second image range; and searching for a second reference unit matching the first image unit within the second image range.

[0007] Optionally, searching for the first reference unit that matches the first image unit within the first image range of the reference image includes: searching for multiple candidate reference units within the first image range according to the first image unit; and selecting the first reference unit from the multiple candidate reference units according to the degree of similarity between each candidate reference unit and the first image unit.

[0008] Optionally, before adjusting the search range corresponding to the first image unit from the first image range to the second image range, the method also includes one of the following: determining that the shortest distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, wherein the target distance threshold is greater than zero; determining that the boundary of the first reference unit overlaps with the boundary of the first image range, wherein the target distance threshold is zero; determining that the motion vector between the first image unit and the first reference unit points to the boundary of the first image range, wherein the target distance threshold is zero.

[0009] Optionally, adjusting the search range corresponding to the first image unit from the first image range to the second image range includes at least one of the following: expanding the first image range to the second image range, wherein the second image range contains the first image range, and the distance between the boundary of the first reference unit and the boundary of the second image range is greater than the target distance threshold; moving the first image range to obtain the second image range, wherein the distance between the boundary of the first reference unit and the boundary of the second image range is greater than the target distance threshold.

[0010] Optionally, after searching for a second reference unit matching the first image unit within the range of the second image, the method further includes: obtaining a second image unit to be motion estimated in the image to be encoded, wherein the image to be encoded uses image units of multiple different sizes for motion estimation, and the size of the second image unit is a target size; in the case where the second image unit is covered by multiple third image units, determining a second motion vector corresponding to the second image unit based on multiple first motion vectors corresponding to the multiple third image units, wherein the multiple third image units correspond one-to-one to the multiple first motion vectors, and the size of each third image unit is different from the target size.

[0011] Optionally, determining the second motion vector corresponding to the second image unit based on the multiple first motion vectors corresponding to the multiple third image units includes: performing weighted summation on the multiple first motion vectors corresponding to the multiple third image units to obtain the second motion vector corresponding to the second image unit.

[0012] Optionally, performing weighted summation on multiple first motion vectors corresponding to multiple third image units to obtain the second motion vector corresponding to the second image unit includes: determining the weight of each third image unit according to the ratio of the area of ​​each third image unit to the area of ​​the second image unit; and performing weighted summation on multiple first motion vectors corresponding to multiple third image units according to the weight of each third image unit to obtain the second motion vector corresponding to the second image unit.

[0013] Optionally, after searching for a second reference unit matching the first image unit within the range of the second image, the method further includes: determining the relative displacement between the first image unit and the second reference unit as a third motion vector corresponding to the first image unit; and encoding the first image unit according to the third motion vector to obtain an encoding result corresponding to the first image unit.

[0014] According to another aspect of an embodiment of the present application, a motion estimation device for an image unit is provided, comprising: a first search unit, configured to search for a first reference unit matching the first image unit within a first image range of a reference image, wherein the first image unit is an image unit to be motion estimated in an image to be encoded; an adjustment unit, configured to adjust the search range corresponding to the first image unit from the first image range to a second image range when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold; and a second search unit, configured to search for a second reference unit matching the first image unit within the second image range.

[0015] Optionally, the first search unit includes: a search module for searching for multiple candidate reference units within the first image range according to the first image unit; and a selection module for selecting the first reference unit from the multiple candidate reference units according to the degree of similarity between each candidate reference unit and the first image unit.

[0016] Optionally, the device further includes one of the following: a first determination unit, used to determine that the shortest distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold before adjusting the search range corresponding to the first image unit from the first image range to the second image range, wherein the target distance threshold is greater than zero; a second determination unit, used to determine that the boundary of the first reference unit overlaps with the boundary of the first image range, wherein the target distance threshold is zero; a third determination unit, used to determine that the motion vector between the first image unit and the first reference unit points to the boundary of the first image range, wherein the target distance threshold is zero.

[0017] Optionally, the adjustment unit includes at least one of the following: an expansion module, used to expand the first image range to the second image range, wherein the second image range contains the first image range, and the distance between the boundary of the first reference unit and the boundary of the second image range is greater than the target distance threshold; a moving module, used to move the first image range to obtain the second image range, wherein the distance between the boundary of the first reference unit and the boundary of the second image range is greater than the target distance threshold.

[0018] Optionally, the device also includes: an acquisition unit, used to search for a second reference unit matching the first image unit within the range of the second image, and then acquire a second image unit to be motion estimated in the image to be encoded, wherein the image to be encoded uses image units of multiple different sizes for motion estimation, and the size of the second image unit is the target size; a fourth determination unit, used to determine, when the second image unit is covered by multiple third image units, the second motion vector corresponding to the second image unit based on multiple first motion vectors corresponding to the multiple third image units, wherein the multiple third image units correspond one-to-one to the multiple first motion vectors, and the size of each third image unit is different from the target size.

[0019] Optionally, the fourth determining unit includes: a summing module, configured to perform weighted summation on a plurality of first motion vectors corresponding to a plurality of third image units to obtain the second motion vector corresponding to the second image unit.

[0020] Optionally, the summation module includes: a determination submodule, used to determine the weight of each of the third image units according to the ratio of the area of ​​each of the third image units to the area of ​​the second image unit; a summation submodule, used to perform weighted summation of multiple first motion vectors corresponding to multiple third image units according to the weight of each of the third image units, to obtain the second motion vector corresponding to the second image unit.

[0021] Optionally, the device also includes: a fifth determination unit, used to search for a second reference unit matching the first image unit within the range of the second image, and then determine the relative displacement between the first image unit and the second reference unit as a third motion vector corresponding to the first image unit; and an encoding unit, used to encode the first image unit according to the third motion vector to obtain an encoding result corresponding to the first image unit.

[0022] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when run.

[0023] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

[0024] In an embodiment of the present application, a method of performing motion estimation on a prediction unit within a smaller range is adopted, by searching for a first reference unit matching the first image unit within a first image range of a reference image, wherein the first image unit is an image unit to be motion estimated in the image to be encoded; when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold, the search range corresponding to the first image unit is adjusted from the first image range to the second image range; and a second reference unit matching the first image unit is searched for within the second image range. Since motion estimation of the prediction unit is performed within a smaller range and the accuracy of the estimation is ensured by adjusting the search range, the purpose of narrowing the search range and reducing the resource consumption of motion estimation can be achieved, thereby achieving the technical effect of improving the efficiency of motion estimation and enhancing the accuracy of motion estimation, thereby solving the problem of low efficiency of motion estimation in the motion estimation method in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0027] Figure 1 is a schematic diagram of a hardware environment of a motion estimation method for an image unit according to an embodiment of the present application;

[0028] Figure 2 is a flowchart of an optional motion estimation method for an image unit according to an embodiment of the present application;

[0029] Figure 3 is a schematic diagram of an optional extended search range according to an embodiment of the present application;

[0030] Figure 4 is a schematic diagram of an optional prediction unit coverage according to an embodiment of the present application;

[0031] Figure 5 is a flowchart of another optional method for motion estimation of an image unit according to an embodiment of the present application;

[0032] Figure 6 is a structural block diagram of an optional motion estimation device for an image unit according to an embodiment of the present application;

[0033] Figure 7 This is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0037] (1) Motion Estimation (ME): It refers to the estimation of the motion of image blocks on different frames during the video encoding process. It is an important part of video encoding. Its accuracy has a significant impact on the degree of video compression. At the same time, the efficiency of motion estimation also has a great impact on the video encoding speed.

[0038] (2) Reference Picture (RP): refers to the image frame used to search for motion in motion estimation.

[0039] (3) Motion Vector (MV): represents the relative displacement between the current coding block and the best matching block in its reference image.

[0040] (4) Motion Compensation (MC): refers to the process of obtaining the image blocks of the current coded frame according to certain rules based on the results of motion estimation during the video coding process.

[0041] According to one aspect of the embodiment of the present application, a method for estimating the motion of an image unit is provided. Optionally, in this embodiment, the method for estimating the motion of an image unit can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal 102 and a server 104. Figure 1As shown, the server 104 is connected to the terminal 102 via a network and can be used to provide services (such as game services, application services, etc.) to the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. It can also be used to process cloud services. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network. The terminal 102 is not limited to a PC, a mobile phone, a tablet computer, etc. The motion estimation method of the image unit in the embodiment of the present application can be executed by the server 104, or by the terminal 102, or by the server 104 and the terminal 102. Among them, the motion estimation method of the image unit in the embodiment of the present application executed by the terminal 102 can also be executed by a client installed thereon.

[0042] Taking the image encoding device (eg, terminal device) as an example, the motion estimation method of the image unit in this embodiment is performed. Figure 2 is a flow chart of an optional method for motion estimation of an image unit according to an embodiment of the present application. Figure 2 As shown, the process of the method may include the following steps:

[0043] Step S202, searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded;

[0044] Step S204: if the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, adjust the search range corresponding to the first image unit from the first image range to the second image range;

[0045] Step S206 : searching within the second image range for a second reference unit that matches the first image unit.

[0046] Through the above steps S202 to S206, a first reference unit matching the first image unit is searched within the first image range of the reference image, wherein the first image unit is an image unit to be motion estimated in the image to be encoded; when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, the search range corresponding to the first image unit is adjusted from the first image range to the second image range; and a second reference unit matching the first image unit is searched within the second image range, thereby solving the problem of low efficiency of motion estimation in the motion estimation method in the related art, improving the efficiency of motion estimation, and enhancing the accuracy of motion estimation.

[0047] In the technical solution provided in step S202, a first reference unit matching the first image unit is searched within a first image range of the reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded.

[0048] The motion estimation method for the image unit in this embodiment can be used in scenarios with image coding requirements (for example, video coding), for example, in scenarios where images are transmitted between an image coding device and an image decoding device, and in scenarios where images are transmitted between an image coding device and an image storage device. The above-mentioned images can be video frames in a target video, and the target video can be a TV series, a movie, a variety show, an animation, a documentary, a short video, a video in a video conference, a chat video, a VR video, and the like. The device that executes the motion estimation method for the image unit in this embodiment can be an image coding device, a video coding device, or other devices with image coding functions, which are not limited in this embodiment.

[0049] In addition, the motion estimation method of the image unit in this embodiment is also applicable to other scenarios with image coding requirements. In the above case, the image can be a video frame (video frame image), which is not limited in this embodiment.

[0050] For example, in the process of encoding the target video, the video encoding device can obtain each video frame in sequence for encoding. The current video frame to be encoded is the video frame to be encoded (image to be encoded), and the reference image of the video frame to be encoded is the reference video frame. The reference video frame can be the previous video frame of the video frame to be encoded, or the Nth video frame before it. This is not limited in this embodiment.

[0051] It should be noted that when encoding the video frames in the target video, encoding can be started only after motion estimation is completed for all video frames, or motion encoding can be performed while motion estimation is being performed. For example, when processing the video frame to be encoded, the reference video frame may have already been encoded, and motion estimation for the video frame to be encoded uses a copy of the reference video frame. For another example, when processing the video frame to be encoded, the reference video frame may not have been encoded, while the video frame preceding the reference video frame has already been encoded. This is not limited in this embodiment.

[0052] When processing an image to be encoded, motion estimation can be performed on each prediction unit in the image to be encoded to obtain a motion vector for each prediction unit. The prediction unit can be an image unit, such as an image block. This embodiment uses an image block as an example for description. The motion estimation method in this embodiment is also applicable to other types of prediction units (image units), such as image tiles.

[0053] For a prediction unit, motion estimation can be performed on it within a smaller range to obtain the optimal motion vector for the prediction unit. The image unit for which motion estimation is to be performed in the image to be encoded is a first image unit. The image encoding device can search for a first reference unit (first reference block, first matching block) that matches the first image unit within a first image range of the reference image. The first reference unit can be the best matching unit of the first image unit within the first area.

[0054] The first image range may be a range determined based on certain specific locations. For example, the first image range may be a region centered around a target point corresponding to a reference point of the first image unit. The reference point of the first image unit may be any point in the first image unit, such as a vertex, a center point, a midpoint of a boundary, etc. The shape of the region may be a circle, a square, a polygon, etc. This is not limited in this embodiment.

[0055] For example, the size of the current video frame to be encoded is: 1024×768, the size of the prediction unit is 4×4, and the current motion estimation is: the prediction unit with the pixel point in the upper left corner as (x1, y1). On the reference frame corresponding to the prediction unit, with 16 pixels as the boundary, search within the range (x1-8, y1-8) to (x1+8, y1+8) (abbreviated as "+-8") (the first image range) to see whether there is a reference unit (the first reference unit) that can match it.

[0056] It should be noted that the range of "+-8" is only an example, and the search range can be configured as needed, and can be larger or smaller than "+-8", which is not limited in this embodiment.

[0057] In the technical solution provided in step S204, when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, the search range corresponding to the first image unit is adjusted from the first image range to the second image range.

[0058] The image encoding device may determine whether a distance between a boundary of the first reference unit and a boundary of the first image range is greater than a target distance threshold. If the distance is greater than the target distance threshold, the first reference unit may be determined as a reference unit that best matches the first image unit, and a motion vector corresponding to the first image unit may be determined based on the first image unit and the first reference unit.

[0059] Optionally, in this embodiment, if the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, it can be determined that the accuracy of motion estimation using the first image range as the search range corresponding to the first image unit is insufficient, and the search range corresponding to the first image unit can be replaced. For example, the search range corresponding to the first image unit can be adjusted from the first image range to the second image range.

[0060] The second image range can be determined based on the first image range, or according to a predetermined range adjustment rule. The second image range can be related to the first image range, for example, it can include the first image range or overlap with the first image range. The second image range can also be unrelated to the first image range, for example, the two have no overlap at all. This is not limited in this embodiment.

[0061] In the technical solution provided in step S206 , a second reference unit matching the first image unit is searched within the second image range.

[0062] After adjusting the search range corresponding to the first image unit to the second image range, the image encoding device may perform a search in a manner similar to the first image range to obtain a second reference unit that matches the first image unit.

[0063] After obtaining the second reference unit, the image encoding device may continue to determine whether the distance between the boundary of the second reference unit and the boundary of the second image range is greater than a target distance threshold, thereby determining whether to further adjust the search range corresponding to the first image unit. Through one or more search area adjustments, the optimal reference unit for the first image unit is ultimately obtained, and the optimal motion vector for the first image unit is then determined.

[0064] It should be noted that the first image range may be an initial image range, or an image range after one or more rounds of search range adjustment, which is not limited in this embodiment.

[0065] As an optional embodiment, searching for a first reference unit matching the first image unit within a first image range of the reference image includes:

[0066] S11, searching for a plurality of candidate reference units within the first image range according to the first image unit;

[0067] S12 : Select a first reference unit from a plurality of candidate reference units according to a similarity between each candidate reference unit and the first image unit.

[0068] The image encoding device may search for a first reference unit that matches the first image unit based on a degree of similarity between the image unit and the reference unit. The image encoding device may search for multiple candidate reference units within the first image based on the first image unit. The size of each candidate reference unit may be the same as the size of the first image unit.

[0069] The candidate reference units may be searched by starting with a vertex within the first image range and sequentially obtaining candidate reference units of a specific size in a row-first, then column-first order. For example, a target sliding window may be slid within the first image range to obtain multiple candidate reference units. The target sliding window may be the same size as the first image unit, and the sliding may be performed in a row-first, then column-first order, with a step size of one or more pixels for each sliding.

[0070] For example, the first image range is a 16×16 range, and the size of the first image unit is 4×4. Starting from the vertex of the first image range, a total of 13×13 4×4 candidate reference units can be obtained by moving one pixel at a time in a row-first, column-later manner.

[0071] The image encoding device can respectively obtain the similarity between each candidate reference unit and the first image unit. The similarity can be, but is not limited to, measured using the sum of absolute differences (SAD), and is also applicable to other similarity measurement methods.

[0072] The image encoding device can select a first reference unit from multiple candidate reference units according to the degree of similarity between each candidate reference unit and the first image unit. For example, the candidate reference unit with the highest similarity can be selected as the first reference unit, or the candidate reference unit with the highest similarity and higher than the target similarity threshold can be selected as the first reference unit. One can also be randomly selected as the first reference unit from one or more candidate reference units with a similarity higher than the target similarity threshold. This is not limited in this embodiment.

[0073] Through this embodiment, a reference unit matching the image unit is obtained according to the similarity between the candidate reference unit and the image unit, which can improve the accuracy of reference unit acquisition and further improve the accuracy of motion estimation.

[0074] As an optional embodiment, before adjusting the search range corresponding to the first image unit from the first image range to the second image range, the method further includes one of the following:

[0075] S21, determining whether the shortest distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold, wherein the target distance threshold is greater than zero;

[0076] S22, determining whether a boundary of the first reference unit overlaps with a boundary of the first image range, wherein the target distance threshold is zero;

[0077] S23 , determining that the motion vector between the first image unit and the first reference unit points to a boundary of the first image range, wherein the target distance threshold is zero.

[0078] There may be various conditions for adjusting the search range corresponding to the first image unit, including but not limited to at least one of the following conditions:

[0079] 1) If the distance between the boundary of the first reference unit and the boundary of the first image range is too close, considering factors such as calculation errors, in order to ensure the accuracy of motion estimation, the search range corresponding to the first image unit can be adjusted and the search can be performed again.

[0080] 2) If the boundary of the first reference unit overlaps with the boundary of the first image range, it can be considered that the first image range may be insufficient for accurate motion estimation, and the search range corresponding to the first image unit needs to be adjusted and the search needs to be repeated.

[0081] 3) If the motion vector between the first image unit and the first reference unit points to the boundary of the first image range, it can be considered that the first image range may be insufficient for accurate motion estimation, and the search range corresponding to the first image unit needs to be adjusted and the search needs to be repeated.

[0082] For the above method, motion estimation can be performed on the first image unit within the first image range to obtain the optimal motion vector of the first image unit. If the optimal motion vector points to the search boundary, it can be considered that the first image range may be insufficient for accurate motion estimation.

[0083] For example, if the motion vector searched within the range of "+-8" does not touch any boundary, it can be determined that this search range is completely sufficient for motion estimation, that is, the optimal motion vector searched within the range of "+-8" is used as the final motion estimation result, and no further motion estimation such as boundary expansion is performed.

[0084] Through this embodiment, whether the search range adjustment is required is determined based on the distance between the boundary of the first reference unit and the boundary of the first image range, or the motion vector between the first image unit and the first reference unit, thereby improving the accuracy of motion estimation and reducing the search time and resource consumption.

[0085] As an optional embodiment, adjusting the search range corresponding to the first image unit from the first image range to the second image range includes at least one of the following:

[0086] S31, expanding the first image range into a second image range, wherein the second image range includes the first image range, and a distance between a boundary of the first reference unit and a boundary of the second image range is greater than a target distance threshold;

[0087] S32 : Moving the first image range to obtain a second image range, wherein the distance between the boundary of the first reference unit and the boundary of the second image range is greater than a target distance threshold.

[0088] The image encoding device can adjust the search range corresponding to the first image unit in a variety of ways, including but not limited to at least one of the following adjustment methods: range expansion, range movement (translation), and the basis for adjustment can be: making the distance between the boundary of the first reference unit and the boundary of the second image range greater than the target distance threshold.

[0089] As an optional embodiment, the image encoding device may expand the first image range into a second image range, and the second image range obtained after the expansion may include the first image range.

[0090] Region expansion can be the expansion of the entire region. For example, for a polygonal region, multiple boundaries can be controlled to expand outward separately. For a circular region, the center of the circle can be kept unchanged and the radius can be increased to control the circular boundary to expand outward.

[0091] Area expansion can also be the expansion of a partial area, that is, controlling the boundaries adjacent to the first reference unit to expand outward. For example, for a polygonal area range, the boundaries adjacent to the first reference unit among multiple boundaries (the boundaries with the closest distance less than or equal to the target distance threshold) can be controlled to expand outward. For a circular area range, the boundary points adjacent to the first reference unit can be controlled to expand outward to control the outward expansion of the circular boundary.

[0092] For example, in the above "+-8" search process, if the obtained motion vector points to the position of (x1-8, y1-8), it means that the optimal motion vector points to the search boundary. At this time, it is considered that the search range of "+-8" may be insufficient for accurate motion estimation, and the search range needs to be further expanded to search within the 24×24 pixel range of (x1-16, y1-16) to (x1+8, y1+8), such as Figure 3 shown.

[0093] As another optional embodiment, the image encoding device may move the first image range to obtain a second image range, where the second image range has the same area size as the first image range but a different position.

[0094] The moving direction of the first image range can be: moving in any direction and selecting the second image range from the multiple image ranges obtained after the movement, or moving in a target direction, and the target direction can be: the direction in which the center of the first image range moves toward the first reference unit, that is, the direction in which the boundary adjacent to the first reference unit moves away from the first reference unit.

[0095] According to this embodiment, the search range corresponding to the image unit is adjusted in an expansion or movement manner, which can improve the efficiency of the search range adjustment and further improve the efficiency of the motion estimation.

[0096] To achieve more efficient video compression, newer video coding standards (such as AV1) have introduced more complex motion compensation mechanisms. These include a large number of non-square motion compensation units (e.g., 4×8, 4×16, 16×8, etc.) and various forms of combined motion compensation. This significantly improves the coding efficiency of moving images. However, since these prediction units (the aforementioned motion compensation units) all require motion estimation, the efficiency of motion estimation is generally low.

[0097] For example, during the coding decision process, a 16×16 pixel image block may be divided into three different partitions for motion compensation: one 16×16, two 16×8, and four 4×16. This may require three or more independent motion estimates, which is inefficient.

[0098] Optionally, for the motion compensation units introduced by the video coding standard that are of the same shape and constitute a recursive structure, this embodiment also provides a motion estimation method for such prediction units (image units), which can quickly estimate the motion of the video with almost no loss in the accuracy of the motion estimation and the quality of the encoded video.

[0099] As an optional embodiment, the motion estimation method of the image unit may include:

[0100] S41, obtaining a second image unit to be subjected to motion estimation in the image to be encoded, wherein the image to be encoded uses image units of multiple different sizes for motion estimation, and the size of the second image unit is a target size;

[0101] S42, when the second image unit is covered by multiple third image units, determine the second motion vector corresponding to the second image unit based on the multiple first motion vectors corresponding to the multiple third image units, wherein the multiple third image units correspond one-to-one to the multiple first motion vectors, and the size of each third image unit is different from the target size.

[0102] The fast motion estimation method (algorithm) provided in this embodiment can simultaneously perform motion estimation on prediction units of multiple sizes (e.g., 16×16, 16×8, and 8×8). By utilizing the overlapping redundancy between prediction units, it can adapt to motions of different complexities.

[0103] The image encoding device may perform motion estimation on prediction units that do not overlap with each other and prediction units that are overlapped by other prediction units in different manners.

[0104] The image encoding device may perform motion estimation on all non-overlapping prediction units (e.g., image units not covered by other image units) to obtain the optimal motion vector for each prediction unit. The method for performing motion estimation on the prediction units may be the same or similar to that described above and is not limited in this embodiment.

[0105] It should be noted that the coverage between image units (prediction units of motion that overlap each other) means that one image unit (for example, the second image unit) is completely covered (there is no uncovered area) by multiple image units (for example, the third image unit), and there is no overlap between the multiple image units.

[0106] For example, a 16×16 image block can be divided into two 16×8 or four 8×8 prediction units. Then each 16×16 prediction unit can be completely covered by the corresponding four 8×8 units, and each 16×8 prediction unit can be completely covered by the corresponding two 8×8 units (e.g. Figure 4 shown).

[0107] For a prediction unit covered by another prediction unit, its motion vector may be estimated using the motion vector of the prediction unit covering it.

[0108] The image encoding device can obtain a second image unit to be motion estimated in the image to be encoded, the size of the second image unit is the target size, the second image unit is covered by multiple third image units, and the size of each third image unit is different from the target size.

[0109] When performing motion estimation on the second image unit, the image encoding device may determine the motion vector (second motion vector) corresponding to the second image unit based on the motion vector (first motion vector) corresponding to each third image unit.

[0110] For example, for a 16×8 prediction unit covered by two corresponding 8×8 prediction units, the motion vector of the 16×8 prediction unit can be obtained according to the motion vectors of the two 8×8 prediction units without performing motion estimation on the 16×8 prediction unit.

[0111] Through this embodiment, the motion vector of a prediction unit covered by other prediction units is determined by utilizing the coverage redundancy between prediction units, which can reduce the number of prediction units requiring motion estimation and improve the efficiency of motion estimation.

[0112] As an optional embodiment, determining the second motion vector corresponding to the second image unit according to the plurality of first motion vectors corresponding to the plurality of third image units includes:

[0113] S51 , performing weighted summation on a plurality of first motion vectors corresponding to a plurality of third image units to obtain a second motion vector corresponding to a second image unit.

[0114] There are many ways to determine the second motion vector corresponding to the second image unit. For example, a motion vector can be selected from multiple first motion vectors as the second motion vector. For another example, at least two motion vectors can be selected from multiple first motion vectors for weighted summation to obtain the second motion vector.

[0115] Optionally, in this embodiment, the second motion vector corresponding to the second image unit may be determined based on the motion vector corresponding to each third image unit, that is, the motion vector corresponding to each third image unit may affect the second motion vector corresponding to the second image unit.

[0116] The image encoding device may perform weighted summation on multiple first motion vectors corresponding to multiple third image units, and use the motion vector obtained after the weighted summation as the second motion vector corresponding to the second image unit.

[0117] For example, the motion estimation of all pixel blocks similar to the above 16×8 is obtained by weighted summing of the corresponding pixel blocks covering 8×8, without the need for independent motion estimation.

[0118] According to this embodiment, the motion vector of the covered prediction unit is estimated by weighting the motion vectors of each covered slice (image unit), so that the rationality and accuracy of the motion vector determination can be improved.

[0119] As an optional embodiment, performing weighted summation on multiple first motion vectors corresponding to multiple third image units to obtain a second motion vector corresponding to the second image unit includes:

[0120] S61, determining a weight of each third image unit according to a ratio of an area of ​​each third image unit to an area of ​​the second image unit;

[0121] S62 , performing weighted summation on a plurality of first motion vectors corresponding to a plurality of third image units according to the weight of each third image unit to obtain a second motion vector corresponding to the second image unit.

[0122] When performing a weighted summation of the first motion vectors, the weight corresponding to each first motion vector may be determined according to the area ratio of the third image unit. The image encoding device may determine the weight of each third image unit according to the ratio of the area of ​​each third image unit to the area of ​​the second image unit. Based on the weight of each third image unit, the image encoding device may perform a weighted summation of the multiple first motion vectors to obtain a second motion vector corresponding to the second image unit.

[0123] For example, for the above 16×8 image block, the motion vector search results of its two 8×8 covering blocks are (v1,u1) and (v2,u2), then the motion vector of the 16×8 image block is estimated to be: (v1+v2,u1+u2) / 2, and the weight is obtained according to the area ratio of each covering image block.

[0124] Through this embodiment, the motion vectors are weighted and summed according to the area ratio of the covered image units, which can ensure the accuracy of weight determination and thus improve the accuracy of motion estimation.

[0125] As an optional embodiment, after searching for a second reference unit matching the first image unit within the second image range, the method further includes:

[0126] S71, determining the relative displacement between the first image unit and the second reference unit as a third motion vector corresponding to the first image unit;

[0127] S72: Encode the first image unit according to the third motion vector to obtain an encoding result corresponding to the first image unit.

[0128] After searching for a second reference unit matching the first image unit within the second image range, if the second reference unit is not the optimal reference unit for the first image unit, the search range corresponding to the first image unit may be further adjusted until the optimal reference unit for the first image unit is found.

[0129] If the distance between the boundary of the second reference unit and the boundary of the second image range is greater than the target distance threshold, it can be determined that the second reference unit is the optimal reference unit of the first image unit. The image encoding device can determine the relative displacement between the first image unit and the second reference unit as a third motion vector (MV) corresponding to the first image unit, and encode the first image unit according to the third motion vector to obtain an encoding result corresponding to the first image unit. The encoding result can indicate the second reference unit and the third motion vector.

[0130] Optionally, in this embodiment, the image encoding device may determine an optimal reference unit corresponding to the first image unit, and determine the relative displacement between the first image unit and the optimal reference unit (e.g., the second reference unit) as a third motion vector corresponding to the first image unit. The image encoding device may also receive difference information between the first image unit and the optimal reference unit and position information of the optimal reference unit in the reference image, and encode the first image unit based on the third motion vector, the difference information, and the position information to obtain an encoding result corresponding to the first image unit. The encoding result may indicate the third motion vector, the difference information between the first image unit and the optimal reference unit, and the position information of the optimal reference unit.

[0131] The image encoding device can transmit the encoding result corresponding to the first image unit to the image decoding device. The image decoding device decodes the first image unit according to the encoding result corresponding to the first image unit, thereby restoring the first image unit. The specific process can refer to the relevant technology and will not be elaborated in this embodiment.

[0132] Through this embodiment, the relative displacement between the image unit and the optimal reference unit is determined as the motion vector corresponding to the image unit, so as to encode the image unit, which can improve the accuracy of image encoding and enhance the efficiency of image encoding.

[0133] The following describes the motion estimation method for image units in the embodiment of the present application with reference to an optional example. In this example, both the reference image and the image to be encoded are video frames, and the image unit is a prediction unit.

[0134] This example provides a fast motion estimation algorithm that can simultaneously perform motion estimation on motion compensation units of multiple different sizes, fully utilize the coverage redundancy between prediction units, and perform adaptive fast motion vector search for motion situations of different complexities.

[0135] like Figure 5 As shown, the process of the motion estimation method for the image unit in this example may include the following steps:

[0136] Step S502 : performing motion estimation on all non-overlapping prediction units within a relatively small range to obtain an optimal motion vector for each prediction unit.

[0137] For all non-overlapping prediction units, motion estimation can be performed separately to obtain the optimal motion vector of each prediction unit.

[0138] For a prediction unit, motion estimation can be performed within a smaller range. If the optimal motion vector for the prediction unit is obtained, and one of the optimal motion vectors points to the search boundary, the search boundary is expanded and the search is repeated until the optimal motion vector no longer points to the search boundary. Otherwise, the search is stopped and the current motion vector is used as the motion estimate for the prediction unit.

[0139] Step S504: For a prediction unit covered by another prediction unit, the weighted sum of the motion vectors of each covered slice is used as the estimated motion vector.

[0140] Through this example, motion estimation is performed using the expansion search method and the covering redundancy between prediction units, so that video frames with a large number of recursive structures can be quickly encoded, motion estimation can be performed more efficiently, and encoding time can be saved without affecting the quality and bit rate of the encoded video.

[0141] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0143] According to another aspect of an embodiment of the present application, a motion estimation device for an image unit is provided for implementing the above-mentioned motion estimation method for an image unit. Figure 6 is a structural block diagram of an optional motion estimation device for an image unit according to an embodiment of the present application, such as Figure 6 As shown, the device may include:

[0144] A first search unit 602 is configured to search for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded;

[0145] an adjusting unit 604, connected to the first searching unit 602, configured to adjust the search range corresponding to the first image unit from the first image range to the second image range when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold;

[0146] The second search unit 606 is connected to the adjustment unit 604 and is configured to search within the second image range for a second reference unit that matches the first image unit.

[0147] It should be noted that the first search unit 602 in this embodiment can be used to execute the above step S202, the adjustment unit 604 in this embodiment can be used to execute the above step S204, and the second search unit 606 in this embodiment can be used to execute the above step S206.

[0148] Through the above module, a first reference unit matching the first image unit is searched within a first image range of a reference image, wherein the first image unit is an image unit to be motion estimated in the image to be encoded; when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold, the search range corresponding to the first image unit is adjusted from the first image range to the second image range; and a second reference unit matching the first image unit is searched within the second image range, thereby solving the problem of low efficiency of motion estimation in the motion estimation method in the related art, improving the efficiency of motion estimation, and enhancing the accuracy of motion estimation.

[0149] As an optional embodiment, the first searching unit 602 includes:

[0150] A search module, configured to search for a plurality of candidate reference units within the first image range according to the first image unit;

[0151] The selection module is configured to select a first reference unit from a plurality of candidate reference units according to a degree of similarity between each candidate reference unit and the first image unit.

[0152] As an optional embodiment, the above device further includes one of the following:

[0153] a first determining unit, configured to determine, before adjusting the search range corresponding to the first image unit from the first image range to the second image range, whether the shortest distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold, wherein the target distance threshold is greater than zero;

[0154] a second determining unit, configured to determine whether a boundary of the first reference unit overlaps with a boundary of the first image range, wherein a target distance threshold is zero;

[0155] The third determining unit is configured to determine that the motion vector between the first image unit and the first reference unit points to a boundary of the first image range, wherein the target distance threshold is zero.

[0156] As an optional embodiment, the adjusting unit 604 includes at least one of the following:

[0157] an expansion module, configured to expand the first image range into a second image range, wherein the second image range includes the first image range, and a distance between a boundary of the first reference unit and a boundary of the second image range is greater than a target distance threshold;

[0158] The moving module is configured to move the first image range to obtain a second image range, wherein a distance between a boundary of the first reference unit and a boundary of the second image range is greater than a target distance threshold.

[0159] As an optional embodiment, the above device further includes:

[0160] an acquisition unit, configured to acquire, after searching within a range of the second image for a second reference unit that matches the first image unit, a second image unit to be subjected to motion estimation in the image to be encoded, wherein the image to be encoded uses image units of a plurality of different sizes for motion estimation, and the size of the second image unit is a target size;

[0161] The fourth determination unit is used to determine the second motion vector corresponding to the second image unit based on the multiple first motion vectors corresponding to the multiple third image units when the second image unit is covered by multiple third image units, wherein the multiple third image units correspond one-to-one to the multiple first motion vectors, and the size of each third image unit is different from the target size.

[0162] As an optional embodiment, the fourth determining unit includes:

[0163] The summing module is configured to perform weighted summation on a plurality of first motion vectors corresponding to a plurality of third image units to obtain a second motion vector corresponding to a second image unit.

[0164] As an optional embodiment, the summing module includes:

[0165] a determination submodule, configured to determine a weight of each third image unit according to a ratio of an area of ​​each third image unit to an area of ​​the second image unit;

[0166] The summing submodule is configured to perform weighted summation on a plurality of first motion vectors corresponding to a plurality of third image units according to the weight of each third image unit to obtain a second motion vector corresponding to the second image unit.

[0167] As an optional embodiment, the above device further includes:

[0168] a fifth determining unit, configured to determine, after searching within the second image range for a second reference unit matching the first image unit, a relative displacement between the first image unit and the second reference unit as a third motion vector corresponding to the first image unit;

[0169] The encoding unit is configured to encode the first image unit according to the third motion vector to obtain an encoding result corresponding to the first image unit.

[0170] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. Figure 1 The hardware environment shown can be implemented through software or hardware, wherein the hardware environment includes a network environment.

[0171] According to another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned motion estimation method for an image unit is also provided. The electronic device may be a terminal device, a server, or a combination thereof.

[0172] Figure 7 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.

[0173] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0174] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0175] S1, searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded;

[0176] S2, when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, adjusting the search range corresponding to the first image unit from the first image range to the second image range;

[0177] S3, searching within the second image range for a second reference unit that matches the first image unit.

[0178] Memory 702 can be used to store software programs and modules, such as program instructions / modules corresponding to the method and apparatus for motion estimation of image units in embodiments of the present invention. Processor 704 executes the software programs and modules stored in memory 702 to perform various functional applications and data processing, thereby implementing the aforementioned method for motion estimation of image units. Memory 702 can include high-speed random access memory (RAM) and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, memory 702 can further include memory remotely located relative to processor 704, and such remote memory can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. Memory 702 can be used, but is not limited to, to store reference images and images to be encoded.

[0179] As an example, Figure 7 As shown, the memory 702 may include, but is not limited to, the first search unit 602, the adjustment unit 604, and the second search unit 606 in the apparatus for estimating motion of the image unit. Furthermore, the memory 702 may also include, but is not limited to, other module units in the apparatus for estimating motion of the image unit, which will not be described in detail in this example.

[0180] Optionally, the transmission device 706 is configured to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one embodiment, the transmission device 706 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 706 is a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0181] In addition, the electronic device further includes: a display 708 for displaying reference images and images to be encoded; and a connection bus 710 for connecting various module components in the electronic device.

[0182] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0183] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only. The device for implementing the above-mentioned method for estimating the motion of the image unit may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 7 It does not limit the structure of the above electronic device. For example, the terminal device may also include Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 7 Different configurations shown.

[0184] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0185] According to another aspect of the embodiment of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute program code of the motion estimation method for an image unit.

[0186] Optionally, in this embodiment, the above-mentioned storage medium may be located on at least one network device among the multiple network devices in the network shown in the above-mentioned embodiment.

[0187] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0188] S1, searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded;

[0189] S2, when the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to the target distance threshold, adjusting the search range corresponding to the first image unit from the first image range to the second image range;

[0190] S3, searching within the second image range for a second reference unit that matches the first image unit.

[0191] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0192] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0193] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0194] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0195] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.

[0197] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0198] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0199] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A motion estimation method for an image unit, characterized in that: include: Searching for a first reference unit matching a first image unit within a first image range of a reference image, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded; When the distance between the boundary of the first reference unit and the boundary of the first image range is less than or equal to a target distance threshold, adjusting the search range corresponding to the first image unit from the first image range to a second image range; Searching for a second reference unit matching the first image unit within the second image range; After searching for a second reference unit matching the first image unit within the range of the second image, the method further includes: obtaining a second image unit to be motion estimated in the image to be encoded, wherein the image to be encoded uses image units of multiple different sizes for motion estimation, and the size of the second image unit is a target size; when the second image unit is covered by multiple third image units, determining a second motion vector corresponding to the second image unit based on multiple first motion vectors corresponding to the multiple third image units, wherein the multiple third image units have a one-to-one correspondence with the multiple first motion vectors, and the size of each third image unit is different from the target size; The second image unit being covered by multiple third image units means that the second image unit and the multiple third image units completely cover each other, and the complete coverage means that there is no uncovered area, and there is no overlap between all image units including the second image unit and the third image unit.

2. The method according to claim 1, characterized in that The searching for a first reference unit matching the first image unit within a first image range of the reference image comprises: Searching for a plurality of candidate reference units within the first image range according to the first image unit; The first reference unit is selected from the multiple candidate reference units according to the similarity between each candidate reference unit and the first image unit.

3. The method according to claim 1, characterized in that Before adjusting the search range corresponding to the first image unit from the first image range to the second image range, the method further includes one of the following: determining whether a shortest distance between a boundary of the first reference unit and a boundary of the first image range is less than or equal to a target distance threshold, wherein the target distance threshold is greater than zero; determining that a boundary of the first reference unit overlaps with a boundary of the first image range, wherein the target distance threshold is zero; It is determined that a motion vector between the first image unit and the first reference unit points to a boundary of the first image range, wherein the target distance threshold is zero.

4. The method according to claim 1, wherein Adjusting the search range corresponding to the first image unit from the first image range to the second image range includes at least one of the following: Expanding the first image range to the second image range, wherein the second image range includes the first image range, and a distance between a boundary of the first reference unit and a boundary of the second image range is greater than the target distance threshold; The first image range is moved to obtain the second image range, wherein a distance between a boundary of the first reference unit and a boundary of the second image range is greater than the target distance threshold.

5. The method according to claim 1, wherein The determining, based on a plurality of first motion vectors corresponding to a plurality of the third image units, a second motion vector corresponding to the second image unit comprises: A weighted sum is performed on a plurality of the first motion vectors corresponding to a plurality of the third image units to obtain the second motion vector corresponding to the second image unit.

6. The method according to claim 5, characterized in that The step of performing weighted summation on the plurality of first motion vectors corresponding to the plurality of third image units to obtain the second motion vector corresponding to the second image unit comprises: determining a weight of each of the third image units according to a ratio of an area of ​​each of the third image units to an area of ​​the second image unit; A weighted sum is performed on a plurality of first motion vectors corresponding to a plurality of the third image units according to the weight of each of the third image units to obtain the second motion vector corresponding to the second image unit.

7. The method according to any one of claims 1 to 6, characterized in that After searching for a second reference unit matching the first image unit within the second image range, the method further includes: determining a relative displacement between the first image unit and the second reference unit as a third motion vector corresponding to the first image unit; The first image unit is encoded according to the third motion vector to obtain an encoding result corresponding to the first image unit.

8. A motion estimation device for an image unit, characterized in that: include: a first search unit, configured to search within a first image range of a reference image for a first reference unit that matches a first image unit, wherein the first image unit is an image unit for which motion estimation is to be performed in the image to be encoded; an adjusting unit, configured to adjust a search range corresponding to the first image unit from the first image range to a second image range when a distance between a boundary of the first reference unit and a boundary of the first image range is less than or equal to a target distance threshold; a second search unit, configured to search within the second image range for a second reference unit matching the first image unit; After searching for a second reference unit matching the first image unit within the range of the second image, the method further includes: obtaining a second image unit to be subjected to motion estimation in the image to be encoded, wherein the image to be encoded uses image units of multiple different sizes for motion estimation, and the size of the second image unit is a target size; and when the second image unit is covered by multiple third image units, determining a second motion vector corresponding to the second image unit based on multiple first motion vectors corresponding to the multiple third image units, wherein the multiple third image units have a one-to-one correspondence with the multiple first motion vectors, and the size of each of the third image units is different from the target size; The second image unit being covered by multiple third image units means that the second image unit and the multiple third image units completely cover each other, and the complete coverage means that there is no uncovered area, and there is no overlap between all image units including the second image unit and the third image unit.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Motion estimation method utilizing modified rhombus pattern search for a succession of frames in digital coding system

    US20060209956A1