Motion vector constraint range determination method, apparatus, device and storage medium

CN114554207BActive Publication Date: 2026-06-19SHANGHAI LUOTA INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI LUOTA INFORMATION TECHNOLOGY CO LTD
Filing Date
2022-01-10
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The existing technology has poor flexibility in determining the range of motion vector constraints, resulting in low video coding efficiency. In particular, when the intensity of video motion changes or the motion of image regions varies, it is difficult to achieve optimal coding efficiency.

Method used

By determining the encoding information of the reference frame image of the current frame image, the motion vector statistics of each coding block are obtained, including vector loss data in the horizontal and vertical directions. The range of motion vector constraints is dynamically calculated, taking into account the complexity of the coding unit, and avoiding the efficiency loss caused by fixed range constraints.

Benefits of technology

It improves the compression efficiency of video encoding, solves the problem of poor flexibility in determining the range of motion vector constraints, and ensures optimized encoding efficiency in different video scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114554207B_ABST
    Figure CN114554207B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method, device and equipment for determining a motion vector constraint range, and a storage medium. The method comprises the following steps: determining a reference frame image of a current frame image, and obtaining encoding information of the reference frame image; determining motion vector statistical data of each encoding block in the reference frame image according to the encoding information, wherein the motion vector statistical data comprises vector loss data in horizontal and vertical directions; and calculating a motion vector constraint range of the reference frame image according to the motion vector statistical data. The scheme significantly improves the compression efficiency of video encoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video processing technology, and in particular to a method, apparatus, device, and storage medium for determining the range of motion vector constraints. Background Technology

[0002] Video data, as one of the most widely used multimedia data types, is applied in many scenarios. During video data processing, to improve transmission and storage efficiency, different encoding methods are typically used for video compression to remove redundant information. Current video coding standards are mostly based on a hybrid coding framework. Under this framework, each frame in the video is first divided into fixed-size maximum coding units (MCUs). Each MCU first uses inter-frame or intra-frame prediction techniques to obtain a predicted image. The difference between the predicted image and the original image is called the residual. This residual is transformed and quantized before being fed into an entropy encoder for encoding. Then, it undergoes inverse quantization and inverse transform, combined with the predicted image, to reconstruct the image. Finally, it is filtered through a loop to obtain the reconstructed image. The reconstructed image is buffered in the encoder and used as a reference image for inter-frame prediction of subsequent encoded frames.

[0003] In the actual video encoding process, inter-frame prediction is an important compression method that can effectively reduce temporal redundancy in the video. During this prediction process, the encoder needs to search for blocks with similar content in the reconstructed image of the reference frame from the original image of the current coding unit, and encode and compress the relative displacement, i.e., the motion vector, between the two. Since the motion estimation process of the current frame coding unit depends on the reconstructed image of the reference frame, it needs to wait for the encoding and reconstruction of the reference frame to complete. Currently, to fully utilize the multi-threading capabilities of modern processors and improve actual encoding speed, encoders employ multi-frame parallel encoding methods, where multiple processor threads simultaneously encode multiple video frames. If there are reference relationships between these simultaneously encoded images, it will severely reduce the encoding parallelism.

[0004] To address this, encoders typically employ methods that limit the motion search range to reduce inter-frame dependencies. That is, once a portion of the reference frame is encoded, the current coding unit can begin motion estimation and subsequent encoding on that reconstructed region, thereby improving multi-frame coding parallelism. In implementation, encoders generally use parameters to specify the maximum motion vector value of the coding unit, corresponding to the offset of the motion estimation constraint region's boundary relative to the current coding block's position in the image. These parameters are defined as horizontal and vertical motion vector range constraints, respectively. However, using fixed motion vector range constraints presents the following problems when dealing with different video scenarios: when the video motion intensity is less than the predetermined constraint, some potential parallelism is lost; when the video motion intensity is greater than the predetermined value, motion estimation cannot reach the optimal value, leading to reduced coding efficiency. Existing methods using dynamic motion vector constraint ranges mostly utilize already encoded information to estimate the motion intensity of the current coding frame or coding unit, thereby dynamically adjusting the motion vector constraint range based on the video content. However, these algorithms fail when the intensity of motion in the video changes, or when the motion of a certain region in the image differs from other regions. In addition, it did not take into account the complexity of the encoding unit, which also caused the parallelism and compression efficiency exchange ratio in the encoding process to deviate from expectations. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and storage medium for determining the range of motion vector constraints, which solves the problems of poor flexibility in determining the range of motion vector constraints and low video coding efficiency in the prior art, and improves the compression efficiency of video coding.

[0006] In a first aspect, embodiments of the present invention provide a method for determining the range of motion vector constraints, the method comprising:

[0007] Determine the reference frame image of the current frame image, and obtain the encoding information of the reference frame image;

[0008] Based on the encoding information, motion vector statistics for each coded block in the reference frame image are determined, and the motion vector statistics include vector loss data in the horizontal and vertical directions;

[0009] The motion vector constraint range of the reference frame image is calculated based on the motion vector statistics.

[0010] Secondly, embodiments of the present invention also provide a motion vector constraint range determination device, comprising:

[0011] The encoding information acquisition module is used to determine the reference frame image of the current frame image and acquire the encoding information of the reference frame image;

[0012] The vector statistics module is used to determine motion vector statistics for each coded block in the reference frame image based on the encoding information. The motion vector statistics include vector loss data in the horizontal and vertical directions.

[0013] The constraint range determination module is used to calculate the motion vector constraint range of the reference frame image based on the motion vector statistics.

[0014] Thirdly, embodiments of the present invention also provide a motion vector constraint range determination device, the device comprising:

[0015] One or more processors;

[0016] Storage device for storing one or more programs.

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the motion vector constraint range determination method described in the embodiments of the present invention.

[0018] Fourthly, embodiments of the present invention also provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the motion vector constraint range determination method described in the embodiments of the present invention.

[0019] In this embodiment of the invention, by determining a reference frame image of the current frame image, the encoding information of the reference frame image is obtained, and the motion vector statistics of each coded block in the reference frame image are determined according to the encoding information. The motion vector statistics include vector loss data in the horizontal and vertical directions. Then, the motion vector constraint range of the reference frame image is calculated based on the motion vector statistics. This realizes the dynamic determination of the motion vector constraint range, solves the problems of poor flexibility in obtaining the motion vector constraint range and low video coding efficiency in the prior art, and improves the compression efficiency of video coding. Attached Figure Description

[0020] Figure 1 A flowchart illustrating a method for determining the range of motion vector constraints provided in an embodiment of the present invention;

[0021] Figure 2 A schematic diagram illustrating the motion vector constraint range of a reference frame image corresponding to a current frame image, provided in an embodiment of the present invention;

[0022] Figure 3 A flowchart of another method for determining the range of motion vector constraints provided in an embodiment of the present invention;

[0023] Figure 4 A flowchart illustrating a method for calculating the range of motion vector constraints provided in an embodiment of the present invention;

[0024] Figure 5 A flowchart of another method for determining the range of motion vector constraints provided in an embodiment of the present invention;

[0025] Figure 6 This is a schematic diagram illustrating the relationship between two reference frame structures provided in an embodiment of the present invention;

[0026] Figure 7 A structural block diagram of a motion vector constraint range determination device provided in an embodiment of the present invention;

[0027] Figure 8 This is a schematic diagram of a motion vector constraint range determination device provided in an embodiment of the present invention. Detailed Implementation

[0028] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and not intended to limit the scope of the invention. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the embodiments of the present invention, and not all structures.

[0029] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0030] Figure 1 The flowchart illustrates a method for determining the range of motion vector constraints provided in this embodiment of the invention. This method can be applied in video encoding and can be executed by computing devices such as servers, smart terminals, laptops, and tablets. Specifically, it includes the following steps:

[0031] Step S101: Determine the reference frame image of the current frame image and obtain the encoding information of the reference frame image.

[0032] In video data transmission and storage, compression is necessary to reduce video bitrate and improve storage and transmission efficiency. Video data compression reduces data redundancy (spatial redundancy, temporal redundancy, structural redundancy, information entropy redundancy, etc.) and visual redundancy. This compression can be achieved through video compression coding methods. Currently, hybrid coding methods are commonly used, combining transform coding, motion estimation and motion compensation, and entropy coding for compression. Transform coding is typically used to remove intra-frame redundancy, motion estimation and motion compensation to remove inter-frame redundancy, and entropy coding to further improve compression efficiency.

[0033] Motion estimation and motion compensation are effective means of eliminating temporal correlations in image sequences. The aforementioned transform coding and entropy coding methods, based on a single frame, can eliminate spatial correlations between pixels within an image. Besides spatial correlations, video images also exhibit temporal correlations. For example, in digital videos with a static background and minimal subject movement, the differences between frames are small, resulting in high correlation between images. In such cases, motion estimation and motion compensation methods can be used to achieve video coding compression.

[0034] Motion estimation involves segmenting the input image into several non-overlapping small image blocks, and then searching for the most similar image block within a search window of the previous or next image for each block. This search process is motion estimation. By calculating the positional information between the most similar image block and the current image block, the corresponding motion vector can be obtained. Therefore, during the encoding process, the block in the current image can be subtracted from the most similar image block pointed to by the motion vector in the reference image to obtain a residual image block. Since the pixel value in the residual image block is very small, a higher compression ratio can be achieved in compression coding. This subtraction process is motion compensation.

[0035] In one embodiment, during video encoding and compression processing, to improve the motion estimation search efficiency of the current frame image, it is necessary to constrain the range of motion vectors in the reference frame image, so as to improve the efficiency of searching the coded blocks in the current frame image in the reference frame image. For example... Figure 2 As shown, Figure 2This is a schematic diagram illustrating the motion vector constraint range of a reference frame image corresponding to a current frame image, provided in an embodiment of the present invention. The current frame image 01 is divided into multiple coded blocks. Taking coded block 011 as an example, when determining the motion vector of coded block 011 relative to the reference frame image 02, it searches within the corresponding coded block 021 of the reference frame image 02 within a certain motion vector constraint range to find the most similar coded block, exemplarily coded block 022. In this example, the motion vector constraint range for coded block 021 is the area enclosed by the dashed line in the reference frame image 02. This area can be characterized by the horizontal and vertical motion vector constraint ranges. That is, for coded block 022, its horizontal and vertical movement search distances are constrained by the horizontal and vertical motion vector constraint ranges, respectively; the search is performed within these constraint ranges.

[0036] In one embodiment, all reference frame images of the current frame image are traversed, and the motion vector constraint range of each reference frame image is determined sequentially for motion estimation during the encoding of the current frame image. When determining the corresponding motion vector constraint range for each reference frame image, the encoding information of the reference frame image is first obtained, that is, the motion vector range is dynamically determined based on the encoding information of the reference frame image.

[0037] Optionally, the encoding information of the reference frame image can be its pre-coding information, such as information recorded during pre-coding before the actual video encoding. An example is the Lookahead information from the Lookahead pre-coding process. Specifically, the Lookahead pre-coding process buffers multiple consecutive images of the input video to form a raw image queue. On this queue, different frame types and reference structure combinations are traversed, and the pre-coding cost of the combination is calculated to make a dynamic frame type decision. This decision is generally made in units of mini-GOPs (Group of Pictures). A GOP refers to a set of consecutive images that can be decoded independently without relying on other images outside the group. It typically consists of a first I-frame (called a RAP frame, Random Access Picture) and several subsequent mini-GOP image groups. A mini-GOP refers to a consecutive set of images consisting of one P-frame and several B-frames. I-frames are images that only undergo intra-frame prediction coding; P-frames are images that only undergo forward inter-frame prediction and intra-frame prediction coding; and B-frames are coded images that can use both bidirectional inter-frame prediction and intra-frame prediction. Optionally, the encoding information of the reference frame image can also be the actual encoding information from the previous round used in multi-round encoding.

[0038] Step S102: Determine the motion vector statistics of each coded block in the reference frame image based on the encoding information. The motion vector statistics include vector loss data in the horizontal and vertical directions.

[0039] In one embodiment, the acquired reference frame image's encoding information records the motion vector of each coded block in the reference frame image, and motion vector statistics are generated based on the motion vectors of each coded block. Optionally, the motion vector statistics can be represented in the form of a histogram.

[0040] For example, taking Lookahead pre-encoded information as the encoding information, Lookahead already contains relatively accurate motion vector information. Typically, when processing inter-frame dependencies, encoders use coding units larger than the Lookahead block, such as LCU blocks, LCU lines, or even the entire image. Larger coding units cover multiple coding blocks divided in Lookahead. In this solution, information from multiple coding blocks is comprehensively statistically analyzed to obtain motion vector statistics. Specifically, in one embodiment, a histogram statistical method is used. Traditional histogram statistics count the number of samples falling within a certain value range, essentially treating all samples as equally weighted. In video coding, coding blocks of different complexities have different impacts on the final video distortion. Directly using traditional histogram statistics can lead to different levels of distortion on video sequences with different complexities using the same algorithm. Therefore, the statistical data in this solution is motion vector loss data, including horizontal and vertical vector loss data, to achieve a more reasonable and accurate estimate. Of course, in another embodiment, traditional histogram statistics can also be used to determine the final motion vector constraint range, but its accuracy is relatively poor.

[0041] Step S103: Calculate the motion vector constraint range of the reference frame image based on the motion vector statistics.

[0042] In one embodiment, when determining the motion vector constraint range of the reference frame image, it is determined based on the aforementioned motion vector statistics, rather than using a fixed-size motion vector constraint range. Specifically, an expected loss ratio can be set to determine a reasonable expected cost loss. The motion vector losses recorded in the aforementioned motion vector statistics are accumulated, and a reasonable motion vector constraint range is determined based on the relationship between the accumulated motion vector loss and the expected cost loss.

[0043] As can be seen from the above scheme, by determining the reference frame image of the current frame image, the encoding information of the reference frame image is obtained. This encoding information records the accurate motion vectors of the reference frame image. Based on this, motion vector statistics of each coded block in the reference frame image are generated. Then, the motion vector constraint range of the reference frame image is calculated based on the motion vector statistics. By using the encoding information of the reference frame image to dynamically determine the motion vector constraint range of each reference frame image, the statistical data is the motion vector loss when determining the motion vector constraint range, which fully considers the complexity of the coding unit. If the coding unit complexity is very low, the compression efficiency loss of using intra-frame coding or a smaller motion vector constraint range is smaller than that of a larger motion vector constraint range. This avoids the problem of large coding efficiency loss caused by using a smaller motion vector constraint range when the coding unit complexity is high. It solves the problem of increased parallelism in multi-frame parallel coding caused by the dependence between different images in motion estimation. Meanwhile, this scheme utilizes the encoding information of the reference frame image, which is pre-encoded information based on the original and predicted images of the video. It does not require reconstruction, so this information is determined before the current image begins encoding, thus avoiding the cold start problem. Furthermore, it maximizes the range of motion vector constraints without changing this dependency, thereby improving the encoding compression efficiency.

[0044] Figure 3 A flowchart of another method for determining the range of motion vector constraints provided in an embodiment of the present invention is given, illustrating a specific method for determining motion vector statistical data, such as... Figure 3 As shown, it specifically includes:

[0045] Step S201: Determine the reference frame image of the current frame image, and obtain the precoding information of the reference frame image. The precoding information includes the motion vector corresponding to each coding block in the reference frame image.

[0046] Step S202: Obtain the motion vector of each coding block according to the precoding information, and determine the interval range into which the current coding block falls based on the motion vector of each coding block.

[0047] For example, for a reference frame image, it is assumed to be divided into 4 coding blocks (in actual division, it can be divided into multiple coding blocks of 8*8 or 16*16; this embodiment uses 4 coding blocks as an example for illustration), denoted as coding block 1, coding block 2, coding block 3, and coding block 4, respectively. When calculating the motion vector constraint range of the reference frame image, the calculation and determination of the horizontal vector constraint range and the vertical vector constraint range are used for illustration. Here, the determination of the horizontal vector constraint range is described as a specific example, and the vertical vector constraint range is described similarly. For coding blocks 1, 2, 3, and 4, it is assumed that the horizontal motion vectors recorded in the obtained coding information are -10, 10, 100, and 150, respectively. Among them, the interval is exemplarily a 64-pixel interval. For example, interval 0 corresponds to [0, 64), interval 1 corresponds to [64, 128), interval 2 corresponds to [128, 192), and so on.

[0048] The motion vector corresponding to each coding block is denoted as hor. The calculation method for determining the interval into which the current coding block falls based on the motion vector of each coding block can be max(0, hor) / 64. The results of substituting the motion vector of each coding block into this formula to calculate the interval into which it falls are shown in the table below:

[0049] Table 1

[0050] Encoded blocks 1 2 3 4 Horizontal motion vector -10 10 100 150 Falling into the interval 0 0 1 2

[0051] Step S203: Calculate the cost loss for each coding block. Based on the cost loss of each coding block and the interval it falls into, calculate the motion vector loss data for each interval as motion vector statistics.

[0052] The cost loss calculation for each coded block includes calculations using its intra-frame cost loss and inter-frame cost loss. In one embodiment, the intra-frame cost loss and inter-frame cost loss can be Satd (Sum of Absolute Transformed Differences) cost loss, which represents the sum of the absolute values ​​of the residuals between the predicted coded image and the original image after Hadamard transformation.

[0053] In one embodiment, the cost loss for each coding block can be calculated using the intra-frame cost loss and inter-frame cost loss of each coding block already stored in the precoding information. Optionally, the cost loss for each coding block can be calculated as follows:

[0054] Loss i =IntraSatd-Min(IntraSatd,InterSatd i)

[0055] Among them, Loss i IntraSatd represents the loss of the current coding block in reference to the i-th reference frame; IntraSatd represents the Satd cost loss of the current coding block calculated during the precoding stage for the intra-prediction mode; InterSatd i This represents the inter-frame prediction Satd cost loss obtained by referencing the i-th reference frame during the precoding stage of the current coding block.

[0056] In one embodiment, after determining the cost loss of each coding block, motion vector loss data for each interval is calculated based on the cost loss of each coding block and the interval it falls into, serving as motion vector statistics. Optionally, the motion vector statistics can be represented by histogram data, which can be represented as an array. Each element in the array is the sum of the cost losses of the coding blocks falling into each interval of the histogram data. For example, if two code blocks fall into the 0th interval, the specific value in the output array element is the sum of the cost losses of those two code blocks. As shown in Table 1, the intra-frame cost loss and inter-frame cost loss for each coding block, along with the calculated cost loss value for each coding block, are shown in Table 2 below:

[0057] Table 2

[0058] Encoded blocks 1 2 3 4 Horizontal motion vector -10 10 100 150 Falling into the interval 0 0 1 2 Inter-frame loss 100 200 300 400 Intra-frame loss 150 150 250 390 Cost and loss 0 50 50 10

[0059] The corresponding histogram data is shown in the table below:

[0060] Table 3

[0061] Interval 4 3 2 1 0 Constraint range 4*64 3*64 2*64 1*64 0*64 Horizontal loss 0 0 10 50 0+50

[0062] Step S204: Calculate the motion vector constraint range of the reference frame image based on the motion vector statistics.

[0063] In one embodiment, a reasonable expected cost loss is determined by setting an expected loss ratio. The motion vector losses recorded in the aforementioned motion vector statistics are accumulated, and a reasonable motion vector constraint range is determined based on the relationship between the accumulated motion vector losses and the expected cost loss. The specific calculation process is as follows: Figure 4 As shown, Figure 4 A flowchart of a method for calculating the range of motion vector constraints provided in an embodiment of the present invention specifically includes:

[0064] Step S2041: Calculate the expected cost loss of the reference frame image based on the cost loss of the reference frame image and the expected loss ratio.

[0065] The cost loss of the reference frame image is the sum of the optimal cost losses of each coding block in the reference frame image. The optimal cost refers to the smaller value between the intra-frame cost loss and the inter-frame cost loss in each coding block. Using the intra-frame cost loss and inter-frame cost loss of each coding block as shown in Table 2, the cost loss of the reference frame image is calculated as 100 + 150 + 250 + 390 = 890. This expected loss ratio can be an adaptively adjustable value set manually, for example, 5%. The expected cost loss is the product of the cost loss of the reference frame image and the expected loss ratio, which is 890 * 5% = 44.5.

[0066] Step S2042: Traverse the intervals sequentially and calculate the cumulative loss accordingly.

[0067] In one embodiment, when traversing the intervals sequentially, the traversal is performed in descending order of index size, and the cumulative loss is calculated. Taking the data shown in Table 3 as an example, the calculated cumulative loss values ​​are shown in Table 4:

[0068] Table 4

[0069] Interval 4 3 2 1 0 Constraint range 4*64 3*64 2*64 1*64 0*64 Horizontal loss 0 0 10 50 0+50 Cumulative losses 0 0 10 60 110

[0070] Step S2043: Determine the interval interval at which the traversal terminates based on the accumulated loss and the expected cost loss, and determine the motion vector constraint range of the reference frame image based on the interval scale of the interval interval and the position of the interval interval at which the traversal terminates.

[0071] Specifically, when traversing each interval sequentially, the interval at which the traversal terminates is determined by comparing the accumulated loss with the expected cost loss. For instance, using the example data in the table above, when traversing interval 2, its accumulated loss is 10, which is less than the expected cost loss of 44.5. Therefore, traversing interval 1 continues, and its accumulated loss is 60, which is greater than the expected cost loss of 44.5, at which point the traversal stops. That is, during the traversal of intervals, traversal stops when the accumulated loss exceeds the expected cost loss. Correspondingly, the interval at which this traversal terminates is interval 1.

[0072] In one embodiment, when determining the motion vector constraint range of the reference frame image based on the interval scale of the interval and the position of the traversal termination interval, the calculation formula can be: constraint range = interval scale * (termination position + 1). Taking the above data as an example, the constraint range of the reference frame image = 64 * (1 + 1) = 128. Wherein, when the motion vector constraint range (the horizontal motion vector constraint range is calculated in this example, and the calculation method for the vertical motion vector constraint range is the same) is set to 128, the cost loss (10) generated by the coding block whose motion vector exceeds this value (such as coding block 4 in the above example, whose motion vector is 150) will just not exceed the expected loss value (44.5), that is, it will not exceed the set expected loss ratio value (5%). When the motion vector constraint range is further reduced, for example, reduced to 64, the resulting loss (10 + 50) will exceed the expected loss.

[0073] As described above, by dynamically determining the motion vector constraint range of the reference frame image, and by utilizing the encoding information of the reference frame image (taking pre-coding information as an example), this method avoids relying on the image itself, thus solving the problem of increased parallelism caused by the dependency between different images in motion estimation under multi-frame parallel coding. Furthermore, this scheme utilizes the encoding information of the reference frame image, which is based on the original and predicted images of the video and does not require reconstruction. Therefore, this information is determined before the current image begins coding, avoiding the cold start problem and further maximizing the motion vector constraint range without changing this dependency, thereby improving coding compression efficiency. Regarding motion vector statistics, cost loss data is used as statistical data, avoiding the problem of unreasonable motion vector constraint ranges caused by using conventional histogram data, which fails to consider the complexity of the coding blocks.

[0074] Based on the above technical solution, obtaining the encoding information of the reference frame image includes: if the encoding information of the reference frame image is unavailable, setting the motion vector constraint range of the current frame image to a default range. For example, the default range can be 64, thus enabling the determination of the motion vector constraint range even when the encoding information of certain reference frames is unavailable, further improving the mechanism for determining the motion vector constraint range.

[0075] Figure 5 The flowchart illustrates another method for determining the motion vector constraint range provided in this embodiment of the invention. The determined motion vector constraint range has been further updated and optimized, such as... Figure 5 As shown, it specifically includes:

[0076] Step S301: Determine the first reference frame image of the current frame image and obtain the encoding information of the first reference frame image.

[0077] Step S302: Determine the motion vector statistics of each coded block in the first reference frame image according to the encoding information. The motion vector statistics include vector loss data in the horizontal and vertical directions.

[0078] Step S303: Calculate the motion vector constraint range of the first reference frame image based on the motion vector statistics.

[0079] Step S304: Determine the second reference frame image referenced by the first reference frame image. If the second reference frame image is also a reference frame image of the current frame image, then update the motion vector constraint range of the second frame image relative to the current frame image based on the motion vector constraint range of the first reference frame image relative to the current frame image and the motion vector constraint range of the second reference frame image relative to the first reference frame image.

[0080] In one embodiment, by utilizing the structural relationship of video coding reference frames, the motion vector constraint range of some reference frame images can be further updated without changing the coding parallelism caused by the aforementioned scheme, thereby improving video compression efficiency. Specifically, in many cases, the reference frames of the current frame image also form a mutual reference relationship. For example... Figure 6 As shown, Figure 6 This is a schematic diagram of two reference frame structure relationships provided in an embodiment of the present invention. In these two reference frame structures, the current frame image P simultaneously references the first reference frame image R0 and the second reference frame image R1. There is also a reference relationship between the first reference frame image R0 and the second reference frame image R1, i.e., the second reference frame image R1 is a reference image of the first reference frame image R0. Assuming that the motion vector constraint range of the first reference frame image R0 calculated in the current frame image P determined by the aforementioned scheme is 2, the calculated motion vector constraint range of the second reference frame image R0 is 3, and the motion vector constraint range of the first reference frame image R0 referencing the second reference image R1 is 3, then there exists a link from the current frame image P to the second reference image R1, i.e., P->R0->R1. The motion vector constraint range of the current frame image P referencing the second reference image R1 has been expanded to 5. Therefore, the motion vector range of the second reference frame image of the current frame image, originally calculated from 3, is updated and adjusted to 5.

[0081] The reason for this adjustment is that before any coding unit at position x in the current frame image P can begin encoding, it needs to wait for all directly dependent reference frame images to complete encoding of the entire motion vector search range. Specifically, for the first reference frame image R0, it needs to wait for position x+2, and for the second reference frame image R1, it needs to wait for position x+3. However, since the first reference frame image R0 references the second reference frame image R1, R1 has already completed encoding at position x+2+3. Expanding the motion vector constraint range of the reference frame for the second reference frame image R1 to position x+5 will not introduce additional dependencies. Furthermore, if all direct and indirect reference chains formed by traversing all reference frames in the current frame image can be used, the motion vector constraint range value of each reference frame image in the current frame image can be expanded without affecting the encoding parallelism, while simultaneously increasing the motion vector search range and ensuring more accurate motion vector search results.

[0082] As can be seen from the above scheme, for the motion vector constraint range of the reference frame image determined in the current frame image, it is further traversed to see if the frame image referenced by each reference frame image is also the reference frame image referenced by the current frame image. If so, the motion vector constraint range of the original reference frame image is expanded according to the motion vector constraint range of the reference frame image in the link relationship. This improves the motion vector search range without affecting the coding parallelism, and ensures a more accurate motion vector search result.

[0083] Figure 7 This is a structural block diagram of a motion vector constraint range determination device provided in an embodiment of the present invention. The device is used to execute the motion vector constraint range determination method provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. As shown in Figure 7, the device specifically includes: an encoding information acquisition module 101, a vector statistics module 102, and a constraint range determination module 103, wherein...

[0084] The encoding information acquisition module 101 is used to determine the reference frame image of the current frame image and acquire the encoding information of the reference frame image;

[0085] The vector statistics module 102 is used to determine motion vector statistics data for each coded block in the reference frame image based on the encoding information. The motion vector statistics data includes vector loss data in the horizontal and vertical directions.

[0086] The constraint range determination module 103 is used to calculate the motion vector constraint range of the reference frame image based on the motion vector statistics.

[0087] As can be seen from the above scheme, by determining the reference frame image of the current frame image, the encoding information of the reference frame image is obtained. This encoding information records the accurate motion vectors of the reference frame image. Based on this, motion vector statistics of each coded block in the reference frame image are generated. Then, the motion vector constraint range of the reference frame image is calculated based on the motion vector statistics. By using the encoding information of the reference frame image to dynamically determine the motion vector constraint range of each reference frame image, the statistical data is the motion vector loss when determining the motion vector constraint range, which fully considers the complexity of the coding unit. If the coding unit complexity is very low, the compression efficiency loss of using intra-frame coding or a smaller motion vector constraint range is smaller than that of a larger motion vector constraint range. This avoids the problem of large coding efficiency loss caused by using a smaller motion vector constraint range when the coding unit complexity is high. It solves the problem of increased parallelism in multi-frame parallel coding caused by the dependence between different images in motion estimation. Meanwhile, this scheme utilizes the encoding information of the reference frame image. This encoding information is pre-coded information, based on the original and predicted images of the video, and does not require reconstruction. Therefore, this information is determined before the current image begins encoding, avoiding the cold start problem. Furthermore, it maximizes the range of motion vector constraints without changing this dependency, thereby improving encoding compression efficiency.

[0088] In one possible embodiment, the encoded information acquisition module 101 is specifically used for:

[0089] Obtain the precoding information of the reference frame image, wherein the precoding information includes the motion vector corresponding to each coded block in the reference frame image.

[0090] In one possible embodiment, the vector statistics module 102 is specifically used for:

[0091] The motion vector of each coding block is obtained based on the precoding information, and the interval range into which the current coding block falls is determined based on the motion vector of each coding block.

[0092] The cost loss of each coding block is calculated separately, and the motion vector loss data of each interval is calculated based on the cost loss of each coding block and the interval it falls into.

[0093] In one possible embodiment, the vector statistics module 102 is specifically used for:

[0094] The cost loss of a coding block is determined based on the intra-frame cost loss and inter-frame cost loss for each coding block.

[0095] In one possible embodiment, the constraint range determination module 103 is specifically used for:

[0096] The expected cost loss of the reference frame image is calculated based on the cost loss of the reference frame image and the expected loss ratio.

[0097] The intervals are traversed sequentially, and the cumulative loss is calculated accordingly.

[0098] The interval interval at which the traversal terminates is determined based on the accumulated loss and the expected cost loss. The motion vector constraint range of the reference frame image is determined based on the interval scale of the interval interval and the position of the interval interval at which the traversal terminates.

[0099] In one possible embodiment, the encoded information acquisition module 101 is specifically used for:

[0100] If the encoding information of the reference frame image is unavailable, the motion vector constraint range of the current frame image is set to the default range.

[0101] In one possible embodiment, the encoded information acquisition module 101 is specifically used for:

[0102] Determine the first reference frame image for the current frame image;

[0103] The constraint range determination module 103 is also used for:

[0104] After calculating the motion vector constraint range of the reference frame image based on the motion vector statistics, a second reference frame image is determined. If the second reference frame image is also a reference frame image of the current frame image, the motion vector constraint range of the second frame image relative to the current frame image is updated based on the motion vector constraint range of the first reference frame image relative to the current frame image and the motion vector constraint range of the second reference frame image relative to the first reference image.

[0105] Figure 8 This is a schematic diagram of a motion vector constraint range determination device provided in an embodiment of the present invention, as shown below. Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 8Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the motion vector constraint range determination method in this embodiment of the invention. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, thereby implementing the aforementioned motion vector constraint range determination method. The input device 203 can be used to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display screen or other display device.

[0106] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a motion vector constraint range determination method described in the above embodiments, specifically including:

[0107] Determine the reference frame image of the current frame image, and obtain the encoding information of the reference frame image;

[0108] Based on the encoding information, motion vector statistics for each coded block in the reference frame image are determined, and the motion vector statistics include vector loss data in the horizontal and vertical directions;

[0109] The motion vector constraint range of the reference frame image is calculated based on the motion vector statistics.

[0110] It is worth noting that in the embodiments of the motion vector constraint range determination device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of the present invention.

[0111] Note that the above are merely preferred embodiments and the technical principles applied in this invention. Those skilled in the art will understand that the embodiments of this invention are not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the protection scope of this invention. Therefore, although the embodiments of this invention have been described in detail above, the embodiments of this invention are not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of the embodiments of this invention, and the scope of the embodiments of this invention is determined by the scope of the appended claims.

Claims

1. A method of motion vector constraint range determination, characterized by, include: Determine the reference frame image for the current frame image; Obtaining the encoding information of the reference frame image includes: obtaining the precoding information of the reference frame image, wherein the precoding information includes the motion vector corresponding to each coded block in the reference frame image; The motion vector statistics of each coded block in the reference frame image are determined according to the encoding information, including: obtaining the motion vector of each coded block according to the precoding information, determining the interval interval into which the current coded block falls based on the motion vector of each coded block, calculating the cost loss of each coded block respectively, and calculating the motion vector loss data of each interval interval based on the cost loss of each coded block and the interval interval into which it falls. The motion vector constraint range of the reference frame image is calculated based on the motion vector statistics, including: calculating the expected cost loss of the reference frame image based on the cost loss and the expected loss ratio of the reference frame image; sequentially traversing the interval intervals and calculating the cumulative loss accordingly; determining the interval interval at which the traversal terminates based on the cumulative loss and the expected cost loss; and determining the motion vector constraint range of the reference frame image based on the interval scale of the interval intervals and the position of the interval interval at which the traversal terminates.

2. The method for determining a constraint range of a motion vector according to claim 1, wherein, The interval size of the interval is fixed, and the intervals together form a continuous range.

3. The method for determining a constraint range of a motion vector according to claim 2, wherein, The calculation of the cost loss for each coded block includes: The cost loss of a coding block is determined based on the intra-frame cost loss and inter-frame cost loss for each coding block.

4. The method of Claim 1, wherein, The step of obtaining the encoding information of the reference frame image includes: If the encoding information of the reference frame image is unavailable, the motion vector constraint range of the current frame image is set to the default range.

5. The method for determining motion vector constraint range according to claim 1, wherein, The step of determining the reference frame image for the current frame image includes: Determine the first reference frame image for the current frame image; After calculating the motion vector constraint range of the reference frame image based on the motion vector statistics, the method further includes: A second reference frame image is determined to be referenced by the first reference frame image. If the second reference frame image is also a reference frame image of the current frame image, the motion vector constraint range of the second reference frame image relative to the current frame image is updated according to the motion vector constraint range of the first reference frame image relative to the current frame image and the motion vector constraint range of the second reference frame image relative to the first reference frame image.

6. Apparatus for determining a motion vector constraint range, characterized in that include: The encoding information acquisition module is used to determine the reference frame image of the current frame image and acquire the encoding information of the reference frame image, including: acquiring the precoding information of the reference frame image, wherein the precoding information includes the motion vector corresponding to each coding block in the reference frame image; The vector statistics module is used to determine motion vector statistics for each coded block in the reference frame image based on the encoding information. The module includes: obtaining the motion vector of each coded block based on the precoding information; determining the interval into which the current coded block falls based on the motion vector of each coded block; calculating the cost loss of each coded block; and calculating the motion vector loss data of each interval based on the cost loss of each coded block and the interval into which it falls. The constraint range determination module is used to calculate the motion vector constraint range of the reference frame image based on the motion vector statistics, wherein the calculation includes: calculating the expected cost loss of the reference frame image based on the cost loss and the expected loss ratio of the reference frame image; sequentially traversing the interval intervals and calculating the cumulative loss accordingly; determining the interval interval at which the traversal terminates based on the cumulative loss and the expected cost loss; and determining the motion vector constraint range of the reference frame image based on the interval scale of the interval intervals and the position of the interval interval at which the traversal terminates.

7. A motion vector constraint range determination apparatus, the apparatus comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the motion vector constraint range determination method as described in any one of claims 1-5.

8. A storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the motion vector constraint range determination method as described in any one of claims 1-5.