CPC H04N 19/137 (2014.11) [H04N 19/105 (2014.11); H04N 19/159 (2014.11); H04N 19/176 (2014.11); H04N 19/80 (2014.11)] | 12 Claims |
1. A method for deriving motion vector from a current block in a coding unit, implemented by an electronic device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, the method comprising:
obtaining a space domain motion vector prediction and a time domain motion vector prediction of adjacent blocks of the coding unit in a predetermined direction;
filtering on the space domain motion vector and the time domain motion vector prediction to obtain the space domain motion vector prediction and the time domain motion vector prediction of the filtered adjacent blocks;
determining, according to a predetermined inter-frame prediction mode, reference motion vectors of the current block in four side directions by using the space domain motion vector prediction and the time domain motion vector prediction of the filtered adjacent blocks and a coordinate position of the current block in the coding unit; and
deriving motion vectors of the current block according to the reference motion vectors and the coordinate position of the current block in the coding unit, the deriving comprising:
deriving motion vectors of the current block according to the formula listed below:
Vh=((M−x)*vl+X*vr)/M
Vv=((N−y)*vt+y*vb)/N
V[x][y]=(Vh+Vv)/2
wherein
vl, vr, vt, and vb represent the reference motion vectors of the current block in the left direction, in the right direction, in the upper direction and in the lower direction, respectively,
x and y represent a coordinate of the current block in the coding unit in units of sub-block; M and N represent a width and a height of the coding unit in units of sub-block; Vh represents a horizontal motion vector of the current block,
Vv represents a vertical motion vector of the current block, and
V[x][y] represents motion vectors of the current block.
|