Motion vector correction processing method, device and equipment in video inter-frame coding
By evaluating the possibility of inter-frame encoding using precoding information in video encoding, skipping the decoding-side motion vector correction, the problem of excessive calculation load is solved, and the video encoding efficiency is improved.
Patent Information
- Application Number
- CN202411235251.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-27
AI Technical Summary
In the existing video encoding technology, excessive use of decoding-end motion vector correction technology leads to excessive calculation load, affecting the encoding efficiency of the inter-frame prediction process.
By obtaining the precoding information of the video frame to be processed, count the number of pre-analytical units whose inter prediction cost is less than the intra prediction cost, calculate their proportion, and skip the decoding motion vector correction when the proportion is less than the set threshold, reduce the Calculation quantity.
It effectively reduces encoding time, improves video encoding efficiency, and reduces calculation load. It is suitable for scenarios such as video conferencing, video calls and live broadcasts.
Smart Images

Figure CN119211529A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video processing technology, and in particular to a motion vector correction processing method, device and equipment in video inter-frame coding. Background Art
[0002] At present, in video coding, in order to solve the problem of a large amount of redundancy in the coded data caused by the content similarity between adjacent image frames, the redundant data of the coding can be reduced by inter-frame prediction. In the current popular video coding standards, block-based motion compensation technology can be used for inter-frame prediction. In formal coding, based on the existing standard mode, the motion vectors of the adjacent blocks in the time domain and space domain and other related information can be used to construct a candidate list of the current coding block. By traversing the predicted motion vectors in the candidate list, the predicted motion vector with the smallest rate-distortion cost is selected as the motion vector of the current coding block. However, since the existing standard mode directly obtains the motion information of the current coding block from the related information such as the adjacent blocks, the motion information may be inaccurate and cannot reflect the actual motion situation.
[0003] In the related art, a decoder-side motion vector correction technology is proposed for the existing standard mode using bidirectional prediction, which can represent the motion vector more accurately. It refines the two motion vector prediction values contained in the predicted motion vector in the existing standard mode through bilateral template matching, and uses a search based on the absolute error sum to obtain the refined motion vector without transmitting additional motion information. However, since the decoder-side motion vector correction technology requires a large amount of search and motion compensation calculation, excessive use of the decoder-side motion vector correction technology will bring too much calculation load during the encoding process, affecting the encoding efficiency of the inter-frame prediction process, and needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a method, device and equipment for motion vector correction processing in video inter-frame coding, which solves the problem in the related art that excessive use of decoding-end motion vector correction technology will bring too large a computational load during the encoding process, affecting the encoding efficiency of the inter-frame prediction process, and effectively utilizes the mode prediction information obtained in the pre-coding process of the video frame to be processed, reasonably evaluates the possibility of applying inter-frame coding to the video frame to be processed, and chooses to skip the decoding-end motion vector correction of the video frame to be processed when the first proportion is less than the set first ratio threshold, thereby reducing the computational amount of video coding and improving the video coding efficiency.
[0005] In a first aspect, an embodiment of the present application provides a motion vector correction processing method in video inter-frame coding, the method comprising:
[0006] Acquire a video frame to be processed and corresponding precoding information, wherein the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each of the pre-analysis units;
[0007] Counting a first number of pre-analysis units satisfying that an inter-frame prediction cost is less than an intra-frame prediction cost among the plurality of pre-analysis units, and calculating a first ratio of the first number of units to a total number of units of the plurality of pre-analysis units;
[0008] When the first proportion is less than a set first ratio threshold, the decoding-end motion vector correction of the to-be-processed video frame is skipped.
[0009] In a second aspect, an embodiment of the present application further provides a motion vector correction processing device in video inter-frame coding, the device comprising:
[0010] An acquisition module is configured to acquire a video frame to be processed and corresponding precoding information, wherein the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each of the pre-analysis units;
[0011] a proportion calculation module, configured to count a first number of pre-analysis units satisfying that an inter-frame prediction cost is less than an intra-frame prediction cost among the plurality of pre-analysis units, and calculate a first proportion of the first number of units relative to a total number of the plurality of pre-analysis units;
[0012] The vector correction skipping module is configured to skip the decoding-end motion vector correction of the to-be-processed video frame when the first proportion is less than a set first proportion threshold.
[0013] In a third aspect, an embodiment of the present application further provides a motion vector correction processing device in video inter-frame coding, the device comprising:
[0014] one or more processors;
[0015] a storage device configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the motion vector correction processing method in video inter-frame coding described in the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the motion vector correction processing method in video inter-frame coding described in an embodiment of the present application.
[0018] In the fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the motion vector correction processing method in video inter-frame coding described in the embodiment of the present application.
[0019] In the embodiment of the present application, by obtaining the video frame to be processed and the corresponding precoding information, the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and the intra-frame prediction cost and inter-frame prediction cost of each pre-analysis unit; the number of first units of the pre-analysis units that meet the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost in the plurality of pre-analysis units is counted, and the first proportion of the number of first units relative to the total number of units of the plurality of pre-analysis units is calculated; when the first proportion is less than the set first proportion threshold, the decoding end motion vector correction of the video frame to be processed is skipped. In the above scheme, by obtaining the precoding information of the video frame to be processed, the mode prediction information obtained in the precoding process of the video frame to be processed can be effectively utilized to provide reliable reference data for whether the subsequent video frame to be processed skips the decoding end motion vector correction; by statistically calculating the first proportion of the pre-analysis units whose inter-frame prediction cost is less than the intra-frame prediction cost, the possibility of applying inter-frame coding to the video frame to be processed can be reasonably evaluated. When the first proportion is less than the set first proportion threshold, it can be effectively judged that the possibility of applying intra-frame coding to the video frame to be processed is higher, and the decoding end motion vector correction of the video frame to be processed is skipped, thereby reducing the amount of calculation of video coding and improving the efficiency of video coding. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a motion vector correction processing method in video inter-frame coding provided by an embodiment of the present application;
[0021] Figure 2 A flowchart of another method for correcting motion vectors in video inter-frame coding provided by an embodiment of the present application;
[0022] Figure 3 A flowchart of a motion vector correction processing method in video inter-frame coding including a process of skipping a current predicted motion vector provided by an embodiment of the present application;
[0023] Figure 4 A flowchart of another method for processing motion vector correction in video inter-frame coding including a process of skipping the current predicted motion vector provided by an embodiment of the present application;
[0024] Figure 5 A flowchart of another method for correcting motion vectors in video inter-frame coding provided by an embodiment of the present application;
[0025] Figure 6 A flowchart of another method for correcting motion vectors in video inter-frame coding provided by an embodiment of the present application;
[0026] Figure 7 A structural block diagram of a motion vector correction processing device in video inter-frame coding provided by an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of a motion vector correction processing device in video inter-frame coding provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0030] At present, in video coding standards such as HEVC (High Efficiency Video Coding), AV1 (Alliance for Open Media), and AVS3 (Audio Video Standard), the predicted motion vector can be directly used as the motion vector of the current coding block, reducing the amount of data required for encoding the motion vector and improving the compression rate. For example, in the VVC standard, the Merge mode can construct a motion vector candidate list for the current coding block, in which each predicted motion vector is correspondingly set with an index, and the encoder selects the predicted motion vector from the motion vector candidate list as the motion vector of the current coding block, and writes the index of the predicted motion vector into the bitstream, and the decoder retrieves the corresponding predicted motion vector from the motion vector candidate list according to the index, thereby determining the motion vector of the current coding block. It should be noted that when using the Merge mode, the motion vector and the reference image index are not encoded, but the residual coefficient and the predicted motion vector index need to be encoded (wherein, if the Skip coding mode is used, the residual coefficient does not need to be encoded). Optionally, if the current coding block uses the Merge mode of bidirectional prediction, the decoding side motion vector correction technology can be used to improve the coding performance. Among them, the decoding side motion vector correction technology can refer to the DMVR (Decoder side motionvector refinement) technology. Among them, when the DMVR technology is used, in order to avoid data drift when the encoding and decoding ends perform data reconstruction, the corresponding decoding side motion vector correction calculation process needs to be performed on the encoding end, which will also lead to the problem of large amount of calculation in the encoding process. Below, an exemplary description of the calculation process of the decoding side motion vector correction is as follows:
[0031] Step S1, select the initial motion vector pair: traverse the predicted motion vectors in the motion vector candidate list. If the predicted motion vector meets the enabling conditions of the motion vector correction on the decoding end, select two motion vector prediction values in the predicted motion vector as the initial motion vector MV0 and motion vector MV1, and enable the motion vector correction on the decoding end for subsequent refinement calculations. Otherwise, directly use the predicted motion vector for related calculations in the Merge mode.
[0032] Step S2, first motion compensation: Calculate the pixel values of the predicted images for the two reference frames according to the initial motion vector MV0 and motion vector MV1 and cache them. If the initial motion vector MV0 or motion vector MV1 is a motion vector with sub-pixel precision, use the bilinear interpolation method to calculate the predicted value. It should be noted that the specific process of motion compensation is to interpolate the motion vector of the current coding block to obtain a predicted coding block with the same width and height as the current coding block. When the motion vector is a motion vector with sub-pixel precision, it is necessary to determine the pixel value of the corresponding sub-pixel position in the reference image by interpolation; when the motion vector is a motion vector with integer pixel precision, the predicted value can be directly obtained by finding the corresponding integer pixel position in the reference image.
[0033] Step S3, integer pixel search: Use the bilateral template to search for points around the initial motion vector MV0 and the motion vector MV1 to find the optimal integer distance corrected motion vector. First, calculate the absolute value error sum between the initial motion vector MV0 and the two corresponding predicted coding blocks under the motion vector MV1; then search for the motion vector of the integer brightness sample offset around the initial motion vector, and calculate the absolute value error sum of the two predicted coding blocks under the bilateral template; if the absolute value error sum corresponding to the surrounding motion vector is smaller than the initial motion vector, the motion vector with the smallest absolute value error sum is replaced. Among them, the motion vector offset of the surrounding search points follows the motion vector difference mirror rule, that is:
[0034] MV0′=MV0+MV offset
[0035] MV1 ′ =MV1-MV offset
[0036] Among them, MV offset Represents the refined offset between the initial motion vector and the refined motion vector in a reference picture in the reference image.
[0037] Step S4, sub-pixel search: Use the parameter error surface equation to derive the corrected motion vector of the sub-pixel distance, use the cost of the center position and the four integer pixel offset positions around it to fit a two-dimensional parabolic error surface equation, and use the position of the sub-pixel corrected motion vector with the minimum cost on the surface equation as the output of the sub-pixel search stage.
[0038] Step S5, second motion compensation: according to the motion vector correction results calculated in the whole pixel and sub-pixel search stages, a common 8-tap interpolation filter is used to generate the final prediction value.
[0039] Step S6: Perform rate-distortion optimization on the prediction result corresponding to the corrected predicted motion vector, and select the result with the minimum rate-distortion cost as the final result of the Merge mode.
[0040] From the above, it can be seen from the specific implementation steps of the motion vector correction at the decoding end that the motion vector correction at the decoding end requires a large amount of search and motion compensation calculation. Excessive use of the motion vector correction at the decoding end will bring too much calculation load during the encoding process, affecting the encoding efficiency of the inter-frame prediction process.
[0041] The motion vector correction processing method in video inter-frame coding provided by the embodiment of the present application can skip or exit the motion vector correction on the decoding end in advance by using the pre-coding information of the video frame to be processed and the coding process information during the formal coding process, which can effectively reduce the coding time and improve the coding efficiency. Relevant application scenarios may include: video conferencing, video calls, indoor and outdoor live broadcasts, and short videos. The several application scenarios listed above are only exemplary and explanatory. In practical applications, the motion vector correction processing method in video inter-frame coding can also be used in video coding in other scenarios, and the embodiment of the present application does not limit this. The motion vector correction processing method, device and equipment in video inter-frame coding provided by the embodiment of the present application are intended to solve the problem in the related art that excessive use of the motion vector correction on the decoding end will bring too large a computational load during the coding process, affecting the coding efficiency of the inter-frame prediction process.
[0042] The motion vector correction processing method in video inter-frame coding provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.
[0043] Figure 1 The following is a flow chart of a motion vector correction processing method in video inter-frame coding provided by an embodiment of the present application. Figure 1 As shown, the following steps are included:
[0044] Step S101: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0045] Before formal encoding, the encoder can perform a forward prediction pre-coding process on the processed video. The encoder creates an original image queue by buffering multiple continuous images of the video input, and dynamically decides the frame type of the original image queue by traversing the combination of different frame types and reference structures, and calculating the pre-coding cost of the combination. The frame type may include key frames, predicted frames, and bidirectional predicted frames. The process of calculating the pre-coding cost is as follows: the image frame is divided into a plurality of pre-analysis units of preset sizes, intra-frame mode prediction and inter-frame mode prediction are performed on each pre-analysis unit, and the absolute error sum, square error sum, or absolute transform difference sum are calculated as the corresponding intra-frame prediction cost and inter-frame prediction cost. The intra-frame prediction cost is used to evaluate the prediction error size of the intra-frame prediction mode applied to the pre-analysis unit. The smaller the intra-frame prediction cost, the smaller the prediction error of the intra-frame prediction mode. The inter-frame prediction cost is used to evaluate the prediction error size of the inter-frame prediction mode applied to the pre-analysis unit. The smaller the inter-frame prediction cost, the smaller the prediction error of the inter-frame prediction mode. Therefore, the smaller the intra-frame prediction cost or inter-frame prediction cost, the more conducive it is to improving the compression efficiency of video coding and ensuring the quality of video coding. Therefore, each video frame to be processed stores corresponding pre-coding information in advance, and obtaining the pre-coding information can provide reference information for subsequent judgment of whether the video frame to be processed skips the motion vector correction at the decoding end.
[0046] Step S102: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0047] Among them, if the inter-frame prediction cost of the pre-analysis unit is less than the intra-frame prediction cost, it can be regarded that the prediction error of the pre-analysis unit applying the inter-frame prediction mode is smaller, which is more conducive to improving the efficiency and quality of encoding. Therefore, by counting the first unit number of pre-analysis units whose inter-frame prediction cost is less than the intra-frame prediction cost and calculating the first proportion, the proportion of pre-analysis units suitable for applying the inter-frame prediction mode for video encoding in the video frame to be processed can be effectively determined, which is conducive to judging whether the video frame to be processed as a whole is suitable for applying the inter-frame prediction mode or the intra-frame prediction mode.
[0048] Step S103: When the first proportion is less than a set first ratio threshold, skipping the decoding end motion vector correction of the to-be-processed video frame.
[0049] Among them, the first ratio threshold can be used to determine whether the video frame to be processed is more suitable for applying the inter-frame prediction mode or the intra-frame prediction mode for video encoding. For example, the value range of the first ratio threshold can be between 0.5-0.8. The developer can set it adaptively according to the coding efficiency and coding quality requirements in the actual application scenario, and this application does not limit it. If the first ratio is less than the set first ratio threshold, it can be regarded that more pre-analysis units in the video frame to be processed are suitable for applying the intra-frame prediction mode. Since the decoding-end motion vector correction is optimized for the inter-frame prediction mode, the decoding-end motion vector correction of all coding blocks in the video frame to be processed can be skipped during the formal encoding process, which can reduce the amount of calculation and has little impact on the encoding quality. If the first ratio is greater than or equal to the set first ratio threshold, it can be regarded that more pre-analysis units in the video frame to be processed are suitable for applying the inter-frame prediction mode, and the decoding-end motion vector correction of the video frame to be processed still needs to be performed.
[0050] In the above, by obtaining the video frame to be processed and the corresponding precoding information, the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and the intra-frame prediction cost and inter-frame prediction cost of each pre-analysis unit; the first unit number of the pre-analysis units that meet the inter-frame prediction cost less than the intra-frame prediction cost in the plurality of pre-analysis units is counted, and the first proportion of the first unit number relative to the total unit number of the plurality of pre-analysis units is calculated; when the first proportion is less than the set first proportion threshold, the decoding end motion vector correction of the video frame to be processed is skipped. In the above scheme, by obtaining the precoding information of the video frame to be processed, the mode prediction information obtained in the precoding process of the video frame to be processed can be effectively utilized to provide reliable reference data for whether the subsequent video frame to be processed skips the decoding end motion vector correction; by statistically calculating the first proportion of the pre-analysis units whose inter-frame prediction cost is less than the intra-frame prediction cost, the possibility of applying inter-frame coding to the video frame to be processed can be reasonably evaluated. When the first proportion is less than the set first proportion threshold, it can be effectively judged that the possibility of applying intra-frame coding to the video frame to be processed is higher, and the decoding end motion vector correction of the video frame to be processed is skipped, thereby reducing the amount of calculation of video coding and improving the efficiency of video coding.
[0051] Figure 2 Flow chart of another method for processing motion vector correction in video inter-frame coding provided by the embodiment of the present application. Figure 2 As shown, the following steps are included:
[0052] Step S201: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0053] Step S202: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0054] Step S203: When the first proportion is less than a set first ratio threshold, skipping the decoding end motion vector correction of the to-be-processed video frame.
[0055] Step S204: when the first proportion is greater than or equal to the first proportion threshold, calculate the pixel brightness variance of each pre-analysis unit.
[0056] Among them, if the first proportion is greater than or equal to the first ratio threshold, it can be regarded that more pre-analysis units in the video frame to be processed are suitable for applying the inter-frame prediction mode. However, if the video frame to be processed is a screen content coding frame, its image content contains a large number of computer graphics and text, and has characteristics that are completely different from natural video content, such as a large number of uniform and flat areas, repeated patterns, high saturation or a limited number of different color values, etc., then the video frame to be processed is more suitable for encoding using intra-frame block copy technology, etc., and is not suitable for applying the inter-frame prediction mode. It is possible to choose to skip the motion vector correction at the decoding end. Therefore, in order to determine whether the video frame to be processed is a screen content coding frame, the pixel brightness variance of each pre-analysis unit can be calculated. The pixel brightness variance can be used to represent the degree of deviation between the brightness value of each pixel in the image and the overall average brightness value. The smaller the pixel brightness variance, the lower the contrast of the image, and the flatter the content as a whole. For example, the calculation formula for the pixel brightness variance is as follows:
[0057]
[0058] Among them, S 2 represents the pixel brightness variance, N represents the total number of pixels in the pre-analysis unit, and I i represents the brightness value of the i-th pixel, and μ represents the mean brightness value of the pre-analysis unit.
[0059] Step S205: Count the number of second units of the pre-analysis units that satisfy the requirement that the pixel brightness variance is less than a set brightness variance threshold among the plurality of pre-analysis units, and calculate a second proportion of the number of second units to the total number of units.
[0060] Among them, the brightness variance threshold can be used to determine whether the image content of the pre-analysis unit is suitable for screen content encoding. Specifically, it can be adaptively set by the developer based on the empirical statistical data of actual encoding in the actual application scenario, and this application is not limited here. If the pixel brightness variance is less than the set brightness variance threshold, it can be regarded as the pixel contrast of the pre-analysis unit is low, the content is relatively flat as a whole, and it is suitable for screen content encoding. If the pixel brightness variance is greater than or equal to the set brightness variance threshold, it can be regarded as the pixel contrast of the pre-analysis unit is high, the content is relatively rich as a whole, and it is not suitable for screen content encoding. By counting the number of second units of the pre-analysis unit that satisfies the pixel brightness variance less than the set brightness variance threshold, and calculating the second proportion, the proportion of pre-analysis units suitable for screen content encoding in the video frame to be processed can be effectively determined, which is conducive to determining whether the video frame to be processed is a screen content encoding frame.
[0061] Step S206: When the second proportion is greater than a set second ratio threshold, skipping the decoding end motion vector correction of the to-be-processed video frame.
[0062] Among them, the second ratio threshold can be used to determine the possibility that the video frame to be processed is a screen content coding frame. For example, the value range of the first ratio threshold can be between 0.25-0.5. The developer can adaptively set it according to the video content characteristics and coding efficiency requirements in the actual application scenario, and this application does not limit it. If the second ratio is greater than the set second ratio threshold, it can be regarded as the possibility that the video frame to be processed is a screen content coding frame. You can choose to skip the motion vector correction on the decoding end. If the second ratio is less than or equal to the set second ratio threshold, it can be regarded as the possibility that the video frame to be processed is a screen content coding frame. It is still necessary to perform the motion vector correction on the decoding end.
[0063] As mentioned above, by combining the pixel brightness variance of the pre-analysis unit to determine whether the video frame to be processed is a screen content coding frame, adding a new decision condition can help to more accurately determine whether to skip the decoding-end motion vector correction of the processed video frame; when the second proportion is greater than the set second ratio threshold, it can be effectively determined that the possibility of the video frame to be processed is a screen content coding frame is high, and continue to choose to skip the decoding-end motion vector correction, thereby improving the overall efficiency of encoding.
[0064] Figure 3 The present invention provides a flowchart of a motion vector correction processing method in video inter-frame coding including a process of skipping the current predicted motion vector. Figure 3 As shown, the following steps are included:
[0065] Step S301: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0066] Step S302: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0067] Step S303: When the first proportion is less than a set first ratio threshold, skipping the decoding-end motion vector correction of the to-be-processed video frame.
[0068] Step S304: when the first proportion is greater than or equal to the first proportion threshold, calculate the pixel brightness variance of each pre-analysis unit.
[0069] Step S305: Count the number of second units of the pre-analysis units that satisfy the requirement that the pixel brightness variance is less than a set brightness variance threshold among the plurality of pre-analysis units, and calculate a second proportion of the number of second units to the total number of units.
[0070] Step S306: When the second proportion is greater than a set second ratio threshold, skipping the decoding-end motion vector correction of the to-be-processed video frame.
[0071] Step S307: When the second proportion is less than or equal to the second ratio threshold, obtain a predicted motion vector list of the current coding block.
[0072] Among them, in step S306, when the second proportion is greater than the set second proportion threshold, the decoding end motion vector correction of the video frame to be processed can be skipped, which is equivalent to controlling the enabling and disabling of the decoding end motion vector correction at the frame level, and in step S307, when the second proportion is less than or equal to the second proportion threshold, it can be regarded as the possibility that the video frame to be processed is a screen content coding frame. It is still necessary to perform the decoding end motion vector correction of the video frame to be processed. Therefore, after entering the decoding end motion vector correction process of the video frame to be processed, it is necessary to traverse all the coding blocks to perform the corresponding decoding end motion vector correction. Since each predicted motion vector in the predicted motion vector list corresponding to each coding block needs to perform motion compensation and pixel search related calculations, it can be considered to optimize the block-level decoding end motion vector correction process, reduce the amount of calculation, and improve the coding efficiency. In the VVC standard, the predicted motion vector list in the Merge mode can be constructed with different types of candidate motion vectors, specifically including in order: spatial domain predicted motion vectors from spatially adjacent coding blocks, temporal domain predicted motion vectors from juxtaposed coding blocks, historically based predicted motion vectors from the first-in-first-out table, paired average predicted motion vectors, and zero motion vectors. Of course, the prediction motion vector lists constructed by different video coding standards are not limited to the aforementioned types of candidate motion vectors, and this application does not make any limitation here.
[0073] Step S308: When it is detected that the current predicted motion vector in the motion vector candidate list meets the enabling condition of the decoding-side motion vector correction, the current predicted motion vector is compared with the previous predicted motion vector in the predicted motion vector list.
[0074] Among them, the predicted motion vector in the motion vector candidate list needs to meet the enabling conditions of the motion vector correction at the decoding end before the calculation process corresponding to the motion vector correction at the decoding end can be executed. Therefore, in the process of traversing the predicted motion vector, once it is detected that the current predicted motion vector meets the enabling conditions of the motion vector correction at the decoding end, the subsequent judgment logic of whether to skip the current predicted motion vector is executed. If the current predicted motion vector can be skipped, the current predicted motion vector does not participate in the subsequent related calculation of the best motion vector. In the VVC standard, the predicted motion vector that enables the motion vector correction at the decoding end in the Merge mode of bidirectional prediction needs to meet the following elements: the two reference frames are respectively located before and after the current video frame, the image sequence count values of the two reference frames are respectively equal to the difference between the image sequence count values of the current video frame, the coding block has at least 64 luminance pixels, the width and height of the coding block are greater than or equal to 8, the BCW (Bi-prediction with CU-level Weight, bidirectional weighted prediction based on the coding unit level) algorithm uses equal weights, and the current coding block does not use the WP (Weighted Prediction, weighted prediction) mode. Of course, different video coding standards can be set with corresponding activation conditions for decoding-side motion vector correction, which are not limited to the aforementioned elements, and are not limited in this application. Since the encoding process traverses the predicted motion vectors in the motion vector candidate list from small to large according to the sequence number, if it is detected that the current predicted motion vector meets the activation condition for decoding-side motion vector correction, the current predicted motion vector can be selected to be compared with the previous predicted motion vector in the predicted motion vector list, and the sequence number of the previous predicted motion vector is less than the sequence number of the current predicted motion vector, and it is determined whether the current predicted motion vector is the same as the previous predicted motion vector. If there are the same predicted motion vectors, it means that the same predicted motion vector has completed the execution or skipping of the decoding-side motion vector correction. The current predicted motion vector continues to participate in the subsequent optimal motion vector calculation decision process, which will cause unnecessary repeated redundant calculations, and the current predicted motion vector can be skipped. If there are no identical predicted motion vectors, the current predicted motion vector can execute the decoding-side motion vector correction and participate in the subsequent optimal motion vector calculation decision process, or continue to execute the judgment logic of combining other elements to determine whether to skip the decoding-side motion vector correction, so as to avoid directly skipping the current predicted motion vector and causing the encoding quality to be damaged.
[0075] Step S309: When there is a first predicted motion vector in the previous predicted motion vector that is the same as the current predicted motion vector, skip the current predicted motion vector.
[0076] As described above, by determining that there is a first predicted motion vector that is the same as the current predicted motion vector in the previous predicted motion vector, and skipping the current predicted motion vector, unnecessary repeated redundant calculations can be effectively reduced, thereby speeding up video encoding.
[0077] Figure 4 A flowchart of another method for correcting motion vectors in video inter-frame coding including skipping the process of currently predicted motion vectors provided by an embodiment of the present application. Figure 4 As shown, the following steps are included:
[0078] Step S401: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0079] Step S402: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0080] Step S403: When the first proportion is less than a set first ratio threshold, skipping the decoding-end motion vector correction of the to-be-processed video frame.
[0081] Step S404: when the first proportion is greater than or equal to the first proportion threshold, calculate the pixel brightness variance of each pre-analysis unit.
[0082] Step S405: Count the number of second units of the pre-analysis units that satisfy the pixel brightness variance less than the set brightness variance threshold among the multiple pre-analysis units, and calculate a second proportion of the number of second units to the total number of units.
[0083] Step S406: When the second proportion is greater than a set second ratio threshold, skipping the decoding-end motion vector correction of the to-be-processed video frame.
[0084] Step S407: When the second proportion is less than or equal to the second ratio threshold, obtain a predicted motion vector list of the current coding block.
[0085] Step S408: When it is detected that the current predicted motion vector in the motion vector candidate list meets the enabling condition of the decoding-side motion vector correction, the current predicted motion vector is compared with the previous predicted motion vector in the predicted motion vector list.
[0086] Step S409: When there is a first predicted motion vector in the previous predicted motion vector that is the same as the current predicted motion vector, skip the current predicted motion vector.
[0087] Step S410 : When there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, perform a reference frame comparison between the current predicted motion vector and the previous predicted motion vector.
[0088] Among them, if there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, it is possible to continue to combine other factors to determine whether the current predicted motion vector skips the decoding-side motion vector correction. The reference frame can be a reference image used to predict the motion information of the current coding block. If the current predicted motion vector is different from the reference frame of the previous predicted motion vector, it can be regarded that the current predicted motion vector has no similar association with the other predicted motion vectors, and it is necessary to continue to perform the decoding-side motion vector correction. If the current predicted motion vector is the same as each reference frame of a predicted motion vector in the previous predicted motion vector, it means that the current predicted motion vector may be similar to the predicted motion vector, and there may be a lot of overlap in the related search calculation process. Therefore, it is possible to continue to combine whether the predicted positions pointed to by the two are close and the pixel accuracy of the current predicted motion vector to determine whether to skip the current predicted motion vector.
[0089] Step S411 : when there is a second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, calculate the pixel distance between the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector respectively.
[0090] Among them, by calculating the pixel distance between the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector respectively, it can be used to measure whether the predicted positions of the current predicted motion vector and the second predicted motion vector are close. If the pixel distance between the predicted positions is small, there may be a lot of overlap in the related search calculation process, occupying unnecessary computing resources.
[0091] In one embodiment, when there is no second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, decoding-side motion vector correction of the current predicted motion vector is performed.
[0092] Among them, if there is no second predicted motion vector in the previous predicted motion vector that is the same as the reference frame of the current predicted motion vector, it can be regarded that the previous predicted motion vector is not close to the current predicted motion vector. Skipping the current predicted motion vector may cause damage to the encoding quality. You can choose to continue to execute the decoding-end motion vector correction of the current predicted motion vector and participate in the subsequent calculation and decision process of the optimal motion vector.
[0093] Step S412: When the pixel distance is less than or equal to a preset number of integer pixel distances and the current predicted motion vector has sub-pixel accuracy, skip the current predicted motion vector.
[0094] Among them, the preset number of integer pixel distances can be a distance threshold used to determine whether the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector are close to each other. For example, the preset number can be 1 or 2, which can be adaptively adjusted by the developer according to the coding efficiency requirements and coding quality requirements of the actual application scenario, and this application does not limit it. If the pixel distance is less than or equal to the preset number of integer pixel distances, it can be regarded that there may be a large amount of overlap in the related search calculation process of the two, the prediction results are close, and the current predicted motion vector is sub-pixel precision, then the related motion compensation requires sub-pixel interpolation calculation, which has a large amount of calculation. Therefore, it can be chosen to skip the current predicted motion vector, which has little impact on the coding performance and can greatly reduce the amount of calculation.
[0095] As described above, by determining that the pixel distance between the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector is less than or equal to a preset number of integer pixel distances, and the current predicted motion vector has sub-pixel accuracy, it is possible to effectively identify that there is a large amount of overlap in the search and calculation processes of the current predicted motion vector and the second predicted motion vector, and that their motion compensation requires complex interpolation calculations, thereby deciding to skip the current predicted motion vector, which is beneficial to ensuring that the encoding performance is less affected while reducing the amount of calculation.
[0096] Figure 5 Flow chart of another method for processing motion vector correction in video inter-frame coding provided by the embodiment of the present application. Figure 5 As shown, the following steps are included:
[0097] Step S501: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0098] Step S502: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0099] Step S503: When the first proportion is less than a set first ratio threshold, the decoding end motion vector correction of the to-be-processed video frame is skipped.
[0100] Step S504: when the first proportion is greater than or equal to the first proportion threshold, calculate the pixel brightness variance of each pre-analysis unit.
[0101] Step S505: Count the number of second units of the pre-analysis units that satisfy the requirement that the pixel brightness variance is less than a set brightness variance threshold among the plurality of pre-analysis units, and calculate a second proportion of the number of second units to the total number of units.
[0102] Step S506: When the second proportion is greater than a set second ratio threshold, skipping the decoding end motion vector correction of the to-be-processed video frame.
[0103] Step S507: When the second proportion is less than or equal to the second ratio threshold, obtain a predicted motion vector list of the current coding block.
[0104] Step S508: When it is detected that the current predicted motion vector in the motion vector candidate list meets the enabling condition of the decoding-side motion vector correction, the current predicted motion vector is compared with the previous predicted motion vector in the predicted motion vector list.
[0105] Step S509: When there is a first predicted motion vector in the previous predicted motion vector that is the same as the current predicted motion vector, skip the current predicted motion vector.
[0106] Step S510 : When there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, perform a reference frame comparison between the current predicted motion vector and the previous predicted motion vector.
[0107] Step S511 : when there is a second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, calculate the pixel distance between the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector respectively.
[0108] Step S512: When the pixel distance is less than or equal to a preset number of integer pixel distances and the current predicted motion vector has sub-pixel accuracy, skip the current predicted motion vector.
[0109] Step S513: When the pixel distance is greater than a preset number of integer pixel distances, or the current predicted motion vector has integer pixel precision, a decoder-side motion vector correction of the current predicted motion vector is performed.
[0110] Among them, if the pixel distance is greater than the preset number of integer pixel distances, it means that the overlap between the search and calculation process of the current predicted motion vector and the second predicted motion vector is small, and the two are not very similar. If the current predicted motion vector is integer pixel precision, it means that the motion compensation calculation amount is relatively small. Therefore, in the above case, skipping the decoding end motion vector correction may have a greater impact on the encoding performance, and you can choose to perform the decoding end motion vector correction of the current predicted motion vector and continue to participate in the subsequent optimal motion vector calculation decision process.
[0111] Step S514: When it is detected that the first absolute error sum calculated when performing integer pixel search based on the current predicted motion vector is greater than the set error sum threshold, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped, wherein the error sum threshold is a preset multiple of the minimum value of the absolute error sum calculated when performing decoding-side motion vector correction on other recorded predicted motion vectors.
[0112] Among them, after the current predicted motion vector determines to execute the decoding-side motion vector correction, it is necessary to perform the motion compensation, integer pixel search, and sub-pixel search calculation processes involved in the decoding-side motion vector correction. The specific implementation details have been provided in the previous description, and this application will not repeat them one by one. In the calculation process of the integer pixel search, the calculated first absolute value error sum is the absolute value error sum of the two predicted coding blocks under the bilateral template. If the first absolute value error sum is greater than the set error sum threshold, it can be regarded as the motion vector obtained by refining the current predicted motion vector after the decoding-side motion vector correction, and it will not be better than the final prediction result of other predicted motion vectors. Therefore, you can choose to end the decoding-side motion vector correction of the current predicted motion vector in advance, and skip the current predicted motion vector, and no longer participate in the subsequent optimal motion vector calculation decision process, reducing unnecessary calculations. The error and threshold corresponding to the current predicted motion vector are dynamically set based on the minimum value of all the absolute error sums calculated by other predicted motion vectors that have completed relevant calculations in the whole pixel search or sub-pixel search stage. The preset multiple can be 2 times, 3 times, etc., and can be adaptively set by the developer according to the coding efficiency requirements of the actual application scenario and relevant empirical data, and this application does not limit this.
[0113] As described above, when the current predicted motion vector performs an integer pixel search, by comparing the calculated first absolute error sum with the set error and threshold, it is possible to effectively determine whether the calculation result of its integer pixel search is better than other predicted motion vectors that have completed relevant calculations; if the calculated first absolute error sum is greater than the set error and threshold, it is possible to choose to end the decoding-end motion vector correction of the current predicted motion vector in advance and skip the current predicted motion vector, thereby reducing unnecessary calculations and improving coding efficiency.
[0114] Figure 6 Flow chart of another method for processing motion vector correction in video inter-frame coding provided by the embodiment of the present application. Figure 6 As shown, the following steps are included:
[0115] Step S601: Obtain a video frame to be processed and corresponding precoding information, where the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit.
[0116] Step S602: Count the number of first units of the pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculate a first ratio of the number of first units to the total number of the pre-analysis units.
[0117] Step S603: When the first proportion is less than a set first ratio threshold, skipping the decoding-end motion vector correction of the to-be-processed video frame.
[0118] Step S604: when the first proportion is greater than or equal to the first proportion threshold, calculate the pixel brightness variance of each pre-analysis unit.
[0119] Step S605: Count the number of second units of the pre-analysis units that satisfy the requirement that the pixel brightness variance is less than a set brightness variance threshold among the plurality of pre-analysis units, and calculate a second proportion of the number of second units to the total number of units.
[0120] Step S606: When the second proportion is greater than a set second ratio threshold, skipping the decoding end motion vector correction of the to-be-processed video frame.
[0121] Step S607: When the second proportion is less than or equal to the second ratio threshold, obtain a predicted motion vector list of the current coding block.
[0122] Step S608: When it is detected that the current predicted motion vector in the motion vector candidate list meets the enabling condition of the decoding-side motion vector correction, the current predicted motion vector is compared with the previous predicted motion vector in the predicted motion vector list.
[0123] Step S609: When there is a first predicted motion vector in the previous predicted motion vector that is the same as the current predicted motion vector, skip the current predicted motion vector.
[0124] Step S610: When there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, perform a reference frame comparison between the current predicted motion vector and the previous predicted motion vector.
[0125] Step S611: When there is a second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, calculate the pixel distance between the prediction positions pointed to by the current predicted motion vector and the second predicted motion vector.
[0126] Step S612: When the pixel distance is less than or equal to a preset number of integer pixel distances and the current predicted motion vector has sub-pixel accuracy, skip the current predicted motion vector.
[0127] Step S613: When the pixel distance is greater than a preset number of integer pixel distances, or the current predicted motion vector has integer pixel precision, a decoder-side motion vector correction of the current predicted motion vector is performed.
[0128] Step S614: When it is detected that the first absolute error sum calculated when performing integer pixel search based on the current predicted motion vector is greater than the set error sum threshold, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped, wherein the error sum threshold is a preset multiple of the minimum value of the absolute error sum calculated when performing decoding-side motion vector correction on other recorded predicted motion vectors.
[0129] Step S615: when it is detected that the calculated second absolute error sum is greater than the error sum threshold when performing pixel-by-pixel search based on the current predicted motion vector, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped.
[0130] Among them, in the calculation process of pixel search, the calculated second absolute value error sum is the absolute value error sum of the best corrected motion vector position calculated according to the parameter error surface equation. If the second absolute value error sum is greater than the set error sum threshold, it can be regarded as the motion vector obtained by refining the current predicted motion vector after the decoding-end motion vector correction, which will not be better than the final prediction results of other predicted motion vectors. Therefore, it is possible to choose to end the decoding-end motion vector correction of the current predicted motion vector in advance, skip the current predicted motion vector, and no longer participate in the subsequent optimal motion vector calculation decision process, thereby reducing unnecessary calculations.
[0131] As described above, when the current predicted motion vector performs a pixel-by-pixel search, by comparing the calculated first absolute error sum with the set error and threshold, it is possible to effectively determine whether the calculation result of its pixel-by-pixel search is better than other predicted motion vectors that have completed relevant calculations; if the calculated second absolute error sum is greater than the set error and threshold, it is possible to choose to end the decoding-end motion vector correction of the current predicted motion vector in advance and skip the current predicted motion vector, thereby reducing unnecessary calculations and improving coding efficiency.
[0132] Figure 7 This is a structural block diagram of a motion vector correction processing device in video inter-frame coding provided by an embodiment of the present application. The device is configured to execute the motion vector correction processing method in video inter-frame coding provided by the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 7 As shown, the device comprises:
[0133] The acquisition module 101 is configured to acquire a video frame to be processed and corresponding precoding information, wherein the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each pre-analysis unit;
[0134] a proportion calculation module 102, configured to count the number of first units of the pre-analysis units satisfying that the inter-frame prediction cost is less than the intra-frame prediction cost among the plurality of pre-analysis units, and calculate a first proportion of the number of the first units relative to the total number of the plurality of pre-analysis units;
[0135] The vector correction skipping module 103 is configured to skip the decoding-end motion vector correction of the to-be-processed video frame when the first proportion is less than a set first proportion threshold.
[0136] In the above, by obtaining the video frame to be processed and the corresponding precoding information, the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and the intra-frame prediction cost and inter-frame prediction cost of each pre-analysis unit; the first unit number of the pre-analysis units that meet the inter-frame prediction cost less than the intra-frame prediction cost in the plurality of pre-analysis units is counted, and the first proportion of the first unit number relative to the total unit number of the plurality of pre-analysis units is calculated; when the first proportion is less than the set first proportion threshold, the decoding end motion vector correction of the video frame to be processed is skipped. In the above scheme, by obtaining the precoding information of the video frame to be processed, the mode prediction information obtained in the precoding process of the video frame to be processed can be effectively utilized to provide reliable reference data for whether the subsequent video frame to be processed skips the decoding end motion vector correction; by statistically calculating the first proportion of the pre-analysis units whose inter-frame prediction cost is less than the intra-frame prediction cost, the possibility of applying inter-frame coding to the video frame to be processed can be reasonably evaluated. When the first proportion is less than the set first proportion threshold, it can be effectively judged that the possibility of applying intra-frame coding to the video frame to be processed is higher, and the decoding end motion vector correction of the video frame to be processed is skipped, thereby reducing the amount of calculation of video coding and improving the efficiency of video coding.
[0137] In a possible embodiment, it further includes a second vector correction skipping module configured as follows:
[0138] When the first proportion is greater than or equal to the first proportion threshold, calculating the pixel brightness variance of each pre-analysis unit;
[0139] Counting the number of second units of the pre-analysis units whose pixel brightness variance is less than a set brightness variance threshold among the multiple pre-analysis units, and calculating a second proportion of the number of second units to the total number of units;
[0140] When the second proportion is greater than the set second ratio threshold, the decoding end motion vector correction of the to-be-processed video frame is skipped.
[0141] In a possible embodiment, a third vector correction skipping module is further included, configured as follows:
[0142] When the second proportion is less than or equal to the second ratio threshold, obtaining a predicted motion vector list of the current coding block;
[0143] When it is detected that the current predicted motion vector in the motion vector candidate list meets the enabling condition of the motion vector correction at the decoding end, the current predicted motion vector is compared with the previous predicted motion vector in the predicted motion vector list;
[0144] When there is a first predicted motion vector identical to the current predicted motion vector among the previous predicted motion vectors, the current predicted motion vector is skipped.
[0145] In a possible embodiment, a fourth vector correction skipping module is further included, configured as follows:
[0146] When there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, performing a reference frame comparison between the current predicted motion vector and the previous predicted motion vector;
[0147] When there is a second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, calculating the pixel distance between the prediction positions pointed to by the current predicted motion vector and the second predicted motion vector respectively;
[0148] When the pixel distance is less than or equal to a preset number of integer pixel distances and the current predicted motion vector has sub-pixel precision, the current predicted motion vector is skipped.
[0149] In a possible embodiment, it further includes a vector correction execution module configured to:
[0150] In the case that there is no second predicted motion vector having the same reference frame as the current predicted motion vector in the previous predicted motion vector, decoding-side motion vector correction of the current predicted motion vector is performed.
[0151] In a possible embodiment, it further includes a first vector correction termination module configured to:
[0152] When the pixel distance is greater than a preset number of integer pixel distances, or the current predicted motion vector has integer pixel precision, performing a decoder-side motion vector correction of the current predicted motion vector;
[0153] When it is detected that the first absolute error sum calculated when performing an integer pixel search based on the current predicted motion vector is greater than the set error sum threshold, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped, wherein the error sum threshold is a preset multiple of the minimum value of the absolute error sum calculated when performing decoding-side motion vector correction on other recorded predicted motion vectors.
[0154] In a possible embodiment, it further includes a second vector correction termination module configured as follows:
[0155] When it is detected that the calculated second absolute error sum is greater than the error sum threshold when performing pixel-by-pixel search based on the current predicted motion vector, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped.
[0156] Figure 8 A schematic diagram of the structure of a motion vector correction processing device in video inter-frame coding provided by an embodiment of the present application, such as 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 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 8 The example of connection via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the motion vector correction processing method in the video inter-frame coding in the embodiment of the present application. 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, that is, implements the above-mentioned motion vector correction processing method in the video inter-frame coding. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0157] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a motion vector correction processing method in video inter-frame coding described in the above embodiment, which includes: obtaining a video frame to be processed and corresponding pre-coding information, the pre-coding information including a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each of the pre-analysis units; counting a first number of pre-analysis units in the plurality of pre-analysis units that satisfy the requirement that the inter-frame prediction cost is less than the intra-frame prediction cost, and calculating a first proportion of the first number of units relative to the total number of the plurality of pre-analysis units; and skipping the decoding-end motion vector correction of the video frame to be processed when the first proportion is less than a set first ratio threshold.
[0158] It is worth noting that in the embodiment of the above-mentioned video inter-frame coding device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0159] In some possible implementations, various aspects of the method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the motion vector correction processing method in video inter-frame coding recorded in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A motion vector correction processing method in video inter-frame coding, characterized in that: include: Acquire a video frame to be processed and corresponding precoding information, wherein the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each of the pre-analysis units; Counting a first number of pre-analysis units satisfying that an inter-frame prediction cost is less than an intra-frame prediction cost among the plurality of pre-analysis units, and calculating a first ratio of the first number of units to a total number of units of the plurality of pre-analysis units; When the first proportion is less than a set first ratio threshold, the decoding-end motion vector correction of the to-be-processed video frame is skipped.
2. The motion vector correction processing method in video inter-frame coding according to claim 1, characterized in that: After calculating a first proportion of the first unit quantity to a total unit quantity of the plurality of pre-analysis units, the method further includes: When the first proportion is greater than or equal to the first ratio threshold, calculating the pixel brightness variance of each of the pre-analysis units; Counting the number of second units of the pre-analysis units whose pixel brightness variance is less than a set brightness variance threshold among the multiple pre-analysis units, and calculating a second proportion of the number of the second units to the total number of units; When the second proportion is greater than a set second ratio threshold, the decoding-end motion vector correction of the to-be-processed video frame is skipped.
3. The motion vector correction processing method in video inter-frame coding according to claim 2, characterized in that: After calculating the second proportion of the second unit quantity to the total unit quantity, the method further includes: When the second proportion is less than or equal to the second ratio threshold, obtaining a predicted motion vector list of the current coding block; When it is detected that the current predicted motion vector in the motion vector candidate list satisfies the enabling condition of the decoder motion vector correction, the current predicted motion vector is compared with the preceding predicted motion vector in the predicted motion vector list; If there is a first prediction motion vector identical to the current prediction motion vector among the previous prediction motion vectors, the current prediction motion vector is skipped.
4. The motion vector correction processing method in video inter-frame coding according to claim 3 is characterized in that: After comparing the current predicted motion vector with the preceding predicted motion vector in the predicted motion vector list, the method further includes: When there is no first predicted motion vector identical to the current predicted motion vector in the previous predicted motion vector, performing reference frame comparison between the current predicted motion vector and the previous predicted motion vector; When there is a second predicted motion vector in the previous predicted motion vector that has the same reference frame as the current predicted motion vector, calculating the pixel distance between the predicted positions pointed to by the current predicted motion vector and the second predicted motion vector respectively; When the pixel distance is less than or equal to a preset number of integer pixel distances and the current predicted motion vector has sub-pixel precision, the current predicted motion vector is skipped.
5. The motion vector correction processing method in video inter-frame coding according to claim 4, characterized in that: After comparing the current predicted motion vector with the previous predicted motion vector by reference frame, the method further includes: In a case where there is no second predicted motion vector having the same reference frame as the current predicted motion vector in the previous predicted motion vector, a decoding-side motion vector correction of the current predicted motion vector is performed.
6. The motion vector correction processing method in video inter-frame coding according to claim 4, characterized in that: After calculating the pixel distance between the prediction positions pointed to by the current prediction motion vector and the second prediction motion vector respectively, the method further includes: When the pixel distance is greater than the preset number of integer pixel distances, or the current predicted motion vector has integer pixel precision, performing decoding-side motion vector correction of the current predicted motion vector; When it is detected that the first absolute error sum calculated when performing integer pixel search based on the current predicted motion vector is greater than the set error sum threshold, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped. The error sum threshold is a preset multiple of the minimum value of the absolute error sum calculated when performing decoding-side motion vector correction on other recorded predicted motion vectors.
7. The motion vector correction processing method in video inter-frame coding according to claim 6, characterized in that: After the decoding end motion vector correction of the current predicted motion vector is performed, the method further includes: When it is detected that the second absolute error sum calculated when performing pixel-by-pixel search based on the current predicted motion vector is greater than the error sum threshold, the decoding-side motion vector correction of the current predicted motion vector is terminated and the current predicted motion vector is skipped.
8. A motion vector correction processing device in video inter-frame coding, characterized in that: include: An acquisition module is configured to acquire a video frame to be processed and corresponding precoding information, wherein the precoding information includes a plurality of pre-analysis units pre-divided in the video frame to be processed, and an intra-frame prediction cost and an inter-frame prediction cost of each of the pre-analysis units; a proportion calculation module, configured to count a first number of pre-analysis units satisfying that an inter-frame prediction cost is less than an intra-frame prediction cost among the plurality of pre-analysis units, and calculate a first proportion of the first number of units relative to a total number of the plurality of pre-analysis units; The vector correction skipping module is configured to skip the decoding-end motion vector correction of the to-be-processed video frame when the first proportion is less than a set first proportion threshold.
9. A motion vector correction processing device in video inter-frame coding, the device comprising: one or more processors; A storage device configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the motion vector correction processing method in video inter-frame coding according to any one of claims 1 to 7.
10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the motion vector correction processing method in video inter-frame coding according to any one of claims 1 to 7 when executed by a computer processor.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the motion vector correction processing method in video inter-frame coding according to any one of claims 1 to 7 is implemented.