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 13th March 2017, 00:30   #81  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Here http://avisynth.nl/index.php/Resampl...line_resampler
Wilbert is offline   Reply With Quote
Old 13th March 2017, 18:53   #82  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by Wilbert View Post
Unfortunately, that's not noticeably more legible.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 13th March 2017, 19:17   #83  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Katie Boundary View Post
Unfortunately, that's not noticeably more legible.
Increase the font size in your browser settings.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 13th March 2017, 23:37   #84  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
A friend once said in relation to an algorithm he was trying to explain, "I can say it again with more words, but I can't make it easier to understand".
TheFluff is offline   Reply With Quote
Old 14th March 2017, 02:16   #85  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by turbojet
I see a noticeable improvement of spline144 over spline100. Would spline196 or even spline256 bring further improvement?
Not necessarily in terms of visual quality; Spline64Resize is fine for almost any sources quality wise. Having more sample points doesn't necessarily mean more visual quality even 'cause, depending on the sources, it may be really barely noticeable.

Quote:
Originally Posted by Katie
Unfortunately, that's not noticeably more legible.
Maybe you could try to tell us what you don't get of that explanation.

Quote:
Originally Posted by Groucho2004
Increase the font size in your browser settings.
Rotfl.

Quote:
Originally Posted by TheFluff
A friend once said in relation to an algorithm he was trying to explain, "I can say it again with more words, but I can't make it easier to understand".
True.
FranceBB is offline   Reply With Quote
Old 20th March 2017, 20:10   #86  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Neither spline resize neither Avisynth Bicubic resize are accurate, mathematically, like Bicubic interpolation explained in https://en.wikipedia.org/wiki/Bicubic_interpolation, if I am not wrong, due to, in Bicubic interpolation, to be computed the first and second image derivatives.
__________________
Searching for great solutions

Last edited by luquinhas0021; 21st March 2017 at 12:39.
luquinhas0021 is offline   Reply With Quote
Old 21st March 2017, 03:03   #87  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
sinc is the most mathematically accurate resampling filter
feisty2 is offline   Reply With Quote
Old 21st March 2017, 09:17   #88  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
This all depends a bit on which task we're talking about. But if it's image upscaling, then let me say:

The problem with linear filters is that they don't treat high-contrast edges any differently than smooth areas. If you downscale a "groundtruth" image, then upscale it again, using linear filters, and if you then use PSSR or SSIM to compare the down+upscaled image to the original image, all linear filters produce *very* bad results. So no offense, but IMHO no linear filter is even remotely mathematically accurate, at least when talking about upscaling. If you want accurate results, you need an algorithm which adapts to high contrast edges.
madshi is offline   Reply With Quote
Old 21st March 2017, 12:26   #89  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
sinc is the most mathematically accurate resampling filter

Is the most accurate when the sample satisfies the Nyquist-Shannon sampling condition.

This all depends a bit on which task we're talking about. But if it's image upscaling, then let me say:
The problem with linear filters is that they don't treat high-contrast edges any differently than smooth areas. If you downscale a "groundtruth" image, then upscale it again, using linear filters, and if you then use PSSR or SSIM to compare the down+upscaled image to the original image, all linear filters produce *very* bad results. So no offense, but IMHO no linear filter is even remotely mathematically accurate, at least when talking about upscaling. If you want accurate results, you need an algorithm which adapts to high contrast edges.


The comparative, by P.S.N.R and S.S.I.M, between an original H.R image and an upscaled downscaled original H.R image only makes sense if the downscaler that was used be good, near perfect. Whatever be the upscaling, the goodest it be, it can not recover an image that was destroyed by a bad quality downscaler.

Madshi, "high contrast edges" and "smooth regions" can means the local contrast that a pixel has with it m x n neighborhood, means the high and low frequencies that an image has when is applied to it a frequency domain operator or can it means the pixel derivatives (Central operator)?
__________________
Searching for great solutions

Last edited by luquinhas0021; 21st March 2017 at 12:45.
luquinhas0021 is offline   Reply With Quote
Old 21st March 2017, 12:55   #90  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
What I mean is that when you apply linear resampling "across" a strong edge, linear filtering will either blur & bloat (make fatter) the edge or add ringing artifacts, or both, depending on which linear resampling filter you're using. sinc helps avoiding blur and bloating, but adds an atrocious amount of ringing. Resamplers like spline add much less ringing artifacts, but still some, and add blur & bloat.

My explanation is probably less scientific than you may be looking for. I prefer looking at the practical output of algos, instead of theorizing over frequency domain stuff.
madshi is offline   Reply With Quote
Old 21st March 2017, 13:04   #91  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Your explanation helped me.

By "linear upscaling operator", do you want mean those operators that are derived from the solving of a set of p x q linear equations (Or it derived discrete form)?
__________________
Searching for great solutions
luquinhas0021 is offline   Reply With Quote
Old 10th April 2017, 06:17   #92  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by TheFluff View Post
A friend once said in relation to an algorithm he was trying to explain, "I can say it again with more words, but I can't make it easier to understand".
I don't need more words, I just need less math... unless those words are an explanation of what the variables mean in the math. For example, "s(x) = sum_n s(n*T) * sinc((x-n*T)/T" might make more sense if someone explained what s, sum_n, n, and T were supposed to mean.

Quote:
Originally Posted by FranceBB View Post
Not necessarily in terms of visual quality; Spline64Resize is fine for almost any sources quality wise. Having more sample points doesn't necessarily mean more visual quality even 'cause, depending on the sources, it may be really barely noticeable.
It's not always even a matter of "barely noticeable". Some algorithms start to look WORSE when the number of taps goes above a certain number. High-tap windowed sinc filters, for example, just add more/worse ringing without increasing sharpness. In the synthetic benchmarks that I ran a few weeks ago, 4-tap Lanczos outperformed both 3-tap and 5-tap, and 3-tap outperformed 5-tap.

Quote:
Originally Posted by FranceBB View Post
Maybe you could try to tell us what you don't get of that explanation.
If I had to pick one thing to start with, I'd start with an explanation of how a function can be cubic when it uses more than four control points. I read somewhere that any function going through N control points can see X raised to an exponent as high as N-1...

Quote:
Originally Posted by luquinhas0021 View Post
Is the most accurate when the sample satisfies the Nyquist-Shannon sampling condition.
...which, when dealing with images, is never
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 10th April 2017, 21:26   #93  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by Katie Boundary View Post
I don't need more words, I just need less math... unless those words are an explanation of what the variables mean in the math. For example, "s(x) = sum_n s(n*T) * sinc((x-n*T)/T" might make more sense if someone explained what s, sum_n, n, and T were supposed to mean.
Did you click and read the wikipedia link that says where the maths come from?

Quote:
The symbol T = 1/fs is customarily used to represent the interval between samples and is called the sample period or sampling interval. And the samples of function x(t) are commonly denoted by x[n] = x(nT) (alternatively "xn" in older signal processing literature), for all integer values of n. A mathematically ideal way to interpolate the sequence involves the use of sinc functions. Each sample in the sequence is replaced by a sinc function, centered on the time axis at the original location of the sample, nT, with the amplitude of the sinc function scaled to the sample value, x[n]
Quote:
Originally Posted by Katie Boundary View Post
If I had to pick one thing to start with, I'd start with an explanation of how a function can be cubic when it uses more than four control points. I read somewhere that any function going through N control points can see X raised to an exponent as high as N-1...
You probably misunderstood what you read then, because the order of the polynomials and the number of control points have nothing to do with each other. The cubic spline is called cubic because each piece (the curve between one control point and the next) is expressed as a third order polynomial. http://mathworld.wolfram.com/CubicSpline.html

Last edited by TheFluff; 10th April 2017 at 21:38.
TheFluff is offline   Reply With Quote
Old 21st September 2022, 17:24   #94  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by TheFluff View Post
Did you click and read the wikipedia link that says where the maths come from?
What wikipedia link?

Quote:
Originally Posted by TheFluff View Post
You probably misunderstood what you read then, because the order of the polynomials and the number of control points have nothing to do with each other.
No, what I read was very explicit and unambiguous about that fact.

Quote:
Originally Posted by TheFluff View Post
The cubic spline is called cubic because each piece (the curve between one control point and the next) is expressed as a third order polynomial. http://mathworld.wolfram.com/CubicSpline.html
Yes, I knew that already. And cubic splines are derived from four control points, which is why they don't need to raise x to any power higher than 3.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 21st September 2022, 22:57   #95  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
What wikipedia link?
Presumably post #86.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 21st September 2022, 23:59   #96  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by StainlessS View Post
Presumably post #86.
Hmmm. I can't find the quoted passage in that article.


EDIT:

I've been able to compare different filter shapes using Desmos graphing calculator, and I'm convinced that 2-tap Lanczos approximates Catrom more closely than any other 2-tap windowed sinc filter (Blackman, Hann, Hamming etc). I'd like to put it up against Spline16 and 2-tap Lagrange, but I have no idea what formulae they use.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.

Last edited by Katie Boundary; 22nd September 2022 at 06:58.
Katie Boundary is offline   Reply With Quote
Old 5th October 2022, 00:15   #97  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
I'm running some side-by-size PSNR tests. There's DEFINITELY something wrong with Spline100. It's performing much worse than literally everything except Linear.

EDIT: something is also wrong with Spline144, though it's not as bad as Spline100. Someone needs to triple-check that the code and coefficients are correct.

EDIT 2: I did a visual check. Spline100 is much blurrier than Spline64 or Spline144.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.

Last edited by Katie Boundary; 6th October 2022 at 04:38.
Katie Boundary is offline   Reply With Quote
Old 20th June 2023, 15:19   #98  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
In retrospect, the fact that Spline36 is sharper than Spline64 should have warned us that something was very wrong with the entire Spline theory/methodology to begin with. Spline100 and Spline144 just made that fact more obvious. I don't think it's a problem with the code being written incorrectly or the coefficients being calculated incorrectly. It's a Spline problem.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Reply

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 11:40.


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