A method of video coding the method comprising obtaining a pair of initial motion vectors for a current block; obtaining a first set of predicted samples for samples in the current block based on the pair of initial motion vectors; calculating a first matching cost according to the first set of predicted samples, wherein the first matching cost represents a sum of absolute differences, SAD, between two prediction blocks obtained using the respective first initial motion vector and second initial motion vector of the pair of initial motion vectors; determining whether the current block is eligible to perform motion vector refinement, MVR; if the current block is determined to be eligible to perform MVR: obtaining a pair of refined motion vectors and a second matching cost corresponding to the pair of refined motion vectors by performing the MVR using the pair of initial motion vectors; obtaining a second set of predicted samples for the samples in the current block using a K-tap interpolation filter using the pair of refined motion vectors; determining whether an optical flow refinement process should be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold; performing an optical flow refinement process for obtaining a final inter prediction for the sample value in the current block, when it is determined that the second matching cost is not less than the threshold; wherein the performing the optical flow refinement process comprising: performing the optical flow refinement based on the second set of predicted samples; wherein only when it is determined that the optical flow refinement process should not be performed, the final inter prediction is obtained by a weighted sum of the second set of predicted samples. obtaining a pair of initial motion vectors for a current block; obtaining a first set of predicted samples for samples in the current block based on the pair of initial motion vectors; calculating a first matching cost according to the first set of predicted samples, wherein the first matching cost represents a sum of absolute differences, SAD, between two prediction blocks obtained using the respective first initial motion vector and second initial motion vector of the pair of initial motion vectors; determining whether the current block is eligible to perform motion vector refinement, MVR; if the current block is determined to be eligible to perform MVR: obtaining a pair of refined motion vectors and a second matching cost corresponding to the pair of refined motion vectors by performing the MVR using the pair of initial motion vectors; obtaining a second set of predicted samples for the samples in the current block using a K-tap interpolation filter using the pair of refined motion vectors; determining whether an optical flow refinement process should be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold; performing an optical flow refinement process for obtaining a final inter prediction for the sample value in the current block, when it is determined that the second matching cost is not less than the threshold; wherein the performing the optical flow refinement process comprising: performing the optical flow refinement based on the second set of predicted samples; wherein only when it is determined that the optical flow refinement process should not be performed, the final inter prediction is obtained by a weighted sum of the second set of predicted samples. obtaining a pair of refined motion vectors and a second matching cost corresponding to the pair of refined motion vectors by performing the MVR using the pair of initial motion vectors; obtaining a second set of predicted samples for the samples in the current block using a K-tap interpolation filter using the pair of refined motion vectors; determining whether an optical flow refinement process should be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition of whether the second matching cost is less than a threshold; performing an optical flow refinement process for obtaining a final inter prediction for the sample value in the current block, when it is determined that the second matching cost is not less than the threshold; wherein the performing the optical flow refinement process comprising: performing the optical flow refinement based on the second set of predicted samples; wherein only when it is determined that the optical flow refinement process should not be performed, the final inter prediction is obtained by a weighted sum of the second set of predicted samples.