A method and an apparatus for affine motion-compensated prediction refinement (AMPR) are provided. The method includes: generating, at a pixel location in a sub-block, a sub-block prediction by performing a sub-block-based affine motion compensation on a video picture that includes a plurality of sub-blocks; obtaining, at the pixel location, a horizontal spatial gradient and a vertical spatial gradient for the sub-block prediction by using an interpolation filter; and obtaining, at the pixel location, a motion vector (MV) difference between a first MV and a second MV based on the pixel location relative to a position within the sub-block. The first MV is an MV of a pixel located at the pixel location and the second MV is an MV of the sub-block.
展开▼