X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=util.cpp;h=7fbc67a07206b81df5a196c580e704a1ba369444;hp=61f3e4de554c999ee373fdf663f0df988b731c3b;hb=fe7a508885d19950c43e46dc60db675375f49ffb;hpb=cea222cc88f1e210cd73331d74d0b33a67de3d81;ds=sidebyside diff --git a/util.cpp b/util.cpp index 61f3e4d..7fbc67a 100644 --- a/util.cpp +++ b/util.cpp @@ -174,7 +174,7 @@ void combine_two_samples(float w1, float w2, float pos1, float pos2, unsigned si if (rounding_behavior == COMBINE_ROUND_TO_FP16) { // Round to fp16. Note that this might take z outside the 0..1 range. *offset = fp16_to_fp64(fp64_to_fp16(*offset)); - z = (z - pos1) / (pos2 - pos1); + z = (*offset - pos1) / (pos2 - pos1); } else { assert(rounding_behavior == COMBINE_DO_NOT_ROUND); }