In accordance with another aspect of the present disclosure, provided is a device for performing motion compensation using a bidirectional optical flow (BIO) in video encoding or decoding, the device including a reference block generator configured to generate a first reference block by a first motion vector referring to a first reference picture and generate a second reference block by a second motion vector referring to a second reference picture; a skip determiner configured to calculate a texture complexity of a current block using the first and second reference blocks and determine whether to skip a BIO process by comparing the texture complexity with a threshold; and a prediction block generator configured to generate a prediction block of the current block based on the first and second reference blocks by selectively applying or skipping the BIO process based on the determination of the skip determiner.