View Full Version : avisynth
kxy
18th February 2003, 03:02
Hi guys,
I stayed up all night(more than 8 hours) reading through the xvid archive and avisynth archive, I see that Koepi and iago mentioned "LumaFilter(-2).UnFilter(-5,-5)" over and over again in several threads. I had played around with those lines myself in avscompare and saw the difference. Now here are some questions....
Question 1: When do you actually use UnFilter(-5,-5) and UnFilter(5,5)? I know the UnFilter(5,5) sharpen the picture thus preserves more detail, and UnFilter(-5,-5) soft the picture and give compressibility. To me UnFilter(-5,-5) make more sense since I am doing 1cd rips, so when would one use UnFilter (5,5)? Over something that is highly compressible(that seems quite rare if aim towards 1cd rips)? Can someone give me some specific examples?
Question 2:
Here is something iago mentioned in one of the old threads.
"For example, I still find a combo of "LumaFilter(-2)" with Marc's mpeg2dec3.dll for AviSynth 2.5 and Tom's "UnFilter" with very low settings (say UnFilter(-5,-5) or UnFilter(5,5) depending on the requirements of the source) very useful to get rid of the famous "black-blocking" issue.
This is one of the script that I grabbed from one of the older threads. Can this be used on a NOISY source or can this be used towards GENERAL CASES?
Why use LumaFilter(-2)? LumaFilter(-1) already seems darken the movie quite a bit, wouldn't LumaFilter(-2) be too dark?
Also can someone explain the logic behind using LumaFilter.Unfilter, C3D before the Lanczos? I mean this doesn't make sense to me. The first three cases slightly blur/blend the picture one way or the other, but Lanczos sharpens. :confused: The question is why in this particular order or set up?
# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\Convolution3DYV12.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnFilter.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnDot.dll")
# CROPPING
Undot()
crop(0,56,718,364)
LumaFilter(-2).UnFilter(-5,-5)
Convolution3d(preset="movieHQ")
# RESIZING
LanczosResize(544,400)
Thank you much for reading this long post.
iago
18th February 2003, 03:59
@kxy
Sorry I couldn't reply to your PM concerning the same issues, but sometimes I just feel too tired and simply do not have the energy to focus on details in some long posts. But as you brought the matter up to the forum, which is much better imho since different opinions will also arrive, I'll shortly try to answer your questions.
1) Yes, for 1CD rips I think it's more reasonable to go with UnFilter(-,-); unless the source is "extremely" compressible, which would really be a rare case when aiming for 1CD -as you have also mentioned-, or unless you have already filtered the source to death (such as cpu=6, bilinear resize, denoisers, DctFilter, etc. ;)) and want to regain some sharpness in the end with UnFilter(+,+).
2) Personally, I didn't like this script (order/choice of filter combination, etc.) and wouldn't use it like this in any of my rips. I don't know where you picked it from but I'm sure it's not mine for at least I do not use 544*xxx resolution in my encodes ;).
As for LumaFilter(-x) values, although black blocking is a known problem more or less with all MPEG-4 codecs, in my experience I can say that LumaFilter(-x) setting actually depends on the source itself, because while some sources exhibit the black-blocking problem more annoyingly some other sources might hardly display it or even not display it at all. Therefore, to make sure, I would suggest to do a couple of test encodes on some dark scenes before your actual encode (and preferably check the results with full brightness/contrast on your monitor or even better on TV if you can) to find the most proper LumaFilter(-x) setting for the source (in combination with UnFilter). At least that's what I do before starting an actual encode ;).
I hope this would be of some help to you.
best regards,
iago
kxy
18th February 2003, 04:12
iago,
Thanks for your quick answer.
2) Personally, I didn't like this script (order/choice of filter combination, etc.) and wouldn't use it in any of my rips. I don't know where you picked it from but I'm sure it's not mine for at least I do not use 544*xxx resolution in my encodes.
I copied all the interesting notes that I gathered from reading all the thread in the archive into a big text file. I couldn't really tell you whose script would be, perhaps the author would like to shin some light, or anyone else are welcome to speculate. If you(iago or anyone else) would to rearrange it, what order would it be. And if you don't like it then, what would your order/choice of filter combination be for a) typical modern movie(good transfer), b) typical classical movie(with some noise)?
frodoontop
18th February 2003, 09:04
What is the sense of first filtering the source really hard and then a sharp resize method. I only use LanczosResize when the source is really good. What I am proposing and what does work with most of my encodes is:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnFilter.dll")
MPEG2Source("D:\dvd\somename.d2v")
Lumafilter()
UnFilter(-5,-5)
crop(0,56,718,364)
BicubicResize(512,288,0.5)
BicubicResize is filtering the image for free, in fact it will work faster than Lanczos. See if this works for you.
iago
18th February 2003, 12:17
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnFilter.dll")
MPEG2Source("D:\dvd\somename.d2v")
Lumafilter()
UnFilter(-5,-5)
crop(0,56,718,364)
BicubicResize(512,288,0.5)Filtering the source before cropping -filtering the black bars with LumaFilter and UnFilter in this example ;)- is totally pointless. Also, there must be a typo in the BicubicResize values, which should be BicubicResize(512,288,0,0.5) I guess.
frodoontop
18th February 2003, 15:47
@iago
I thought that unfilter had problems with doing edges, so I put it before cropping. If you say it's useless, I'll guess you're right. Learning something everday here:D .
kxy
18th February 2003, 17:05
Originally posted by frodoontop
What is the sense of first filtering the source really hard and then a sharp resize method.
I believe Acaila answer this question in one of the old threads, see below. So after filtering, you still wants to keep the sharpest image of your results, therefore use LanczosResize.
Originally posted by Acaila
Use smoothing filters before resize if you want the highest quality. It's always been like that.
Yes it goes faster after resize, but you are also smoothing out the little bit of detail you have left. When done before resizing you work on the original picture which has more detail and greater dimensions to begin with so losing a bit won't be noticable.
Or using extremely low thresholds for your filter might work when done after resizing.
e.g.
Suppose you have a picture that is 100x100 and you average every first and second pixel with eachother.
Now take the original 100x100 picture, resize it to 32x32 and again average every first and second pixel with eachother.
Which do you think looks better?
frodoontop
18th February 2003, 17:40
Originally posted by Acaila
Use smoothing filters before resize if you want the highest quality. It's always been like that.
That's not in violation with what I said, is it? I didn't use any filtering after resizing. Resize was the last part in the script.
kxy
18th February 2003, 23:01
Originally posted by frodoontop
That's not in violation with what I said, is it? I didn't use any filtering after resizing. Resize was the last part in the script.
No it is not. But I believe that your question is "What is the sense of first filtering the source then sharpen it?"
Anyways, anyone care to critize what is wrong with above mentioned script or why the dislikes of the ordering? I test a few movies with it, to my surprise, the results are pretty good! The only downside is that the image is a bit softer(not very noticeable if you dont't pause and zoom in 50X).
I re-copy and pasted script below.
# CROPPING
Undot()
crop(0,56,718,364)
LumaFilter(-2).UnFilter(-5,-5)
Convolution3d(preset="movieHQ")
# RESIZING
LanczosResize(xxx,xxx)
birdy
18th February 2003, 23:27
I just have one question!
When I frame serv with the settings and filters you guys mention my cpu load (p4 2.4) is already arround 90 to 96 % !
Is this normal?
peaudepailles
19th February 2003, 02:31
Hi all,
I've a question too.
Well my english is far from perfect and i may missed something...
Well use Filtering beetween Crop and resize seems more logical to me.
Like Acaila said:
"it goes faster after resize, but you are also smoothing out the little bit of detail you have left. When done before resizing you work on the original picture which has more detail and greater dimensions to begin with so losing a bit won't be noticable."
Now my question wich is for all (but maybe more for iago) <== what a lucky boy you are !! :):
# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\Convolution3DYV12.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnFilter.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\UnDot.dll")
# CROPPING
Undot()
crop(0,56,718,364)
LumaFilter(-2).UnFilter(-5,-5)
Convolution3d(preset="movieHQ")
# RESIZING
LanczosResize(544,400)
"I didn't like this script (order/choice of filter combination, etc.)"
Speaking only about the order (not about the filters combination):
1.Crop
2.Use whatever filters'combination you need
3.Then resize
Do you (iago and everybody of course ;) !) think there is something wrong with this order ?
@ iago:
No offense of course I just try to understand and like frodoontop I 'm learning everydays ;)
Thanks in advance.
Peaudepailles
iago
19th February 2003, 13:19
Originally posted by peaudepailles
1.Crop
2.Use whatever filters'combination you need
3.Then resize
Do you ... think there is something wrong with this order ?
No ;).
edit - btw, iago, who has mostly misspent his good old boyhood days, is unfortunately in his mid-thirties now! :D
peaudepailles
19th February 2003, 14:52
what a lucky boy you are !!
Maybe not as lucky as I was thinking first -lol-
In about 10 years I probably will understand ...
Anyway, Thanks !
Peaudepailles
Nothing can replace Experience ... ;)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.