Patent attributes
This application provides a motion vector obtaining method and apparatus. The method includes: determining a target offset vector of a block and identifier information of a target picture, wherein the block comprises at least one sub-block; determining a location of the sub-block; determining, as a target location coordinate value of a collocated sub-block, a location coordinate value obtained by performing a clipping operation on an initial location coordinate value in a range, wherein the initial location coordinate value is based on the location of the sub-block and the target offset vector; and obtaining a motion vector of the sub-block based on a motion vector corresponding to the target location coordinate value. Thus, a range of the target offset vector is limited, so that a quantity of memory read times can be reduced in a process of obtaining the motion vector of the collocated sub-block.