Embodiment
The encoder complexity of standard is a starting point to reduce H.264 just in the present invention, explored the characteristic of estimation and motion vector under its multi-reference frame situation, propose and verified the motion continuity hypothesis, and a kind of fast motion estimation strategy based on the effective coverage proposed in view of the above, this strategy is searched for the motion vector that obtains in this frame entirely in a reference frame, with follow-up other frames be with reference to the time, can be with the zonule of motion-vector prediction that is obtained, and only in the zonule of being predicted, search for estimation entirely.The particular content of this invention comprises:
The present invention is a kind of multi-reference frame rapid movement estimation method based on the effective coverage, draw and verified the motion continuity hypothesis of video sequence with the effective coverage of multi-reference frame estimation, and adopt the motion continuity of described video sequence that the piece B in the present frame is carried out fast motion estimation, its motion-estimation step is as follows:
(A) at first reference frame F
-1In carry out full searching moving and estimate, obtain the motion vector of 1/4 pixel precision and the cost function of estimation, be designated as MV (B ,-1) and SAD (B ,-1) respectively;
(B) according to the motion vector MV (B ,-1) in (A), obtain reference frame F
j, the effective coverage VR of j ≠-1;
(C) with frame F
j, motion vector and corresponding cost function that full searching moving estimates to obtain 1/4 pixel precision are carried out as a reference in j ≠-1 in the effective coverage VR that (B) obtains, be designated as respectively MV (B, j) and SAD (B, j);
(D), obtain optimal reference frame and the corresponding motion estimation result of present frame piece B according to the result of calculation of above-mentioned (A)~(C).
In the present invention, motion vector v=(X, y) effective coverage in search window is the pixel collection that satisfies following condition:
In the formula, z represents effective coverage VR (the v) abscissa value in kinetic coordinate system, w represent effective coverage VR (the v) ordinate value in kinetic coordinate system, x represents the abscissa value of motion vector v in the kinetic coordinate system, y represents the ordinate value of motion vector v in the kinetic coordinate system.
In the present invention, motion continuity hypothesis P (MV (B, j) ∈ VR (MV
j(B ,-1))) ≈ 1,
In the formula, the probability of P (X) presentation of events X, (B, j) expression piece B is at frame F for MV
jIn motion vector, MV
j(B ,-1) expression frame F
jIn and MV (B ,-1) picture element of same coordinate value is arranged.
The present invention is described in further detail below in conjunction with drawings and Examples.
(1) motion continuity hypothesis and effective coverage model:
Definition 1: to video sequence { F
k|
K=-N M, F
0Represent the current frame of video (being present frame) that is about to coding, F
i(i>0) is the subsequent frame that will encode, F
i(i<0) is encoded frame, does not specify, the explanation of back of the present invention all only allows with reference to F
i(i<0) frame present frame F that encodes
0
Definition 2: for present frame F
0In a piece B, make MV (B, i)=(x
i, y
i) represent that it is at F
iMotion vector in the frame.Under the situation of multiframe reference, for F arbitrarily
j, j ≠ i,, make MV
j(B, i) expression frame F
iIn and MV (B i) has the picture element of same coordinate value.
Usually, adjacent two frames are more similar than two non-adjacent frames in the video motion sequence, i.e. F
I-1Than other any F
j, j<i-1 and F
iMore similar, the present invention claims that this kinetic characteristic is the motion continuity of video sequence, and the multi-reference frame of a lot of document descriptions estimates that motion vector statistical property and this motion continuity under the situation is identical.In addition, in the actual implementation procedure of a lot of video standards,, generally all use F for display delay simple and the minimizing video
-1Carry out estimation, the success of these video standards is from the motion continuity of the clear video sequence of true Shanghai Stock Exchange.
According to the motion continuity characteristic, the present invention proposes: usually, (B, i), i<-1 should mostly concentrate on a MV to any MV
i(B ,-1) on every side, promptly (B i) is present in MV to MV
iIn the zonule that (B ,-1) is determined, we claim that this zonule is the effective coverage, and its different structure form is shown in Fig. 2 (a), Fig. 2 (b) and Fig. 2 (c).
(2) defined hit rate and verified the effective coverage model
Hit rate: for video sequence { F
k}
K=-N MIf use B
I, kIf i piece in k the frame of expression in the sequence is F then
i<(j<k-1) is piece B
I, kReference frame and MV (B
I, k, j) be positioned at effective coverage VR (MV (B
I, k, k-1)) in, MV (B then claimed
I, k, be what hit j); Otherwise MV (B
I, k, j) be called as miss.If defined function f:S
3→ 0,1} and g:S
3→ 0,1}, wherein: S={i|-N≤i≤M}, and if only if F
jBe B
I, kA reference frame time, f equals 1, otherwise equals 0; Currently only equal 1 and MV (B as f
I, k, j) hitting, g equals 1, otherwise g equals 0.For this reason, video sequence { F
k}
K=-N MHit rate (hit_rate) be defined as formula (1), it has represented that each piece motion vector in different reference frames in the sequence drops on the probability in its specific effective coverage.
Obviously, for present frame F
0In any piece B, can be similar to P (MV (B, j) ∈ VR (MV with the hit rate hit_rate of video sequence
j(B ,-1))), wherein, j ≠-1 and F
jBe F
0A reference frame.
Hit rate that the present invention has passed through verification experimental verification, result such as table 1, hit rate is on average up to more than 97%.
(3) based on the rapid motion estimating method of effective coverage:
The present invention is based on effective coverage defined above model, proposed a kind of rapid motion estimating method, i.e. MVRF method, its step is as follows:
(A) at first reference frame F
-1In carry out full searching moving and estimate, obtain the motion vector of 1/4 pixel precision and the cost function of estimation, be designated as MV (B ,-1) and SAD (B ,-1) respectively;
(B) according to the motion vector MV (B ,-1) in (A), obtain reference frame F
j, the effective coverage VR of j ≠-1;
(C) with frame F
j, motion vector and corresponding cost function that full searching moving estimates to obtain 1/4 pixel precision are carried out as a reference in j ≠-1 in the effective coverage VR that (B) obtains, be designated as respectively MV (B, j) and SAD (B, j);
(D), obtain optimal reference frame and the corresponding motion estimation result of present frame piece B according to the result of calculation of above-mentioned (A)~(C).
(4) consideration of fraction pixel estimation:
Different with other fast methods such as three step search, logarithm search, though searching for entirely, MVRF method of the present invention do not estimate to search the integer-pel precision motion vector, but its region of search remains a continuous zonule, this special continuous region of search has determined that the MVRF method can well be utilized the existing fraction pixel precision Fast Estimation Algorithm of estimating based on the whole pixel precision of full search.Therefore, if when the MVRF method need be carried out the fraction pixel precision motion search, can adopt following Fast estimation thought:
1) if the corresponding whole pixel precision motion vector MV that is searched with the MVRF method in the inside of effective coverage, then the motion estimation result of the whole pixel around this MV necessarily exists, therefore, when carrying out the search of fraction precision pixel, can be the same with common full search, adopt any outstanding fast method;
2) if the corresponding whole pixel precision motion vector MV that is searched with the MVRF method on the border of effective coverage, method in the time of can not using full the search this moment, if with other approximate evaluation strategies, certainly will further influence compression ratio and video recovery quality, therefore, for better compromise, can keep traditional method to fraction pixel precision search in this case.
(5) analyzed the effect of this invention in theory
Definition 3: rate does not match, for certain given method for estimating (such as MVRF), a given video blocks, if its motion vector that finds with this algorithm be used in whole search window in to search for the motion vector that finds entirely identical, claim that then this motion vector MV is the MV of a coupling, otherwise be a unmatched MV.The rate of not matching is illustrated in the motion vector of all pieces in all frames in the video sequence, the ratio of the motion vector that do not match.
For a piece, the motion vector MV that MVRF method proposed by the invention is searched
MVRFExpression, and the motion vector MV that searches with the estimation of full searching moving
FSExpression, then motion vector MV
FSBe distributed with three kinds of situations: 1) MV
FSAt F
-1In the frame; 2) MV
FSAt F
-iIn the frame and in its effective coverage; 3) MV
FSAt F
iIn but not in its effective coverage, i<-1 here.If MV
MVRFAt F
-1In the reference frame, perhaps MV
MVRFAt F
iIn the frame and in its effective coverage, MV then
MVRFAnd MV
FSConsistent; Otherwise, MV
MVRFAnd MV
FSDifference and MV
MVRFBe a unmatched motion vector MV.That is to say that the rate that do not match of MVRF method only is MV
FSAt F
iIn (i<-1) reference frame and the probability outside the VR of its effective coverage.If with P (! F
-1) represent MV
FSNot at F
-1Probability in the reference frame, then P (mis)=P (! F
-1) * (1-hit_rate).Available research achievements shows in the world: when 5 reference frames, search window size w=7, the motion vector distribution of video blocks is at F
-1Probability in the reference frame has reached 48.83%, therefore, P (! F
-1)=1-48.83%=51.17%, thus the rate that do not match of MVRF method then is: P (mis)=(1-48.83%) * 2.87%=1.47%.This shows that the rate that do not match of MVRF method is very low, therefore, its compression ratio and video recovery quality and carry out in whole search window that full searching moving estimates quite, and its amount of calculation reduces greatly.
Video Applications more and more widely, such as video conference, video request program VoD, remote teaching and medical treatment etc.And no matter be the video storage or the application of mode transmission, all need to carry out video compression coding.Video compression is generally divided intraframe coding and interframe encode, and wherein interframe encode generally needs estimation to eliminate the interframe redundancy.Behind the video process motion estimation and compensation of input, adopt strategies such as DCT or integer transform to eliminate redundancy in the frames, and quantize and entropy coding, form compressed bit stream, this compressed bit stream can be stored also and can be transferred on the network.The FB(flow block) of typical inter prediction encoding process as shown in Figure 3.
In standard H.264, because macro block exists multiple dividing mode, estimation to allow multi-reference frame and support 1/4 pixel precision motion vector, therefore, for a video macro block, its motion estimation process is as follows: For (all macroblock partitions modes)
For (all pieces under certain macroblock partitions mode)
{
For (reference frames of all permissions)
{
Putting in order the full searching moving of pixel in search window estimates;
Near the whole pixel of being searched for, carry out the half-pix estimation;
Carrying out 1/4 pixel motion near the half-pix point of being searched for estimates;
Obtain the motion vector MV of this piece under this reference frame;
Obtain " certain the sub-piece under certain macroblock partitions mode with certain frame be with reference to the time motion estimation result and cost function ";
}
}
Obtain under certain macroblock partitions mode, the overall movement estimated result and the cost function of this macro block; According to the estimation cost function of macro block under all dividing mode, obtain its optimal movement and estimate cost function; For macro block finds best dividing mode, the optimal reference frame of each sub-piece and relevant compression result;
Above-mentioned is the full searching moving estimation procedure (false code) of a macro block in the standard H.264.
When using MVRF method of the present invention, H.264 the motion estimation search process of a macro block is in the standard: For (all macroblock partitions modes)
For (all pieces under certain macroblock partitions mode)
{
At first reference frame F
-1In put in order the full searching moving of pixel precision and estimate;
Near the whole pixel of being searched for, carry out the half-pixel accuracy estimation;
Near the half-pix point of being searched for, carry out 1/4 pixel motion and estimate, obtain its motion vector MV (B ,-1);
Calculating is at reference frame F
-1Carry out the cost function of estimation;
Obtain the effective coverage according to MV (B ,-1);
For (every other reference frame)
{
Putting in order the full searching moving of pixel in the effective coverage estimates;
Near the whole pixel of being searched for, carry out the half-pix estimation;
Carrying out 1/4 pixel motion near the half-pix point of being searched for estimates;
Obtain the motion vector MV of this piece under this reference frame;
Obtain " certain the sub-piece under certain macroblock partitions mode with certain frame be with reference to the time motion estimation result and cost function ";
}
}
Obtain under certain macroblock partitions mode, the overall movement of this macro block estimates cost function; According to the estimation cost function under all dividing mode of macro block, obtain its optimal movement and estimate cost function; For macro block finds best dividing mode, the optimal reference frame of each sub-piece and relevant compression result;
Above-mentioned is to adopt the multi-reference frame rapid movement based on the effective coverage of the present invention to estimate after (MVRF) method H.264 a macro block motion estimation process (false code) in the standard.
In the present invention, be to serve as that checking is realized on the basis with the reference test platform JM7.3 of standard H.264, not only verified the hit rate of motion continuity hypothesized model and effective coverage, and checking and compared the present invention in detail and the performance of strategy on video recovery quality, compression ratio and motion estimation search are counted estimated in full search.Example has selected representational 7 international standard sequences as cycle tests: Coast sequence, Forman sequence, Mother sequence, Mobile sequence, Tennis sequence, Hall sequence and Flower.In this embodiment, except the Flower sequence is that the CIF form is thought, other all are the QCIF forms, and other parameters are provided with as follows:
A) frame rate is 30fps;
B) every kind of sequence comprises 200 frames, I frame of per 100 frames coding, and other all are the P frame;
C) allow 5 reference frame (N
F=5);
D) allow 4 kinds of macroblock partitions modes, promptly 16 * 16,16 * 8,8 * 16 and 8 * 8;
E) quantizer is 32;
F) entropy coding pattern: CAVLC;
G) Hadamard conversion and error recovery mechanisms have been ignored;
H) search window size w is 7.
(1) hit rate of motion continuity model is relatively:
The hit rate result such as the table 1 of motion continuity model, obviously, although the defined effective coverage of the present invention is far smaller than the search window of full search, but its motion vector hit rate is on average but up to more than 97%, promptly estimate the motion vector that obtained with full searching moving, the overwhelming majority all can drop in the defined effective coverage of the present invention.
Table 1 motion vector is present in the hit rate of VR
Video sequence | Miss rate | Hit rate |
Coast | 3.80% | 96.20% |
Forman | 6.20% | 93.80% |
Mother | 0.77% | 99.23% |
Mobile | 1.46% | 98.54% |
Tennis | 5.25% | 94.75% |
Hall | 0.24% | 99.76% |
Flower(CIF) | 2.37% | 97.63% |
On average | 2.87% | 97.13% |
Estimate that with full searching moving strategy (FS) compares, with the example of method of the present invention (MVRF) realization count at motion estimation search, compression ratio and the qualitative comparing result of recovery be as follows:
(2) the motion estimation search comparison of counting:
The motion vector distribution characteristic of table 2 MVRF algorithm
T
FS=N
F[(2w+1)
2+16]=1141
In the formula, T
FS, T
MVRFRepresent that respectively the search point that full searching moving is estimated and the motion estimation search of MVRF method of the present invention count.As seen result of calculation estimated to compare with full searching moving thus, and motion estimation search of the present invention is counted and descended greatly.
(3) video recovery quality objective quality is relatively:
Video recovery quality objective to such as table 3, as seen, although search point descends greatly, video recovery quality that the present invention obtains and full search suitable substantially:
The PSNR-Y contrast (dB) of table 3 MVRF algorithm and full-search algorithm
(4) compression ratio is relatively:
Compression ratio is to such as table 4, as seen, although search point descends greatly, the basically identical of video code flow compression ratio that the present invention obtains and full search:
The bit rate contrast (Kbps) of table 4 MVRF algorithm and full-search algorithm
Contrast by his-and-hers watches 1, table 2, table 3 and table 4, verified the multi-reference frame rapid movement estimation method that the present invention is based on the effective coverage, based on video encoding standard H.264,5 reference frames arranged, allowing under 4 kinds of macro blocks (16 * 16,16 * 8,8 * 16,8 * 8) partition mode, with in the whole search window of all reference frames, carry out full searching moving and estimate to compare, the motion estimation search of this method is counted and has on average been descended 41%, the video recovery quality has on average increased by 0.007 decibel, and bit rate has on average only descended 0.18%.