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:
parent
e4c4a4628b
commit
6efadf44d0
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue