CPC H04N 19/577 (2014.11) [H04N 19/105 (2014.11); H04N 19/159 (2014.11); H04N 19/176 (2014.11)] | 18 Claims |
1. A method of decoding an image, the method comprising:
determining whether a bi-directional optical flow (BIO) mode is applied to a current block;
in response that the BIO mode is applied to the current block, obtaining prediction samples of an extended sub-block based on a motion vector of the current block, the extended sub-block being composed of a sub-block included in the current block and an extended region around the sub-block;
obtaining gradient information of each prediction sample in the extended sub-block;
deriving a motion refinement vector for the sub-block based on the gradient information of each prediction sample in the extended sub-block;
deriving a prediction offset for a first prediction sample in the sub-block; and
modifying the first prediction sample in the sub-block based on the prediction offset therefor,
wherein the gradient information of each prediction sample in the sub-block is derived by using at least one neighbor sample adjacent to a prediction sample, and
wherein, when an integer pixel position closest to a reference position for a second prediction sample in the extended region is at an available position, the second prediction sample is obtained from a sample at the integer pixel position, the reference position being specified by the motion vector of the current block, and
wherein when the integer pixel position for the second prediction sample in the extended region is at an unavailable position, the second prediction sample is obtained from a sample at a boundary position.
|