AVS Forum banner

Status
Not open for further replies.
21 - 40 of 111 Posts

·
Registered
Joined
·
4,037 Posts
Quote:
Originally posted by dmunsil
The big, big downside to long filters is that they exhibit excessive ringing on sharp transitions. You can't see it in this particular sample, but it's pretty easy to see on suitably sharp material, and it varies in visibility depending on the scaling ratio. Many of the test patterns in Avia show it off quite well. Titles on video often show little halos around them when many-lobe filters are being used. I see it on the Alias discs and it bugs the heck out of me.
Right ON! FFDShow Lanczos >4 (meaning 5,6,7,8,9,10) gives heavy ringing around vertical line. Many people complain about EE and yet they apply so much sharpen on the image...


regards,


Li On
 

·
Registered
Joined
·
491 Posts
I am amazed this thread hasn't gotten more attention! I mean you have someone like Don Munsil in here discussing the pros and cons of various scaling algorithms but only a few take the opportunity to develop it further.


As an example of wisdom in here, Don has explained that the various Lanczos values do not equal the number of taps but the number of lobes in the scaling, and still people are refering to taps when they are talking about e.g. Lanczos4 vs Lanczos10. Even Vlad does :).


I would like to hear from Don what he thinks would be the optimal resize strategy given the algorithms available in ffdshow & graphic cards for various input and output resolutions. Time to back up the current theories with some science.


If you are not familiar with them all Don I'd be more than happy to list them for you.
 

·
Registered
Joined
·
1,638 Posts
I agree NiToNi. Its reminds me of gamers thry to get the highest FPS but in this case its who can run the highest Lanczos without really knowing whats going on. I had dropped back to Lanczos2 after reading Dons posts.
 

·
Registered
Joined
·
3,510 Posts
Discussion Starter #24
Quote:
Right ON! FFDShow Lanczos >4 (meaning 5,6,7,8,9,10) gives heavy ringing around vertical line. Many people complain about EE and yet they apply so much sharpen on the image...


regards,


Li On
Personally, I use Lanczos at 4 taps with it's luma sharpening set to only 0.5 at most and I don't stack the sharpness filter on top of that after. Lanczos 4 by itself is so good already. So good that SWE3:AOTC actually looks detailed and crisp, not soft and gauzy as with bicubic.
 

·
Registered
Joined
·
133 Posts
Quote:
Originally posted by NiToNi
I am amazed this thread hasn't gotten more attention! I mean you have someone like Don Munsil in here discussing the pros and cons of various scaling algorithms but only a few take the opportunity to develop it further.
Hey, I'm fascinated by Don's comments .. but no way am I equipped to enter a discussion on the subject, being completely ignorant about it, my entire knowledge is based on what I've read on here in conncection with FFDSHOW. :D


If there's anything that I would ask is what the luma and chroma sharpening effects of Lanczos are intended to achieve, because while I can see a slight sharpening with luma, I see no change at all with chroma?
 

·
Registered
Joined
·
107 Posts
Quote:
Originally posted by Jesse S
Fair enough, here are perfectly matched frames for 4 and 10-tap Lanczos and bicubic.


However, this time unlabelled :)

thegame.zip (1.8mb)


Be sure to list


A -

B -

C -


with what you think each is. Bicubic is easy, but what about 4 vs 10?
The link doesn't seem to work anymore...
 

·
Central Scrutinizer
Joined
·
8,301 Posts
Quote:
I am amazed this thread hasn't gotten more attention! I mean you have someone like Don Munsil in here discussing the pros and cons of various scaling algorithms but only a few take the opportunity to develop it further.
I'm not. Science and religion don't mix well, and many people would rather continue believing on blind faith rather than be presented with facts. Facts just tend to cloud the issues and are not going to change anyone's religion anyway, so why discuss them?
 

·
Registered
Joined
·
491 Posts
Quote:
Originally posted by Li On

FFDShow Lanczos >4 (meaning 5,6,7,8,9,10) gives heavy ringing around vertical line. Many people complain about EE and yet they apply so much sharpen on the image...

But even Lanczos4 rings pretty badly Li On...

Quote:
Originally posted by Mad Chemist
I had dropped back to Lanczos2 after reading Dons posts.
How did that work out for you Greg? Did you feel you had to compensate for that by adding another kind of sharpness filter in the chain?

Quote:
Originally posted by Jesse S
Personally, I use Lanczos at 4 taps...
Jesse, Lanczos4 does not equal 4 taps but 4 lobes. What that actually means in layman terms is one of those things we should have taken the opportunity to ask Don about.


Look, the man has written software for several highly regarded scalers and apparently has a better understanding of as well as practical experience from scaling in video applications than many academic "authorities" who have written books on the subject. He has for a long time been one of the greatest profiles in the wonderful world of video and is currently working for Microsoft to develop MCE along with Stacey Spears.


If he would grace the HTPC community with some seriously good advice on how to best set up ffdshow for resize and sharpening (and why), that would be pretty fantastic. Heck, he could even lay out the perfect scaling algorithm for us and someone like Andy or his like could then write the necessary code and integrate it into ffdshow itself. Now, that would be sensational... :)

Quote:
Originally posted by KraGorn
Hey, I'm fascinated by Don's comments .. but no way am I equipped to enter a discussion on the subject, being completely ignorant about it, my entire knowledge is based on what I've read on here in conncection with FFDSHOW. :D
Well, I feel the same way Robin, but you've got to ask to learn anything, haven't you? :D

Quote:
Originally posted by KraGorn
If there's anything that I would ask is what the luma and chroma sharpening effects of Lanczos are intended to achieve, because while I can see a slight sharpening with luma, I see no change at all with chroma?
Good question. Let's hope he or anyone else with a solid understanding of this stuff chimes in...
 

·
Registered
Joined
·
491 Posts
Quote:
Originally posted by Bob Sorel
I'm not. Science and religion don't mix well, and many people would rather continue believing on blind faith rather than be presented with facts. Facts just tend to cloud the issues and are not going to change anyone's religion anyway, so why discuss them?
Well said. So you're an HTPC agnostic then... :)
 

·
Registered
Joined
·
1,280 Posts
Quote:
Originally posted by Jesse S
So good that SWE3:AOTC actually looks detailed and crisp, not soft and gauzy as with bicubic.
SWE2 perhaps? :) hehe


the link doesn't work for me either :(
 

·
Registered
Joined
·
1,005 Posts
Lobes vs. Taps. The short version.



Any signal-processing filter has "taps" which are the discrete input values that are used to calculate each output value. In audio processing it's pretty straightforward - a 20-tap FIR resampling filter takes 20 audio samples, multiplies each by one value in a 20-element filter "kernel," adds all the results together, and spits out a single output sample. Lather, rinse, repeat. In video it's a little different, but that's the rough idea.


When a filter is based on a windowed sinc function (sinc is (sin(x)/x)), it's convenient to talk about the number of lobes of the sinc function that are being used. X=0 to X=pi is one lobe. X=pi to X=2pi is another lobe. X=2pi to X=3pi is another lobe and so forth. Because all windowed FIR sinc filters are symmetrical around 0, we only talk about the number of lobes on one side of 0. There are an equal number of lobes on the the other side.


So when people talk about Lanczos2, they mean a 2-lobe Lanczos-windowed sinc function. There are actually 4 lobes -- 2 on each side. The function, graphed in the range -2pi to 2pi looks kinda like a sombrero. I've attached a graph of Lanczos2. Catmull-Rom looks almost identical, but is not a windowed sinc filter, or in fact any kind of sinc filter. The fact that two resizing filters created using completely different mathematical principles look almost identical is not a coincidence, but understanding why it turned out that way was certainly a big ah-ha! moment for me. And way too complicated to explain here, sadly.


For upsampling (making the image larger), the filter is sized such that the entire equation falls across 4 input samples, making it a 4-tap filter. It doesn't matter how big the output image is going to be - it's still just 4 taps. For downsampling (making the image smaller), the equation is sized so it will fall across 4 *destination* samples, which obviously are spaced at wider intervals than the source samples. So for downsampling by a factor of 2 (making the image half as big), the filter covers 8 input samples, and thus 8 taps. For 3X downsampling, you need 12 taps, and so forth.


The total number of taps you need for downsampling is the downsampling ratio times the number of lobes, times 2. And practically, one needs to round that up to the next even integer. For upsampling, it's always 4 taps.


So a 2-lobe (which is really a 4-lobe) Lanczos filter could require any number of taps. To downsample a 1080p image down to 108 pixels high would require 40 taps.


All of these numbers are, of course, just in one dimension. To get the full number of taps required for an output pixel, you would theoretically calculate the number of taps required in each dimension (height & width) and then multiply them together. So upsampling would require 4x4=16 taps. By convention, though, we still call that a 4-tap filter (unless we're in marketing, and then we call it a 48-tap filter: 16 taps times 3 components R, G, and B
).


Practically speaking, for performance you would always scale the image in two passes, which is perfectly kosher (or at least it is with these filters, which are *separable*, meaning that we can apply them separately in X and Y and get the same result as applying the combined filter). Conceptually you scale just in the width dimension into a new buffer that is as wide as the target image and as high as the original. Then you scale that intermediate image just in the height dimension into a final target buffer. Thus in the upsampling case you are applying two 4-tap filters instead of a single 16-tap filter.


Again, there are a huge number of practical considerations. You end up pipelining things very differently than the "conceptual" algorithm, mainly to maximize cache coherency. In order to do any kind of arbitrary scaling, you need to calculate a large number of filter kernels, as the phase between the input and output samples changes as you work your way across the image.


Man, if that's the short version I hope I never have to write the long version. Again, the thing to do if you want to understand practical scaling algorithms is to read the Turkowski paper I referenced earlier in the thread and read the code for Paul Heckbert's "Zoom" (it's not the cleanest code in the world, but understanding why he does various things is a real education). Start there and then branch out.


And if you have questions, you can always email me. My email address is not hard to find. I can't always promise I can answer every question, as among other things some of the stuff I'm doing right now with scaling is about to be patented, but I'm happy to steer folks in the right direction.


As for the questions about the best ways to use ffdshow, I have to admit that I don't know. At home I use the scaler built into the VW10HT, which looks to me like a basic bicubic, which is perfectly fine. At work I use my own scaler. I don't really have time to evaluate ffdshow extensively.


I will say that I am adamantly against filters with more than 2 lobes when scaling images. Their advantage is extra sharpness, but they ring like crazy. In my own scaler, I adjust sharpness by combining a modified sharpening kernel with the basic scaling kernel. It makes the image just as sharp as a multi-lobe Lanczos, but without the multi-lobe ringing.


Don
 

·
Registered
Joined
·
1,005 Posts
Here's Lanczos3.
 

·
Registered
Joined
·
1,005 Posts
Here's Lanczos10. The extra-deep first negative lobe (from 1 tp 2 and -1 to -2) gives you the extra sharpness, but all the other lobes (beyond 2 and -2) produce annoying fringes around sharp edge transitions. Bleah.


The perception of sharpness in an image scaling filter is almost entirely related to the depth of the first negative lobe. The more lobes you put on a Lanczos (or any other windowed sinc) the deeper the first negative lobe gets. But that's an incredibly pricey way to deepen the negative lobe, and has ugly side effects. There are lots of other ways.
 

·
Registered
Joined
·
9,884 Posts
Wow, great thread. Especially thanks Don.

Quote:
More taps does make the image greener. Why?
That shouldn't be happening. But when working with integer arithmatic it is possible when you aren't careful to have a slight downward truncation bias. And when working in YUV color spaces this will appear as a greenish shift.


Don -


You've suggested, and I believe, that different algorithms may be appropriate depending upon whether you are upscaling or downscaling. Any further comment?


And if you are willing, any comments on downscaling when you expect to upscale again later? (very often the case, so it could be optimized with that intent)


- Tom
 

·
Registered
Joined
·
2,164 Posts
I am very excited to see how this thread matures, hopefully it will gain as much momentum as some of the other monster threads, this has been very enlightening indeed.


Cheers...

Duy-Khang Hoang
 

·
Registered
Joined
·
5,580 Posts
Quote:
You've suggested, and I believe, that different algorithms may be appropriate depending upon whether you are upscaling or downscaling. Any further comment?
We are using Catull-Rom for both up and down scaling.


I was hoping to include some split-screen resize demos (2-lobe vs. 4-lobe vs. 10-lobe) on the upcoming DVE Pro (WMV HD discs), but I did not have time. There is a really cool color space demo that I am proud of.

Quote:
And if you are willing, any comments on downscaling when you expect to upscale again later?
Not sure I understand. What is the scenario?


Personally, keep the image as big as possible for as long as possible. We recently started off with some 4096x1714 content. It was 16-bit per channel (4:4:4) or RGB48. The end results was 1280x536 8-bit 4:2:0.
 

·
Registered
Joined
·
335 Posts
In another thread that I forget Chalres Black posted some scope pictures of ffdshow scaling and the ringing on all Lanczos options was pretty obvious...
 
21 - 40 of 111 Posts
Status
Not open for further replies.
Top