Skip to content

rA.0alpha test for custom kernel support

Pre-release
Pre-release
Compare
Choose a tag to compare
@AkarinVS AkarinVS released this 27 Oct 06:59
· 20 commits to mod since this release

For example, here is yet another way to implement Debilinear(src, dw, dh):

dsed = core.descale.Descale(src, dw, dh, custom=lambda x: max(0, 1-abs(x)), support=1)

Assume custom=f, the support argument is the radius of x's support, i.e.
if |x| > support, then f(x) must be zero.
The max support for existing kernels is 4 for spline64, but descale only has optimized code path for 1 and 2.
(see https://github.com/AmusementClub/descale/blob/4a288cf57e65f7c098ac049a2fa34b5cac95c07d/src/descale.c#L166 if you want some kernel function references.)


The corresponding fmtconv change:

scaled = core.fmtc.resample(src, scale=2, custom=lambda x: max(0, 1-abs(x)), support=1) # bilinear upscale

Added parameters: custom/support, custom_h/support_h, custom_v/support_v. They should behave as the rest of fmtconv parameters (including specifying different custom kernel for horizontal/vertical scaling and/or each plane.) Also note that fmtconv will apply an additional anti-aliasing low-pass filter for downscales.

This is very experimental and of alpha quality (read: only tested bilinear (de-)scaling).