Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 2 is the schematic flow sheet of the method for motion vector prediction of one embodiment of the invention.As shown in Figure 2, this method of motion vector prediction comprises:
101, whether the motion vector detecting the reference block of the first adjacent position of current block can be used, if available, is then recorded as spatial domain candidate motion vector;
102, whether the motion vector detecting the reference block of the second adjacent position of current block can be used, if available, is then recorded as spatial domain candidate motion vector;
103, if the motion vector of the reference block of the second adjacent position of described current block is unavailable, then to the reference block of described first adjacent position and/or the reference block of described second adjacent position, whether can with detecting through the motion vector of proportion adjustment, if available, be then recorded as spatial domain candidate motion vector;
104, obtain and record time domain candidate motion vector;
105, according to recorded spatial domain candidate motion vector and time domain candidate motion vector, motion-vector prediction is carried out to described current block.
In above-mentioned 101-105, the execution order of 101-103 and 104 does not limit, and namely both after execution 101-103, can perform 104; Also first can perform 104, then perform 101-103; Can also by 101-103 and 104 executed in parallel.Similarly, the execution order of 101 and 102 does not also limit.
In the method for motion vector prediction of the present embodiment, using the reference block of the second adjacent position of first of current block the adjacent reference block and current block as spatial domain neighboring reference blocks, for exporting to many two spatial domain candidate motion vectors.Wherein, the first adjacent position of current block can be the left position of current block, and the second adjacent position of current block can be the upper position of current block; The reference block of the reference block of the first adjacent position of current block and the second adjacent position of current block both can be interframe (Inter) encoding block, also can be (Intra) encoding block in frame, not limit herein.
Particularly, in the process obtaining spatial domain candidate motion vector, first the reference block of the reference block of the first adjacent position of current block and the second adjacent position of current block is detected, judge whether the MV of the reference block of the reference block of the first adjacent position of current block and the second adjacent position of current block can use, wherein, " available " refers to that MV exists and reference picture corresponding to MV is identical with the reference picture of current block.More specifically, detect reference block whether can step comprise: detect reference block and whether have MV, when reference block is inter-coded block, it has MV, and when reference block is Intra-coded blocks, it does not have MV.If there is not MV, then directly judge unavailable; If there is MV, then whether the reference picture index comparing the MV of reference block corresponding is identical with the reference picture index of current block, if identical, then judges that MV can use, and is recorded as spatial domain candidate motion vector by corresponding MV; If different, then judge unavailable.
After completing said process, if the MV of the reference block of the first adjacent position of current block can with (namely deriving a spatial domain candidate motion vector, such as be recorded as candidate A), and the MV of the reference block of the second adjacent position of current block can with (namely deriving a spatial domain candidate motion vector, such as be recorded as candidate B), then meet the requirement exporting to many two spatial domain candidate motion vectors needed for HEVC standard, the operation now without the need to performing 103.
If (said process derives a spatial domain candidate motion vector when knowing that the MV of the reference block of the second adjacent position of current block is unavailable, or do not derive spatial domain candidate motion vector), then detect the reference block of the first adjacent position and/or the reference block of described second adjacent position, MV(scaled MV after proportion adjustment) whether can use.More specifically, whether can with comprise: detect reference block and whether there is MV, if do not exist, then judge that scaled MV is unavailable if detecting scaled MV; If exist, then judge that scaled MV can use; Judge available after, suitable proportion adjustment is carried out to MV, i.e. convergent-divergent process (scaling), to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, then this scaled MV is recorded as spatial domain candidate motion vector.
To the detection order of the scaled MV of the reference block of the first adjacent position and the reference block of the second adjacent position can be: first the scaled MV of the reference block of the first adjacent position is detected, can use if testing result is scaled MV, then stop execution 103; If testing result is that scaled MV is unavailable, then continue to detect the scaled MV of the reference block of the second adjacent position; Again such as: if the testing result of 101 is available, the testing result of 102 is unavailable, then, in 103, first detect the scaled MV of the reference block of the second adjacent position, and when testing result is unavailable, then the scaled MV of the reference block of the first adjacent position is detected.
By above-mentioned 101-103, get spatial domain candidate motion vector.In 104, adopt existing time domain candidate motion vector deriving method, obtain time domain candidate motion vector, particularly, such as, according to time domain reference block message, the pattern information as reference block is inter or intra, or MV motion vector informations etc., obtain time domain candidate motion vector.These spatial domain candidate motion vectors, together with time domain candidate motion vector, form a motion vector list.
When coding side is encoded, from this motion vector list, select a best motion vector as the motion vector predictor of current block, the best wherein selected, can be best in rate distortion (Rate-distortion) meaning, also can be select based on other performance index etc. as required, not limit herein.Encoder is by selected motion vector location index number write code stream in lists.
Correspondingly, when decoding end is decoded, motion vector call number is obtained by decoding, and the motion vector information of decoded reference block according to current block, adopt the 101-104 tectonic movement vector list in the present embodiment, and by from this motion vector list, select to obtain motion vector corresponding to motion vector call number, as the motion vector predictor of current block with decoding.
According to the method for motion vector prediction of the present embodiment, in the process obtaining spatial domain candidate motion vector, because whether the motion vector of the reference block of the first adjacent position and the second adjacent position of first detecting current block can be used, and when the motion vector of the reference block of the second adjacent position is unavailable, whether the motion vector detected again through proportion adjustment can be used, under making worst condition, spatial domain candidate motion vector need be obtained by three steps.And in prior art, in worst case, four steps need be performed to obtain spatial domain candidate motion vector.Therefore, can find out, the method for motion vector prediction of the present embodiment reduces complexity relative to prior art, reduces in prior art the flow process performing motion-vector prediction, thus improves the execution efficiency of coding, decoding.
Embodiment two
On the basis of embodiment one, in the present embodiment, expansion explanation is carried out to the process obtaining spatial domain candidate motion vector.
Fig. 3 is for deriving the schematic diagram of the reference block of spatial domain candidate motion vector in one embodiment of the invention.As shown in Figure 3, the reference block of the first adjacent position comprises position, the lower left corner corresponding lower-left block A0 and left side block A1; The reference block of the second adjacent position comprises upper right block B0 corresponding to position, the upper right corner and top block B1.
Particularly, the spatial domain candidate motion vector of the present embodiment comprises:
201, whether the MV detecting the position, the lower left corner of current block corresponding lower-left block A0 and/or left side block A1 can use, if available, is then recorded as candidateA;
Particularly, such as: first detect the MV of lower-left block A0 and whether can use, if available, then the MV of lower-left block A0 is recorded as spatial domain candidate motion vector A(candidate A), and directly perform 202; If unavailable, then whether the MV detecting left side block A1 can use, if the MV of left side block A1 can use, then the MV of left side block A1 is recorded as candidate A, and performs 202; If the MV of left side block A1 is unavailable, perform 202.
202, whether the MV detecting the position, the upper right corner of current block corresponding upper right block B0 and/or top block B1 can use, if available, is then recorded as candidate B;
Particularly, such as: whether the MV first detecting upper right block B0 can use, if available, then the MV of upper right block B0 is recorded as spatial domain candidate motion vector B(candidate B), and directly perform 203; If unavailable, then whether the MV detecting top block B1 can use, if the MV of top block B1 can use, then the MV of top block B1 is recorded as candidate B, and performs 203; If the MV of top block B1 is unavailable, perform 203.
203, whether do not record candidate B; If so, then 204 are performed, if not, then process ends;
204, whether the scaled MV detecting the position, the lower left corner of current block corresponding lower-left block A0 or left side block A1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends; If unavailable, then perform 205;
Particularly, select in lower-left block A0 and left side block A1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of lower-left block A0 and left side block A1, both can be select lower-left block A0 according to formerly configuration is fixing, also can be select left side block A1 according to formerly configuration is fixing.
205, whether the scaled MV detecting the position, the upper right corner of current block corresponding upper right block B0 or top block B1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends, if unavailable, then direct process ends.
Particularly, select in upper right block B0 and top block B1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of upper right block B0 and top block B1, both can be select upper right block B0 according to formerly configuration is fixing, also can be select top block B1 according to formerly configuration is fixing.
According to the method for motion vector prediction of the present embodiment, owing to adopting lower-left block A0 and left side block A1 simultaneously as the reference block of position, the lower left corner, and when adopting reference block simultaneously as position, the upper right corner of upper right block B0 and top block B1, when whether the scaled MV of the reference block of the reference block and/or position, the described upper right corner that need detect position, the lower left corner is available, choose in lower-left block A0 and left side block A1 respectively, and in upper right block B0 and top block B1 one is as object to be detected, and without the need to lower-left block A0 and left side block A1, and upper right block B0 and top block B1 all carries out scaled MV detection.Therefore, relative to step b of the prior art and steps d, reduce further complexity, reduce the flow process performing motion-vector prediction, improve the execution efficiency of coding, decoding.
Embodiment three
On the basis of above-described embodiment, the method for motion vector prediction of the present embodiment comprises:
301, whether the MV detecting the position, the lower left corner of current block corresponding lower-left block A0 and/or left side block A1 can use, if available, is then recorded as spatial domain candidate motion vector;
This step is identical with 201 in above-described embodiment, so place repeats no more.
302, whether the MV detecting the position, the upper right corner of current block corresponding upper right block B0 and/or top block B1 can use, if available, is then recorded as spatial domain candidate motion vector;
This step is identical with 201 in above-described embodiment, so place repeats no more.
303, if the testing result of 302 is unavailable, then whether the scaled MV detecting left side block A1 corresponding to the position, the lower left corner of current block can use; If available, be then recorded as spatial domain candidate motion vector, and perform 305; If unavailable, then perform 305;
304, whether the scaled MV detecting top block B1 corresponding to the position, the upper right corner of current block can use; If available, be then recorded as spatial domain candidate motion vector, and perform 305; If unavailable, then directly perform 305;
In above-mentioned 303 and 304, the order of the reference block detected can exchange, that is: whether the scaled MV that can detect top block B1 corresponding to the position, the upper right corner of current block in 303 can use, and whether the scaled MV of left side block A1 corresponding to the position, the lower left corner detecting current block in 304 can use.
305, obtain and record time domain candidate motion vector;
306, according to recorded spatial domain candidate motion vector and time domain candidate motion vector, motion-vector prediction is carried out to described current block.
Above-mentioned steps 305,306 and 104 in embodiment one, 105 identical, so place repeats no more.
On HEVC reference software platform HM7.0, the method for motion vector prediction of the embodiment of the present invention and prior art have been carried out the performance comparison test under various configurations, the comparing result of test gained is as shown in following table 1-3.Particularly, table 1 is the comparing result (comprise the lower Main configuration of complexity under this scene and the higher HE10 of complexity configures) under Stochastic accessing scene, table 2 is the comparing result (comprising the lower Main configuration of complexity under this scene and the higher HE10 configuration of complexity) under low delay B scene, and table 3 be comparing result under low delay P scene (HE10 that Main configures and complexity is higher comprising complexity under this scene lower configures).
Table 1
Table 2
Table 3
As shown shown in 1-3, each percentages is the difference of method of motion vector prediction relative to prior art of the embodiment of the present invention.Such as, under Stochastic accessing scene Main in table 1 is configured, class A(Class A) corresponding video luminance component value (Y) is 0.0%, represents for this parameter, it is identical that the method for motion vector prediction of the embodiment of the present invention expends bit relative to prior art; The chromatic component value (U) that class A is corresponding is-0.1%, represents for this parameter, and the method for motion vector prediction of the embodiment of the present invention saves the bit of 0.1% relative to prior art.Overall performance difference in consolidated statement 1-3, can find out, adopt the method for motion vector prediction of the embodiment of the present invention compared to prior art, when reducing complexity, reducing flow process, do not cause the reduction of video performance, and video performance can also be improved to a certain extent under part scene.
Embodiment four
On the basis of embodiment one, in the present embodiment, expansion explanation is carried out to the process obtaining spatial domain candidate motion vector.
In the present embodiment, adopt Fig. 1 as the schematic diagram of the reference block for deriving spatial domain candidate motion vector.That is: the reference block of the first adjacent position comprises lower-left block corresponding to position, the lower left corner and left side block; The reference block of described second adjacent position comprises upper right block corresponding to position, the upper right corner and top block, and the upper left block that upper left position is corresponding.
Particularly, the spatial domain candidate motion vector of the present embodiment comprises:
401, whether the MV detecting the position, the lower left corner of current block corresponding lower-left block A0 and/or left side block A1 can use, if available, is then recorded as candidate A;
Particularly, such as: first detect the MV of lower-left block A0 and whether can use, if available, then the MV of lower-left block A0 is recorded as spatial domain candidate motion vector A(candidate A), and directly perform 202; If unavailable, then whether the MV detecting left side block A1 can use, if the MV of left side block A1 can use, then the MV of left side block A1 is recorded as candidate A, and performs 402; If the MV of left side block A1 is unavailable, perform 402.
402, whether the MV detecting upper left block B2 corresponding to the position, the upper right corner of current block corresponding upper right block B0, top block B1 and/or upper left position can use, if available, is then recorded as candidate B;
Particularly, such as: whether the MV first detecting upper right block B0 can use, if available, then the MV of upper right block B0 is recorded as spatial domain candidate motion vector B(candidate B), and process ends; If unavailable, then whether the MV detecting top block B1 can use, if the MV of top block B1 can use, then the MV of top block B1 is recorded as candidate B, and process ends; If the MV of top block B1 is unavailable, then whether the MV detecting upper left block B2 can use, if the MV of upper left block B2 can use, then the MV of upper left block B2 is recorded as candidate B, and process ends; If the MV of upper left block B2 is unavailable, then perform 403.
403, whether the scaled MV detecting the position, the lower left corner of current block corresponding lower-left block A0 or left side block A1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends; If unavailable, then perform 404;
Particularly, select in lower-left block A0 and left side block A1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of lower-left block A0 and left side block A1, both can be select lower-left block A0 according to formerly configuration is fixing, also can be select left side block A1 according to formerly configuration is fixing.
404, whether the scaled MV detecting the position, the upper right corner of current block corresponding upper right block B0 or top block B1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends, if unavailable, then direct process ends.
Particularly, select in upper right block B0 and top block B1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of upper right block B0 and top block B1, both can be select upper right block B0 according to formerly configuration is fixing, also can be select top block B1 according to formerly configuration is fixing.
According to the method for motion vector prediction of the present embodiment, owing to adopting lower-left block A0 and left side block A1 simultaneously as the reference block of position, the lower left corner, and when adopting reference block simultaneously as position, the upper right corner of upper right block B0 and top block B1, when whether the scaled MV of the reference block of the reference block and/or position, the described upper right corner that need detect position, the lower left corner is available, choose in lower-left block A0 and left side block A1 respectively, and in upper right block B0 and top block B1 one is as object to be detected, and without the need to lower-left block A0 and left side block A1, and upper right block B0 and top block B1 all carries out scaled MV detection.Therefore, relative to step b of the prior art and steps d, reduce further complexity, reduce the flow process performing motion-vector prediction, improve the execution efficiency of coding, decoding.
Embodiment five
On the basis of above-described embodiment four, in the present embodiment, expansion explanation is carried out to the process obtaining spatial domain candidate motion vector.
In the present embodiment, still adopt Fig. 1 as the schematic diagram of the reference block for deriving spatial domain candidate motion vector.Particularly, the spatial domain candidate motion vector of the present embodiment comprises:
501, whether the MV detecting the position, the lower left corner of current block corresponding lower-left block A0 and/or left side block A1 can use, if available, is then recorded as candidate A;
Particularly, such as: first detect the MV of lower-left block A0 and whether can use, if available, then the MV of lower-left block A0 is recorded as spatial domain candidate motion vector A(candidate A), and directly perform 202; If unavailable, then whether the MV detecting left side block A1 can use, if the MV of left side block A1 can use, then the MV of left side block A1 is recorded as candidate A, and performs 502; If the MV of left side block A1 is unavailable, perform 502.
502, whether the MV detecting upper left block B2 corresponding to the position, the upper right corner of current block corresponding upper right block B0, top block B1 and/or upper left position can use, if available, is then recorded as candidate B;
Particularly, such as: whether the MV first detecting upper right block B0 can use, if available, then the MV of upper right block B0 is recorded as spatial domain candidate motion vector B(candidate B), and process ends; If unavailable, then whether the MV detecting top block B1 can use, if the MV of top block B1 can use, then the MV of top block B1 is recorded as candidate B, and process ends; If the MV of top block B1 is unavailable, then whether the MV detecting upper left block B2 can use, if the MV of upper left block B2 can use, then the MV of upper left block B2 is recorded as candidate B, and process ends; If the MV of upper left block B2 is unavailable, then perform 503.
503, if the testing result of 502 is unavailable, then whether the scaled MV detecting the position, the lower left corner of current block corresponding lower-left block A0 or left side block A1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends; If unavailable, then perform 504;
Particularly, select in lower-left block A0 and left side block A1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of lower-left block A0 and left side block A1, both can be select lower-left block A0 according to formerly configuration is fixing, also can be select left side block A1 according to formerly configuration is fixing.
504, whether the scaled MV detecting the position, the upper right corner of current block corresponding upper right block B0 or top block B1 can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends, if unavailable, then perform 505;
Particularly, select in upper right block B0 and top block B1, detect it and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.Wherein, for the selection mode of upper right block B0 and top block B1, both can be select upper right block B0 according to formerly configuration is fixing, also can be select top block B1 according to formerly configuration is fixing.
505, whether the scaled MV detecting upper left block B2 corresponding to the upper left position of current block can use; If available, be then recorded as spatial domain candidate motion vector, such as, be recorded as candidate B, and process ends, if unavailable, then process ends.
Particularly, detect upper left block B2 and whether there is MV, if exist, then proportion adjustment is carried out to its MV, obtain scaled MV, to make the reference picture that scaled MV is corresponding identical with the reference picture of current block, and this scaled MV is recorded as candidate B.
Embodiment six
Fig. 4 is the structural representation of the motion-vector prediction device of one embodiment of the invention.As shown in Figure 4, this motion-vector prediction device comprises spatial domain candidate motion vector acquisition module 41, time domain candidate motion vector acquisition module 42, the motion-vector prediction module 43 be connected with described spatial domain candidate motion vector acquisition module 41 and described time domain candidate motion vector acquisition module 42 respectively, wherein:
Described spatial domain candidate motion vector acquisition module 41 comprises:
Whether the first detecting unit 41a, can use for the motion vector detecting the reference block of the first adjacent position of current block, if available, then be recorded as spatial domain candidate motion vector;
Whether the second detecting unit 41b, can use for the motion vector detecting the reference block of the second adjacent position of current block, if available, then be recorded as spatial domain candidate motion vector; And
3rd detecting unit 41c, if unavailable for the motion vector of the reference block of the second adjacent position of described current block, then to the reference block of described first adjacent position and/or the reference block of described second adjacent position, whether can with detecting through the motion vector of proportion adjustment, if available, be then recorded as spatial domain candidate motion vector;
Described time domain candidate motion vector acquisition module 42, for obtaining and recording time domain candidate motion vector;
Described motion-vector prediction module 43, for according to recorded spatial domain candidate motion vector and time domain candidate motion vector, carries out motion-vector prediction to described current block.
The flow process of the motion-vector prediction device execution motion-vector prediction of the present embodiment is identical with the method for motion vector prediction of above-described embodiment, so place repeats no more.The motion-vector prediction device of the present embodiment is such as encoder or decoder, or is integratedly arranged in encoder or decoder.Wherein, spatial domain candidate motion vector acquisition module 41, time domain candidate motion vector acquisition module 42 and motion-vector prediction module 43 can be all processors, and the first detecting unit 41a, the second detecting unit 41b and the 3rd detecting unit 41c can be realized by same processor or different processor.
According to the motion-vector prediction device of the present embodiment, in the process obtaining spatial domain candidate motion vector, because whether the motion vector of the reference block of the first adjacent position and the second adjacent position of first detecting current block can be used, and when the motion vector of the reference block of the second adjacent position is unavailable, whether the motion vector detected again through proportion adjustment can be used, under making worst condition, spatial domain candidate motion vector need be obtained by three steps.And in prior art, in worst case, four steps need be performed to obtain spatial domain candidate motion vector.Therefore, can find out, reduce complexity relative to prior art, reduce in prior art the flow process performing motion-vector prediction, thus improve the execution efficiency of coding, decoding.
Further, in the motion-vector prediction device of above-described embodiment, the reference block of described first adjacent position comprises lower-left block corresponding to position, the lower left corner and left side block; The reference block of described second adjacent position comprises upper right block corresponding to position, the upper right corner and top block.
Further, in the motion-vector prediction device of above-described embodiment, whether described first detecting unit can be used for the motion vector detecting lower-left block corresponding to position, the described lower left corner, and only when unavailable, whether the motion vector detecting left side block corresponding to position, the described lower left corner can be used;
Whether described second detecting unit can be used for the motion vector detecting upper right block corresponding to position, the described upper right corner, and only when unavailable, whether the motion vector detecting top block corresponding to position, the described upper right corner can be used.
Further, in the motion-vector prediction device of above-described embodiment, the reference block of described second adjacent position also comprises upper left block corresponding to upper left position.
Further, in the motion-vector prediction device of above-described embodiment, whether described first detecting unit can be used for the motion vector detecting lower-left block corresponding to position, the described lower left corner, and only when unavailable, whether the motion vector detecting left side block corresponding to position, the described lower left corner can be used;
Whether described second detecting unit can be used for the motion vector detecting upper right block corresponding to position, the described upper right corner, and only when unavailable, whether the motion vector detecting top block corresponding to position, the described upper right corner can be used, and only when unavailable, whether the motion vector detecting upper left block corresponding to described upper left position can be used.
Further, in the motion-vector prediction device of above-described embodiment, described 3rd detecting unit is for selecting at least one in the reference block of described first adjacent position, and/or at least one selecting in the reference block of described second adjacent position, whether the motion vector detected through proportion adjustment can be used.
Further, in the motion-vector prediction device of above-described embodiment, described 3rd detecting unit is used for the left side block corresponding to position, the lower left corner, and/or top block corresponding to position, the upper right corner, whether can with detecting through the motion vector of proportion adjustment.
Further, in the motion-vector prediction device of above-described embodiment, whether described 3rd detecting unit can be used for the motion vector after proportion adjustment detecting left side block corresponding to position, the described lower left corner, and only when unavailable, whether the motion vector after proportion adjustment detecting top block corresponding to position, the described upper right corner can be used; Or
Whether the motion vector after proportion adjustment detecting top block corresponding to position, the described upper right corner can be used, and only when unavailable, whether the motion vector after proportion adjustment detecting left side block corresponding to position, the described lower left corner can be used.
Further, in the motion-vector prediction device of above-described embodiment, described 3rd detecting unit is used for the left side block corresponding to position, the lower left corner, and/or the top block that position, the upper right corner is corresponding, and/or upper left block corresponding to upper left position, whether can with detecting through the motion vector of proportion adjustment.
Further, in the motion-vector prediction device of above-described embodiment, whether described 3rd detecting unit can be used for the motion vector after proportion adjustment detecting left side block corresponding to position, the described lower left corner, and only when unavailable, whether the motion vector after proportion adjustment detecting top block corresponding to position, the described upper right corner can be used, and only when unavailable, whether the motion vector after proportion adjustment detecting upper left block corresponding to described upper left position can be used; Or
Whether the motion vector after proportion adjustment detecting top block corresponding to position, the described upper right corner can be used, and only when unavailable, whether the motion vector after proportion adjustment detecting left side block corresponding to position, the described lower left corner can be used, and only when unavailable, whether the motion vector after proportion adjustment detecting upper left block corresponding to described upper left position can be used.
Embodiment seven
The embodiment of the present invention provides a kind of encoder, comprises the motion-vector prediction device of above-described embodiment.
The encoder execution flow process of motion-vector prediction of the present embodiment is identical with the workflow of the motion-vector prediction device of above-described embodiment, so place repeats no more.
In the encoder of the present embodiment, when the execution coding side of the motion-vector prediction module of motion-vector prediction device is encoded, from motion vector list according to preset rules, select a best motion vector as the motion vector predictor of current block, the best wherein selected, can be best in rate distortion (Rate-distortion) meaning, also can be select based on other performance index etc. as required, not limit herein.Wherein, motion vector list comprises recorded spatial domain candidate motion vector and time domain candidate motion vector, and each spatial domain candidate motion vector and time domain candidate motion vector all have a location index number in motion vector list.
Encoder also can comprise a coding dispensing device, for selected motion vector location index number is in lists write code stream, and is sent by code stream.
According to the encoder of the present embodiment, in the process obtaining spatial domain candidate motion vector, because whether the motion vector of the reference block of the first adjacent position and the second adjacent position of first detecting current block can be used, and when the motion vector of the reference block of the second adjacent position is unavailable, whether the motion vector detected again through proportion adjustment can be used, under making worst condition, spatial domain candidate motion vector need be obtained by three steps.And in prior art, in worst case, four steps need be performed to obtain spatial domain candidate motion vector.Therefore, can find out, reduce complexity relative to prior art, reduce in prior art the flow process performing motion-vector prediction, thus improve the execution efficiency of coding.
Embodiment eight
The embodiment of the present invention provides a kind of encoder, comprises the motion-vector prediction device of above-described embodiment.
The encoder execution flow process of motion-vector prediction of the present embodiment is identical with the workflow of the motion-vector prediction device of above-described embodiment, so place repeats no more.
In the decoder of the present embodiment, can also comprise receipt decoding device, this receipt decoding device received code device transmitted stream, decodes to code stream, obtains the motion vector call number of current block, is supplied to motion-vector prediction device.Spatial domain candidate motion vector and the time domain candidate motion vector of current block is obtained by motion-vector prediction device, generate the motion vector list comprising spatial domain candidate motion vector and time domain candidate motion vector, the candidate motion vector corresponding with the motion vector call number that receipt decoding device provides is chosen, as the motion vector predictor of current block from this motion vector list.
According to the decoder of the present embodiment, in the process obtaining spatial domain candidate motion vector, because whether the motion vector of the reference block of the first adjacent position and the second adjacent position of first detecting current block can be used, and when the motion vector of the reference block of the second adjacent position is unavailable, whether the motion vector detected again through proportion adjustment can be used, under making worst condition, spatial domain candidate motion vector need be obtained by three steps.And in prior art, in worst case, four steps need be performed to obtain spatial domain candidate motion vector.Therefore, can find out, reduce complexity relative to prior art, reduce in prior art the flow process performing motion-vector prediction, thus improve the execution efficiency of decoding.
Embodiment nine
The system architecture diagram of the coding/decoding system that Fig. 5 provides for one embodiment of the invention.As shown in Figure 5, this coding/decoding system comprises the encoder 51 of above-described embodiment, and the decoder 52 of above-described embodiment.
The flow process that the coding/decoding system of the present embodiment realizes encoding and decoding is identical with the workflow of encoder in above-described embodiment, so place repeats no more.
According to the coding/decoding system of the present embodiment, in the process obtaining spatial domain candidate motion vector, because whether the motion vector of the reference block of the first adjacent position and the second adjacent position of first detecting current block can be used, and when the motion vector of the reference block of the second adjacent position is unavailable, whether the motion vector detected again through proportion adjustment can be used, under making worst condition, spatial domain candidate motion vector need be obtained by three steps.And in prior art, in worst case, four steps need be performed to obtain spatial domain candidate motion vector.Therefore, can find out, reduce complexity relative to prior art, reduce in prior art the flow process performing motion-vector prediction, thus improve the execution efficiency of coding, decoding.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that program command is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.