Log in

View Full Version : LimitedSharpenFaster and PixieDustPP


Bankis
12th January 2007, 01:27
I would like to ask Didee as I know he is the master in this field ;)

I'm thinking of using LSF & PixieDustPP for sharpening a DVD as without sharpening it gets a little blurry.

Import("LimitedSharpenFaster.avs")
Import("PixieDustPP")
LoadPluginEx("DustV5.dll")
LoadPlugin("masktools.dll")
... #other loading

... #cropping & etc

# original script was
#Undot()
#ConvertToYUY2().PixieDust(2).ConverttoYV12()
#LimitedSharpen().Undot()

RemoveGrain(mode=1)
ConvertToYUY2().PixieDustPP().ConverttoYV12()
LimitedSharpenFaster()
RemoveGrain(mode=1)

Is this script good enough for my task? do I need somehow to modify it? As I have read, Undot() is equal to RemoveGrain(mode=1) is it so? what about mode=2? should I leave default Pixie & LSF modes/limits?
does conversion to the from YV12 to YUV2 and back to YV12 have impact on quality (if noticeable)?

What would you suggest for sharpening good quality DVD (without noise). If I want light sharpening, should I use PixieDustPP (default mode?) or FaerieDust()? maybe for light denoising to stick with FluxSmooth?

sorry for so many questions in one place, thnx

Didée
12th January 2007, 22:57
What would you suggest for sharpening good quality DVD (without noise). If I want light sharpening, should I use PixieDustPP (default mode?) or FaerieDust()? maybe for light denoising to stick with FluxSmooth?

Usually and generally, I refuse to give any of such recommendations like what kind of filtering to use for what kind of material. "Good quality" lies in the eye of the beholder. Same for "little (no) noise". Same for sharpness.
For me, the only "safe" way of figuring which filters to use, is to look closely at the actual source material. Even some minor changes in the characteristics may turn a good fitting filterchain into a suboptimal one. And that's exactly why recommending something into-the-blue makes little sense.

If your ratings are correct, then it's quite easy:

- if the source has (really!) "good quality", then sharpening is not needed. :)

- if the source has "no noise", then Faery/Pixie/Flux/whatever are not needed. :)


However, despite giving no "general" recommendations ...
If the source is "reasonably good" and has "moderately low" noise, then you can't do much wrong with your posted script. (SeeSaw might give a bit more liveliness, though.)


BTW, PixieDustPP has some mild sharpening already included, to counteract the slight blurring of PixieDust. Look at the description.

HeadBangeR77
13th January 2007, 23:20
Hi,

I'm currently dealing with similar problem (if that's a problem at all ;) ) - pretty good DVD source, on which I've been experimenting and learing for the last few weeks (The Curse of the Black Pearl), and theoretically almost no noise. When I decided to sharpen it just a little bit with LSF, then suddenly much noise appeared and the bitrate went up. Therefore I examined the source more thoroughly and discovered, the noise was in the source as well (just in some scenes).

I read through the whole fft3dgpu's thread, read the included instructions of both the original and gpu filter, read more about LSF, made whole lot of samples and... All that denoising, sharpening and denoising again (e.g. with RemoveGrain(mode=1)) produces the endeffect very similar to the original source video, just the processing lasts much longer :P

Some decent, yet subtle sharpening effect makes sense imho only then, when after the denoising and sharpening no additional filters (dealing with noise, grain, blurring, sharpening etc.) are applied. I mean the sharpening goes at the very end of that part of my script. What's the point in removing noise & some details, adding details and noise, and denoising again, no matter how subtle the effects would be? I prefer to denoise and sharpen. Point. I only sharpen less, so that less unwanted side-effects appear. Here is what works best for me:

# Created by HeadBangeR77

# PLUGINS
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\FFT3dGPU.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\MaskTools.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\RemoveGrain.dll")
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\WarpSharp.dll")

# SCRIPTS
Import("C:\Program Files\GordianKnot\AviSynthPlugins\LimitedSharpenFaster.avsi")

# SOURCE
mpeg2source("I:\DVD\VTS_01_PGC_01_1.d2v", idct=7)

# TRIM
trim(0,205325)

# CROPPING
crop(4,58,712,360,true)

# DENOISING
fft3dgpu(sigma=0.7,bt=3,plane=4,mode=1,degrid=1.0)

# RESIZING
#LanczosResize(720,304)

# SHARPENING
LimitedSharpenFaster(dest_x=720,dest_y=304,strength=69)


or a faster version (no chroma denoising, a tad less sharpening):
# DENOISING
fft3dgpu(sigma=0.7,bt=3,mode=1,degrid=1.0)

# LIMITEDSHARPEN
LimitedSharpenFaster(dest_x=720,dest_y=304,strength=60)

and the same with different frequency denosing (high frequencies less filtered, low frequencies more, like plain surfaces), hence more sharpening:
# DENOISING
fft3dgpu(sigma=0.5,bt=3,mode=1,degrid=1.0,sigma2=0.7,sigma3=1.0,sigma4=1.0)

# SHARPENING
LimitedSharpenFaster(dest_x=720,dest_y=304,strength=69)

cheers,
HeadBangeR

Bankis
16th January 2007, 23:34
HeadBangeR77, it's better resize and then denoise in your first script, but not otherwise.

As I understand, denoising after denoising and sharpening removes noise artefacts, produced by sharpening (mostly near edges). That helps to gain better compressability.

I have asked my question mainly because I feel, that encoded needs to be sharpened. And sharpening withoug denoising before and after isn't a good idea. This way LSF and PixieDust came into my script ;)

foxyshadis
16th January 2007, 23:50
RemoveGrain isn't a great way to round off the corners of a sharpener though. It'll work, but you'd be better off using Soothe, which enhances stability (and Jeremy really likes Spresso).

HeadBangeR77
17th January 2007, 00:37
@ Bankis
I didn't know, I'm learning all the time - within the last few weeks, after I had suddenly discovered AviScript and all its uses, I've been trying and trying again and again ;)

I read somewhere, that Didee recommended as few resizing steps as possible, and LSF already deals with resizing while supersampling (1.5 as default for both x & y axis).
Do you really think that (a) resizing at the beginning (in the above case downsizing), denoising after that (would go faster with downsized material), and sharpening with LSF is better than just (b) denoising the untouched (almost, just after cropping black bars) source and sharpening with LSF, that will take care of resizing?

That would also change the sharpening strength:

a) LSF swallows 720x304 square pixels (resized & denoised), resizes x 1.5 in both dimensions, sharpens, and downsizes again, spitting out the same resolution. True x 1.5 upsampling takes place here.

b) LSF swallows the donoised source i.e. 712x360 anomorph (after cropping), resizes as above x 1.5 (the question is: into the display resolution or not???), and spits out 720x304. Even if it doesn't resize the display resolution, but the source as it is (anomorph), the height is bigger than in the first case, so SS is actually higher than just x 1.5 (remember, I'm downsizing), hence a bit softer image & less artifacts at the same time. The higher SS, the less artifacts but also less sharpening, as he wrote in LimitedSharpen thread and as my samples show me.

E.g. a small clip from "Black Pearl" (upsized, but that's another story) :
- only LanczosResize(1024x432) - 298MB
- fft3dgpu & LSF (ss 1.25, strength 40) - 329MB
- fft3dgpu & LSF (ss 1.50, strength 40) - 319MB
- fft3dgpu & LSF (ss 2.00, strength 40) - 306MB.

Denosing a bit once again, after sharpening, is a good idea IMHO, when you sharpen more, and you do: () means Smode=3, strength=100. I will carry on in my next post, now I must have a smoke :D

HeadBangeR77
17th January 2007, 01:04
RemoveGrain isn't a great way to round off the corners of a sharpener though. It'll work, but you'd be better off using Soothe, which enhances stability (and Jeremy really likes Spresso).
I've just discovered the above ;) RemoveGrain(mode=1) can't do any harm, neither me nor Bankis, I actually agree that very slight denoising after sharpening is a good idea, but it won't deal with potential artifacts caused by sharpening. The other modes probably yes, but they could also ruin the sharpening effect, I assume. I will check out Soothe then. Thanks!

As to my scirpt, as I've already written, I decided to leave the encode as it is, after all I was downsizing and the source was good. Now, however, I'm upsizing, so this is a different story, and I do find all that filtering useful, without a thought I might suffer from "filteritis" ;)

What about BlindDeHalo3 (MaskTools 2.0 version)? I've already made some samples and it seems to make sense, but only the built-in postprocessing. I mean BlindDeHalo3(PPmode=-2,PPlimit=4) - without limiting it smooths too much - or better BlindDeHalo3(PPmode=-3). Looks interesting ... :sly:

saigadu
18th January 2007, 18:45
Thank you very much this site helped me a lot.

Bankis
19th January 2007, 19:44
Of course resizing at first is better idea - that makes less data for denoising, therefore it takes less time than in (b) case. I know a little about supersampling, but as I understand it - it's opposite action of sharpening ;)

@ Bankis
Do you really think that (a) resizing at the beginning (in the above case downsizing), denoising after that (would go faster with downsized material), and sharpening with LSF is better than just (b) denoising the untouched (almost, just after cropping black bars) source and sharpening with LSF, that will take care of resizing?

HeadBangeR77
19th January 2007, 20:38
Of course resizing at first is better idea - that makes less data for denoising, therefore it takes less time than in (b) case. I know a little about supersampling, but as I understand it - it's opposite action of sharpening ;)
In my example above - you're right, absolutely, at least in terms of speed, but effectivness probably also. I was wrong, I must confess ;)

However, atm, I'm upsizing - that makes things a bit more complicated :D In such a case I must keep the original resolution as long as I can, at least for higher speed, and let the LSF do the final resizing.

Supersampling isn't the opposite, but it makes the sharpening effect weaker somehow, leaving less artifacts behind on the other hand. The whole process means (more or less ;)) sth like that: upsizing x SS-factor, sharpening, downsizing to the input resolution, unless you specify a different one (that changes however the effectivnes of SS).

If you happen to have some spare time & some knowledge, could you have a look here?
http://forum.doom9.org/showthread.php?t=120860