aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-13 10:53:13 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-19 11:20:38 -0500
commit6efadf44d0ca34505e024a90bf6e8c169d36402e (patch)
tree4c6f33802df989e46b4952356679ac908b8b0ed8 /klippy
parente4c4a4628b013124cec92d210894d793cb4c7dca (diff)
downloadkutter-6efadf44d0ca34505e024a90bf6e8c169d36402e.tar.gz
kutter-6efadf44d0ca34505e024a90bf6e8c169d36402e.tar.xz
kutter-6efadf44d0ca34505e024a90bf6e8c169d36402e.zip
stepcompress: Favor higher add values when bisecting
Instead of splitting the available "add range" in half, try for add values closer to the higher end of the range. This heuristic seems to result in better choices. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/stepcompress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/stepcompress.c b/klippy/stepcompress.c
index eb9abf2c..0ae3bd57 100644
--- a/klippy/stepcompress.c
+++ b/klippy/stepcompress.c
@@ -202,7 +202,7 @@ compress_bisect_add(struct stepcompress *sc)
// Bisect valid add range and try again with new 'add'
if (minadd > maxadd)
break;
- add = (minadd + maxadd) / 2;
+ add = maxadd - (maxadd - minadd) / 4;
}
return (struct step_move){ bestinterval, bestcount, bestadd };
}