Commit 82b0659fea for ffmpeg
commit 82b0659fea53da8912d8d5924ae1f0ae4a1a77e9
Author: Niklas Haas <git@haasn.dev>
Date: Sun Nov 8 03:12:45 2026 +0100
swscale/filters: exclude integer boundaries from start/stop
ceil(pos) gives pos when pos is exactly aligned with the filter edge,
where the weight is 0 (or SWS_MAX_REDUCE_CUTOFF). Using floor(pos) + 1
excludes this case instead. Ditto for the upper bound.
Mainly useful for the following commit.
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libswscale/filters.c b/libswscale/filters.c
index ddc4db8770..3f8d8d1f86 100644
--- a/libswscale/filters.c
+++ b/libswscale/filters.c
@@ -84,8 +84,8 @@ static void compute_row(SwsFilterWeights *f, const SwsFilterFunction *fun,
}
/* First and last pixels that are actually within the filter envelope */
- const int start = ceil (src_pos - radius);
- const int stop = floor(src_pos + radius);
+ const int start = floor(src_pos - radius) + 1;
+ const int stop = ceil (src_pos + radius) - 1;
const int clamped = av_clip(start, 0, f->src_size - f->filter_size);
*pos = clamped;