CN102143364B - Motion estimation method based on genetic search and template matching - Google Patents

Motion estimation method based on genetic search and template matching Download PDF

Info

Publication number
CN102143364B
CN102143364B CN 201110097766 CN201110097766A CN102143364B CN 102143364 B CN102143364 B CN 102143364B CN 201110097766 CN201110097766 CN 201110097766 CN 201110097766 A CN201110097766 A CN 201110097766A CN 102143364 B CN102143364 B CN 102143364B
Authority
CN
China
Prior art keywords
point
sad
template
representes
search
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
CN 201110097766
Other languages
Chinese (zh)
Other versions
CN102143364A (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN 201110097766 priority Critical patent/CN102143364B/en
Publication of CN102143364A publication Critical patent/CN102143364A/en
Application granted granted Critical
Publication of CN102143364B publication Critical patent/CN102143364B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a motion estimation method based on genetic search and template matching, belonging to the technical field of video compression coding. The method comprises the following steps: adopting multiple methods to predict blocks to be coded in a frame to be coded so as to obtain multiple predicted motion vectors; respectively searching a point directed by each predicted motion vector in a search window, adopting three termination strategies to judge, and if the three termination strategies are met, finishing the search; using an initial template to carry out population initialization, and copying, intersecting and selecting population cycles until genetic termination conditions are met; on the basis, searching adjacent points so as to obtain matched blocks to code the blocks to be coded; and traversing a complete frame image, and coding the complete frame image. In the method, the statistic characteristics of the motion vectors are combined to set the three termination strategies, and the template matching is combined with the genetic search algorithm for use, thus ensuring the coding quality and greatly reducing the time of the motion estimation at the same time.

Description

A kind of method for estimating based on genetic search and template matches
Technical field
The invention belongs to the technology of video compressing encoding field, relate to a kind of method for estimating based on genetic search and template matches.
Background technology
Estimation is the important step of technology of video compressing encoding, its role is to remove effectively the time redundancy of image sequence.In the video compression coding process, estimation has occupied the operand of 50%-70%, and the efficient that therefore improves estimation has great significance for accelerating video coding speed.
BMA is to use method for estimating the most widely at present; Through every two field picture being divided into the piece of a plurality of non-overlapping copies; In the search window of reference frame, search out and the highest piece of reference block similarity; Calculate residual sum motion vector between the two and encode, thereby realize the processed compressed of video image.Wherein, full search method is passed through all match block in the traversal search window, thereby reaches very high search precision, but computation complexity is too high, is difficult to requirement of real time.Be requirement of real time, occurred many fast search algorithms in succession, as: three step search methods, new three step search methods, four step search methods, hierarchical search method, diamond search method etc., and these fast algorithms are easy to be absorbed in locally optimal solution.(Genetic Algorithm GA) has global optimizing ability preferably, and in recent years, the application of this algorithm in estimation obtained increasing concern in view of genetic algorithm.
Genetic algorithm is that a kind of evolution rule by the nature survival of the fittest develops and next random search algorithm, has very high robustness, and has potential systematicness and concurrency, is very suitable for block matching motion and estimates.But traditional motion estimation algorithm based on genetic search is placed on main energy on coding method, fitness function and the genetic operator of complex design mostly, has increased algorithm complex to a great extent.Though the estimation based on genetic algorithm has global optimizing ability preferably, its too high algorithm complex needs huge calculating and storage overhead, has increased the scramble time.The search time of some improvement algorithm even suitable with full-search algorithm, this is inconsistent with the original intention that improves search speed.And traditional motion estimation algorithm based on genetic search generally adopts lower genetic iteration number of times, though improved the speed of search relatively, has reduced the precision of genetic algorithm, thereby has influenced encoding quality.
Summary of the invention
The object of the invention, be exactly to traditional motion estimation algorithm based on genetic search in the deficiency aspect search speed and the search precision, a kind of method for estimating based on genetic search and template matches is provided.
For realizing above-mentioned purpose, the method for estimating that the present invention is based on genetic search and template matches may further comprise the steps:
(1) the previous coded frame with frame to be encoded is current reference frame; One of them block to be encoded of treating coded frame adopts medium filtering, the prediction of upper strata piece, consecutive frame forecast method to predict corresponding median prediction motion vector, upper strata piece motion vectors and the consecutive frame motion vectors that obtains this block to be encoded respectively; Adopt this block to be encoded of method prediction of medium filtering simultaneously SADValue;
(2) coordinate by said block to be encoded adds the above median prediction motion vector, obtains the search center point of current reference frame; The piece that to calculate with said search center point be starting point SADValue; Judge whether to satisfy first and stop tactful condition: if satisfy, be optimum point then with said search center point, and execution in step (10); If do not satisfy, then execution in step (3).
(3) coordinate by said block to be encoded adds the above upper strata piece motion vectors and consecutive frame motion vectors respectively, corresponding upper strata piece prediction search point and the consecutive frame prediction search point of obtaining; Starting point, search center point, upper strata piece prediction search point and consecutive frame prediction search point with said block to be encoded is central point respectively, obtains the consecutive points of the level and the vertical direction of each said central point; Calculating each is that the piece of starting point is the piece of starting point with said consecutive points with each with said central point SADValue therefrom obtains current minimum SADValue;
(4) judge whether to satisfy second and stop tactful condition: if satisfy, then with said current minimum SADThe starting point that is worth pairing is as optimum point, and execution in step (10); If do not satisfy, then judge whether to satisfy the 3rd stop strategy condition: if satisfy, execution in step (9) then; If do not satisfy, then execution in step (5);
(5) design original template with the said search center point of step (2) for the center, it is individual to calculate in the initial hereditary population each SADThe piece that it is starting point that value, each individuality of said initial hereditary population correspond to each point of being covered with said original template respectively;
(6) judge whether to satisfy heredity and stop strategy: if satisfy, execution in step (9) then; If do not satisfy, then in the present age hereditary population with minimum SADThe corresponding individuality of value carries out duplicating for three times, to second little SADThe corresponding individuality of value carries out duplicating and give up for twice three with maximum SADThree individuals that value is corresponding, more once to all the other each individual replicates;
(7) step (6) is duplicated each that obtain and duplicate individuality and carry out mutation operation to obtain corresponding variation individual, and it is individual to calculate each said variation SADValue; Select it from said duplicating individuality and the variation individuality corresponding with it SADValue smaller gets into hereditary population of future generation;
(8) judge the said present age, whether hereditary population reached preset population iteration threshold: if reach, execution in step (9) then; Otherwise, execution in step (6);
(9) with in the said present age hereditary population with minimum SADThe starting point of the piece that value is corresponding is as central point, obtains four consecutive points in the level and the vertical direction of this central point, each piece that to calculate with these four consecutive points respectively be starting point SADValue is therefrom chosen with minimum SADThe starting point of the piece that value is corresponding is an optimum point;
(10) to being that the match block of starting point is encoded with said optimum point; Whether the frame number of judging the coded frame between current reference frame and the said frame to be encoded less than preset maximum reference frame number: if less than, with the previous coded frame of this current reference frame as current reference frame and return execution in step (2); Otherwise accomplish the coding of said block to be encoded, and execution in step (11);
(11) the said frame to be encoded of traversal judges whether also to exist block to be encoded; If exist, then return step (1) next block to be encoded is encoded; If do not exist, then finish.
Further, step of the present invention (2) said first stops strategy suc as formula shown in (1), if y 1=1, then the condition of the first termination strategy is satisfied in expression; Otherwise foot first with thumb down stops the condition of strategy;
Figure 2011100977662100002DEST_PATH_IMAGE001
(1)
In the formula (1), SADExpression is with the said search center point piece that is starting point SADValue; Pred_SADRepresent the block to be encoded of said prediction SADValue; Pred_mvRepresent said median prediction motion vector; TH1 expression first threshold, said first threshold is calculated by formula (2);
Figure 421607DEST_PATH_IMAGE002
(2)
In the formula (2), TH_staticThe parameter that expression is preset; TH_factorThe expression threshold value factor, the said threshold value factor is calculated by formula (3);
(3)
In the formula (3), BlocktypeThe type of representing said block to be encoded, 1 expression 16x16 type blocks, 2 expression 16x8 type blocks, 3 expression 8x16 type blocks, 4 expression 8x8 type blocks, 5 expression 8x4 type blocks, 6 expression 4x8 type blocks, 7 expression 4x4 type blocks.
Further, step of the present invention (4) said second stops strategy suc as formula shown in (4), if y 2=1, then the condition of the second termination strategy is satisfied in expression; Otherwise foot second with thumb down stops the condition of strategy;
Figure 41069DEST_PATH_IMAGE004
(4)
In the formula (4), Min_SADThe described current minimum sad value of expression step (3); Pred_SADRepresent the block to be encoded of said prediction SADValue; THThe said first threshold of 1 expression.
Further, step of the present invention (4) the said the 3rd stops strategy suc as formula shown in (5), if y 3=1, then the condition of the 3rd termination strategy is satisfied in expression; Otherwise foot the 3rd with thumb down stops the condition of strategy;
Figure DEST_PATH_IMAGE005
?(5)
In the formula (5), Abs() representes to take absolute value function; MV_x, MV_yRepresent the said current minimum of step (3) respectively SADX, the y component of the motion vector of value corresponding blocks; Pred_MV_x, Pred_MV_yX, the y component of representing the said median prediction motion vector of step (2) respectively; Min_SADThe said current minimum of expression step (3) SADValue; Pred_SADRepresent the block to be encoded of said prediction SADValue; TH2 expressions, second threshold value, said second threshold value is calculated by formula (6);
Figure 920032DEST_PATH_IMAGE006
(6)
In the formula (6), TH_DSBe preset parameter; TH_factorRepresent the said threshold value factor.
Further; The present invention is in the said original template of step (5); With the 8th point directly over the said search center point is template first point, is template second point with first level of said template the 8th point left, with first level of said template the 8th point to the right be template thirdly; With the 8th point under the said search center point is template the 4th point; With the 4th level of said template the 8th point left is template the 5th point, is template the 6th point with the 4th level of said template the 8th point to the right, is template the 7th point with said search center point level the 12nd point left; With said search center point level the 12nd point to the right is template the 8th point; The 4th point with directly over the said search center point is first datum mark, is template the 9th point with the said first datum mark level the 4th point left, is template the 10th point with the said first datum mark level the 4th point to the right; The 4th point with under the said search center point is second datum mark; With the said second datum mark level the 4th point left is template the ten one point, is template the ten two point with the said second datum mark level the 4th point to the right, is template the ten three point with said search center point.
Further, the said heredity of step of the present invention (6) stops strategy suc as formula shown in (7), if y 4=1, then the condition that heredity stops strategy is satisfied in expression; Otherwise foot heredity with thumb down stops the condition of strategy;
(7)
In the formula (7), Pred_SAD_aveRepresent the average of previous generation heredity population SADValue; SAD_aveRepresent the average of contemporary hereditary population SADValue; TH_DSThe parameter that expression is preset; Minge_SADRepresent in the contemporary hereditary population minimum SADValue; THSaid second threshold value of 2 expressions.
Further, the step of the said mutation operation of step of the present invention (7) is following:
1) calculates the said individual variation step-length of duplicating by formula (8); Confirm the said individual variation direction of duplicating through producing a random number; Said random number is got any number in 1,2,3,4; Wherein, directly over " 1 " representes that the variation direction is, under " 2 " represent that the variation direction is; " 3 " expression variation direction be level left, " 4 " expression variation direction be level to the right;
2) the said coordinate that duplicates individuality is added the variation step-length along the determined variation direction of step 1), obtain the individual coordinate of said variation;
Figure 342530DEST_PATH_IMAGE008
(8)
In the formula (8), Mutation_stepIndividual variation step-length is duplicated in expression; SAD_indThe sad value of representing current individuality; SAD_aveThe average sad value of representing contemporary hereditary population.
Compared with prior art, the invention has the beneficial effects as follows: the present invention adopts the Forecasting Methodology of multiple motion vector that the motion vector of block to be encoded is predicted in step (1), compared with prior art, has improved the precision of motion vectors; Take into full account the statistical property of motion vector simultaneously, in step (2) and step (4), designed three kinds and stopped strategy, significantly reduced search point when guaranteeing coding quality, improved the slow defective of traditional algorithm search speed; In step (5) and step (9); Use template matching algorithm that the genetic search process is optimized; Take into account the strong and high characteristics of template matching algorithm local optimal searching precision of genetic algorithm global optimizing ability, when accelerating convergence rate, improved search precision problem of lower in the traditional algorithm.
Description of drawings
Fig. 1 is the method for estimating flow chart based on genetic search and template matches;
Fig. 2 is the search sketch map based on multiple motion vectors;
Fig. 3 is consecutive points search sketch map;
Fig. 4 is the initial population distribution schematic diagram;
Fig. 5 is the mutation operation sketch map.
Embodiment
As shown in Figure 1, below illustrate the method for estimating that the present invention is based on genetic search and template matches, its step is following:
(1) with frame to be encoded (with mFrame is an example) previous coded frame be current reference frame; To one of them block to be encoded of m frame (with nPiece is an example) adopt the prediction of medium filtering, upper strata piece, consecutive frame forecast method to predict respectively, correspondingly obtain the nThe median prediction motion vector of piece ( Pred_mv), upper strata piece motion vectors ( MV_uplayer) and the consecutive frame motion vectors ( MV_adj); Adopt the method prediction the of medium filtering simultaneously nPiece SAD(Sum of Absolute Difference) value obtains Pred_SAD
(2) as shown in Figure 2, by nThe coordinate of piece (is promptly put D corresponding the nThe coordinate of piece) adds Pred_mv, obtain the search center point A of current reference frame; And to calculate with an A be the piece of starting point SADValue; Whether the condition of judging the first termination strategy satisfies: if satisfy, be optimum point then with an A, and execution in step (10); If do not satisfy, then execution in step (3).
In the present embodiment, step (2) said first stops strategy suc as formula shown in (1), if y 1=1, then the condition of the first termination strategy is satisfied in expression; Otherwise foot first with thumb down stops the condition of strategy;
Figure 990549DEST_PATH_IMAGE001
(1)
In the formula (1), SADExpression is with the said search center point piece that is starting point SADValue; Pred_SADRepresent the block to be encoded of said prediction SADValue; Pred_mvRepresent said median prediction motion vector; TH1 expression first threshold, said first threshold is calculated by formula (2);
Figure 46492DEST_PATH_IMAGE002
(2)
In the formula (2), TH_staticThe parameter that expression is preset, span is 20-200, value is 50 in the present embodiment; TH_factorThe expression threshold value factor, the said threshold value factor is calculated by formula (3);
Figure 350434DEST_PATH_IMAGE003
(3)
In the formula (3), BlocktypeThe type of representing said block to be encoded, 1 expression 16x16 type blocks, 2 expression 16x8 type blocks, 3 expression 8x16 type blocks, 4 expression 8x8 type blocks, 5 expression 8x4 type blocks, 6 expression 4x8 type blocks, 7 expression 4x4 type blocks.
The present invention is provided with first and stops strategy, has taken into full account the situation of coded image static block.In sequence image, the movement tendency between adjacent two frames is often smaller, and correspondingly, the motion vector of each piece is also smaller, and this situation is particularly evident in the static background image and the less image that moves.Whether the condition through judging the first termination strategy satisfies, and can determine whether to finish search at the algorithm initial stage.With respect to traditional motion estimation algorithm based on genetic search, significantly reduced the search of static block, improved the speed of motion search.The present invention also can use other termination strategies to static block of the prior art; But the first set termination strategy of present embodiment is directed against the termination strategy of static block than other; Increased the estimating part of motion vector; It is more accurate to the judgement of static block to make, avoids by the disconnected decline that causes coding quality of erroneous judgement.
(3) as shown in Figure 2, by n(some D corresponding the for the coordinate of piece nThe coordinate of piece) adds respectively MV_adjWith MV_uplayer, corresponding consecutive frame prediction search point B and the upper strata piece prediction search point C of obtaining; Be central point (each central point is shown in the filled circles among Fig. 2) with an A, some B, some C and some D respectively; Obtain the consecutive points (each consecutive points is shown in the open circles among Fig. 2) of the level and the vertical direction of each said central point, the consecutive points that each central point correspondence obtains constitute a little rhombus template; Calculating each is that the piece of starting point is the piece of starting point with said consecutive points with each with said central point SADValue therefrom obtains current minimum SADValue Min_SAD
(4) judge second stop strategy condition whether satisfy: if satisfy, then with Min_SADPairing starting point is as optimum point, and execution in step (10); If do not satisfy, then judge the 3rd stop strategy condition whether satisfy: if satisfy, execution in step (9) then; If do not satisfy, then execution in step (5).
In the present embodiment, step (4) said second stops strategy suc as formula shown in (4), if y 2=1, then the condition of the second termination strategy is satisfied in expression; Otherwise foot second with thumb down stops the condition of strategy;
Figure 687875DEST_PATH_IMAGE004
(4)
In the formula (4), Min_SADThe said current minimum of expression step (3) SADValue; Pred_SADRepresent the block to be encoded of said prediction SADValue; THThe said first threshold of 1 expression.
In the present embodiment, step (4) the said the 3rd stops strategy suc as formula shown in (5), if y 3=1, then the condition of the 3rd termination strategy is satisfied in expression; Otherwise foot the 3rd with thumb down stops the condition of strategy;
Figure 972093DEST_PATH_IMAGE005
?(5)
In the formula (5), Abs() representes to take absolute value function; MV_x, MV_yRepresent the said current minimum of step (3) respectively SADX, the y component of the motion vector of value corresponding blocks; Pred_MV_x, Pred_MV_yX, the y component of representing the said median prediction motion vector of step (2) respectively; Min_SADThe said current minimum of expression step (3) SADValue; Pred_SADRepresent the block to be encoded of said prediction SADValue; TH2 expressions, second threshold value, said second threshold value is calculated by formula (6);
Figure 369576DEST_PATH_IMAGE006
(6)
In the formula (6), TH_DSBe preset parameter, span is 50-500, and value is 150 in the present embodiment; TH_factorRepresent the said threshold value factor.
Of the present invention second, third stops strategy also can use of the prior art through judging the termination strategy of sad value size.
Compare through the termination strategy of judging the sad value size with existing, second, third of present embodiment setting stops center-biased characteristic and the Space Consistency that strategy has taken into full account motion vector; For improving the precision of motion vectors, not only motion vector is carried out median prediction, also take upper strata piece prediction, closed on the reference frame forecast method; And present embodiment has also taken into full account the statistical property of motion vector, makes that the judgement that stops strategy is more accurate, has significantly reduced search point simultaneously, has accelerated the speed of search.
(5) design original template with the said search center point A of step (2) for the center, it is individual to calculate in the initial hereditary population each SADValue, each individuality of said initial hereditary population is corresponding with the piece that is starting point with each point that said original template was covered respectively.
The present invention can produce initial population at random or adopt the original template of other common types of prior art to produce initial population, but as preferred implementation of the present invention, in the present embodiment, the description of original template is specific as follows:
As shown in Figure 4, the distance between adjacent horizontal line or the adjacent vertical line is 4 points, with the 8th some F directly over the said search center point A 1Be template first point; With first level of said template the 8th some F left 2Be template second point; With first level of said template the 8th some F to the right 3For template thirdly; With the 8th some F under the said search center point 4Be template the 4th point; With the 4th level of said template the 8th some F left 5Be template the 5th point; With the 4th level of said template the 8th some F to the right 6Be template the 6th point; With said search center point level the 12nd some F left 7Be template the 7th point; With said search center point level the 12nd some F to the right 8Be template the 8th point; The 4th point with directly over the said search center point is first datum mark, with the said first datum mark level the 4th some F left 9Be template the 9th point; With the said first datum mark level the 4th some F to the right 10Be template the 10th point; The 4th point with under the said search center point is second datum mark, with the said second datum mark level the 4th some F left 11Be template the ten one point; With the said second datum mark level the 4th some F to the right 12Be template the ten two point; With an A is template the ten three point.
The present invention produces initial population by fixing template is set, and effectively combines the local optimal searching ability of template matching algorithm; And the template covering points distributes extensively, can effectively bring into play the outstanding global optimizing ability of genetic algorithm.Perhaps adopt the original template generation initial population of other types to compare with producing initial population at random, adopt the initial population of the original template generation of setting of the present invention to increase the quality of initial population in the genetic search, accelerated the search speed of estimation.
(6) judge that heredity stops strategy and whether satisfies: if satisfy, execution in step (9) then; If do not satisfy, then in the present age hereditary population with minimum SADThe corresponding individuality of value carries out duplicating for three times, to second little SADThe corresponding individuality of value carries out duplicating for twice, give up three with maximum SADThree individuals that value is corresponding, more once to all the other each individual replicates.
In the present embodiment, the said heredity of step (6) stops strategy suc as formula shown in (7), if y 4=1, then the condition that heredity stops strategy is satisfied in expression; Otherwise foot heredity with thumb down stops the condition of strategy;
Figure 160815DEST_PATH_IMAGE007
(7)
In the formula (7), Pred_SAD_aveRepresent the average of previous generation heredity population SADValue; SAD_aveRepresent the average of contemporary hereditary population SADValue; TH_DSThe parameter that expression is preset; Minge_SADRepresent in the contemporary hereditary population minimum SADValue; THSaid second threshold value of 2 expressions.
The present invention can use traditional heredity of only judging the sad value size to stop strategy; But the heredity of present embodiment stops strategy to be compared with traditional heredity termination strategy of only judging the sad value size; Increased kind of the judgement of group mean sad value; Can judge effectively whether population restrains, it is more accurate to make that heredity stops strategy, has increased coding quality.
(7) step (6) is duplicated each that obtain and duplicate individuality and carry out mutation operation to obtain corresponding variation individual, and it is individual to calculate each said variation SADValue; Select it from said duplicating individuality and the variation individuality corresponding with it SADValue smaller gets into hereditary population of future generation.
In the present embodiment, the step of the said mutation operation of step (7) is specific as follows:
1) calculates the said individual variation step-length of duplicating by formula (8) Mutation_stepConfirm the said individual variation direction of duplicating through producing a random number; Said random number is got any number in 1,2,3,4; Wherein, directly over " 1 " representes that the variation direction is, under " 2 " represent that the variation direction is; " 3 " expression variation direction be level left, " 4 " expression variation direction be level to the right.
2) shown in figure (5), add the variation step-length with the said coordinate (shown in the filled circles) that duplicates individuality along the determined variation direction of step 1), (1,2 or 3) obtain the individual coordinate of said variation; It is 1 o'clock individual possible position of coordinate of variation that figure intermediate cam shape is expressed as the variation step-length; It is 2 o'clock individual possible positions of coordinate of variation that square is expressed as the variation step-length; It is 3 o'clock individual possible positions of coordinate of variation that five-pointed star is expressed as the variation step-length.
Figure 803411DEST_PATH_IMAGE008
(8)
In the formula (8), SAD_indRepresent current individuality SADValue; SAD_aveRepresent the average of contemporary hereditary population SADValue.
The present invention also can use conventional coding position variation method, but present embodiment is taked the mode of adaptively changing variation step-length, and picked at random variation direction has increased the possibility that obtains the new individuality of high-quality through mutation operation greatly.Compare with conventional coding position variation method, the mutation operation method of present embodiment has been accelerated the convergence rate of population, has reduced storage demand and amount of calculation, in the estimation of multiframe reference, can significantly reduce the time of motion search.
(8) judge the said present age, whether hereditary population reached preset population iteration threshold L(span of population iteration threshold is generally 3-10, and value is 5 in the present embodiment): if reached preset population iteration threshold L, execution in step (9) then; If do not reach preset population iteration threshold L, execution in step (6) then;
(9) as shown in Figure 3, with in the said present age hereditary population with minimum SADThe starting point E of the piece that value is corresponding is as central point (shown in the filled circles of Fig. 3); Level and vertical direction at an E obtain four consecutive points (shown in the open circles of Fig. 3); These four consecutive points constitute a little rhombus template, each piece that to calculate with these four consecutive points respectively be starting point SADValue is therefrom chosen with minimum SADThe starting point of the piece that value is corresponding is an optimum point;
(10) to being that the match block of starting point is encoded with said optimum point; Judge current reference frame and mWhether (span of maximum reference frame number is 1-16 normally less than preset maximum reference frame number for the frame number of the coded frame between the frame; Value is 10 in the present embodiment): if less than, with the previous coded frame of this current reference frame as current reference frame and return execution in step (2); Otherwise accomplish nThe coding of piece, execution in step (11);
(11) traversal the mFrame judges whether also to exist block to be encoded; If exist, then return step (1) next block to be encoded is encoded; If do not exist, then finish.

Claims (4)

1. method for estimating based on genetic search and template matches is characterized in that may further comprise the steps:
(1) the previous coded frame with frame to be encoded is current reference frame; One of them block to be encoded of treating coded frame adopts medium filtering, the prediction of upper strata piece, consecutive frame forecast method to predict corresponding median prediction motion vector, upper strata piece motion vectors and the consecutive frame motion vectors that obtains this block to be encoded respectively; Adopt the sad value of this block to be encoded of method prediction of medium filtering simultaneously;
(2) coordinate by said block to be encoded adds the above median prediction motion vector, obtains the search center point of current reference frame; Calculating with said search center point is the sad value of the piece of starting point; Judge whether to satisfy first and stop tactful condition: if satisfy, be optimum point then with said search center point, and execution in step (10); If do not satisfy, then execution in step (3);
Said first stops strategy suc as formula shown in (1), if y 1=1, then the condition of the first termination strategy is satisfied in expression; Otherwise foot first with thumb down stops the condition of strategy;
y 1=[(SAD-Pred_SAD)<TH1]&&(Pred_mv==0) (1)
In the formula (1), SAD representes that with said search center point be the sad value of the piece of starting point; Pred_SAD representes the sad value of the block to be encoded of said prediction; Pred_mv representes said median prediction motion vector; TH1 representes first threshold, and said first threshold is calculated by formula (2);
TH1=TH_static/TH_factor (2)
In the formula (2), TH_static representes the parameter preset; TH_factor representes the threshold value factor, and the said threshold value factor is calculated by formula (3);
Figure FDA00001799709700011
In the formula (3), blocktype representes the type of said block to be encoded, 1 expression 16x16 type blocks, 2 expression 16x8 type blocks, 3 expression 8x16 type blocks, 4 expression 8x8 type blocks, 5 expression 8x4 type blocks, 6 expression 4x8 type blocks, 7 expression 4x4 type blocks;
(3) coordinate by said block to be encoded adds the above upper strata piece motion vectors and consecutive frame motion vectors respectively, corresponding upper strata piece prediction search point and the consecutive frame prediction search point of obtaining; Starting point, search center point, upper strata piece prediction search point and consecutive frame prediction search point with said block to be encoded is central point respectively, obtains the consecutive points of the level and the vertical direction of each said central point; Calculate each with said central point be starting point piece with each be the sad value of the piece of starting point with said consecutive points, therefrom obtain current minimum sad value;
(4) judge whether to satisfy second stop strategy condition: if satisfy, then with the starting point of pairing of said current minimum sad value as optimum point, and execution in step (10); If do not satisfy, then judge whether to satisfy the 3rd stop strategy condition: if satisfy, execution in step (9) then; If do not satisfy, then execution in step (5);
Said second stops strategy suc as formula shown in (4), if y 2=1, then the condition of the second termination strategy is satisfied in expression; Otherwise foot second with thumb down stops the condition of strategy;
y 2=(min_SAD-Pred_SAD<TH1) (4)
In the formula (4), min_SAD representes the described current minimum sad value of step (3); Pred_SAD representes the sad value of the block to be encoded of said prediction; TH1 representes said first threshold;
The said the 3rd stops strategy suc as formula shown in (5), if y 3=1, then the condition of the 3rd termination strategy is satisfied in expression; Otherwise foot the 3rd with thumb down stops the condition of strategy;
y 3=[abs(MV_x-Pred_MV_x)≤2]&&
[abs(MV_y-Pred_MV_y)≤2]&&[(min_SAD-Pred_SAD)<TH2] (5)
In the formula (5), abs () representes to take absolute value function; MV_x, MV_y represent x, the y component of the motion vector of the said current minimum sad value corresponding blocks of step (3) respectively; Pred_MV_x, Pred_MV_y represent x, the y component of the said median prediction motion vector of step (2) respectively; Min_SAD representes the said current minimum sad value of step (3); Pred_SAD representes the sad value of the block to be encoded of said prediction; TH2 representes second threshold value, and said second threshold value is calculated by formula (6);
TH2=TH_DS/TH_factor (6)
In the formula (6), TH_DS is preset parameter; TH_factor representes the said threshold value factor;
(5) design original template with the said search center point of step (2) for the center; Calculate each the individual sad value in the initial hereditary population, the piece that it is starting point that each individuality of said initial hereditary population corresponds to each point of being covered with said original template respectively;
(6) judge whether to satisfy heredity and stop strategy: if satisfy, execution in step (9) then; If do not satisfy; Then to the individuality corresponding in the present age hereditary population with minimum sad value carry out duplicating for three times, to carrying out duplicating and giving up for twice and maximum three corresponding individuals of three sad values, more once to all the other each individual replicates with the corresponding individuality of the second little SAD value;
(7) step (6) is duplicated each that obtain and duplicate individuality and carry out mutation operation to obtain corresponding variation individual, and calculate the individual sad value of each said variation; Select its sad value smaller to get into hereditary population of future generation individuality and the variation individuality corresponding from said duplicating with it;
(8) judge the said present age, whether hereditary population reached preset population iteration threshold: if reach, execution in step (9) then; Otherwise, execution in step (6);
(9) with the starting point of piece corresponding in the said present age hereditary population with minimum sad value as central point; Level and vertical direction at this central point obtain four consecutive points; Calculate respectively with these four sad values that consecutive points are each piece of starting point, the starting point of therefrom choosing the piece corresponding with minimum sad value is an optimum point;
(10) to being that the match block of starting point is encoded with said optimum point; Whether the frame number of judging the coded frame between current reference frame and the said frame to be encoded less than preset maximum reference frame number: if less than, with the previous coded frame of this current reference frame as current reference frame and return execution in step (2); Otherwise accomplish the coding of said block to be encoded, and execution in step (11);
(11) the said frame to be encoded of traversal judges whether also to exist block to be encoded; If exist, then return step (1) next block to be encoded is encoded; If do not exist, then finish.
2. the method for estimating based on genetic search and template matches according to claim 1; It is characterized in that, in the said original template of step (5), be template first point with the 8th point directly over the said search center point; With first level of said template the 8th point left is template second point; With first level of said template the 8th point to the right be template thirdly, be template the 4th point with the 8th point under the said search center point, be template the 5th point with the 4th level of said template the 8th point left; With the 4th level of said template the 8th point to the right is template the 6th point; With said search center point level the 12nd point left is template the 7th point, is template the 8th point with said search center point level the 12nd point to the right, is first datum mark with the 4th point directly over the said search center point; With the said first datum mark level the 4th point left is template the 9th point; With the said first datum mark level the 4th point to the right is template the 10th point, is second datum mark with the 4th point under the said search center point, is template the ten one point with the said second datum mark level the 4th point left; With the said second datum mark level the 4th point to the right is template the ten two point, is template the ten three point with said search center point.
3. the method for estimating based on genetic search and template matches according to claim 1 is characterized in that, the said heredity of step (6) stops strategy suc as formula shown in (7), if y 4=1, then the condition that heredity stops strategy is satisfied in expression; Otherwise foot heredity with thumb down stops the condition of strategy;
y 4=(Pred_SAD_ave-SAD_ave<TH_DS) (7)
&&(minge_SAD-Pred_SAD<TH2)
In the formula (7), Pred_SAD_ave representes the average sad value of previous generation heredity population; SAD_ave representes the average sad value of contemporary hereditary population; TH_DS representes the parameter preset; Minge_SAD representes sad value minimum in the contemporary hereditary population; TH2 representes said second threshold value.
4. the method for estimating based on genetic search and template matches according to claim 1 is characterized in that, the step of the said mutation operation of step (7) is following:
1) calculates the said individual variation step-length of duplicating by formula (8); Confirm the said individual variation direction of duplicating through producing a random number; Said random number is got any number in 1,2,3,4; Wherein, directly over " 1 " representes that the variation direction is, under " 2 " represent that the variation direction is; " 3 " expression variation direction be level left, " 4 " expression variation direction be level to the right;
2) the said coordinate that duplicates individuality is added the variation step-length along the determined variation direction of step 1), obtain the individual coordinate of said variation;
Figure FDA00001799709700041
In the formula (8), mutation_step representes to duplicate individual variation step-length; SAD_ind representes the sad value of current individuality; SAD_ave representes the average sad value of contemporary hereditary population.
CN 201110097766 2011-04-19 2011-04-19 Motion estimation method based on genetic search and template matching Expired - Fee Related CN102143364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110097766 CN102143364B (en) 2011-04-19 2011-04-19 Motion estimation method based on genetic search and template matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110097766 CN102143364B (en) 2011-04-19 2011-04-19 Motion estimation method based on genetic search and template matching

Publications (2)

Publication Number Publication Date
CN102143364A CN102143364A (en) 2011-08-03
CN102143364B true CN102143364B (en) 2012-11-14

Family

ID=44410552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110097766 Expired - Fee Related CN102143364B (en) 2011-04-19 2011-04-19 Motion estimation method based on genetic search and template matching

Country Status (1)

Country Link
CN (1) CN102143364B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2986395A1 (en) * 2012-01-30 2013-08-02 France Telecom CODING AND DECODING BY PROGRESSIVE HERITAGE
CN105007493B (en) * 2015-07-17 2018-06-29 珠海市杰理科技股份有限公司 Matching searching method and system based on motion search window
CN105338354B (en) * 2015-09-29 2019-04-05 北京奇艺世纪科技有限公司 A kind of motion vector estimation method and apparatus
CN112991521B (en) * 2021-03-26 2022-04-29 清华大学 Point cloud anisotropic neighborhood searching method based on entropy energy

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212681A (en) * 2007-12-25 2008-07-02 海信集团有限公司 Quick motion search method
CN101951521A (en) * 2010-10-30 2011-01-19 上海交通大学 Video image motion estimation method for extent variable block

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212681A (en) * 2007-12-25 2008-07-02 海信集团有限公司 Quick motion search method
CN101951521A (en) * 2010-10-30 2011-01-19 上海交通大学 Video image motion estimation method for extent variable block

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
H.So et al..Fast motion estimation using modified diamond search patterns.《ELECTRONICS LETTERS》.2005,第41卷(第2期), *
Lai-Mi Po et al..Novel Directional Gradient Descent Searches for Fast Block Motion Estimation.《Circuits and Systems for Video Technology,IEEE Transactions on》.2009,第19卷(第8期), *
许波 等.一种新的基于自适应模板的相关跟踪算法.《光学与光电技术》.2004,第2卷(第4期), *

Also Published As

Publication number Publication date
CN102143364A (en) 2011-08-03

Similar Documents

Publication Publication Date Title
CN110087087A (en) VVC interframe encode unit prediction mode shifts to an earlier date decision and block divides and shifts to an earlier date terminating method
CN103260031B (en) Method and apparatus for encoding/decoding to motion vector
CN103873861B (en) Coding mode selection method for HEVC (high efficiency video coding)
CN102143364B (en) Motion estimation method based on genetic search and template matching
CN103546758B (en) A kind of fast deep graphic sequence inter mode decision fractal coding
CN105306947B (en) video transcoding method based on machine learning
CN106131547A (en) The high-speed decision method of intra prediction mode in Video coding
CN106713933A (en) Image decoding method
CN102801976A (en) Inter-frame module selecting method based on three-dimensional wavelet video code
CN103237222B (en) The method for estimating of multi-mode search
CN103327327B (en) For the inter prediction encoding unit selection method of high-performance video coding HEVC
CN103702122B (en) Coding mode selection method, device and encoder
CN101710985B (en) Image brightness compensation method for image coding
CN106791828B (en) Video transcoding method and its transcoder based on machine learning
CN105120290A (en) Fast coding method for depth video
CN107071421B (en) A kind of method for video coding of combination video stabilization
CN107318016A (en) A kind of HEVC inter-frame forecast mode method for rapidly judging based on zero piece of distribution
CN103826125A (en) Concentrated analysis method of compressed surveillance video and device
CN102291581A (en) Realizing method of self-adaptive motion estimation supporting frame field
CN103475879A (en) Side information generation method in distribution type video encoding
CN115695803B (en) Inter-frame image coding method based on extreme learning machine
CN101877790B (en) Panoramic video coding-oriented quick global motion estimation method
CN104104966B (en) The division methods and device of video block
CN102164283A (en) Sub-pixel motion estimation method based on AVS (audio video standard)
CN101917618A (en) Calculation complexity control method for multi-viewpoint video coding and layering B frame predicting structure

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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: 20121114

Termination date: 20150419

EXPY Termination of patent right or utility model