digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Trying out LimitedSharpen() (http://www.digitalfaq.com/archives/avisynth/13762-avisynth-limitedsharpen.html)

incredible 09-01-2005 08:58 AM

Funny, ... Im at work so I had to dig for it in the forums as its in my avsiynths plugins folder as permanent available avsi.

Seems there are 2 diff. versions in the outside!
Boulder, do you know which one is more recent?
(anyway someone should try by himself and see which result is better *lol)
Code:

function LRemoveDust(clip input, int _mode, int "limit")
{
limit=default(limit,4)
repmode = 2
clensed = Clense(input)
rep=Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=_mode)
rd=TemporalRepair(rg, rep)
return LimitChange(rd, input, limit, limitU=255)
}

EDIT: I figured it out: The version above is for SSE in general capable CPUs (usage of LimitChange), the version posted by Gamma is for NON SSE capable CPUs.

@ Phil
LRemovedust is one of the best denoisers I know IF the aspect "spedd in relation to denoising" counts.
BUT be careful as you should tweak the modes and limits as it could erase Details significantly.
(see Boulders post above)

People say its as good as pixiedust but for shure hughinnnngggg faster, For me Pixiedust is still a tiny bit better.




I also found a fast version of LimitedSharpen at the Gleitz board from Didée. Well NO masks and also other things have been pulled out.
("schnell" means "fast" in german ;) )

Code:

# LimitedSharpen()
#
# A multi-purpose sharpener by DidÈe
#
function LS_schnell_schnell( clip clp,
 \                      float "ss_x",  float "ss_y",    int "dest_x", int "dest_y",
 \                      int  "Smode",  int  "strength", int  "radius" )
{
ox = clp.width
oy = clp.height
ss_x =    default( ss_x, 1.5 )
ss_y =    default( ss_y, 1.5 )
dest_x =  default( dest_x, ox )
dest_y =  default( dest_y, oy )
Smode =    default( Smode, 3 )
strength = Smode==1
 \      ? default( strength, 160 )
 \      : default( strength, 100 )
strength = Smode==2&&strength>100 ? 100 : strength
radius =  default( radius, 2 )
#radius =  round( radius*(ss_x+ss_y)/2)  #  If it's you, Mug Funky - feel free to activate it again 

xxs=round(ox*ss_x/8)*8
yys=round(oy*ss_y/8)*8

clp.isYV12() ? clp : clp.converttoyv12()

ss_x != 1.0 || ss_y != 1.0 ? last.lanczosresize(xxs,yys) : last
tmp = last

dark_limit  = tmp.inpand()
bright_limit = tmp.expand()

minmaxavg    = yv12lutxy(bright_limit,dark_limit,yexpr="x y + 2 /")

Str=string(float(strength)/100.0)
normsharp = Smode==1 ? tmp.unsharpmask(strength,radius,0)
 \        : Smode==2 ? tmp.sharpen(float(strength)/100.0)
 \        :            yv12lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +",U=2,V=2)

repair(normsharp,tmp,mode=1)

    (ss_x != 1.0 || ss_y != 1.0)
\ || (dest_x != ox || dest_y != oy) ? lanczosresize(dest_x,dest_y) : last

clp.isYV12() ? last
 \          : lanczosresize(clp, dest_x,dest_y).mergeluma(last.converttoyuy2())

 return last
}
#


You should really use it in combination with TemporalRepair as it prevents the output from heavy spatialfilter resulted artifacts.

orig = Mpeg2Source()
filtered = orig. LS_schnell_schnell(.........)
TemporalRepair(Filtered, orig)

In case of Heavy Temporal filtering and avoiding its artifacts...

orig = Mpeg2Source()
filtered = orig. TemporalFilterXYZ()
Repair(Filtered, orig, repmode=x)

Dialhot 09-01-2005 08:59 AM

Thanks. The "mode" parameter made me think this was into RemoveGrain but I did not understood it was a an external function using RemoveGrain.

I have to find now where is "LimitChange" :D

Note: funny that this function is so smart. Looking at it it seems to be done by someone that wanted to try all functions from RemoveGrain together :).

Boulder 09-01-2005 09:09 AM

These are the ones that I use:

Code:

function LRemoveDust_YUY2(clip input, int clmode, int "limit")
{
clmode=default(clmode,17)
limit=default(limit,2)
repmode = 2
clensed = Clense(input, grey=true)
rep = Repair(clensed, input, mode=repmode, modeU=-1)
rg = RemoveGrain(rep, mode=clmode, modeU=-1)
return LimitChange(rg, input, limit, limitU=255)
}

function LRemoveDust_YV12(clip input, int clmode, int "limit")
{
limit=default(limit,2)
clmode=default(clmode,17)
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=clmode)
return LimitChange(rg, input, limit)
}

I've ditched the TemporalRepair part as that's not necessary with mode 17. LimitChange can be found in the latest SSETools plugin, which is in the RemoveGrain v0.9 package.

The YV12 one is for stuff that's originally YV12. The YUY2 version is for my YUY2 captures, process chain is
Code:

AVISource()
org=last
ConverttoYV12()
LRemoveDust(17,2)
ConverttoYUY2()
MergeChroma(org)


GFR 09-02-2005 06:29 AM

Quote:

Originally Posted by Boulder
Uh, I'm often confused as well :lol:

I'd say look for removedirt, removegrain, avstimer, avsrecursion and ssetools (under construction) - add the word in www.xxx.de.tf.

As his documenting style is very verbose, I guess he decided to make separate domains for each one. One single page with all the links would have been really great, maybe I should ask him to do that.

Nowadays I use Didée's LTSMC for my analog captures so I haven't had to keep up with all the different plugins, IIRC that one uses RemoveGrain and SSETools from kassandro's plugins. kassandro's forum is a good place for information, and he's also very positive towards any new ideas - as you can see from RemoveGrain, which contains ~30 modes already 8O

Hi Boulder,

Do you have some suggested settings for LTSMC (like for VHS camcorders or TV captures)?

How does it compare to LRemoveDust (for captures)? I have used LRemoveDust(4,2) for VHS camcorder works OK for me.

Perhaps we should split this to the capture forum, or start a new thread here at optimal scripts.

Boulder 09-02-2005 07:02 AM

Quote:

Originally Posted by GFR
Perhaps we should split this to the capture forum, or start a new thread here at optimal scripts.

http://www.kvcd.net/forum/viewtopic.php?t=16106

Boulder 09-06-2005 10:06 AM

Check out Soothe() , another fine function from Didée :D

Designed to be used after sharpeners, especially LimitedSharpen.

http://forum.doom9.org/showthread.php?t=99679

Dialhot 09-11-2005 03:29 PM

Quote:

Originally Posted by incredible
Quote:

Originally Posted by Boulder
I've got this one : http://home.arcor.de/kassandro/Remov...emoveGrain.rar (RemoveGrain v1.0 prerelease) and the last SSETools from the official RemoveGrain v0.9 package. Confusing, huh 8O

thanks! Ill have a look at it, even I think its the one Im also working with.

Inc,

Did you fix the alignment problem finally ? If yes, how ?
Because I'm suffering the same problem on a P4 : with ConvertToYUY2().ConvertToYV12() the script needs 4 minutes to encode a 100 second sample, but without it is took... 30 minutes 8O

Edit: Forget. I solved it using "true" in the Crop line and avisynth 2.5.6RC1.

Note: concerning results you are right, this is definitely better than RemoveGrain().Deen() for the same speed and almost the same filesize !

incredible 09-11-2005 05:10 PM

I even used crop(....., align=true) but did not help in my case.
Only when 2x supersampling like done in LS() ... then no CspaceConversion is needed, so it defenitely has something to do with alignment in memory.

Kassandro gots his own forum (link above on the removedirt site).
Till now im a bit busy and I didnt go further tweaking LS() or LRemovedust() ... so someone could ask there or lets wait till I have time.

The ColorQualityloss of that nonsense CspaceConversion can be restored by using mergechroma() as the luma wont be touched - not in the conversion, neither by LRemovedust().

OrigChroma = last
ConverttoYUY2().ConverttoYV12()
LRemovedust(17,x)
MergeChroma(OrigChroma)

Anyhow, these routines even if not touching the chromaquality finally do use unneeded Routines/CPU-power, so that really should be discussed at Kassandros Board.

gamma 12-16-2005 02:15 PM

For the ones interested, there's a new version of LS(), which incorporates a new smode (smode=4), different approach to the "soft" option and yes, it's faster!

get it here:
http://forum.doom9.org/attachment.php?attachmentid=5007

All I can say is 8O

BTW you will need the latest removegrain package (1.0), otherwise you'll get an error that mode 19 isn't available.

Look what's smode4 got in store for us...

http://www.digitalfaq.com/archives/error.gif
http://www.digitalfaq.com/archives/error.gif

No tweaked settings. IMO is the second picture a bit overdone, so the defaults are a bit strong.

rds_correia 12-26-2005 04:18 PM

Nice end results gamma.
Could you please point us to the right thread @ D9 where you found this modded LS() ?
TIA
Cheers

supermule 12-26-2005 11:32 PM

Btw, which movie are these clippings from, seems interesting, gotta see it :)

gamma 12-27-2005 02:10 AM

Quote:

Originally Posted by rds_correia
Nice end results gamma.
Could you please point us to the right thread @ D9 where you found this modded LS() ?
TIA
Cheers

Thanks. The whole thread is here: http://forum.doom9.org/showthread.ph...limitedsharpen
Look at page 11 for the new version. A few pages further the latest removegrain package is linked. Of course credits to Inc for spotting this in the first place :wink:

gamma 12-27-2005 02:12 AM

Quote:

Originally Posted by supermule
Btw, which movie are these clippings from, seems interesting, gotta see it :)

It's Blade Trinity, and yes, you gotta see this :D

Dialhot 12-27-2005 04:57 AM

The direct links :
http://forum.doom9.org/showthread.ph...909#post731909
http://forum.doom9.org/showthread.ph...098#post732098

(LS() was few lines before, it is now a complete programm :))

rds_correia 12-27-2005 06:34 AM

Hi guys,
Thanks for the links :D.
Cheers

Prodater64 12-28-2005 01:54 PM

Could somebody explain the whole process with examples.
I didn't understand nothing.

rds_correia 12-28-2005 02:28 PM

Which post did you find problems understanding?
We're talking about LimitedSharpen() which is in fact a function like ADS, slicer, etc.
LimitedSharpen or simply LS() is especially good for encoding non-Anamorphic sources to Anamorphic targets.
Other than that we just talked about where we can read about it in D9 with more detail.
If you're still missing something, Luis, just ask us again but try to give us a hint on what you're not understanding so that we can help ;-).
Cheers

Prodater64 12-28-2005 04:36 PM

Quote:

Originally Posted by rds_correia
Which post did you find problems understanding?
We're talking about LimitedSharpen() which is in fact a function like ADS, slicer, etc.
LimitedSharpen or simply LS() is especially good for encoding non-Anamorphic sources to Anamorphic targets.
Other than that we just talked about where we can read about it in D9 with more detail.
If you're still missing something, Luis, just ask us again but try to give us a hint on what you're not understanding so that we can help ;-).
Cheers

I did read that Inc said that is hard to find out the parameters.
I would want to know if there are some basic parameter as, i.e. LRemoveDust(17,2).

rds_correia 12-28-2005 04:46 PM

Quote:

Originally Posted by Prodater64
I would want to know if there are some basic parameter as, i.e. LRemoveDust(17,2).

I see.
I'd like to know that myself too.
I think LS() is too complex.
And maybe even experienced scripters like Phil, Andrej, Boulder, Kwag, etc have hard times configuring this function.
Let's see if some of them gives us a hint ;-).

Shibblet 12-28-2005 08:19 PM

I am having three problems with LimitedSharpen().

1. It does clear up the image, and add some missing detail, however it adds edging and pixels to places that weren't really there before. So a stationary object in the background results in some flickering around the edges because of the sharpening from frame to frame.

2. By adding these extra pixeled areas, you are actually increasing the size of your encode. Which results in having to lower your quality level in order to make it fit in the same place it was before.

3. Older movies (which are problematic and noisy to begin with) seem to get a lot of edging issues from frame to frame.

Anybody else get these same results?


All times are GMT -5. The time now is 07:23 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.