Patent ID: 11902563
Assignee: HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO., LTD.
Field: Audio-visual technology (Electrical engineering)
Classification: CPC H | IPC H

Claim 18:
19. A decoder, wherein the decoder is configured to implement the following steps:
when a current block enables a motion vector refinement mode, determining prediction values of sub-blocks of the current block, and determining a prediction value of the current block according to the prediction values of sub-blocks of the current block, wherein for each sub-block of the current block, determining a prediction value of a sub-block comprises:
obtaining motion information of the current block comprising a first original motion vector and a first reference frame, a second original motion vector and a second reference frame;
determining a first reference block corresponding to the sub-block according to the first original motion vector of the current block, and determining a second reference block corresponding to the sub-block according to the second original motion vector of the current block;
obtaining an optimal motion vector according to pixel values of the first reference block and pixel values of the second reference block, wherein obtaining an optimal motion vector comprises:
taking an initial motion vector as a center, selecting motion vectors from the motion vectors containing the initial motion vector and the motion vectors surrounding the initial motion vector, and determining the selected motion vectors as candidate motion vectors; wherein the initial motion vector is the first original motion vector or the second original motion vector; obtaining a cost value corresponding to the initial motion vector and cost values corresponding to the candidate motion vectors according to the pixel values of the first reference block and the pixel values of the second reference block; selecting a motion vector from the initial motion vector and the candidate motion vectors as the optimal motion vector according to the cost value corresponding to the initial motion vector and the cost values corresponding to the candidate motion vectors;
adjusting the first original motion vector and the second original motion vector according to the optimal motion vector to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector;
determining the prediction value of the sub-block according to the first target motion vector and the second target motion vector; wherein determining the prediction value of the sub-block according to the first target motion vector and the second target motion vector comprises: determining a third reference block corresponding to the sub-block according to the first target motion vector, and determining a fourth reference block corresponding to the sub-block according to second target motion vector; weighting pixel values of the third reference block and pixel values of the fourth reference block to obtain the prediction value of the sub-block.