PDA

View Full Version : Looking for info and opinions on lanczosresize


markrb
22nd October 2002, 05:37
I am trying to catch up with the latest beta of DVD2SVCD and all of it's additions. It seems you guys in the Avisynth world have been mighty busy and I am soaking in as much as I can about all the new stuff. It will take awhile I am sure. I have been reading as much as I can, but I am sure I may have missed a post or two so please forgive my sloppy searching.

This post is mostly about the new lanczosresize. I would very much like to know a little more about it and see how most feel about this method vs. Bicubicresize.

Is there any kind of strength field in the script? All I have seen is straight resize with no strength field like Bicubic has.

Addition to the DVD2SVCD.ini that DVD2SVCD posted reads:

[AVISYNTH_Lanczos3Resize]
0=LanczosResize(^TargetWidth,^TargetHeight)
1=AddBorders(0,^BorderTop,0,^BorderBottom)

Is there anything that can and/or should be added for more flexability?

Now onto the opinions.

How do you feel about this resize method compared to Bicubic on DVD source material going into a standard SVCD?

How about when the bitrate is raised well beyond the SVCD spec? Say to 4000Kbit Avg.

Any links or pointers to more info would be greatly appreciated. I did read up at the new avisynth.org (great little site), but the info on Lanczos3Resize is limted, at least what I could find.

Now I am off to look more into unfilter.

Thanks much,
Mark

cjv
22nd October 2002, 05:54
Unfortunately, I don't do many SVCDs (although I've done a few dozen), but coming from an XviD user, I would have to say that Lanczos has replaced BicubicResize for many.
It has almost the same sharpness and effect on compressibility as BicubicResize(0.75), but seems to reduce the ringing/mosquito noise that seems to come with using Bicubic(0.75).
Among the best modern resizing filters (and the only ones I would consider)..I would rank them from best to worst: LanczosResize->SimpleResize->BicubicResize(0.60)

From my observersations, many XviD users are now using Convolution3d() along with _always_ using LanczosResize(). Instead of using a less-sharp bicubic filter, we tweak the c3d() parameters. At least when using c3d() I can better control the amount of filtering, and using lanczos, it is just a given that it will not filter additionally.

For SVCD, I would try something like:
filtered=original.Convolution3(0,4,4,4,4,2.8.0).LanczosResize(x,y).unfilter(3,3)
...and go from there..using c3d() instead of the usual TemporalSmoother(2,1) and Unfilter(up to 5,5) instead of sharpen()
Good luck,

cjv
PS c3d() is kinda slow..so it may drop CCE down to 0.5 depending on CPU.

SansGrip
22nd October 2002, 06:00
This post is mostly about the new lanczosresize. I would very much like to know a little more about it and see how most feel about this method vs. Bicubicresize.

LanczosResize has no strength setting. It's roughly the same as a sharp bicubic (0, 0.75) but IMO makes much fewer artifacts.

I use it most of the time for DVD->VCD scaling, unless the source is already over-sharp, in which case I use some kind of bicubic (usually neutral).

Did you look at Convolution3D yet?

markrb
22nd October 2002, 07:38
Did you look at Convolution3D yet?

No I haven't. This is in fact the first time I have heard of using it with DVD material.
I am so far behind and in just a few weeks.
I must add that to my list to learn.
Can you point to some info on Convolution3D? I must admit I haven't even started looking, but if you have any info and links that is off of this forum(I can do a search) I would appreciate it if you would share.

cjv is there some sort of compromise speed wise between all those filters and still getting a decent quality picture? I think most people would never put up with .5 if they were use to 1.0 or higher.

Personally I have never much liked Bicubic at .75. I much prefered .60 myself.

In my first test between Bicubic .60 and lanczosresize without any additional filters I couldn't see much of a difference. My speed did seem to drop some with lanczosresize, but not much, maybe .10.

Thanks again,
Mark

Acaila
22nd October 2002, 09:45
When you have a video with very low quants (2 or 3) or high bitrate, using either Bicubic or Lanczos won't make much difference on compressibility. However once you get to the gray area (quants of 4, 5, 6 or medium to low bitrate) using Lanczos really cuts into the bitrate.
I've seen DVD's that averaged at a quant of 3.0 with Bicubic, but got an average of 3.5 with Lanczos. So blindly using Lanczos all the time is definately not a good way to go.

For this reason I wouldn't advise to ever use Lanczos on SVCD's unless you can seriously up the bitrate somehow (>2500). Because since it's only MPEG-2 you'll often be on the medium to low end scale with the bitrate you supply.

C3D could be a great help in decreasing the bitrate requirements, it really helps a lot, but unfortunately for clean DVD's you need really low settings otherwise you lose detail very fast.

markrb
22nd October 2002, 17:03
I feel like such a dummy.
Acaila could you explain it a little different? I think I got it, but most went a little over my head. I don't know what you mean by (quants of 4, 5, 6). What are quants?
Sorry if this is Avisynth 101.

So if I get you right I should use Lanczos for bitrates greater then 2500, but use Bicubic below it.

In terms of picture quality only which is better at a given bitrate?

Thanks again,
Mark

WarpEnterprises
22nd October 2002, 17:35
@acaila: using Lanczos really cuts into the bitrate.
you mean using a setting of c~0.7 with Bicubic makes a difference in compressibility?

Acaila
22nd October 2002, 19:14
@markrb:

Sorry, because I'm always dealing with MPEG-4 I'm used to talking/reading/thinking about quants, but I forgot that with MPEG-1/2 you never work with that.

When you use a filter that increases or maintains a lot of detail you force the codec to compress frames more in order to still reach the same filesize (=bitrate).

Lanczos keeps more detail than Bicubic, so it forces the video to be compressed more, hence lower quality, unless the bitrate is high enough to maintain high quality overall.

So if I get you right I should use Lanczos for bitrates greater then 2500, but use Bicubic below it.I never like using the term "bitrate", because it is so incredibly subjective. Some video have great quality at a given bitrate, other videos look like crap. So bitrate doesn't really say anything.

That's why I used the term "quant". The amount of quantization (reducing information in a block by dividing it by an integer, it's a part of the encoding process the codec does) that has been done on a frame points directly to the quality a frame has. But it's not really necessary to go deeper into this. Just think of it this way: the higher the quant, the lower the quality.

Basically, if the movie looks good with Bicubic, don't use Lanczos. But if the movie looks great with Bicubic then using Lanczos will increase the amount of detail without affecting the overal quality too much.

In terms of picture quality only which is better at a given bitrate?At a given bitrate Bicubic has a little less detail but a higher quality picture. Lanczos has a little more detail at the expense of some quality. The lower the bitrate the more impact on quality Lanczos has.

markrb
23rd October 2002, 04:04
I am really sorry if I come of as thick, but some of your terms seem confusing to me.

Here you say:

Lanczos has a little more detail at the expense of some quality.

I would think that the more detail the better the quality. Maybe it's just my way of thinking.

If Lanczos is always lower quality then Bicubic is there any reason to use it?
To me the trade off with Simple was speed. It didn't look as good to my eye as Bicubic, but it had a very good advantage of speed and you don't have this here.

At about what point can you safely say that Lanczos starts to outperform Bicubic or does it?
There are many that use DVD2SVCD to create DVD-R discs that can do 5000 Kbit Avg, which is almost as high as most DVD's. Is this a case where Lanczos actually creates a better image then Bicubic or does it never?

Thanks again,
Mark

cjv
23rd October 2002, 04:41
@markrb:

The best way I can describe the effects of lanczosresize is that it does not really filter your image at all. Think of when you resize your DVD from 720x down to 480x SVCD...the bicubic filtering < 0.65 introduces some smoothing. Using bicubic 0.75 will somewhat artificially sharpen the image..but it can alias it and make it look worse. Now think if you could have the same sharpness that you had at 720x, now at 480x. It produces a very sharp, clear image..but since most details are preserved when resizing (including any noise) a lot of the bitrate will be used up encoding the noise and details. That means it will keep more details, but the final image may very well look worse due to not enough bitrate.
Thus, without any pre-processing, I would not personally use lanczos resize with SVCD bitrates any less than 2100..and even that depending on the source.

In my opinion, a 5000Kb MPEG-2 encoding would MOST DEFINATELY look better using lanczos over bicubic..mainly because it better preserves the source by not introducing any unwanted filtering.

cjv

SansGrip
23rd October 2002, 05:03
Another consideration (as if you needed any more variables :D) is the resolution of the final result, and whether it's going to be displayed on a monitor or a TV. A TV (at least, a regular analogue one) by its nature has a great softening effect, whereas a monitor is designed to retain the sharpness of the image.

Since I mainly make XVCDs at 352x240 (2564 kb/s) for watching on TV, I usually use LanczosResize even though it has an impact on quality. Since a TV tends to soften, and 352x240 is such low resolution, I like to sharpen quite a bit. I think it gives a more pleasing result.

On the other hand, SVCD resolution is a pretty big step up, and looks significantly sharper on a TV (I find it's the doubled vertical resolution that is most responsible for making it look so much more crisp). If I were to make SVCDs I think I would probably use a neutral bicubic or even a bilinear, since by increasing the resolution you're having to encode many more pixels, and thus need a softer image to maintain quality.

By the way, when I talk about quality I mean the quantization level, which roughly speaking is how much of the original image the encoder throws away to make it fit into the bitstream.

Edit: You might want to check out this thread (http://forum.doom9.org/showthread.php?s=&threadid=35789) in the CCE forum on how quality relates to bitrate.

As always, the best thing to do is to experiment. But make sure you view the encodes on your target medium. For example, the best-looking clip viewed on your monitor is almost certainly not going to be the best seen on a TV.

HTH.

Edit 2: Oops, you asked about Convolution3D. Just do a search for that "word" and you'll find a ton of information.

Acaila
23rd October 2002, 09:15
Lanczos has a little more detail at the expense of some quality.
I would think that the more detail the better the quality. Maybe it's just my way of thinking.More detail means that more info has to be thrown away by the codec to reach the same filesize as when not using it, which in turn means lower quality. You can compare this with a sharpener filter. If you use it on an already low quality video it will actually turn out worse. When used on a high quality video it will increase crispness without leading to (visibly) lower quality.
If Lanczos is always lower quality then Bicubic is there any reason to use it?Not always lower quality, only lower quality when used with a relatively low bitrate.

Recommendations:
VCD: Don't use Lanczos
SVCD: Don't use Lanczos
DVD-R: Use Lanczos