Summary of the invention
The method of cutting apart based on macro block inward flange Information Selection of the present invention, its purpose is to address the above problem and is not enough and at the motion prediction of inter frame image, utilize human eye to relatively more responsive this characteristic of object edge information, propose a kind of dividing method of determining macro block fast, can effectively improve arithmetic speed, reduce complexity at object edge information.
The described method of cutting apart based on macro block inward flange Information Selection, applied macro block includes 16 * 16, and 8 * 16,16 * 8,8 * 8,8 * 4,4 * 8,4 * 4, this sub-piece of 7 types.
The step of described selection dividing method is as follows, that is:
The first step is carried out the pre-segmentation at macro block.
Described pre-segmentation is according to whether containing marginal information in the macro block to divide.The piece that does not contain marginal information that pre-segmentation obtains, promptly 4 * 4,4 * 8,8 * 4 these three classes pieces will no longer be proceeded to cut apart, and be asserted and finally cut apart sub-piece.
By the piece that contains marginal information that pre-segmentation obtains, continue step processing down.
Second step, can cut apart again, promptly contain the piece of marginal information, promptly 16 * 16,8 * 16,16 * 8,8 * 8 these four classes pieces carry out exploratory estimation.
Comprise the anticipation of edge pixel point, the piece that is not less than predetermined threshold value for pixel residual absolute value sum SAD carries out cutting apart of next stage.
If can not cut apart again, will be defined as finally cutting apart sub-piece; If also divisible, this piece is carried out exploratory estimation again, the step above repeating is until finishing cutting apart of whole macro block.
Pre-segmentation described in the said method first step is divided into following step and carries out:
(1), present frame being carried out 16 * 16 pixel macroblock divides.
(2), macro block is carried out exploratory estimation, compare, not needing to be defined as the macro block position of further dividing less than the macro block of threshold value t for pixel residual absolute value sum SAD and preset threshold t.
(3), doing marginal information for the macro block that does not satisfy the rapid condition of previous step extracts.
According to the distribution situation of marginal information, it still is 2 grades cut apart to determine to do 0 grade, 1 grade.Wherein, 0 grade does not contain marginal information for this macro block, one side 1 grade be any the contain marginal information of macro block after dividing equally from the centre, 2 grades all contain marginal information for the both sides of macro block after dividing equally from the centre.
The purpose that above-mentioned pre-segmentation is handled is that the part that marginal information is more separates with the less part of marginal information, proceeds to cut apart so that will contain the more piece of marginal information again.
In fact, the distribution situation of marginal information is by the number decision of the pixel that contains marginal information.The threshold value t that sets is judged to be non-marginal information piece to containing the less piece of edge pixel point, will no longer do further and cut apart.
To contain the more piece of marginal information carries out next step and cuts apart.If two that are divided into all contain marginal information, then stop to cut apart; The rest may be inferred, until the pre-segmentation of finishing whole macro block, to divide all marginal information pieces and non-marginal information piece.
Carry out pre-segmentation and given prominence to the processing of edge block, desalinated the processing of non-edge block.The information because human eye more can give careful note to details, pre-segmentation is just carried out at marginal information, and does not search for coupling, and the calculating of marginal information is very not complicated, so the operand of pre-segmentation part is not very big, speed is than faster.
The algorithm of using above-mentioned marginal information extraction has multiple choices at present, such as the sobel operator, and roberts operator, Laplce, prewitt operator, wavelet transformation etc.
The objective of the invention is to improve arithmetic speed, thereby preferentially select prewitt operator and sobel operator for algorithm.
Said method for the exploratory estimation of marginal information piece, the steps include: in second step
Determine to contain in the piece position and the number of marginal information pixel, extract in the reference frame co-located pixel in the search block, ask the residual absolute value sum SAD1 of these pixel values, with preset threshold T1 relatively.
If can prove that this reference block contains the current block marginal information, ask SAD to whole again, compare with preset threshold T2 again, will not give up this piece if do not contain marginal information, and next piece will be searched for coupling.
According to the method for marginal information anticipation, better reflecting edge information, and in the process of search, reduced computing, can accelerate the speed of whole estimation.
Really establish a capital with single residual values threshold value and number of pixels product for SAD and SAD1 threshold value and to determine, so be adaptive for the size of sub-piece, the threshold value of judging for edge block also is to stipulate according to varying in size of piece.
In sum, the method of cutting apart based on macro block inward flange Information Selection is at MPEG-2, the more time-consuming characteristics of block-based estimation in the video standards such as H264, in conjunction with the human eye characteristics relatively more responsive to object edge, the partitioning scheme of determining macro block fast at object edge information, can reduce the time of whole video coding effectively, decoded image visual effect is preferable, and this method also can be applied to the occasion of multi-reference frame simultaneously.
Embodiment
Embodiment 1, as shown in Figure 1 to Figure 3, uses the described method of cutting apart based on macro block inward flange Information Selection, determines that at a two field picture wherein the step of the partitioning scheme of all macro blocks is:
(1), present frame is divided into 16 * 16 block of pixels (macro block).
(2), press from left to right, order is from top to bottom finished all macro blocks is cut apart, get first earlier and in reference frame, do exploratory estimation, for pixel residual absolute value sum SAD less than the threshold value t1's of a regulation, then this macro block employing is cut apart for 0 grade, establishing 0 grade is the final partitioning scheme of this macro block, writes down this macro block position.
(3) if not the macro block in the previous step rapid (2) is then done the marginal information extraction to this macro block.
Edge extracting adopts the prewitt operator, and if statistics edge pixel point number and position less than threshold value t2, are carried out 0 grade and cut apart; Otherwise adopt 1 grade of arbitrary mode in cutting apart, respectively the edge pixel number in two parts is added up, a part then is asserted the sub-piece in non-edge, and cuts apart in this way less than 1/2nd of t2 if having wherein;
If two sub-pieces all be the sub-piece in edge, carry out in 1 grade another way and cut apart, carry out threshold test equally, if find out the sub-piece in non-edge, carry out above-mentioned (1) partitioning scheme that goes on foot by this.
If can not obtain the sub-piece in non-edge, then be asserted 2 grades and cut apart cutting apart of (1) step.Simultaneously, detect whether to find out the sub-piece in non-edge.
Write down the position of all the sub-pieces in non-edge after (1) step was cut apart, this a little is asserted finally cuts apart sub-piece.
For (1) the sub-piece in edge that goes on foot after cutting apart, undertaken next step by Fig. 2 again and cut apart, if can not find non-edge block.
Then this sub-piece is kept cutting apart of previous step,, carry out this kind and cut apart, write down the position of non-edge block and be defined as the final partitioning scheme of sub-piece if find non-edge block.
By Fig. 2 non-edge block is continued to cut apart, till can not cutting apart again or finishing all and cut apart, so far finish pre-segmentation.
(4), for the piece that promptly contains marginal information after all pre-segmentations, i.e. 16 * 16,8 * 16,16 * 8,8 * 8 these four classes pieces according to pixels carry out the anticipation estimation and sound out estimation.
The piece that can not reach requirement (less than number of pixels and single pixel threshold residual value product) for SAD is done cutting apart of next step again.
Cut apart the back if belong to 4 * 8,8 * 4,4 * 4 piece is then regarded as definite this and is cut apart.
Otherwise, do the anticipation estimating motion again and sound out estimating motion, meet the requirements of and write down this piece position, be asserted and finally cut apart sub-piece.
Finish cutting apart of all macro blocks by above four steps.