VSE: replace Subsampled3x3 filter by a general Box filter #117584

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:vse_box_filter into main 2024-01-29 18:41:40 +01:00

1 Commits

Author SHA1 Message Date
Aras Pranckevicius c25412142d VSE: replace Subsampled3x3 filter by a general Box filter
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
Part of overall "improve filtering situation" (#116980): replace
Subsampled3x3 (added for blender 3.5 in f210842a72 et al.) strip
scaling filter with a general Box filter.

Subsampled3x3 is really a Box filter ("average pixel values over NxM
region"), hardcoded to 3x3 size. As such, it works pretty well when
downscaling images by 3x on each axis. But starts to break down
and introduce aliasing at other scaling factors. When scaling up or
scaling down by less than 3x, using total of 9 samples is a bit of
overkill and hurts performance.

So instead, calculate the amount of NxM samples needed by looking
at scaling factors on X/Y axes. Note: use at least 2 samples on each
axis, so that when rotation is present, the result edges will get some
anti-aliasing, just like it was happening in previous filter
implementation.
2024-01-28 21:27:35 +02:00