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