| CPC H04N 19/137 (2014.11) [H04N 19/117 (2014.11); H04N 19/119 (2014.11); H04N 19/159 (2014.11); H04N 19/176 (2014.11); H04N 19/186 (2014.11); H04N 19/513 (2014.11); H04N 19/52 (2014.11); H04N 19/521 (2014.11); H04N 19/573 (2014.11)] | 3 Claims |

|
1. A method of decoding an image, the method comprising:
dividing a current block to acquire a subblock of the current block;
determining whether to perform a subblock based BI-DIRECTIONAL OPTICAL FLOW (BIO) prediction on the subblock;
deriving a first direction prediction sample and a second direction prediction sample of the subblock;
deriving a BIO offset of the subblock;
generating a final prediction sample of the subblock block using the first direction prediction sample, the second direction prediction sample and the BIO offset; and
generating a reconstructed sample of the current block based on the final prediction sample,
wherein whether to perform the subblock based BIO prediction determines based on a result of comparing a threshold value and a difference between the first direction prediction sample and the second direction prediction sample,
wherein the threshold value is set using on a size of the current block,
wherein the deriving a BIO offset comprising:
deriving a gradient using neighboring samples;
deriving a motion refining vector; and
deriving the BIO offset based on the gradient and the motion refining vector,
wherein the gradient is, when a position of the neighboring sample is a subpixel position, derived by rounding to an integer pixel position close to the subpixel position.
|