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>
This commit is contained in:
Kevin O'Connor 2016-12-13 10:53:13 -05:00
parent e4c4a4628b
commit 6efadf44d0
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ compress_bisect_add(struct stepcompress *sc)
// Bisect valid add range and try again with new 'add' // Bisect valid add range and try again with new 'add'
if (minadd > maxadd) if (minadd > maxadd)
break; break;
add = (minadd + maxadd) / 2; add = maxadd - (maxadd - minadd) / 4;
} }
return (struct step_move){ bestinterval, bestcount, bestadd }; return (struct step_move){ bestinterval, bestcount, bestadd };
} }