Log in

View Full Version : A stupid idea for reducing ringing?


wonkey_monkey
10th March 2025, 14:23
This isn't something that particularly interests me, exactly, but after stumbling on something in another thread it got me thinking so I tested it out and thought I'd share the results in case it's of any use.

https://i.imgur.com/ZQjjMLp.png
https://i.imgur.com/p2mw0bu.png

Left: original (nearest neighbour upscale)
Center: 4x JincResize with a silly number of taps (16)
Right: 4x JincResize after limiting based on surrounding pixels

Basically you do the upscale, then do this (probably only works properly on 4:4:4 images right now):

expr(jinc_resized_clip, nearest_neighbour_clip, "
x
y[-3,-3] y[3,-3] y[-3,3] y[3,3] y min min min min max
y[-3,-3] y[3,-3] y[-3,3] y[3,3] y max max max max min
")

Change the 3s to scale-1 if you try other scale factors.

Edit: Just noticed it has puts some spots in the letters which is no good.

DTL
11th March 2025, 05:02
Typically to save from ringing at upsize you need to low-pass filter-out some (part of) valid high frequencies. If you like 2D resamplers - it may be also good to use 2D convolution low-pass filtering with weighted sum of jincs. Same as designed in UserDefined2 1D kernel (but somehow transformet for 2D kernel) - https://github.com/jpsdr/ResampleMT/blob/75062b634aa63a517a8277245bce0967098745d6/ResampleMT/resample_functions.cpp#L366

It is planned to test but not yet implemented. Waiting for finally integration of 2D resampler in the AVS+ core.

1D case of balancing sum of sincs to fix ringing is most simple. But 2D case somehow more complex - it also depends on sampling grid type. In addition to typically used squared grid - some like triangle is also possible and may be others. I still do not have example of perfectly balanced jincs placed in the nodes of squared sampling grid but hope it is possible with some set of weighting. At least JincResize of flat 2D field produces also non-ringed flat 2D field. So with some not too small sum of jincs the non-ringed 2D field is also possible.