CN103188496B - Based on the method for coding quick movement estimation video of motion vector distribution prediction - Google Patents

Based on the method for coding quick movement estimation video of motion vector distribution prediction Download PDF

Info

Publication number
CN103188496B
CN103188496B CN201310098216.1A CN201310098216A CN103188496B CN 103188496 B CN103188496 B CN 103188496B CN 201310098216 A CN201310098216 A CN 201310098216A CN 103188496 B CN103188496 B CN 103188496B
Authority
CN
China
Prior art keywords
motion vector
search
motion
current macro
prediction
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.)
Expired - Fee Related
Application number
CN201310098216.1A
Other languages
Chinese (zh)
Other versions
CN103188496A (en
Inventor
刘鹏宇
高原
贾克斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing University of Technology filed Critical Beijing University of Technology
Priority to CN201310098216.1A priority Critical patent/CN103188496B/en
Publication of CN103188496A publication Critical patent/CN103188496A/en
Application granted granted Critical
Publication of CN103188496B publication Critical patent/CN103188496B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention belongs to video compression coding field, disclose a kind of method for coding quick movement estimation video based on motion vector distribution prediction.First the method extracts the monochrome information of current macro from original video data, designs succinct motion estimation search template, reasonable distribution search point for Integer Pel motion vector distribution signature search.Then motion vector distribution being predicted, selecting adaptively according to predicting the outcome to search among a small circle in search pattern respective regions.Be whether 0 to judge, as the criterion skipping template search to motion vector in motion estimation search process.The inventive method and video encoding standard H.264 in compared with the Motion Estimation Search Algorithms that adopts and other innovatory algorithm, can accelerated motion estimating searching process effectively, reduce estimation consuming time, strictly control code check to increase, ensure that good reconstructed image quality, achieve fast motion estimation coding.

Description

Based on the method for coding quick movement estimation video of motion vector distribution prediction
Technical field
The invention belongs to video compression coding field, relate to a kind of quick video motion estimated coding method based on motion vector distribution prediction.
Background technology
Combine promulgation in 2003 by International Telecommunication Union (ITU-T) and International Organization for standardization (ISO/IEC) and propose video encoding standard of new generation H.264/AVC.H.264 excellent compression performance and video quality make it be widely used in actual life, comprise digital television broadcasting, multi-media SMS, the transmission of Internet video Streaming Media and video real time communication etc.Compared to coding standard before, H.264 improve in the following aspects: adopt 1/4 pixel precision estimation; Support 16 × 16,16 × 8, the prediction mode of 8 × l6,8 × 8,8 × 4,4 × 8,4 × 4 totally 7 kinds of sized blocks; Support multi-frame-reference; 4 × 4 integer transforms are adopted to replace the dct transform of 8 × 8; Optional 2 kinds of entropy code modes: based on context-adaptive variable-length encoding (contextAdaptiveVariableLengthCoding, be called for short CAVLC) and based on context adaptive binary arithmetic coding (ContextAdaptiveBinaryArithmeticCoding is called for short CABAC); Adopt rate-distortion optimization technology, consider coding efficiency and code check in cataloged procedure and weigh.Although H.264 there has been very large improvement in coding efficiency, but exchange for sacrifice encoder complexity for cost.H.264 high complicated dynamic behaviour makes coding time long, has had a strong impact on its real-time performance, so most important for the research promoting H.264 coding rate aspect.
Correlative study shows, H.264 coding time comes from inter prediction encoding mostly, and wherein estimation (MotionEstimation is called for short ME) process account for 60%-80% of coding total time, is the key component increasing computational complexity and affect coding efficiency.In recent years, researchers are devoted to be optimized motion estimation process always, while guarantee coding efficiency, shorten motion estimation time as far as possible.
H.264 adopt Algorithm for Block Matching Motion Estimation for estimation in, its principle as shown in Figure 1.First video one frame is divided into some M × N blocks, supposes that in block, all pixels all do identical translational motion.If the former frame field of search is (M+2W x, N+2W y), the displacement of present frame block and former frame block is d (i, j), if can find the former frame block with present frame Block-matching in the field of search, this d (i, j) is required motion vector MV (Motionvector).In block matching method, usually adopt absolute length chang SAD (SumofAbsoluteDifference) to weigh the degree of correlation between current block and prediction block as correlation function, sad value is less, then represent that correlation is stronger, the two is coupling more.
In existing Algorithm for Block Matching Motion Estimation, that search precision is the highest is full-search algorithm (FS).Because FS algorithm computation complexity is too high, be unfavorable for real-time application, researcher proposes the new searching algorithm such as three-step approach (TSS), four step rule (FSS) and hexagon method (HEXBS) in succession for this reason, but they still to there is search point many, be easily absorbed in the deficiency of local optimum.Along with going deep into of research, the new algorithm proposed for temporal correlation and human-eye visual characteristic has had and has developed on a large scale very much, typically there is asymmetric cross multilayer hexagon search algorithm (Unsymmetrical-CrossMulti-HexagonSearch is called for short UMHexagonS).Compared to full-search algorithm, this algorithm can reduce the motion estimation time of 90%, and Y-PSNR on average declines and is less than 0.05dB, and it is substantially constant to maintain code check.
Application number be CN201010140709.3 patent discloses a kind of method for coding quick movement estimation video based on macroblock motion vector tagsort, be called NUMHexagonS(New-UMHexagonS) algorithm, its motion estimation search scheme is as shown in Figure 2.This algorithm has had significant improvement for UMHexagonS algorithm, but still exists and fail to make full use of motion vector distribution feature and carry out search strategy formulation, divide meticulous not and have ignored the deficiencies such as search feature when motion vector is 0 for large-scale search pattern region of search.
Summary of the invention
For the above-mentioned problems in the prior art, the present invention proposes a kind of new Motion Estimation Search Algorithms, under maintenance low bit-rate and high-quality prerequisite, reaching shortening video encoding time by reducing search point in motion estimation process, improving code efficiency object.
The technical solution used in the present invention is: based on the method for coding quick movement estimation video of motion vector distribution prediction, the shortcoming of search point waste is there is for extensive search template, unsymmetrical cross searching template and non-homogeneous hexagonal mesh search pattern are redesigned, and motion vector distribution prediction was carried out respectively before unsymmetrical cross searching and the search of non-homogeneous hexagonal mesh, select corresponding region of search adaptively, judge whether motion vector is 0 at searching period, add premature termination criterion, and then the coding quick movement estimation video realized inter macroblocks, it is characterized in that specifically comprising the steps:
Step one, extracts the monochrome information of current predicted macro block as coded object from current video frame;
Step 2, determine twofold motion estimating searching template, carry out search point distribution, method is as follows:
(1) unsymmetrical cross searching template: be made up of 4 regions of search, distributes 4 search points respectively vertically, distributes 8 search points about level respectively;
(2) non-homogeneous hexagonal mesh search pattern: jointly form 32 regions of search by 4 layers and 8 directions, non-homogeneous distribution of counting is carried out in each region, along with the increase of search radius, the expansion of hunting zone, distribute search point from the inside to the outside to increase progressively, total search point 62 in the horizontal direction ± 45 ° of regions, total search point 22 in the vertical direction ± 45 ° of regions;
Step 3, determine the initial search point of high precision: adjudicate foundation by Lagrangian rate-distortion optimization (RDO-RateDistortionOptimization) function as estimation, in selection rate distortion sense, optimum Match prediction block and optimal motion vector, make the bit of motion vector and residual coding distribute minimum.Lagrangian rate distortion criterion is utilized to select optimal motion vector problem can be described as:
J motion(mv,ref|λ motion)=SAD[s,r(ref,mv)]+λ motion[R(mv-pred)+R(ref)]
Wherein, J motionfor the rate distortion costs value of the motion vector of current predictive s is current macro block pixels value, mv is current motion vector, pred is motion vectors, ref is reference frame, r (ref, mv) be the pixel value of reference macroblock, R is the bit number that motion vector carries out differential coding consumption, comprises the differential coding bit number of motion vector and its predicted value and the number of coded bits of reference frame; λ motionfor Lagrange multiplier, SAD(SumofAbsoluteDifference) for the absolute error between current block and reference block pixel and:
SAD [ s , r ( ref , mv ) ] = Σ x = 1 B 1 Σ y = 1 B 2 | s ( x , y ) - r ( x - m x , u - m y ) |
Wherein, B 1and B 2represent horizontal pixel and the vertical pixel of block respectively, according to different inter-frame forecast modes, its value can be 16, and 8,4; S (x, y) is current macro block pixels value; The pixel value that r (x, y) is reference macroblock, m xand m yrepresent the displacement in horizontal and vertical direction respectively.
Lagrangian rate distortion criterion is utilized to select the problem of optimization model to be expressed as:
J mode(s,c,MODE|λ mode)=SSD(s,c,MODE|QP)+λ mode×R(s,c,MODE|QP)(1)
Wherein, MODE represents a kind of interframe encoding mode of current macro; J mode(s, c, MODE| λ mode) represent rate distortion costs value under MODE pattern s is original vision signal; C is the reconstructed video signal after adopting MODE pattern-coding; λ modefor Lagrange multiplier; R (s, c, MODE|QP) is the total number of bits that comprises MB header, motion vector and all DCT block message relevant with MODE and quantization parameter, and it obtains afterwards, so its operand is larger by carrying out actual coding to block; QP is coded quantization step-length; SSD (s, c, MODE|QP) (SumofSquareDifference) is the difference of two squares sum between primary signal and reconstruction signal, that is:
SSD ( s , c , MODE | QP ) = Σ i = 1 , j = 1 B 1 , B 2 [ S Y ( x , y ) - G Y ( x , y , MODE | QP ) ] 2
+ Σ i = 1 , j = 1 B 1 , B 2 [ S U ( x , y ) - G U ( x , y , MODE | QP ) ] 2 + Σ i = 1 , j = 1 B 1 , B 2 [ S V ( x , y ) - C V ( x , y , MODE | QP ) ] 2
Wherein, B 1and B 2represent horizontal pixel and the vertical pixel of block respectively, its value can be 16, and 8,4; S y(x, y) is the value of source macro block brightness information; C y(x, y, MODE|QP) represents the value of the monochrome information of rebuilding macro block; S u, S vand C u, C vrepresent the value of corresponding colour difference information respectively.
Specifically comprise the following steps:
(1) multiple prediction mode is adopted to carry out starting point prediction:
1) the median prediction MV of spatial domain is carried out pred_space: utilize the correlation between adjacent macroblocks, the motion vector of current predicted macrablock is obtained by the motion-vector prediction of the adjacent block of known surrounding;
2) the upper strata block prediction MV of many sized blocks division is carried out pred_uplayer: utilize inter frame motion estimation macroblock partitions feature, current predicted macrablock motion vector is obtained co-located, upper level from the hierarchical search order of 7 patterns and is twice the motion vector of sized blocks;
3) the reference frame motion-vector prediction MV of time-domain is carried out pred_ref: utilize the motion vector of current macro in different reference frame to have correlation, current macro motion vector is predicted by a certain percentage by the motion vector of current block in reference frame before and is obtained.
(2) the rate distortion costs value put pointed by these three kinds of motion vector prediction mode is designated as space_pred respectively mincost, uplayer_pred mincostand ref_pred mincost.To have the motion vector points point of minimum rate distortion costs value as initiating searches point, the optimal match point of this step wants the terminal of motion vectors as next step.
Step 4, judges whether motion vector is 0:
The motion vector obtaining current macro optimal match point in previous step is designated as (MV x, MV y), if MV x=0 and MV y=0, being then considered as now motion vector is 0, skips step 5, directly carries out step 8.
Step 5, carries out motion vector direction prediction to current macro: according to next step unsymmetrical cross searching template feature, current predicted macrablock motion vector is divided into four direction, and namely horizontal square is to, horizontal negative direction, vertical positive direction and vertical negative direction.Current predicted macrablock motion vector distribution direction prediction step is as follows:
(1) according to current macro motion vector position calculation directioin parameter:
Current macro motion vector coordinate (MV x, MV y), motion vector direction its direction vector MV=(MV x, MV y) represent.Calculate value.
(2) current predicted macrablock motion vector direction is judged:
As k<1, according to MV xstate judges: work as MV xjudge during > 0 current macro motion vector direction as horizontal square to, work as MV xjudge during < 0 that current macro motion vector direction is as horizontal negative direction;
As k>1 or MV xwhen=0, according to MV ystate judges: work as MV yjudge during > 0 that current macro motion vector direction is as vertical positive direction, works as MV yjudge during < 0 that current macro motion vector direction is as vertical negative direction;
Step 6, carries out unsymmetrical cross searching: vertical search scope is the half of horizon scan scope, and between adjacency search point, step-length is two pixels.Predict the outcome according to current macro motion vector direction in the 5th step and select the direction of search adaptively: be judged to be horizontal square to time, search initial point horizontal square 8 Searching point upwards; When being judged to be horizontal negative direction, 8 Searching point in the horizontal negative direction of search initial point; When being judged to be vertical positive direction, 4 Searching point in the vertical positive direction of search initial point; When being judged to be vertical negative direction, 4 Searching point in the vertical negative direction of search initial point.The optimal match point determined in this step will want the terminal of motion vectors as next step.
Step 7, judges current macro motion vector size: current predicted macrablock motion vector size is divided into motion vector is comparatively large, motion vector is medium and less three ranks of motion vector.The determination methods of current predicted macrablock motion vector size is as follows:
(1) pred is determined according to the prediction mode of initial search point mincostand RD mincostvalue:
If adopt time prediction mode in step 3, then: pred mincost=ref_pred mincost;
If adopt spatial prediction mode in step 3, then: pred mincost=space_pred mincost;
If adopt upper strata block prediction mode in step 3, then: pred mincost=uplayer_pred mincost;
RD mincostfor calculating the minimum rate distortion costs value of current predicted macrablock under MODE pattern by formula (1).
(2) computational prediction motion vector parameter:
Motion vectors lower threshold is:
(1+γ)pred mincost
Motion vectors upper limit threshold is:
(1+δ)pred mincost
The motion vectors factor is:
&gamma; = Bsize [ blocktype ] pred min cos t 2 - &alpha; 1 [ blocktype ]
&delta; = Bsize [ blocktype ] pred min cos t 2 - &alpha; 2 [ blocktype ]
Wherein, Bsize [blocktype] represents the size of current predicted macrablock, and its value can be 16,8,4,
α 1[blocktype]=[-0.23,-0.23,-0.23,-0.25,-0.27,-0.27,-0.28]
α 2[blocktype]=[-2.39,-2.40,-2.40,-2.41,-2.45,-2.45,-2.48]
(3) current predicted macrablock motion vector size is judged:
Work as RD mincost≤ (1+ γ) pred mincost, when namely minimum rate distortion costs value is less than motion vectors lower threshold, judge that current macro motion vector is less, namely movement degree is mild;
As (1+ γ) pred mincost< RD mincost< (1+ δ) pred mincost, when namely minimum rate distortion costs value is between motion vectors lower threshold and motion vector upper limit threshold, judge that current macro motion vector is medium, namely movement degree is medium;
Work as RD mincost>=(1+ δ) pred mincost, when namely minimum rate distortion costs value is greater than motion vectors upper limit threshold, judge that current macro motion vector is comparatively large, namely movement degree is more violent.
Step 8, optionally carries out 5 × 5 pixels and entirely searches for: according to predicting in step 7 that current macro motion vector size result is optionally carried out 5 × 5 pixels and entirely searched for.Only when motion vector is less or when motion vector is 0, ability, centered by current predictive point, carries out the full search of 5 × 5 search points around it in 4 × 4 regions; Otherwise do not carry out 5 × 5 entirely to search for, directly enter step 9.
Step 9, current macro is judged whether motion vector is 0 again, and carry out motion vector direction prediction and motion vector size is predicted: the optimal match point in step 8 is predicted again, wherein judges that whether motion vector is 0 identical with step 7 with above-mentioned steps four with motion vector size Forecasting Methodology.If motion vector is 0, then skip step 10, directly carry out step 11; If motion vector is not 0, then obtains current macro motion vector distribution by motion vector direction prediction and the prediction of motion vector size and predict the outcome.According to next step non-homogeneous multilayer hexagonal mesh search pattern feature, current predicted macrablock motion vector is divided into eight directions:
(-22.5°,22.5°],(157.5°,202.5°],(22.5°,67.5°],(-157.5°,-112.5°],
(67.5°,112.5°],(-112.5°,-67.5°],(112.5°,157.5°],(-67.5°,-22.5°];
The method of motion vector direction prediction is as follows:
(1) according to current macro motion vector position calculation directioin parameter: same to step 5 (1), calculates the value of motion vector direction parameter k.
(2) current predicted macrablock motion vector distribution direction is judged:
As k < 0.25, according to MV xvalue judges: work as MV xjudge during > 0 current macro motion vector direction as (-22.5 °, 22.5 °], work as MV xjudge during < 0 current macro motion vector direction as (157.5 °, 202.5 °];
As k > 1.5 or MV xwhen=0, according to MV yvalue judges: work as MV yjudge during > 0 current macro motion vector direction as (67.5 °, 112.5 °], work as MV yjudge during < 0 current macro motion vector direction as (-112.5 ° ,-67.5 °];
When 0.25≤k≤1.5, according to MV xand MV yvalue judges: work as MV x> 0 and MV yjudge during > 0 current macro motion vector direction as (22.5 °, 67.5 °], work as MV x< 0 and MV yjudge during < 0 current macro motion vector direction as (-157.5 ° ,-112.5 °], work as MV x< 0 and MV yjudge during > 0 current macro motion vector direction as (112.5 °, 157.5 °], work as MV x> 0 and MV yjudge during < 0 current macro motion vector direction as (-67.5 ° ,-22.5 °].
Step 10, carries out the search of non-homogeneous multilayer hexagonal mesh: predict the outcome according to current macro motion vector distribution in step 9 and select motion estimation search region adaptively: the position in non-homogeneous multilayer hexagonal mesh search pattern 32 regions by motion vector size and motion vector direction determination motion vector.According to motion vector distribution characteristic allocation 1 ~ 6 Searching point in region, using the optimal match point that the searches initial ranging central point as step 11.
Step 11, extended symmetry hexagon search: first with 2 pixel precisions for step-length carries out symmetrical hexagon search, using optimal match point as starting point again with 1 pixel precision for step-length carries out diamond search, final optimal match point is the optimal match point of current macro integer pixel motion estimation search;
Step 12, exports motion-estimation encoded information, comprises motion estimation time (TotalMEtime), code check (Bit-rate), Y-PSNR (Y-PSNR), to evaluate encryption algorithm quality.
The present invention has carried out template redesign, motion vector distribution prediction and has judged whether motion vector is 0 combination of selecting whether to skip template search three kinds of technology on the advantage basis retaining former UMHexagonS algorithm and NUMHexagonS algorithm.As shown in Figure 6, wherein motion vector direction predictor flow process as shown in Figure 5 for whole motion estimation search main flow.Motion Estimation Search Algorithms of the present invention both ensure that the accuracy of motion search, had increased substantially again the real-time performance of motion-estimation encoded.
Beneficial effect of the present invention: compared with the current H.264 middle UMHexagonS algorithm adopted, the present invention ensure that under coded video quality prerequisite, strictly control code check to increase and video quality decline, effectively reduce motion estimation search to count, well improve estimation this shortcoming consuming time.
Accompanying drawing explanation
Fig. 1 is block-based motion estimation schematic diagram;
Fig. 2 is NUMHexagonS asymmetric cross multilayer hexagon search algorithm schematic diagram;
Fig. 3 is unsymmetrical cross searching template of the present invention;
Fig. 4 is non-homogeneous hexagonal mesh search pattern of the present invention;
Fig. 5 is motion vector direction predictor flow chart of the present invention;
Fig. 6 is motion estimation search main flow chart of the present invention;
Fig. 7 is the rate distortion curve (HARBOUR) of motion estimation algorithm of the present invention compared with other algorithms;
Fig. 8 is the rate distortion curve (ICE) of motion estimation algorithm of the present invention compared with other algorithms.
Embodiment
Below in conjunction with drawings and Examples, more detailed description is done to the present invention.
In order to check the validity of put forward the methods of the present invention, have selected the cycle tests of different characteristics, video sequence ICE as comparatively violent in motion; Move comparatively mild video sequence HARBOUR; There is the video sequence MOBILE of more details smooth motion.And compare from these three performances of motion-estimation encoded time, compression bit rate and Y-PSNR and the UMHexagonS algorithm the reference software JM18.4 of H.264/AVC standard.Experiment condition configuration is as follows: at 4G internal memory, the computer of 3.4GHz dominant frequency runs; Encode 100 frames, frame per second 30f/s, code flow structure is IPPP, and quantization parameter QP is set to 40, and entropy code is CAVLC, 5 reference frames.
Because this method has come for the luminance component in video sequence, first read the video sequence of one section of yuv format in actual use, extract its luma component information value, encoder calls the inter macroblocks fast motion estimation module of the present invention's design to complete concrete video compression coding.
Method main flow chart of the present invention as shown in Figure 6, completes following steps in a computer:
The first step, reads in the video sequence of yuv format according to encoder configuration file encoder.cfg, according to the parameter configuration encoder in configuration file.
Second step, reads out the luma component values of video sequence from the video file of original yuv format, takes out the luma component values needing coded macroblocks in order.
3rd step, determines initial search point: be median prediction MV to current predicted macrablock pred_space, upper strata block prediction MV pred_uplayerwith time prediction MV pred_ref.
Median prediction MV pred_spacemake use of the correlation between adjacent macroblocks, the motion vector of current predicted macrablock can be obtained by the motion-vector prediction that known surrounding woods is fast.
Upper strata block prediction MV pred_uplayermake use of inter frame motion estimation macroblock partitions feature, current predicted macrablock motion vector is obtained co-located, upper level from the hierarchical search order of 6 patterns and is twice the motion vector of sized blocks.
Time prediction MV pred_refutilize the motion vector of current macro in different reference frame to have correlation, current macro motion vector is predicted by a certain percentage by the motion vector of current block in reference frame before and is obtained.
Similar motion vector MV, corresponding sad value also has very strong correlation.The rate distortion costs value put pointed by these three kinds of motion vector prediction mode is designated as space_pred respectively mincost, uplayer_pred mincostand ref_pred mincost, will have the motion vector points point of minimum rate distortion costs value as initiating searches point, the optimal match point of this step will want the terminal of motion vectors as next step.
4th step, judges whether motion vector is 0: the motion vector obtaining current macro optimal match point in previous step is designated as (MV x, MV y), if MV x=0 and MV y=0, being then considered as now motion vector is 0, skips the 5th step, with current best match point for initiating searches point directly carries out the 8th step.
5th step, carries out motion vector direction prediction to current macro: according to next step unsymmetrical cross searching template feature, current predicted macrablock motion vector is divided into four direction, and namely horizontal square is to, horizontal negative direction, vertical positive direction and vertical negative direction.Current macro motion vector coordinate (MV x, MV y), calculate value.Utilize the criterion in step 5 (2) to judge current macro motion vector direction.
6th step, unsymmetrical cross searching: according to the adaptive selection direction of search of current macro motion vector distribution direction prediction result: be judged to be horizontal square to time search initial point horizontal square 8 Searching point upwards, 8 Searching point in the horizontal negative direction of initial point are searched for when being judged to be horizontal negative direction, search for 4 Searching point in the vertical positive direction of initial point when being judged to be vertical positive direction, when being judged to be vertical positive direction, search for 4 Searching point in the vertical positive direction of initial point.Unsymmetrical cross searching template as shown in Figure 3.In this implementation process, search box size is 32 × 16, and between adjacency search point, step-length is 2 pixels, even judges to search for needs 8 candidate search points in the horizontal direction, searches for needs 4 candidate search points in vertical direction.Candidate search point is calculated respectively to the rate distortion costs value of its motion vector, therefrom choose rate distortion costs and be worth the optimal match point of minimum point as this step, the terminal of motion vectors will be wanted as next step.
7th step, carries out the prediction of motion vector size to current macro: current predicted macrablock motion vector size is divided into motion vector is comparatively large, motion vector is medium and less three ranks of motion vector.Current predicted macrablock motion vector size Forecasting Methodology is as follows:
Pred is determined according to step 7 (1) mincostand RD mincostvalue, judge the motion vector size of current predicted macrablock according to step 7 (3), in step 7 (2), define motion vectors parameter γ, δ, α 1, α 2with motion vectors bound threshold value.
8th step, optionally carry out 5 × 5 pixels entirely to search for: judged current macro motion vector size in the 7th step after, only when current macro motion vector is less or when motion vector is 0, ability, centered by current predictive point, carries out the full search of 5 × 5 search points around it in 4 × 4 regions; Do not carry out 5 × 5 entirely to search for when motion vector size is medium or larger, directly enter the 9th step.
9th step, current macro is judged whether motion vector is 0 again, and carry out motion vector distribution direction prediction and the prediction of motion vector size: the optimal match point in the 8th step is predicted again, wherein judges that whether motion vector is 0 identical with the 7th step with above-mentioned 4th step with motion vector size Forecasting Methodology.If predict the outcome, motion vector is 0, then skip the tenth step, directly carry out the 11 step.If motion vector is not 0, then obtains current macro motion vector distribution by motion vector direction prediction and the prediction of motion vector size and predict the outcome.In this step, motion vector distribution direction prediction method is as follows:
The value of motion vector direction parameter k is calculated according to step 5 (1).Current macro motion vector distribution walking direction is carried out according to step 9 (2).
Tenth step, non-homogeneous multilayer hexagonal mesh search: predict the outcome according to current macro motion vector distribution in step 9 and select motion estimation search region adaptively: the position in non-homogeneous multilayer hexagonal mesh search pattern 32 regions by motion vector size and motion vector direction determination motion vector.Non-homogeneous multilayer hexagonal mesh search pattern as shown in Figure 4, in region of search according to motion vector distribution characteristic allocation 1 ~ 6 Searching point.Using the optimal match point that searches in this step initial ranging central point as step 11.
11 step, extended symmetry hexagon search: first with 2 pixel precisions for step-length carries out symmetrical hexagon search, using optimal match point as starting point again with 1 pixel precision for step-length carries out diamond search, final optimal match point is the optimal match point of current macro integer pixel motion estimation search.
12 step, terminates motion estimation search, preserves and exports motion-estimation encoded information, comprise motion estimation time, code check, Y-PSNR, to evaluate encryption algorithm quality.
Experimental result is as shown in table 1.As can be seen from Table 1, method of the present invention is compared with the UMHexagonS algorithm in the reference software JM18.4 of H.264/AVC standard, and Y-PSNR slightly reduces, and on average reduces by 0.05%, and video quality slightly declines in human visible range; Strict control code check, on average increases by 0.35%, maintains the advantage of primary standard algorithm high compression ratio; Effectively shorten the motion-estimation encoded time, the motion-estimation encoded time of average saving 21.71%.Fig. 7 and Fig. 8 represents that the video sequence (ICE) representing the mild video sequence (HARBOUR) of motion and represent motion intense is in different quantization step (QP) situation respectively, motion estimation algorithm of the present invention and UMHexagonS algorithm rate distortion curve comparative result.Show that the present invention improves motion-estimation encoded real-time performance well by table 1 and Fig. 7,8, and maintain the advantage of H.264 low bit-rate height video quality.Algorithm optimization successful of the present invention and stable, effectively reduces the complexity of motion estimation algorithm architecture.
UMHexagonS algorithm motion-estimation encoded Performance comparision in table 1 motion estimation algorithm of the present invention and JM18.4

Claims (5)

1. the quick video motion estimated coding method based on motion vector distribution prediction, it is characterized in that the method selects template search region adaptively according to the prediction of current macro motion vector distribution, whether be 0 predict to motion vector on a large scale before template search, add premature termination criterion, and then the coding quick movement estimation video realized inter macroblocks, specifically comprise the following steps:
Step one, extracts the monochrome information of current predicted macro block as coded object from current video frame;
Step 2, determines twofold motion estimating searching template, carries out search point distribution;
Step 3, determine the initial search point of high precision:
Foundation is adjudicated as estimation by Lagrangian rate-distortion optimization (RDO-RateDistortionOptimization) function, in selection rate distortion sense, optimum Match prediction block and optimal motion vector, make the bit of motion vector and residual coding distribute minimum; Lagrangian rate distortion criterion is utilized to select optimal motion vector problem can be described as:
J motion(mv,ref|λ motion)=SAD[s,r(ref,mv)]+λ motion[R(mv-pred)+R(ref)]
Wherein, J motionfor the rate distortion costs value of the motion vector of current predictive s is current macro block pixels value, mv is current motion vector, pred is motion vectors, ref is reference frame, r (ref, mv) be the pixel value of reference macroblock, R is the bit number that motion vector carries out differential coding consumption, comprises the differential coding bit number of motion vector and its predicted value and the number of coded bits of reference frame; λ motionfor Lagrange multiplier, SAD (SumofAbsoluteDifference) for the absolute error between current block and reference block pixel and:
S A D &lsqb; s , r ( r e f , m v ) &rsqb; = &Sigma; x = 1 B 1 &Sigma; y = 1 B 2 | s ( x , y ) - r ( x - m x , u - m y ) |
Wherein, B 1and B 2represent horizontal pixel and the vertical pixel of block respectively, according to different inter-frame forecast modes, its value can be 16, and 8,4; S (x, y) is current macro block pixels value; The pixel value that r (x, y) is reference macroblock, m xand m yrepresent the displacement in horizontal and vertical direction respectively;
Lagrangian rate distortion criterion is utilized to select the problem of optimization model to be expressed as:
J mode(s,c,MODE|λ mode)=SSD(s,c,MODE|QP)+λ mode×R(s,c,MODE|QP)(1)
Wherein, MODE represents a kind of interframe encoding mode of current macro, J mode(s, c, MODE| λ mode) represent rate distortion costs value under MODE pattern s is original vision signal, and c is the reconstructed video signal after adopting MODE pattern-coding, λ modefor Lagrange multiplier, R (s, c, MODE|QP) be the total number of bits that comprise MB header, motion vector and all DCT block message relevant with MODE and quantization parameter, QP is coded quantization step-length, SSD (s, c, MODE|QP) (SumofSquareDifference) is the difference of two squares sum between primary signal and reconstruction signal, that is:
S S D ( s , c , M O D E | Q P ) = &Sigma; i = 1 , j = 1 B 1 , B 2 &lsqb; S Y ( x , y ) - C Y ( x , y , M O D E | Q P ) &rsqb; 2 + &Sigma; i = 1 , j = 1 B 1 , B 2 &lsqb; S U ( x , y ) - C U ( x , y , M O D E | Q P ) &rsqb; 2 + &Sigma; i = 1 , j = 1 B 1 , B 2 &lsqb; S V ( x , y ) - C V ( x , y , M O D E | Q P ) &rsqb; 2
Wherein, B 1and B 2represent horizontal pixel and the vertical pixel of block respectively, its value can be 16, and 8,4; S y(x, y) is the value of source macro block brightness information, C y(x, y, MODE|QP) represents the value of the monochrome information of rebuilding macro block, S u, S vand C u, C vrepresent the value of corresponding colour difference information respectively;
Specifically comprise the following steps:
(1) multiple prediction mode is adopted to carry out starting point prediction:
1) the median prediction MV of spatial domain is carried out pred_space: utilize the correlation between adjacent macroblocks, the motion vector of current predicted macrablock is obtained by the motion-vector prediction of the adjacent block of known surrounding;
2) the upper strata block prediction MV of many sized blocks division is carried out pred_uplayer: utilize inter frame motion estimation macroblock partitions feature, current predicted macrablock motion vector is obtained co-located, upper level from the hierarchical search order of 7 patterns and is twice the motion vector of sized blocks;
3) the reference frame motion-vector prediction MV of time-domain is carried out pred_ref: utilize the motion vector of current macro in different reference frame to have correlation, current macro motion vector is predicted by a certain percentage by the motion vector of current block in reference frame before and is obtained;
(2) the rate distortion costs value put pointed by above-mentioned three kinds of motion vector prediction mode is designated as space_pred respectively mincost, uplayer_pred mincostand ref_pred mincost, will have the motion vector points point of minimum rate distortion costs value as initiating searches point, the optimal match point of this step wants the terminal of motion vectors as next step;
Step 4, judges whether motion vector is 0:
The motion vector obtaining current macro optimal match point in previous step is designated as (MV x, MV y), if MV x=0 and MV y=0, being then considered as now motion vector is 0, skips step 5, directly carries out step 8;
Step 5, prediction current macro carries out motion vector direction: according to next step unsymmetrical cross searching template feature, current predicted macrablock motion vector is divided into four direction, and namely horizontal square is to, horizontal negative direction, vertical positive direction and vertical negative direction;
Step 6, carries out unsymmetrical cross searching: vertical search scope is the half of horizon scan scope, and between adjacency search point, step-length is two pixels; Predict the outcome according to current macro motion vector direction in the 5th step and select the direction of search adaptively: be judged to be horizontal square to time, search initial point horizontal square 8 Searching point upwards; When being judged to be horizontal negative direction, 8 Searching point in the horizontal negative direction of search initial point; When being judged to be vertical positive direction, 4 Searching point in the vertical positive direction of search initial point; When being judged to be vertical negative direction, 4 Searching point in the vertical negative direction of search initial point; The optimal match point determined in this step will want the terminal of motion vectors as next step;
Step 7, is divided into current predicted macrablock motion vector size that motion vector is comparatively large, motion vector is medium and less three ranks of motion vector, judges current macro motion vector size;
Step 8, optionally carries out 5 × 5 pixels and entirely searches for: according to predicting in step 7 that current macro motion vector size result is optionally carried out 5 × 5 pixels and entirely searched for; Only when motion vector is less or when motion vector is 0, ability, centered by current predictive point, carries out the full search of 5 × 5 search points around it in 4 × 4 regions; Otherwise do not carry out 5 × 5 entirely to search for, directly enter step 9;
Step 9, current macro is judged whether motion vector is 0 again, and carry out motion vector direction prediction and motion vector size is predicted: the optimal match point in step 8 is predicted again, wherein judges that whether motion vector is 0 identical with step 7 with above-mentioned steps four with motion vector size Forecasting Methodology; If motion vector is 0, then skip step 10, directly carry out step 11; If motion vector is not 0, then obtains current macro motion vector distribution by motion vector direction prediction and the prediction of motion vector size and predict the outcome; According to next step non-homogeneous multilayer hexagonal mesh search pattern feature, current predicted macrablock motion vector is divided into eight directions:
(-22.5°,22.5°],(157.5°,202.5°],(22.5°,67.5°],(-157.5°,-112.5°],
(67.5°,112.5°],(-112.5°,-67.5°],(112.5°,157.5°],(-67.5°,-22.5°];
Step 10, carries out the search of non-homogeneous multilayer hexagonal mesh: predict the outcome according to current macro motion vector distribution in step 9 and select motion estimation search region adaptively: the position in non-homogeneous multilayer hexagonal mesh search pattern 32 regions by motion vector size and motion vector direction determination motion vector; According to motion vector distribution characteristic allocation 1 ~ 6 Searching point in region, using the optimal match point that the searches initial ranging central point as step 11;
Step 11, extended symmetry hexagon search: first with 2 pixel precisions for step-length carries out symmetrical hexagon search, using optimal match point as starting point again with 1 pixel precision for step-length carries out diamond search, final optimal match point is the optimal match point of current macro integer pixel motion estimation search;
Step 12, exports motion-estimation encoded information, comprises motion estimation time (TotalMEtime), code check (Bit-rate), Y-PSNR (Y-PSNR), to evaluate encryption algorithm quality.
2. the quick video motion estimated coding method based on motion vector distribution prediction according to claim 1, is characterized in that, the method that step 2 determination estimation template distributes search point is as follows:
(1) unsymmetrical cross searching template: be made up of 4 regions of search, distributes 4 search points respectively vertically, distributes 8 search points about level respectively;
(2) non-homogeneous hexagonal mesh search pattern: jointly form 32 regions of search by 4 layers and 8 directions, non-homogeneous distribution of counting is carried out in each region, along with the increase of search radius, the expansion of hunting zone, distribute search point from the inside to the outside to increase progressively, total search point 62 in the horizontal direction ± 45 ° of regions, total search point 22 in the vertical direction ± 45 ° of regions.
3. the quick video motion estimated coding method based on motion vector distribution prediction according to claim 1, is characterized in that, the method that step 5 prediction current macro carries out motion vector direction comprises the following steps:
(1) according to current macro motion vector position calculation directioin parameter:
Current macro motion vector coordinate (MV x, MV y), motion vector direction its direction vector MV=(MV x, MV y) represent, calculate value;
(2) current predicted macrablock motion vector direction is judged:
As k<1, according to MV xstate judges: work as MV xjudge during > 0 current macro motion vector direction as horizontal square to, work as MV xjudge during < 0 that current macro motion vector direction is as horizontal negative direction;
As k>1 or MV xwhen=0, according to MV ystate judges: work as MV yjudge during > 0 that current macro motion vector direction is as vertical positive direction, works as MV yjudge during < 0 that current macro motion vector direction is as vertical negative direction.
4. the quick video motion estimated coding method based on motion vector distribution prediction according to claim 1, it is characterized in that, step 7 judges that the method for current macro motion vector size is as follows:
(1) pred is determined according to the prediction mode of initial search point mincostand RD mincostvalue:
If adopt time prediction mode in step 3, then: pred mincost=ref_pred mincost;
If adopt spatial prediction mode in step 3, then: pred mincost=space_pred mincost;
If adopt upper strata block prediction mode in step 3, then: pred mincost=uplayer_pred mincost;
RD mincostfor calculating the minimum rate distortion costs value of current predicted macrablock under MODE pattern by formula (1);
(2) computational prediction motion vector parameter:
Motion vectors lower threshold is:
(1+γ)pred mincost
Motion vectors upper limit threshold is:
(1+δ)pred mincost
The motion vectors factor is:
&gamma; = B s i z e &lsqb; b l o c k t y p e &rsqb; pred min cos t 2 - &alpha; 1 &lsqb; b l o c h y p e &rsqb;
&delta; = B s i z e &lsqb; b l o c k t y p e &rsqb; pred min cos t 2 - &alpha; 2 &lsqb; b l o c k t y p e &rsqb;
Wherein, Bsize [blocktype] represents the size of current predicted macrablock, and its value can be 16,8,4,
α 1[blocktype]=[-0.23,-0.23,-0.23,-0.25,-0.27,-0.27,-0.28]
α 2[blocktype]=[-2.39,-2.40,-2.40,-2.41,-2.45,-2.45,-2.48]
(3) current predicted macrablock motion vector size is judged:
Work as RD mincost≤ (1+ γ) pred mincost, when namely minimum rate distortion costs value is less than motion vectors lower threshold, judge that current macro motion vector is less, namely movement degree is mild;
As (1+ γ) pred mincost< RD mincost< (1+ δ) pred mincost, when namely minimum rate distortion costs value is between motion vectors lower threshold and motion vector upper limit threshold, judge that current macro motion vector is medium, namely movement degree is medium;
Work as RD mincost>=(1+ δ) pred mincost, when namely minimum rate distortion costs value is greater than motion vectors upper limit threshold, judge that current macro motion vector is comparatively large, namely movement degree is more violent.
5. the quick video motion estimated coding method based on motion vector distribution prediction according to claim 1, it is characterized in that, the method in step 9 motion vectors direction is as follows:
(1) according to current macro motion vector position calculation directioin parameter: prediction current macro carries out motion vector direction, first according to current macro motion vector position calculation directioin parameter, calculates the value of motion vector direction parameter k;
(2) current predicted macrablock motion vector distribution direction is judged:
As k < 0.25, according to MV xvalue judges: work as MV xduring > 0, judge current macro motion vector direction as (-22.5 °, 22.5 °]; Work as MV xduring < 0, judge current macro motion vector direction as (157.5 °, 202.5 °];
As k > 1.5 or MV xwhen=0, according to MV yvalue judges: work as MV yduring > 0, judge current macro motion vector direction as (67.5 °, 112.5 °]; Work as MV yduring < 0, judge current macro motion vector direction as (-112.5 ° ,-67.5 °];
When 0.25≤k≤1.5, according to MV xand MV yvalue judges: work as MV x> 0 and MV yduring > 0, judge current macro motion vector direction as (22.5 °, 67.5 °]; Work as MV x< 0 and MV yduring < 0, judge current macro motion vector direction as (-157.5 ° ,-112.5 °]; Work as MV x< 0 and MV yjudge during > 0 current macro motion vector direction as (112.5 °, 157.5 °]; Work as MV x> 0 and MV yduring < 0, judge current macro motion vector direction as (-67.5 ° ,-22.5 °].
CN201310098216.1A 2013-03-26 2013-03-26 Based on the method for coding quick movement estimation video of motion vector distribution prediction Expired - Fee Related CN103188496B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310098216.1A CN103188496B (en) 2013-03-26 2013-03-26 Based on the method for coding quick movement estimation video of motion vector distribution prediction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310098216.1A CN103188496B (en) 2013-03-26 2013-03-26 Based on the method for coding quick movement estimation video of motion vector distribution prediction

Publications (2)

Publication Number Publication Date
CN103188496A CN103188496A (en) 2013-07-03
CN103188496B true CN103188496B (en) 2016-03-09

Family

ID=48679426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310098216.1A Expired - Fee Related CN103188496B (en) 2013-03-26 2013-03-26 Based on the method for coding quick movement estimation video of motion vector distribution prediction

Country Status (1)

Country Link
CN (1) CN103188496B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3189660B1 (en) * 2014-09-30 2023-07-12 HFI Innovation Inc. Method of adaptive motion vector resolution for video coding
CN104301724B (en) 2014-10-17 2017-12-01 华为技术有限公司 Method for processing video frequency, encoding device and decoding device
US20170272775A1 (en) * 2015-11-19 2017-09-21 Hua Zhong University Of Science Technology Optimization of interframe prediction algorithms based on heterogeneous computing
CN105959699B (en) * 2016-05-06 2019-02-26 西安电子科技大学 A kind of quick inter-frame prediction method based on estimation and time-space domain correlation
CN106878727A (en) * 2016-12-31 2017-06-20 深圳市共进电子股份有限公司 Video data handling procedure and device
CN107483936B (en) * 2017-08-01 2019-09-06 清华大学深圳研究生院 A kind of light field video inter-prediction method based on macro pixel
CN109951707B (en) * 2017-12-21 2021-04-02 北京金山云网络技术有限公司 Target motion vector selection method and device, electronic equipment and medium
CN115250350B (en) * 2018-09-03 2024-04-09 华为技术有限公司 Motion vector acquisition method, motion vector acquisition device, computer equipment and storage medium
CN109618153A (en) * 2019-01-17 2019-04-12 杨郭英 Video data encoder processing mechanism
CN110740322A (en) * 2019-10-23 2020-01-31 李思恒 Video encoding method and device, storage medium and video encoding equipment
CN113115038B (en) * 2021-04-16 2022-03-29 维沃移动通信有限公司 Motion estimation method and device, electronic equipment and readable storage medium
CN113965753B (en) * 2021-12-20 2022-05-17 康达洲际医疗器械有限公司 Inter-frame image motion estimation method and system based on code rate control
CN117412065B (en) * 2023-12-15 2024-03-08 福州时芯科技有限公司 Optimization scheme of spiral search algorithm
CN117640939A (en) * 2024-01-25 2024-03-01 宁波康达凯能医疗科技有限公司 Method for discriminating motion estimation search mode for inter-frame image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1871115A1 (en) * 2006-06-21 2007-12-26 Samsung Electronics Co., Ltd. Motion estimation method and apparatus for fast motion estimation
CN101621694A (en) * 2009-07-29 2010-01-06 深圳市九洲电器有限公司 Motion estimation method, motion estimation system and display terminal
CN101815218A (en) * 2010-04-02 2010-08-25 北京工业大学 Method for coding quick movement estimation video based on macro block characteristics
CN102186070A (en) * 2011-04-20 2011-09-14 北京工业大学 Method for realizing rapid video coding by adopting hierarchical structure anticipation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1871115A1 (en) * 2006-06-21 2007-12-26 Samsung Electronics Co., Ltd. Motion estimation method and apparatus for fast motion estimation
CN101621694A (en) * 2009-07-29 2010-01-06 深圳市九洲电器有限公司 Motion estimation method, motion estimation system and display terminal
CN101815218A (en) * 2010-04-02 2010-08-25 北京工业大学 Method for coding quick movement estimation video based on macro block characteristics
CN102186070A (en) * 2011-04-20 2011-09-14 北京工业大学 Method for realizing rapid video coding by adopting hierarchical structure anticipation

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
A Self-Adaptive And Fast Motion Estimation Search Method For H.264/Avc;Pengyu Liu 等;《Intelligent Information Hiding and Multimedia Signal Processing (IIH-MSP)》;20101017;第651-654页 *
An Effective Motion Estimation Scheme for H.264/AVC;Pengyu Liu 等;《IIH-MSP "08 Proceedings of the 2008 International Conference on Intelligent Information Hiding and Multimedia Signal Processing》;20080815;第797-801页 *
基于UMHexagenS快速运动估计算法优化;卢政 等;《电视技术》;20110402;第35卷(第7期);第139-146页 *
基于UMHexagonS的快速运动估计编码算法研究;刘鹏宇 等;《电路与系统学报》;20121031;第17卷(第5期);第29-31页 *

Also Published As

Publication number Publication date
CN103188496A (en) 2013-07-03

Similar Documents

Publication Publication Date Title
CN103188496B (en) Based on the method for coding quick movement estimation video of motion vector distribution prediction
CN103561263B (en) Based on motion vector constraint and the motion prediction compensation method of weighted motion vector
CN101815218B (en) Method for coding quick movement estimation video based on macro block characteristics
CN102484719B (en) Method and apparatus for encoding video, and method and apparatus for decoding video
CN102763411B (en) Method and apparatus to Video coding and the method and apparatus to video decode
CN102984521B (en) High-efficiency video coding inter-frame mode judging method based on temporal relativity
CN102648631B (en) For the method and apparatus of coding/decoding high-definition picture
TWI468019B (en) Method for decoding image
CN103634606B (en) Video encoding method and apparatus
CN102740077B (en) H.264/AVC standard-based intra-frame prediction mode selection method
CN105959699B (en) A kind of quick inter-frame prediction method based on estimation and time-space domain correlation
CN101640802A (en) Video inter-frame compression coding method based on macroblock features and statistical properties
CN102238391A (en) Predictive coding method and device
CN102647598B (en) H.264 inter-frame mode optimization method based on maximin MV (Music Video) difference value
CN101022555B (en) Interframe predictive coding mode quick selecting method
CN101888546B (en) A kind of method of estimation and device
CN103238334A (en) Image intra prediction method and apparatus
CN101014129B (en) Video data compression method
CN102186081B (en) H.264 intra-frame mode selection method based on gradient vector
CN103248895A (en) Quick mode estimation method used for HEVC intra-frame coding
CN110365975A (en) A kind of AVS2 video encoding and decoding standard prioritization scheme
CN105187826A (en) Rapid intra-frame mode decision method specific to high efficiency video coding standard
CN104702959B (en) A kind of intra-frame prediction method and system of Video coding
CN102196272A (en) P frame encoding method and device
CN101883275B (en) Video coding method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB03 Change of inventor or designer information

Inventor after: Liu Pengyu

Inventor after: Gao Yuan

Inventor after: Jia Kebin

Inventor before: Gao Yuan

Inventor before: Liu Pengyu

Inventor before: Jia Kebin

COR Change of bibliographic data

Free format text: CORRECT: INVENTOR; FROM: GAO YUAN LIU PENGYU JIA KEBIN TO: LIU PENGYU GAO YUAN JIA KEBIN

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160309

CF01 Termination of patent right due to non-payment of annual fee