A method of decoding a video, the method comprising: obtaining, based on a size of a current prediction unit, motion prediction mode information indicating a motion prediction mode applied to the current prediction unit from among a unidirectional motion prediction mode and a bidirectional motion prediction mode (bi prediction mode), wherein the unidirectional motion prediction mode comprises one of an L0 prediction mode and an L1 prediction mode; determining the motion prediction mode applied to the current prediction unit from among the L0 prediction mode, the L1 prediction mode and the bi prediction mode based on the motion prediction mode information of the current prediction unit; performing, based on the determined motion prediction mode, motion compensation on the current prediction unit by using prediction values of the current prediction unit, characterized in that the performing motion compensation on the current prediction unit comprises: determining a location (x 1, y 1) with x 1 equal to N+1/4 and y 1 equal to M+1/4, wherein N and M are integers, of a first sub-pixel in a reference frame of the current prediction unit indicated by a motion vector of the current prediction unit, wherein the reference frame of the current prediction unit is obtained according to the determined motion prediction mode, generating a pixel value of the first sub-pixel by using a neighboring sub-pixel located on an upper side location (x 2, y 2), with x 2 equal to N+1/4 and y 2 equal to M, of the first sub-pixel, and obtaining the prediction values of the current prediction unit including the generated pixel value of the first sub-pixel. obtaining, based on a size of a current prediction unit, motion prediction mode information indicating a motion prediction mode applied to the current prediction unit from among a unidirectional motion prediction mode and a bidirectional motion prediction mode (bi prediction mode), wherein the unidirectional motion prediction mode comprises one of an L0 prediction mode and an L1 prediction mode; determining the motion prediction mode applied to the current prediction unit from among the L0 prediction mode, the L1 prediction mode and the bi prediction mode based on the motion prediction mode information of the current prediction unit; performing, based on the determined motion prediction mode, motion compensation on the current prediction unit by using prediction values of the current prediction unit, characterized in that the performing motion compensation on the current prediction unit comprises: determining a location (x 1, y 1) with x 1 equal to N+1/4 and y 1 equal to M+1/4, wherein N and M are integers, of a first sub-pixel in a reference frame of the current prediction unit indicated by a motion vector of the current prediction unit, wherein the reference frame of the current prediction unit is obtained according to the determined motion prediction mode, generating a pixel value of the first sub-pixel by using a neighboring sub-pixel located on an upper side location (x 2, y 2), with x 2 equal to N+1/4 and y 2 equal to M, of the first sub-pixel, and obtaining the prediction values of the current prediction unit including the generated pixel value of the first sub-pixel. determining a location (x 1, y 1) with x 1 equal to N+1/4 and y 1 equal to M+1/4, wherein N and M are integers, of a first sub-pixel in a reference frame of the current prediction unit indicated by a motion vector of the current prediction unit, wherein the reference frame of the current prediction unit is obtained according to the determined motion prediction mode, generating a pixel value of the first sub-pixel by using a neighboring sub-pixel located on an upper side location (x 2, y 2), with x 2 equal to N+1/4 and y 2 equal to M, of the first sub-pixel, and obtaining the prediction values of the current prediction unit including the generated pixel value of the first sub-pixel.