Skip to content

Commit 0a229cc

Browse files
astiobarch1t3cht
authored andcommitted
Don't quantize resampled drawing coordinates coarser than necessary
1/8 is coarser than the actual 1/64 precision of both VSFilter and libass (for \p1). Moreover, quantization to exact 1/8 steps causes the output to have up to 3 figures after the decimal point (e.g.: 0.125). If reducing the output size were the goal, then rounding to 1/10 would trivially produce shorter output *and* less quantization error, and even 1/100 would produce shorter output for uniformly distributed input values. Current Lua automation scripts for Aegisub commonly round drawing coordinates to 1/1000, so stick to that precision here. This happens to be float_to_string's default, so just rely on that.
1 parent 17ea294 commit 0a229cc

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/resolution_resampler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ namespace {
7575
val = (val + shift_x) * scale_x;
7676
else
7777
val = (val + shift_y) * scale_y;
78-
val = round(val * 8) / 8.0; // round to eighth-pixels
7978
final += float_to_string(val);
8079
final += ' ';
8180
is_x = !is_x;

0 commit comments

Comments
 (0)