CN114727115B - Integer motion estimation method, system and storage medium for video coding - Google Patents
Integer motion estimation method, system and storage medium for video coding Download PDFInfo
- Publication number
- CN114727115B CN114727115B CN202210393510.4A CN202210393510A CN114727115B CN 114727115 B CN114727115 B CN 114727115B CN 202210393510 A CN202210393510 A CN 202210393510A CN 114727115 B CN114727115 B CN 114727115B
- Authority
- CN
- China
- Prior art keywords
- data
- processed
- current block
- block
- point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 239000013598 vector Substances 0.000 claims abstract description 29
- 238000004364 calculation method Methods 0.000 claims description 84
- 230000003139 buffering effect Effects 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 7
- 239000000872 buffer Substances 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000013461 design Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 238000000638 solvent extraction Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/533—Motion estimation using multistep search, e.g. 2D-log search or one-at-a-time search [OTS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/557—Motion estimation characterised by stopping computation or iteration based on certain criteria, e.g. error magnitude being too large or early exit
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention relates to the technical field of video coding, and discloses an integer motion estimation method for video coding, which comprises the following steps: calculating a first SAD value of the zero current block according to the center point, and outputting the relative coordinates of the center point as an optimal motion vector under the condition that the first SAD value is smaller than a threshold value; calculating a second SAD value of the current block of the dense area according to the first search point, and outputting the relative coordinates of the first search point as an optimal motion vector under the condition that the second SAD value is smaller than a threshold value; under the condition that the optimal motion vector is not determined in the current block of the dense area, calculating a third SAD value of the current block of the sparse area according to the second search point, and under the condition that the third SAD value is smaller than a threshold value, outputting the relative coordinates of the second search point as the optimal motion vector.
Description
Technical Field
The present invention relates to the field of video coding technologies, and in particular, to a method, a system, and a storage medium for integer motion estimation in video coding.
Background
With the rapid development of video technology, the information amount carried by video is greatly increased, the video coding technology is used as a core technology of video transmission, redundant information in video can be eliminated, bandwidth pressure and storage cost in the video transmission process are reduced, in the video coding process, integer motion estimation (Interger Motion Estimation, IME) is the most complex link in the coding process, the whole video coding takes more than 50% of time, currently, in an integer motion estimation search algorithm, the two main types of full search and rapid search can be divided, compared with the full search, the rapid search can save a large amount of time, and improve coding performance, but a large amount of time and storage control are still needed for reading and storing pixel data calculated in real time, so the problems of long time consumption and large storage space consumption exist in the process of calculating an integer motion estimation related algorithm are solved.
Disclosure of Invention
The invention provides an integer motion estimation method, an integer motion estimation system and a storage medium for video coding, which are used for solving the problems of long time consumption and large storage space consumption in the existing integer motion estimation related calculation.
In order to achieve the above object, the present invention is realized by the following technical scheme:
in a first aspect, the present invention provides a method for integer motion estimation for video coding, comprising:
Dividing the data to be processed into a zero current block, a dense region current block and a sparse region current block according to the step length of the data to be processed, and determining a center point of the zero current block, a first search point of the dense region current block and a second search point of the sparse region current block;
Calculating a first SAD value of the zero current block according to the center point, and outputting the relative coordinates of the center point as an optimal motion vector under the condition that the first SAD value is smaller than a threshold value;
calculating a second SAD value of the current block of the dense area according to the first search point under the condition that the optimal motion vector is not determined in the current block of the zero point, and outputting the relative coordinates of the first search point as the optimal motion vector under the condition that the second SAD value is smaller than a threshold value;
and calculating a third SAD value of the current block of the sparse area according to the second search point when the optimal motion vector is not determined in the current block of the dense area, and outputting the relative coordinates of the second search point as the optimal motion vector when the third SAD value is smaller than a threshold value.
Optionally, before the data to be processed is divided into the zero current block, the dense area current block and the sparse area current block according to the step length of the data to be processed, the method further includes:
obtaining a target video frame to be encoded, determining a video frame to be processed in the target video frame, dividing the video frame to be processed into n pieces of data to be processed according to a preset size, wherein n is a positive integer.
Optionally, the method further comprises:
Taking a first frame video frame of the target video frame as a reference video frame, and dividing the reference video frame into n pieces of reference data according to a preset size;
Dividing the reference data into a zero point reference block, a dense region reference block and a sparse region reference block according to the step length of the reference data, and determining a first calculation point of the zero point reference block, a second calculation point of the dense region reference block and a third calculation point of the sparse region reference block.
Optionally, the calculating the first SAD value of the zero current block according to the center point includes:
acquiring the zero point current block and the zero point reference block based on the coordinates of the center point and the coordinates of the first calculation point;
Splitting the zero current block and the zero reference block, and splicing the split data blocks to obtain a first calculation basic unit block;
and subtracting the pixels from the zero current block and the pixels from the zero reference block in the first calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a first SAD value.
Optionally, the calculating the second SAD value of the current block of the dense area according to the first search point includes:
Acquiring the current block of the dense area and the reference block of the dense area based on the coordinates of the first search point and the coordinates of the second calculation point;
splitting the current block of the dense area and the reference block of the dense area, and splicing the split data blocks to obtain a second calculation basic unit block;
and subtracting the pixels from the current block of the dense region from the pixels from the reference block of the dense region in the second calculation basic unit block, taking the absolute value, and accumulating the absolute values to obtain a second SAD value.
Optionally, the calculating the third SAD value of the current block of the sparse region according to the second search point includes:
acquiring the current sparse region block and the reference sparse region block based on the coordinates of the second search point and the coordinates of the third calculation point;
splitting the current sparse region block and the reference sparse region block, and splicing the split data blocks to obtain a third calculation basic unit block;
and subtracting the pixels from the current block of the sparse region from the pixels from the reference block of the sparse region in the third calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a third SAD value.
Optionally, the method further comprises:
Determining first data to be processed and second data to be processed, wherein the second data to be processed is adjacent to the first data to be processed;
determining a target area overlapping with the first data to be processed in the second data to be processed according to the step length and the size of the first data to be processed and the second data to be processed;
and eliminating the target area in the second data to be processed.
Optionally, the dividing the data to be processed into the zero point current block, the dense area current block and the sparse area current block according to the step length of the data to be processed includes:
dividing data to be processed with the step length of 0 into zero areas, and determining a zero current block in the data division to be processed based on the zero areas;
dividing data to be processed with the step length smaller than or equal to 4 into dense areas, and determining a current block of the dense areas in the data division to be processed based on the dense areas;
Dividing the data to be processed with the step length greater than or equal to 8 into sparse areas, and determining a current block of the sparse areas in the data division to be processed based on the sparse areas.
In a second aspect, an embodiment of the present application provides an integer motion estimation system for video coding, including: the system comprises a control module, a data scheduling module, a data buffering module, a two-stage data splicing module, an SAD calculation module, an SAD comparison module and a storage module;
the data scheduling module is used for acquiring data to be processed and sending the data to be processed to the SAD calculation module, and is also used for acquiring reference data and sending the reference data to the two-stage data splicing module;
the two-stage data splicing module is used for splitting and splicing the reference data and sending the spliced data to the SAD calculation module;
the SAD calculation module is used for calculating according to the acquired spliced data and the acquired data to be processed to obtain an SAD value, and sending the SAD value to the SAD comparison module;
the SAD comparison module is used for generating feedback information according to the acquired SAD value and sending the SAD value and the feedback information to the control module;
The control module is used for receiving the starting and stopping of the feedback information control flow of the SAD comparison module and outputting an optimal motion vector according to the SAD value.
In a third aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method steps according to the first aspect.
The beneficial effects are that:
The integer motion estimation algorithm for video coding provided by the invention divides data to be processed into three search windows of a zero current block, a dense area current block and a sparse area current block, performs optimal matching operation of motion vectors in the three search windows in a gradual search operation mode, and terminates operation after obtaining the optimal matching block of the motion vectors through the concept of early termination, thereby reducing unnecessary steps, improving calculation parallelism, and repeatedly using threshold values in the operation process through the concept of data reuse, thereby reducing operation steps and reducing calculation and storage cost.
Drawings
FIG. 1 is a flow chart of an integer motion estimation method for video coding according to a preferred embodiment of the present invention;
FIG. 2 is a schematic diagram of the calculation of the first SAD value, the second SAD value, and the third SAD value according to the preferred embodiment of the present invention;
FIG. 3 is a diagram illustrating the partitioning of current blocks in a dense area according to a preferred embodiment of the present invention;
FIG. 4 is a schematic diagram of overlapping target areas of adjacent data to be processed according to a preferred embodiment of the present invention;
FIG. 5 is a schematic diagram of data concatenation between a current block of a dense area and a reference block of the dense area according to a preferred embodiment of the present invention;
FIG. 6 is a diagram illustrating current block partitioning of a sparse region in accordance with a preferred embodiment of the present invention;
FIG. 7 is a schematic diagram of an integer motion estimation system for video coding according to a preferred embodiment of the present invention;
Fig. 8 is a second schematic diagram of an integer motion estimation system for video coding according to a preferred embodiment of the present invention.
Detailed Description
The following description of the present invention will be made clearly and fully, and it is apparent that the embodiments described are only some, but not all, of the embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. The terms "first," "second," and the like, as used herein, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. Likewise, the terms "a" or "an" and the like do not denote a limitation of quantity, but rather denote the presence of at least one. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate a relative positional relationship, which changes accordingly when the absolute position of the object to be described changes.
Referring to fig. 1-6, an embodiment of the present application provides an integer motion estimation method for video coding, including:
Dividing the data to be processed into a zero current block, a dense region current block and a sparse region current block according to the step length of the data to be processed, and determining a center point of the zero current block, a first search point of the dense region current block and a second search point of the sparse region current block;
Calculating a first SAD value of the zero current block according to the center point, and outputting the relative coordinates of the center point as an optimal motion vector under the condition that the first SAD value is smaller than a threshold value;
calculating a second SAD value of the current block of the dense area according to the first search point under the condition that the optimal motion vector is not determined in the current block of the zero point, and outputting the relative coordinates of the first search point as the optimal motion vector under the condition that the second SAD value is smaller than a threshold value;
and calculating a third SAD value of the current block of the sparse area according to the second search point when the optimal motion vector is not determined in the current block of the dense area, and outputting the relative coordinates of the second search point as the optimal motion vector when the third SAD value is smaller than a threshold value.
In the above embodiment, the data to be processed is divided into three search windows of the zero point current block, the dense area current block and the sparse area current block, the optimal matching operation of the motion vector is gradually performed in the three search windows in a step-by-step search operation mode, the operation is terminated after the optimal matching block of the motion vector is obtained through the concept of early termination, thus unnecessary steps are reduced, is improved, and when the zero point current block is operated, the zero point current block is calculated according to the coordinates of the center point of the zero point current block, and the calculated first SAD value is compared with the threshold value immediately after the calculation is finished, and meanwhile, the threshold value compared with the calculated first SAD value of the first zero point current block is 0, after the comparison, the value of the first SAD value obtained after the calculation of the first zero current block is endowed with a threshold value, after that, the first SAD value obtained after the calculation of the zero current block, the second SAD value obtained after the calculation of the dense current block and the third SAD value obtained after the calculation of the sparse current block are all compared with the assigned threshold value, thereby realizing the reuse of data, reducing the calculation steps, acquiring the first search points of all the dense current blocks in the calculation process of the dense current block, calculating the second SAD value of the dense current block according to all the first search points to obtain all the second SAD values, comparing all the second SAD values with the threshold value to obtain the second SAD value meeting the conditions, comparing the second SAD value meeting the conditions to find the smallest SAD value meeting the conditions as the optimal output, and outputting the best motion vector of the relative coordinates of the searching points of the current block of the dense region corresponding to the second SAD value as the best output.
Optionally, before the data to be processed is divided into the zero current block, the dense area current block and the sparse area current block according to the step length of the data to be processed, the method further includes:
obtaining a target video frame to be encoded, determining a video frame to be processed in the target video frame, dividing the video frame to be processed into n pieces of data to be processed according to a preset size, wherein n is a positive integer.
In the above embodiment, the video frames to be processed are the video frames remaining in the target video frame except the first frame video frame, and the video frames to be processed are divided into a plurality of pieces of data to be processed with equal size according to the preset size, and then the divided data to be processed are sequentially processed, so that the overlarge data and the excessive calculated amount of data processed at one time are avoided.
Optionally, the method further comprises:
Taking a first frame video frame of the target video frame as a reference video frame, and dividing the reference video frame into n pieces of reference data according to a preset size;
Dividing the reference data into a zero point reference block, a dense region reference block and a sparse region reference block according to the step length of the reference data, and determining a first calculation point of the zero point reference block, a second calculation point of the dense region reference block and a third calculation point of the sparse region reference block.
In the above embodiment, the first frame video frame in the target video frame is used as the reference data, the reference data is divided according to the division mode of the data to be processed, so that the data divided by the reference data can be in one-to-one correspondence with the data divided by the data to be processed, and meanwhile, the first calculation point, the second calculation point and the third calculation point are determined according to the determination methods of the center point, the first search point and the second search point, so that when the reference data is used for calculation in the follow-up process, the correspondence between the coordinates of the first calculation point, the second calculation point and the third calculation point and the center point, the first search point and the second search point can be determined, and the data to be processed corresponding to the coordinates and the reference data are put together for calculating the SAD value.
Optionally, the calculating the first SAD value of the zero current block according to the center point includes:
acquiring the zero point current block and the zero point reference block based on the coordinates of the center point and the coordinates of the first calculation point;
Splitting the zero current block and the zero reference block, and splicing the split data blocks to obtain a first calculation basic unit block;
and subtracting the pixels from the zero current block and the pixels from the zero reference block in the first calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a first SAD value.
In the above embodiment, the first SAD value is calculated by splitting and splicing the zero point current block and the zero point reference block, in which the coordinates of the center point correspond to the coordinates of the first calculation point, and the data added to 16 pixels when the absolute values are added, and this added data added to 16 pixels is merely an example and is not limited.
Meanwhile, in the above embodiment, the first SAD value is obtained by decoding pixel information by using a two-stage block concatenation storage module, so as to obtain the information such as the current block size, the burst transmission frequency, the position of the reference pixel in the search window, etc., where the first stage concatenation is shown in fig. 2, ref_pi×el is the reference pixel transferred in each cycle in the pipeline, and buffer_0 and buffer_1 are two 256-bit reference pixel concatenation BUFFERs. In the first-stage pixel splicing, the first step is to shift the effective data in the pixel with any effective data bit number of the reference pixel to BUFFER_1 through a shift operation with lower time delay, and the BUFFER_0 waits; the second step and the third step shift the reference pixel data to two buffers respectively according to the information of the split valid bit, and empty the data to wait for new splicing operation after sending the spliced buffer data to the RAM; the fourth step is the last step of splicing, and part of the effective data is spliced into the buffer which is not spliced completely in the last step and is sent to the RAM. And (5) completing first-stage splicing. The second stage splices 8 rows of pixels of the same 8×8 block stored in the RAM into a 512bit group of reference pixels on the basis of the first stage. The 512bit pixel after the splicing is divided data multiplexing and 8×8 sub-blocks of the SAD calculation basic unit;
The SAD calculation module is used for calculating different bits according to different hardware architecture designs: in the low-cost design, the parallelism of the SAD calculation module is 4, namely, the SAD calculation module consists of 4SAD calculation units capable of calculating an 8 multiplied by 8 pixel block at a time; in the high-performance design, in order to meet the requirement of larger data throughput, the parallelism of the SAD calculation module is 8, namely, the SAD calculation module consists of 8 SAD calculation units capable of calculating 8×8 pixel blocks at a time, each SAD calculation unit calls 4 bottom-layer 4×4SAD arithmetic units, the SAD calculation units are added up until the SAD value of 16 pixels is added up after subtracting the pixel of the reference block from the pixel of the current block, and the SAD calculation module calculates SAD results of 4 or 88×8 blocks in each period by adopting pipeline design. Judging whether the pixel information of the reference block is consistent with the pixel information of the current block in the SAD calculation module so as to ensure that the calculated SAD value is accurate and effective, and continuously transmitting related information;
In the case where the block size is 8×8 or less, the SAD comparison module compares the input SAD value with the current minimum value. Then the minimum SAD value and pixel information are sent to a control module for early termination of the judgment of the algorithm or the output of a final result; when the block size is larger than 8×8, the SAD comparison module continues to accumulate the SAD value with the SAD value of the corresponding search point according to the input pixel information until the SAD value calculation of the search point is completed. Comparing the SAD values of the search points which are calculated finally, and outputting the information of the search points where the minimum SAD value is located;
When the block size is larger than 8×8, according to the block splitting and data reuse concept, the SAD comparison module stores the SAD result of the 8×8 sub-block already calculated for replacing the original pixel data with larger data size, and accumulates after the SAD operation is completed for all 8×8 sub-blocks waiting for the splitting of the search point, and finally compares to obtain the minimum SAD and the optimal MV, and the second SAD value and the third SAD value calculation method described below are the same as the above method.
Optionally, the calculating the second SAD value of the current block of the dense area according to the first search point includes:
Acquiring the current block of the dense area and the reference block of the dense area based on the coordinates of the first search point and the coordinates of the second calculation point;
splitting the current block of the dense area and the reference block of the dense area, and splicing the split data blocks to obtain a second calculation basic unit block;
and subtracting the pixels from the current block of the dense region from the pixels from the reference block of the dense region in the second calculation basic unit block, taking the absolute value, and accumulating the absolute values to obtain a second SAD value.
In the above embodiment, the second SAD value is calculated by splitting and splicing the dense area current block and the dense area reference block, in which the coordinates of the first search point correspond to the coordinates of the second calculation point, and the data added to 16 pixels when the absolute values are added, and this added data added to 16 pixels is merely an example and is not limiting.
Meanwhile, in the above embodiment, the variable-shape pixel block composed of the reference pixels to be read in the dense area is referred to as a dense area search window, which is changed according to the current size as shown in fig. 3, because the interval of adjacent search points in the dense area is 4 or less, each pixel in the search window in the dense area is adopted at least once for any PU size, so that for all the reference pixels in the search window in the dense area, the block division in the dense area is based on the block in which each search point is located, divided into a plurality of 8 x 8 sub-blocks, the block division based on the search start point and the data reuse between the adjacent search points are as shown in fig. 4, assuming that the current size is 16×16, taking two 16×16 search points on the step length of 4 of the dense area, dividing each 16×16 block into 48×8 sub-blocks based on the block division of the search points, dividing the first search point into four 8×8 sub-blocks of A, B, C and D, dividing the second search point into four 8×8 sub-blocks of E, F, G and H, and after finishing the reading of all four blocks of A, B, C and D of the first search point, only F and H need to read part of reference pixels for the four blocks of E, F, G and H of the second search point, and repeating other reference pixels with the reference pixels of the first search point, thereby achieving the purpose of reducing the data quantity of the reference pixels to be read and stored;
When the reference pixels are read, the repeated pixels of different sub-blocks are distributed to the corresponding sub-blocks, so that a row-by-row reading mode is adopted for the dense area search window, the read reference pixels are distributed to 8×8 blocks divided by each search point, and when a certain row of reference pixels is read, the effective first 8 reference pixels are distributed to the row corresponding to the first 8×8 sub-blocks as shown in fig. 5. Then, the subsequent reference pixels are distributed to the corresponding 8×8 sub-blocks according to the intervals of the search points, repeated reference pixels between adjacent search points are distributed for multiple times, so that the reuse of data is realized until all the reference pixels to be read in the row in the dense area are completely distributed, then, the reference pixels in the next row are read, and in combination with fig. 4, the first 8 reference pixels are distributed to the first row of the sub-block A on the assumption that 16 continuous reference pixels are read at one time; assigning 5 th to 12 th reference pixels to a first row of the E sub-block; assigning the last 8 reference pixels to the first row of the B sub-block; the last 4 reference pixels are assigned to the first row of the F sub-block. Thus, the repeated utilization of all subsequent repeated reference pixels can be met by reading the reference pixels once;
because the reference pixels are read according to the rows in the algorithm, the search points in the dense area are densely arranged, the hardware adopts bus burst transmission to read the reference pixels, and the reference pixels are saved by adopting the RAM by taking the search points as units, so that the processing speed is improved. The pixel reading order of the dense area is read row by row from top to bottom within the dense area search window.
For the conventional algorithm, assuming that the current block size is 16×16, if all search points of the computationally intensive area need to be read for 32×64×8=16384 bits, while the data required to be read by the algorithm presented herein is only 24×24×8=4608 bits, reducing the amount of data by 71.88%. The amount of data reduced varies for different sized blocks, with the greater the size the greater the degree of data reuse. For a 128 x 128 size block, the reduced data amount is 96.02%.
Optionally, the calculating the third SAD value of the current block of the sparse region according to the second search point includes:
acquiring the current sparse region block and the reference sparse region block based on the coordinates of the second search point and the coordinates of the third calculation point;
splitting the current sparse region block and the reference sparse region block, and splicing the split data blocks to obtain a third calculation basic unit block;
and subtracting the pixels from the current block of the sparse region from the pixels from the reference block of the sparse region in the third calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a third SAD value.
In the above embodiment, the third SAD value is calculated by splitting and stitching the sparse region current block and the sparse region reference block, where the coordinates of the second search point correspond to the coordinates of the third calculation point, and the data accumulated to 16 pixels when the absolute values are accumulated is accumulated, where the data accumulated to 16 pixels is merely taken as an example and not limited.
Meanwhile, in the above embodiment, since the sparse area search is performed after the dense area search, the data reuse of the pixels of the overlapping portion is realized, the number of times of reading is reduced, in the sparse area, the pitch of each search point is 8 or more, and for all the sizes, if the pixels which are not needed in part are read by rows, the efficiency is reduced, so that the reading from small to large by the step sizes is adopted for different step sizes. And the pixels required by the search points in each step length are divided into four variable-size sparse area search windows according to the size, as shown in fig. 6, the search points with the step length of 16 form four variable-size search windows of A, B, C and D, in each search window, reference pixels are allocated to corresponding 8 x 8 blocks in the same line reading mode as the dense area search window, unlike the dense area search, in the block segmentation process, the sparse area divides the four search windows into 8 x 8 sub-blocks instead of the block where the search points are located, and part of 8 x 8 sub-blocks in the sparse area search window are only read once and stored although the search points are adopted, so that the reuse of data is realized. For the same step length, four search windows are searched according to the sequence of A, D, B and C, and for each search window, the search sequence is that the search is performed from top to bottom in a row mode, because the interval between the search points of the sparse region is large, hardware divides the search window of the sparse region into 8X 8 sub-blocks for storage when storing reference pixels, RAM of the dense region is multiplexed, and cost is saved. And finally adding the sub-blocks of the same search point. Since the arrangement pitch of each search point in the sparse region is larger than 8, there is a case where pixel points are reused when the size is larger than 8×8.
Optionally, the method further comprises:
Determining first data to be processed and second data to be processed, wherein the second data to be processed is adjacent to the first data to be processed;
determining a target area overlapping with the first data to be processed in the second data to be processed according to the step length and the size of the first data to be processed and the second data to be processed;
and eliminating the target area in the second data to be processed.
In the above embodiment, in the process of performing data processing, there is an overlapping target area between one to-be-processed data and two adjacent to-be-processed data, in order to avoid repeated computation of data in the overlapping target area, the overlapping data in the overlapping target area needs to be removed, for example, when the first to-be-processed data and the second to-be-processed data are adjacent to each other, after the first to-be-processed data are computed, when the second to-be-processed data are computed, the second to-be-processed data from which the overlapping target area data of the second to-be-processed data and the first to-be-processed data are removed are computed.
Optionally, the dividing the data to be processed into the zero point current block, the dense area current block and the sparse area current block according to the step length of the data to be processed includes:
dividing data to be processed with the step length of 0 into zero areas, and determining a zero current block in the data division to be processed based on the zero areas;
dividing data to be processed with the step length smaller than or equal to 4 into dense areas, and determining a current block of the dense areas in the data division to be processed based on the dense areas;
Dividing the data to be processed with the step length greater than or equal to 8 into sparse areas, and determining a current block of the sparse areas in the data division to be processed based on the sparse areas.
In the above embodiment, the results of the statistical analysis of the non-moving blocks and the small moving blocks in the test sequence show that: the best matching block of the motion vector exceeding 85% is positioned in the step length less than or equal to 8, so that the step length is used as the judgment basis for dividing the data to be processed, the area with the step length of 0 is divided into zero areas, the area with the step length less than or equal to 4 is divided into dense areas, the area with the step length greater than or equal to 8 is divided into sparse areas, according to the research result, the probability that the best matching block of the motion vector appears in the zero areas and the dense areas is greater than that of the sparse areas, the zero areas and the dense areas can be used as key processing objects for data processing, and the zero areas, the dense areas and the sparse areas are sequentially calculated according to the step length, so that the final data processing result is obtained through the shortest operation processing mode, and the calculation and search processes are reduced.
Referring to fig. 7-8, an embodiment of the present application provides an integer motion estimation system for video coding, comprising: the system comprises a control module, a data scheduling module, a data buffering module, a two-stage data splicing module, an SAD calculation module, an SAD comparison module and a storage module;
the data scheduling module is used for acquiring data to be processed and sending the data to be processed to the SAD calculation module, and is also used for acquiring reference data and sending the reference data to the two-stage data splicing module;
the two-stage data splicing module is used for splitting and splicing the reference data and sending the spliced data to the SAD calculation module;
the SAD calculation module is used for calculating according to the acquired spliced data and the acquired data to be processed to obtain an SAD value, and sending the SAD value to the SAD comparison module;
the SAD comparison module is used for generating feedback information according to the acquired SAD value and sending the SAD value and the feedback information to the control module;
The control module is used for receiving the starting and stopping of the feedback information control flow of the SAD comparison module and outputting an optimal motion vector according to the SAD value.
In the above embodiment, there may be two types of video-encoded integer motion estimation systems, fig. 7 is a first type of video-encoded integer motion estimation system architecture diagram, supporting 4k@30fps video transmission, fig. 8 is a second type of video-encoded integer motion estimation system architecture diagram, supporting 8k@60fps video transmission, in the first type of video-encoded integer motion estimation system design, the control module first receives current block information, then the control module sends the read pixel information of search points and step sizes, etc. to the data scheduling module, and then sends the read pixel information to the Avalon bus and the data scheduling module, and each module in the pipeline starts to operate, the data scheduling calculates a memory address according to the pixel information and the search center point information, etc., and then acquires a reference block pixel and a current block pixel through burst transmission of the Avalon bus, and the current block pixel will be stored in the current block pixel storage module. After the reference block pixels are collected, the reference block pixels and the corresponding pixel information are stored in a data buffer module formed by FIFO, then the reference block pixels are sent to a two-stage data splicing module according to the first-in first-out principle, the control module judges the state of a pipeline in real time, and if data back pressure occurs, the operation of the front-stage pipeline and the reading of Avalon data are paused.
In a second video encoded integer motion estimation system design, the control module will perform a pre-read operation: after the current block information and the searching center point coordinates are obtained, all data in the complete searching window on the current block pixels and the reference frame are stored in a pixel storage and management module, and the data are stored in a RAM according to 8 multiplied by 8 sub-blocks as units during storage. The control module then opens the pipeline and calculates the pixel information to pass into the pipeline. The data buffer module mainly comprises a FIFO and an address calculator. The address calculator calculates the address of the data to be spliced in the pixel storage and management module, reads the address into the FIFO, and splices the two-stage data according to the first-in first-out principle of the FIFO.
Alternatively, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method steps as described above.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention by one of ordinary skill in the art without undue burden. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.
Claims (10)
1. A method for integer motion estimation for video coding, comprising:
Dividing the data to be processed into a zero current block, a dense region current block and a sparse region current block according to the step length of the data to be processed, and determining a center point of the zero current block, a first search point of the dense region current block and a second search point of the sparse region current block;
Calculating a first SAD value of the zero current block according to the center point, and outputting the relative coordinates of the center point as an optimal motion vector under the condition that the first SAD value is smaller than a threshold value;
calculating a second SAD value of the current block of the dense area according to the first search point under the condition that the optimal motion vector is not determined in the current block of the zero point, and outputting the relative coordinates of the first search point as the optimal motion vector under the condition that the second SAD value is smaller than a threshold value;
and calculating a third SAD value of the current block of the sparse area according to the second search point when the optimal motion vector is not determined in the current block of the dense area, and outputting the relative coordinates of the second search point as the optimal motion vector when the third SAD value is smaller than a threshold value.
2. The method according to claim 1, wherein before dividing the data to be processed into the zero point current block, the dense area current block, and the sparse area current block according to a step size of the data to be processed, the method further comprises:
obtaining a target video frame to be encoded, determining a video frame to be processed in the target video frame, dividing the video frame to be processed into n pieces of data to be processed according to a preset size, wherein n is a positive integer.
3. The method of integer motion estimation for video coding of claim 2, further comprising:
Taking a first frame video frame of the target video frame as a reference video frame, and dividing the reference video frame into n pieces of reference data according to a preset size;
Dividing the reference data into a zero point reference block, a dense region reference block and a sparse region reference block according to the step length of the reference data, and determining a first calculation point of the zero point reference block, a second calculation point of the dense region reference block and a third calculation point of the sparse region reference block.
4. The method of integer motion estimation for video coding according to claim 3, wherein said calculating a first SAD value for the zero current block from the center point comprises:
acquiring the zero point current block and the zero point reference block based on the coordinates of the center point and the coordinates of the first calculation point;
Splitting the zero current block and the zero reference block, and splicing the split data blocks to obtain a first calculation basic unit block;
and subtracting the pixels from the zero current block and the pixels from the zero reference block in the first calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a first SAD value.
5. The method of integer motion estimation for video coding according to claim 3, wherein said calculating a second SAD value for the current block of the dense region based on the first search point comprises:
Acquiring the current block of the dense area and the reference block of the dense area based on the coordinates of the first search point and the coordinates of the second calculation point;
splitting the current block of the dense area and the reference block of the dense area, and splicing the split data blocks to obtain a second calculation basic unit block;
and subtracting the pixels from the current block of the dense region from the pixels from the reference block of the dense region in the second calculation basic unit block, taking the absolute value, and accumulating the absolute values to obtain a second SAD value.
6. The method according to claim 3, wherein said calculating a third SAD value of the sparse region current block from the second search point comprises:
acquiring the current sparse region block and the reference sparse region block based on the coordinates of the second search point and the coordinates of the third calculation point;
splitting the current sparse region block and the reference sparse region block, and splicing the split data blocks to obtain a third calculation basic unit block;
and subtracting the pixels from the current block of the sparse region from the pixels from the reference block of the sparse region in the third calculation basic unit block, taking an absolute value, and accumulating the absolute values to obtain a third SAD value.
7. The method of integer motion estimation for video coding of claim 1, further comprising:
Determining first data to be processed and second data to be processed, wherein the second data to be processed is adjacent to the first data to be processed;
determining a target area overlapping with the first data to be processed in the second data to be processed according to the step length and the size of the first data to be processed and the second data to be processed;
and eliminating the target area in the second data to be processed.
8. The integer motion estimation method of video coding according to claim 1, wherein the dividing the data to be processed into zero point current blocks, dense area current blocks, and sparse area current blocks according to a step size of the data to be processed comprises:
dividing data to be processed with the step length of 0 into zero areas, and determining a zero current block in the data division to be processed based on the zero areas;
dividing data to be processed with the step length smaller than or equal to 4 into dense areas, and determining a current block of the dense areas in the data division to be processed based on the dense areas;
Dividing the data to be processed with the step length greater than or equal to 8 into sparse areas, and determining a current block of the sparse areas in the data division to be processed based on the sparse areas.
9. An integer motion estimation system for video coding, comprising: the system comprises a control module, a data scheduling module, a data buffering module, a two-stage data splicing module, an SAD calculation module, an SAD comparison module and a storage module;
the data scheduling module is used for acquiring data to be processed and sending the data to be processed to the SAD calculation module, and is also used for acquiring reference data and sending the reference data to the two-stage data splicing module;
the two-stage data splicing module is used for splitting and splicing the reference data and sending the spliced data to the SAD calculation module;
the SAD calculation module is used for calculating according to the acquired spliced data and the acquired data to be processed to obtain an SAD value, and sending the SAD value to the SAD comparison module;
the SAD comparison module is used for generating feedback information according to the acquired SAD value and sending the SAD value and the feedback information to the control module;
The control module is used for receiving the starting and stopping of the feedback information control flow of the SAD comparison module and outputting an optimal motion vector according to the SAD value.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, carries out the method steps according to any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210393510.4A CN114727115B (en) | 2022-04-14 | 2022-04-14 | Integer motion estimation method, system and storage medium for video coding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210393510.4A CN114727115B (en) | 2022-04-14 | 2022-04-14 | Integer motion estimation method, system and storage medium for video coding |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114727115A CN114727115A (en) | 2022-07-08 |
CN114727115B true CN114727115B (en) | 2024-05-03 |
Family
ID=82243821
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210393510.4A Active CN114727115B (en) | 2022-04-14 | 2022-04-14 | Integer motion estimation method, system and storage medium for video coding |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114727115B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101374235A (en) * | 2007-08-24 | 2009-02-25 | 大唐移动通信设备有限公司 | Method and apparatus for estimating rapid block motion of video encoding |
CN110139106A (en) * | 2019-04-04 | 2019-08-16 | 中南大学 | A kind of video encoding unit dividing method and its system, device, storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060002472A1 (en) * | 2004-06-30 | 2006-01-05 | Mehta Kalpesh D | Various methods and apparatuses for motion estimation |
US20060002471A1 (en) * | 2004-06-30 | 2006-01-05 | Lippincott Louis A | Motion estimation unit |
US8098733B2 (en) * | 2008-03-10 | 2012-01-17 | Neomagic Corp. | Multi-directional motion estimation using parallel processors and pre-computed search-strategy offset tables |
-
2022
- 2022-04-14 CN CN202210393510.4A patent/CN114727115B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101374235A (en) * | 2007-08-24 | 2009-02-25 | 大唐移动通信设备有限公司 | Method and apparatus for estimating rapid block motion of video encoding |
CN110139106A (en) * | 2019-04-04 | 2019-08-16 | 中南大学 | A kind of video encoding unit dividing method and its system, device, storage medium |
Non-Patent Citations (3)
Title |
---|
A novel motion compensation method for random frequency hopping radar;Zhikun Liao;《2017 10th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI)》;20180226;全文 * |
一种适用于星载太阳翼的驱动控制器设计;李丽娇;《空间控制技术与应用》;20181215;第44卷(第6期);全文 * |
基于可重构***的HEVC运动估计算法实现;韩佳;毛志刚;;信息技术;20161125(11);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114727115A (en) | 2022-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11664013B2 (en) | Speech feature reuse-based storing and calculating compression method for keyword-spotting CNN | |
US6339616B1 (en) | Method and apparatus for compression and decompression of still and motion video data based on adaptive pixel-by-pixel processing and adaptive variable length coding | |
US9106922B2 (en) | Motion estimation engine for video encoding | |
JP3036937B2 (en) | Correlation device | |
KR100242880B1 (en) | Apparatus for tracing contours of segmented regions | |
CN102113327B (en) | Image encoding device, method, and integrated circuit | |
CN102148990B (en) | Device and method for predicting motion vector | |
US7515761B2 (en) | Encoding device and method | |
US20030031257A1 (en) | Motion estimation method and apparatus for interrupting computation which is determined not to provide solution | |
CN1224977A (en) | Method and apparatus for coding interlaced shape information | |
CN113436057B (en) | Data processing method and binocular stereo matching method | |
CN114727115B (en) | Integer motion estimation method, system and storage medium for video coding | |
CN201066898Y (en) | A hardware structure for realizing diamond search algorithm | |
JP4228705B2 (en) | Motion vector search method and apparatus | |
CN114897665A (en) | Configurable real-time parallax point cloud computing device and method | |
CN101399978A (en) | Reference frame data reading method in hardware decoder and apparatus thereof | |
CN103327340A (en) | Method and device for searching integer | |
CN1110209C (en) | Device for estimation of movement | |
JP3432039B2 (en) | Image encoding method and apparatus | |
CN115914645A (en) | Inter-frame prediction method and device | |
CN112001492A (en) | Mixed flow type acceleration framework and acceleration method for binary weight Densenet model | |
CN113676737B (en) | GPU-based efficient video encoder and encoding method | |
CN112612762B (en) | Data processing method and related equipment | |
JP4859168B2 (en) | Motion detection device and motion detection method | |
CN116074533B (en) | Motion vector prediction method, system, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |