What is claimed is:1. An inter prediction apparatus for predicting a target block using a bi-directional optical flow in a video encoding, the apparatus comprising one or more processor configured to:generate a first motion vector for a first reference picture and a second motion vector for a second reference picture;derive a variable from sample value differences between samples in the first reference picture which are determined based on the first motion vector and samples in the second reference picture which are determined based on the second motion vector, wherein the variable is SAD (Sum of Absolute Differences) or SSE (Sum of Squared Errors) and is used for determining whether to apply the bi-directional optical flow; andgenerate a prediction block of the target block from the first and second reference pictures, by selectively either performing or skipping the bi-directional optical flow depending on the variable,wherein the bi-directional optical flow is performed by the unit of samples in the target block or by the unit of sub-blocks partitioned from the target block.2. The apparatus of claim 1, wherein the bi-directional optical flow is skipped when the variable is less than a predetermined threshold, and is applied when the variable is greater than the predetermined threshold.3. The apparatus of claim 1, wherein, when at least one of a width or a height of the target block is less than a predetermined length, the bi-directional optical flow is skipped.4. The apparatus of claim 3, wherein the predetermined length is 8.5. The apparatus of claim 1, wherein the sub-blocks have a size of 4×4.6. An inter prediction method for predicting a target block using a bi-directional optical flow in a video decoding, the method comprising:generating a first motion vector for a first reference picture and a second motion vector for a second reference picture;deriving a variable from sample value differences between samples in the first reference picture which are determined based on the first motion vector and samples in the second reference picture which are determined based on the second motion vector, wherein the variable is SAD (Sum of Absolute Differences) or SSE (Sum of Squared Errors) and is used for determining whether to apply the bi-directional optical flow; andgenerating a prediction block of the target block from the first and second reference pictures, by selectively either performing or skipping the bi-directional optical flow depending on the variable,wherein the bi-directional optical flow is performed by the unit of samples in the target block or by the unit of sub-blocks partitioned from the target block.7. The method of claim 6, wherein the bi-directional optical flow is skipped when the variable is less than a predetermined threshold, and is applied when the variable is greater than the predetermined threshold.8. The method of claim 6, wherein, when at least one of a width or a height of the target block is less than a predetermined length, the bi-directional optical flow is skipped.9. The method of claim 8, wherein the predetermined length is 8.10. The method of claim 6, wherein the sub-blocks have a size of 4×4.11. A non-transitory recording medium storing a bitstream generated by an inter prediction method of predicting a target block using a bi-directional optical flow, the method comprising:generating a first motion vector for a first reference picture and a second motion vector for a second reference picture;deriving a variable from sample value differences between samples in the first reference picture which are determined based on the first motion vector and samples in the second reference picture which are determined based on the second motion vector, wherein the variable is SAD (Sum of Absolute Differences) or SSE (Sum of Squared Errors) and is used for determining whether to apply the bi-directional optical flow; andgenerating a prediction block of the target block from the first and second reference pictures, by selectively either performing or skipping the bi-directional optical flow depending on the variable,wherein the bi-directional optical flow is performed by the unit of samples in the target block or by the unit of sub-blocks partitioned from the target block.