Summary of the invention
For solving the problems of the technologies described above, the object of the present invention is to provide a kind of method of the correction borderline region motion vector based on global motion vector, by the believable motion vector boundary shifts piece, be assigned to boundary block, make boundary block point to the direction identical with the motion vector of boundary shifts piece, thereby improve the picture quality in video frame boundary region.
Corresponding and described method, the present invention also aims to provide a kind of device of applying said method.
One of for achieving the above object, a kind of method of proofreading and correct borderline region motion vector of the present invention, comprises the steps:
S1, determine boundary shifts piece and the boundary block of frame of video;
S2, the motion vector of described boundary shifts piece is assigned to described boundary block, so that described boundary block points to the direction identical with the motion vector of described boundary shifts piece.
As a further improvement on the present invention, described step S1 specifically comprises the following steps:
S11, each frame of frame of video is all developed to a global motion vector;
S12, divide described global motion vector to obtain the first motion vector and the second motion vector;
S13, according to the size of piece, the motion vector of frame of video is converted into piece index, wherein, described the first motion vector is corresponding to first index, described the second motion vector is corresponding to second index;
S14, according to described index, determine the distribution of described boundary shifts piece and boundary block.
As a further improvement on the present invention, described step S14 specifically comprises:
The left side block index obtaining in frame of video equals the piece of first index and the piece that equals second index at the right side block index of frame of video, with the boundary shifts piece region of looping;
The piece that piece index is positioned at outside described boundary shifts piece region is defined as boundary block.
As a further improvement on the present invention, the mode that " motion vector of described boundary shifts piece is assigned to described boundary block " in described step S2 comprises the combination in any of directly copying or being offset or stretching of motion vector or aforesaid way.
As a further improvement on the present invention, the step of described " motion vector of described boundary shifts piece is assigned to described boundary block " also comprises:
By formula, MV2=A*MV1+B carries out the transmission of motion vector, and wherein, MV1 is the motion vector of boundary shifts piece, and MV2 is the motion vector of boundary block, and A and B are configurable parameter.
For realizing above-mentioned another goal of the invention, the present invention also provides a kind of device of proofreading and correct borderline region motion vector, comprises as lower unit:
Boundary block acquiring unit, for determining boundary shifts piece and the boundary block of frame of video;
Motion vector transfer unit, for the motion vector of described boundary shifts piece is assigned to described boundary block, so that described boundary block points to the direction identical with the motion vector of described boundary shifts piece.
As a further improvement on the present invention, described boundary block acquiring unit specifically comprises as lower unit:
Global motion vector acquiring unit, for each frame of frame of video is all developed to a global motion vector;
Global motion vector division unit, for dividing described global motion vector to obtain the first motion vector and the second motion vector;
Conversion unit, for according to the size of piece, the motion vector of frame of video is converted into piece index, wherein, described the first motion vector is corresponding to first index, described the second motion vector is corresponding to second index;
Border knows unit, for determine the distribution of described boundary shifts piece and boundary block according to described index.
As a further improvement on the present invention, described border know unit specifically for:
The left side block index obtaining in frame of video equals the piece of first index and the piece that equals second index at the right side block index of frame of video, with the boundary shifts piece region of looping;
The piece that piece index is positioned at outside described boundary shifts piece region is defined as boundary block.
As a further improvement on the present invention, in described motion vector transfer unit, the mode of " motion vector of described boundary shifts piece is assigned to described boundary block " comprises the combination in any of directly copying or being offset or stretching of motion vector or aforesaid way.
As a further improvement on the present invention, described motion vector transfer unit also for:
By formula, MV2=A*MV1+B carries out the transmission of motion vector, and wherein, MV1 is the motion vector of boundary shifts piece, and MV2 is the motion vector of boundary block, and A and B are configurable parameter.
Compared with prior art, the invention has the beneficial effects as follows: the present invention is assigned to boundary block by the believable motion vector boundary shifts piece, make boundary block point to the direction identical with the motion vector of boundary shifts piece, if boundary block and boundary shifts piece belong to same object, pass through so such processing, just can make their motion vector be consistent, thereby improve the picture quality in video frame boundary region.
Embodiment
Below with reference to embodiment shown in the drawings, describe the present invention.But these execution modes do not limit the present invention, the conversion in the structure that those of ordinary skill in the art makes according to these execution modes, method or function is all included in protection scope of the present invention.
Please refer to shown in Fig. 1, in the embodiment of the invention, the method for described correction borderline region motion vector, it comprises the steps:
S1, determine boundary shifts piece and the boundary block of frame of video;
The present invention is intended to by special processing is carried out in the border of frame of video, makes to be consistent at the motion vector at video frame boundary place and the motion of object or scene.So determine the border of frame of video, it is a crucial ring.
For realizing the final purpose of above-mentioned steps, step S1 can specifically be divided into following steps to be realized:
S11, each frame of frame of video is all developed to a global motion vector;
First each frame is all developed to a global motion vector.For example, frequency by the motion vector of each piece (size is the piece of 8*8) in each frame of accumulative total, produces this global motion vector.Preferably, in the present invention, the motion vector that the highest counting is corresponding is designated as global motion vector.
S12, divide described global motion vector to obtain the first motion vector and the second motion vector;
Shown in ginseng Fig. 2, global motion vector can be used to determine that whether the motion vector at video frame boundary place is credible.According to the distance of former frame and intermediate frame, first global motion vector is split into two parts (the first motion vector and the second motion vector).For example, if the horizontal component of global motion vector (Global MV) is 16, and the sensing left side, to show that global motion is from left to right to carry out so, intermediate frame is apart from former frame 3/4, and the rear frame 1/4 of intermediate frame distance, so global motion vector is split into two parts, a part equals 12, and another part equals 4.Equal the motion vector (MV(uncovered) that 12 part is called exposure), i.e. the first motion vector; Equal the motion vector (MV(covered) that 4 part is called covering), i.e. the second motion vector.
S13, according to the size of piece, the motion vector of frame of video is converted into piece index, wherein, described the first motion vector is corresponding to first index, described the second motion vector is corresponding to second index;
In order to facilitate determining of boundary shifts piece corresponding to frame of video and boundary block, the motion vector of frame of video must be converted into corresponding piece index.And the motion vector of frame of video is converted into the process of piece index, be that size by piece realizes, such as, for the piece of 4x4 size, the piece index of the first motion vector is 12/4=3, the piece index of the second motion vector is 4/4=1.Wherein, after transforming, piece index be 3 that be called piece skew (first index) of exposure, piece index be 1 that be called piece skew (second index) of covering.
S14, according to described index, determine the distribution of described boundary shifts piece and boundary block.
Shown in Fig. 3, described step S14 specifically comprises:
The left side block index obtaining in frame of video equals the piece of first index and the piece that equals second index at the right side block index of frame of video, with the boundary shifts piece region (grey color part in figure) of looping, these pieces are completely defined as the boundary shifts piece 101 of frame of video;
It is worth mentioning that, boundary shifts piece 101 includes the motion vector (level, to the right, or straight up, downwards) with certain sensing left.
The piece that just piece index can be positioned at outside described boundary shifts piece region after this, is defined as boundary block 102.Wherein, shown in, be arranged in and outside boundary shifts piece, refer to the periphery that is positioned at figure annular section.
S2, the motion vector of described boundary shifts piece is assigned to described boundary block, so that described boundary block points to the direction identical with the motion vector of described boundary shifts piece.
In the present embodiment, for the error that the borderline region reducing in frame of video is brought by estimation, the motion vector of boundary shifts piece is passed to its adjacent boundary block.Therefore, if boundary block and boundary shifts piece belong to same object, pass through so such processing, just can make their motion vector be consistent.
Wherein, in the present invention, the mode that " motion vector of described boundary shifts piece is assigned to described boundary block " in step S2 comprises the combination in any of directly copying or being offset or stretching of motion vector or aforesaid way.
Directly copy the middle part that is generally applicable to border, can to direction and size, all be equal to the vector of the corresponding motion vector of boundary shifts piece by direct copying with boundary shifts piece adjacent boundary piece;
And at some position, can be imparted into direction identical and vary in size in the vector (stretching) of the corresponding motion vector of boundary shifts piece with boundary shifts piece adjacent boundary piece;
Corner portions (ginseng Fig. 3) on border, from boundary shifts piece adjacent boundary piece can be imparted into direction different and big or small identical (also can different) in the vector (skew) of the corresponding motion vector of boundary shifts piece;
Certainly, in other execution mode of the present invention, the mode of " motion vector of described boundary shifts piece is assigned to described boundary block " can also be the combination of above-mentioned each mode (copy, stretch, be offset).
Above-mentioned mentioned " motion vector of described boundary shifts piece is assigned to described boundary block " if step with the transmission that a more optimal formula is realized motion vector, be: MV2=A*MV1+B, wherein, MV1 is the motion vector of boundary shifts piece, MV2 is the motion vector of boundary block, and A and B are configurable parameter.
Next, 4 the device of correction borderline region motion vector of the present invention is described by reference to the accompanying drawings.The present invention with embodiment in, described device comprises:
Boundary block acquiring unit 10, for determining boundary shifts piece and the boundary block of frame of video;
The present invention is intended to by special processing is carried out in the border of frame of video, makes to be consistent at the motion vector at video frame boundary place and the motion of object or scene.So determine the border of frame of video, it is a crucial ring.
For realizing the final purpose of this unit, boundary block acquiring unit 10 can specifically be divided into lower unit and realizing:
Global motion vector acquiring unit 11, for each frame of frame of video is all developed to a global motion vector;
First each frame is all developed to a global motion vector.For example, frequency by the motion vector of each piece (size is the piece of 8*8) in each frame of accumulative total, produces this global motion vector.Preferably, in the present invention, the motion vector that the highest counting is corresponding is designated as global motion vector.
Global motion vector division unit 12, for dividing described global motion vector to obtain the first motion vector and the second motion vector;
Shown in ginseng Fig. 2, global motion vector can be used to determine that whether the motion vector at video frame boundary place is credible.According to the distance of former frame and intermediate frame, first global motion vector is split into two parts (the first motion vector and the second motion vector).For example, if the horizontal component of global motion vector (Global MV) is 16, and the sensing left side, to show that global motion is from left to right to carry out so, intermediate frame is apart from former frame 3/4, and the rear frame 1/4 of intermediate frame distance, so global motion vector is split into two parts, a part equals 12, and another part equals 4.Equal the motion vector (MV(uncovered) that 12 part is called exposure), i.e. the first motion vector; Equal the motion vector (MV(covered) that 4 part is called covering), i.e. the second motion vector.
Conversion unit 13, for according to the size of piece, the motion vector of frame of video is converted into piece index, wherein, described the first motion vector is corresponding to first index, described the second motion vector is corresponding to second index;
In order to facilitate determining of boundary shifts piece corresponding to frame of video and boundary block, the motion vector of frame of video must be converted into corresponding piece index.And the motion vector of frame of video is converted into the process of piece index, be that size by piece realizes, such as, for the piece of 4x4 size, the piece index of the first motion vector is 12/4=3, the piece index of the second motion vector is 4/4=1.Wherein, after transforming, piece index be 3 that be called piece skew (first index) of exposure, piece index be 1 that be called piece skew (second index) of covering.
Border knows unit 14, for determine the distribution of described boundary shifts piece and boundary block according to described index.
Shown in Fig. 3, described border know unit 14 specifically for:
The left side block index obtaining in frame of video equals the piece of first index and the piece that equals second index at the right side block index of frame of video, with the boundary shifts piece region (grey color part in figure) of looping, these pieces are completely defined as the boundary shifts piece 101 of frame of video;
It is worth mentioning that, boundary shifts piece 101 includes the motion vector (level, to the right, straight up, downwards, or theirs synthetic) with certain sensing left.
After this, border knows that the piece that unit 14 just can be positioned at piece index outside described boundary shifts piece region is defined as boundary block 102.Wherein, shown in, be arranged in and outside boundary shifts piece, refer to the periphery that is positioned at figure annular section.
Motion vector transfer unit 20, for the motion vector of described boundary shifts piece is assigned to described boundary block, so that described boundary block points to the direction identical with the motion vector of described boundary shifts piece.
In the present embodiment, for the error that the borderline region reducing in frame of video is brought by estimation, the motion vector of boundary shifts piece is passed to its adjacent boundary block.Therefore, if boundary block and boundary shifts piece belong to same object, pass through so such processing, just can make their motion vector be consistent.
Wherein, in the present invention, the mode that " motion vector of described boundary shifts piece is assigned to described boundary block " in motion vector transfer unit 20 comprises the combination in any of directly copying or being offset or stretching of motion vector or aforesaid way.
Directly copy the middle part that is generally applicable to border, can to direction and size, all be equal to the vector of the corresponding motion vector of boundary shifts piece by direct copying with boundary shifts piece adjacent boundary piece;
And at some position, can be imparted into direction identical and vary in size in the vector (stretching) of the corresponding motion vector of boundary shifts piece with boundary shifts piece adjacent boundary piece;
Corner portions (ginseng Fig. 3) on border, from boundary shifts piece adjacent boundary piece can be imparted into direction different and big or small identical (also can different) in the vector (skew) of the corresponding motion vector of boundary shifts piece;
Certainly, in other execution mode of the present invention, the mode of " motion vector of described boundary shifts piece is assigned to described boundary block " can also be the combination of above-mentioned each mode (copy, stretch, be offset).
Above-mentioned mentioned " motion vector of described boundary shifts piece is assigned to described boundary block " if step with the transmission that a more optimal formula is realized motion vector, be: MV2=A*MV1+B, wherein, MV1 is the motion vector of boundary shifts piece, MV2 is the motion vector of boundary block, and A and B are configurable parameter.
Compared with prior art, method in technical scheme of the present invention and related device are assigned to boundary block by the believable motion vector boundary shifts piece, make boundary block point to the direction identical with the motion vector of boundary shifts piece, if boundary block and boundary shifts piece belong to same object, pass through so such processing, just can make their motion vector be consistent, thereby improve the picture quality in video frame boundary region.
Device embodiments described above is only schematic, the wherein said unit as separating component explanation can or can not be also physically to separate, the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of module wherein to realize the object of present embodiment scheme.Those of ordinary skills, in the situation that not paying creative work, are appreciated that and implement.
While for convenience of description, describing above device, with function, being divided into various unit describes respectively.Certainly, when implementing the application, the function of each unit can be realized in same or a plurality of software and/or hardware.
Device embodiments described above is only schematic, the wherein said unit as separating component explanation can or can not be also physically to separate, the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of module wherein to realize the object of present embodiment scheme.Those of ordinary skills, in the situation that not paying creative work, are appreciated that and implement.
The application can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment (DCE), put into practice the application, in these distributed computing environment (DCE), by the teleprocessing equipment being connected by communication network, be executed the task.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
Be to be understood that, although this specification is described according to execution mode, but not each execution mode only comprises an independently technical scheme, this narrating mode of specification is only for clarity sake, those skilled in the art should make specification as a whole, technical scheme in each execution mode also can, through appropriately combined, form other execution modes that it will be appreciated by those skilled in the art that.
Listed a series of detailed description is above only illustrating for feasibility execution mode of the present invention; they are not in order to limit the scope of the invention, all disengaging within equivalent execution mode that skill spirit of the present invention does or change all should be included in protection scope of the present invention.