mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Correctly round evaluation to grain size
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
23cbb221b2
commit
dd718d92a7
1 changed files with 1 additions and 1 deletions
|
@ -1105,7 +1105,7 @@ namespace {
|
|||
Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL);
|
||||
|
||||
int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
|
||||
return Value(result & ~(GrainSize - 1));
|
||||
return Value((result + GrainSize / 2) & ~(GrainSize - 1));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue