| CPC H04N 19/147 (2014.11) [H04N 19/105 (2014.11); H04N 19/176 (2014.11); H04N 19/52 (2014.11)] | 14 Claims |

|
1. A method for acquiring motion vectors, comprising:
obtaining a plurality of related motion vectors of a current block, wherein the plurality of related motion vectors are motion vectors of a related block of the current block, a prediction mode of the related block is the same as a current prediction mode of the current block, an encoding has been completed; wherein the plurality of related motion vectors comprise temporal motion vectors; the temporal motion vectors are motion vectors of a temporal related block; the temporal related block does not belong to the current frame; the obtaining the plurality of related motion vectors of the current block comprises:
configuring the current block as a block to be queried;
querying a block in which a co-located point is located in a reference frame of the block to be queried corresponding to a point of the block to be queried;
determining the block in which the co-located point is located as the temporal related block of the current block and configuring the temporal related block as a new block to be queried, in response to a type of the block in which the co-located point is located being the same as a type of the block to be queried; and
repeatedly performing the querying the block in which the co-located point is located in the reference frame of the block to be queried corresponding to the point of the block to be queried, and subsequent operations, until a number of temporal related blocks reaches a preset amount, or the type of the block in which the co-located point is located is different from the type of the block to be queried;
determining weights of at least part of the plurality of related motion vectors, comprising:
determining a weight of the temporal related block based on a distance of the temporal related block relative to the current block; wherein the weight of the temporal related block and the distance of the temporal related block relative to the current block are negatively correlated; and
calculating a weighted motion vector of the current block based on at least part of the plurality of related motion vectors and the weights of at least part of the plurality of related motion vectors, comprising:
in response to a sum of weights of the temporal motion vectors being equal to 1, the temporal motion vectors and the weights of the same are configured to perform a weighted sum operation to obtain a weighted motion vector of the current block; or,
in response to the sum of weights of the temporal motion vectors not being equal to 1, the temporal motion vectors and the weights of the same are configured to perform a weighted average operation to obtain the weighted motion vector of the current block.
|