Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st February 2015, 15:27   #1  |  Link
Divet
Registered User
 
Join Date: Dec 2007
Posts: 16
SincResize taps=128

Hi!
Could anybody answer, does the taps parameter of SincResize really work?
I've tried taps=128, taps=256, taps=512 and see no difference!
It's impossible because such giant taps must produce giant ringing halo and must reduce the speed almost to zero!

taps=20 and taps=10 looks the same as taps=512! No ringing at all!

Is this parameter completely disabled?
If yes, how many taps does SincResize use instead?
Divet is offline   Reply With Quote
Old 1st February 2015, 16:02   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Divet View Post
Hi!
Could anybody answer, does the taps parameter of SincResize really work?
I've tried taps=128, taps=256, taps=512 and see no difference!
It's impossible because such giant taps must produce giant ringing halo and must reduce the speed almost to zero!

taps=20 and taps=10 looks the same as taps=512! No ringing at all!

Is this parameter completely disabled?
If yes, how many taps does SincResize use instead?
The documentation would suggest that "taps" gets clamped to 20 for sincresize.

A look at the code confirms it:
Code:
/***********************
 *** Sinc filter ***
 ***********************/
SincFilter::SincFilter(int t = 4) {
   taps = (double)(max( 1,min(20,t)));
}

Last edited by Groucho2004; 1st February 2015 at 16:05.
Groucho2004 is offline   Reply With Quote
Old 1st February 2015, 16:31   #3  |  Link
Divet
Registered User
 
Join Date: Dec 2007
Posts: 16
Quote:
Originally Posted by Groucho2004 View Post
taps = (double)(max( 1,min(20,t)));
Oh, thanks!
So, if taps>20 than 20 uses!

But I am confused that I can't see any difference between taps=10 and taps=20. Why?

Could You look to the screenshots, please? taps=10 and taps=20 are almost identical!

taps=10
taps=20

Last edited by Divet; 1st February 2015 at 17:16.
Divet is offline   Reply With Quote
Old 1st February 2015, 19:38   #4  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Divet View Post
But I am confused that I can't see any difference between taps=10 and taps=20. Why?
I can clearly see a difference.
Try this script to visualize and amplify the difference:
Code:
a = imagesource("10.png")
b = imagesource("20.png")
Overlay(a, b, mode="Subtract").Levels(0,5,100,0,255)
Groucho2004 is offline   Reply With Quote
Old 1st February 2015, 23:49   #5  |  Link
Divet
Registered User
 
Join Date: Dec 2007
Posts: 16
Quote:
Originally Posted by Groucho2004 View Post
I can clearly see a difference.
I am sorry, this is because these are not the same frames (frame number from the beginning).

Now I write this script:

FFVideoSource("D:\Kiki.mkv")
a=SincResize(1280,720,taps=1)
b=SincResize(1280,720,taps=20)
Overlay(a,b,mode="Subtract")

Kiki.mkv is BDRemux 1920x1080

Result - Oh My God, absolutely black rectangle!
So, the taps parameter is ignored. It's terrible!
But no, I'm mistaken! Taps aren't ignored!
Next I tried this:

FFVideoSource("D:\Kiki.mkv")
a=SincResize(640,360,taps=1)
b=SincResize(640,360,taps=20)
Overlay(a,b,mode="Subtract")

And now I see something. A few white curves and stars.

Does it mean that the difference between taps=1 and taps=20 is very, very little and is practically visible only if resize ratio is very, very big?

But where are giant ringing artefacts which must be produced by taps=20? I don't understand this...

Last edited by Divet; 1st February 2015 at 23:52.
Divet is offline   Reply With Quote
Old 2nd February 2015, 00:39   #6  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Try comparing two completely different resizers like this:
Code:
a=bicubicResize(640,360)
b=spline64Resize(640,360)
Overlay(a,b,mode="Subtract").Levels(0,5,100,0,255)
Even with enhanced levels you can barely see the difference. Maybe you should try Compare().
Groucho2004 is offline   Reply With Quote
Old 3rd February 2015, 01:55   #7  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,565
Why would you assume you'll get giant horrifying ringing artifacts with 20 taps? The effect of each further tap is reduced exponentially; by the time you get to 6 or 7 you're probably already below the precision floor of 8-bit video. (I don't feel like doing any math right now.) Using 10 or 20 only makes your CPU burn extra calories on the treadmill.

With 16 bit video there might be a minute difference, but it would never be visible.
foxyshadis is offline   Reply With Quote
Old 3rd February 2015, 06:45   #8  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,350
You certainly aren't the only person to think this, but it isn't true.

The normalised sinc function is given by sin(pi*x)/(pi*x). from this it should be clear that the sinc function decays linearly as you move away from the origin. Its decay is directly analogous to the decay of the function 1/x.

It is easiest to show the ringing cause by large tap sinc filters unambiguously using very large images. Make sure to view them at a 1 to1 zoom or the ringing may not be visible.

10 tap sinc
256 tap sinc
*.mp4 guy is offline   Reply With Quote
Old 10th February 2015, 01:11   #9  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
One interesting tidbit about sinc interpolation is that it's not guaranteed to converge as you increase the number of taps because it's not absolutely convergent. For a particularly pathological case, try working out what truncated sinc interpolation does to …,0,1,0,1,0,1,1,0,1,0,1,0,…

In other words, not only does sinc decay slowly, there isn't even a large number of taps such that the error will always fall below −48 dB (or any arbitrary threshold).

(When working with images of bounded size, though, sinc will always converge under the assumption of reasonable border handling, such as tiling, mirroring or extension.)
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!

Last edited by colours; 10th February 2015 at 01:17.
colours is offline   Reply With Quote
Old 10th February 2015, 09:36   #10  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,048
Quote:
Originally Posted by foxyshadis View Post
Why would you assume you'll get giant horrifying ringing artifacts with 20 taps? The effect of each further tap is reduced exponentially; by the time you get to 6 or 7 you're probably already below the precision floor of 8-bit video. (I don't feel like doing any math right now.)
Here you are - Sinc with ω=0.495 (at 13.5Mhz sample rate this should give somewhere 6.68 MHz bandwidth)

Code:
55,55,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,57,53,57,53,57,53,57,53,57,53,57,235,57,53,57,53,57,53,57,53,57,53,57,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,53,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,56,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,54,55,55,55,55,
It still rings after over 150 taps... and this why you need to window it...
pandy is offline   Reply With Quote
Reply

Tags
resizing, ringing halo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.