Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th January 2006, 16:09   #401  |  Link
Socio
Registered User
 
Join Date: May 2004
Posts: 288
Quote:
Originally Posted by psme
The MakeDiff version needs the latest support dll here:

http://people.pwf.cam.ac.uk/mg262/po...t_03Dec05B.dll

regards,

Li On

Thanks that worked, I had the version just prior to that one did not know about that newer one.
Socio is offline   Reply With Quote
Old 8th January 2006, 07:57   #402  |  Link
JarrettH
Registered User
 
Join Date: Aug 2004
Location: Canada
Posts: 860
If we ever want a settings thread here's mine now =p

Quote:
Import("C:\Program Files\AviSynth 2.5\plugins\Soothe.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")

SetMTMode(2)
mergeluma( removegrain(4,-1), 0.70 )
dull = last
sharp = dull.LimitedSharpen(ss_x=1.0,ss_y=1.0,Smode=4,strength=100,soft=33)
mergeluma( removegrain(2,-1), 0.25 )

Soothe( sharp, dull, 20 )
The contrast is bumped up 10 and saturation by 5 too. I'll see if I can post some pics comparing ATI TV to GAM+LimitedSharpen.

*Edit...how DO you take screenshots in ATI TV and Got All Media. Why must everything be so difficult!

Last edited by JarrettH; 8th January 2006 at 08:08.
JarrettH is offline   Reply With Quote
Old 8th January 2006, 10:20   #403  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
BUG fixed: the right-hand side of AddDiff wasn't working correctly. Thank you for spotting it, foxyshadis! (I really hope this wasn't causing you headaches yet, Didée.)

LimitedSupport, 8 January 2006

The source is also uploaded if anyone feels like checking it.

Quote:
However, if some of the "support" filters could work on chroma too, it would help indeed. (Top ranking: the "difference" filters.)
Doing this should be fairly straightforward. So... why haven't I done it yet ? Because I'm nervous about breaking things. I do test things for quite a while... but in this case, where these things are going to be put to an important use (and where they are replacing something that clearly works), I'd feel better if a couple of you would test them before Didée uses them.

It isn't technically difficult -- you get two one-line commands, like

yv12lutxy(o,d, "x y 128 - +")

adddiff(o,d)

and you need to check that they have the same output whatever the input clips o and d are. [For example, like this...
a=yv12lutxy(o,d, "x y 128 - +").GreyScale()
b=adddiff(o,d).GreyScale()
suBTRACT(a,b)
]
It isn't technically difficult... the important thing is to try on a wide range of clips. So this is a great opportunity for the average reader to prove helpful .
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.
mg262 is offline   Reply With Quote
Old 8th January 2006, 11:34   #404  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
If it's not too much trouble, then could you create a version with xDiff(o,d,[1/2/3/4]) where the last parameter are similar to the y/u/v parameters to masktools, but always for chroma? (1=>trash, 2=>copy first, 3=>execute, 4=>copy second) Then at least we have something to test out, even if it isn't perfect at first.
foxyshadis is offline   Reply With Quote
Old 9th January 2006, 00:52   #405  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
LimitedSupport, 9 January 2006

LimitedSupport, 9 January 2006

All filters have been modified to take an extra argument chroma. chroma can either be be a clip (in which case the chroma of that clip is copied) or one of the following strings:
"ignore"
"process"
"copy first"
"copy second"
"copy third"

The default mode is "ignore". "Copy first", etc. are just for convenience; obviously, you can just repeat the relevant argument. (These strings are case insensitive, so you can also use e.g. "PROCESS".)

I'll edit in a proper summary of the functions tomorrow, but just as a recap:

SimpleAverage(clip, clip, chroma)
MakeDiff(clip, clip, chroma)
AddDiff(clip, clip, chroma)
SubtractDiff(clip, clip, chroma)
Clamp(clip, clip bright_limit, clip dark_limit, int overshoot, int undershoot, chroma)
Prewitt(clip, float multiplier, chroma)

If you pass in clips whose length differs, the output is not guaranteed to be sensible beyond the length of the shortest clip.

*This really hasn't been tested much yet*...

Quote:
If it's not too much trouble, then could you create a version with xDiff(o,d,[1/2/3/4]) where the last parameter are similar to the y/u/v parameters to masktools, but always for chroma? (1=>trash, 2=>copy first, 3=>execute, 4=>copy second) Then at least we have something to test out, even if it isn't perfect at first.
Foxyshadis, I wasn't sure whether you were asking for a quick rough version with the functionality (which you've now got) or for this particular syntax. I'm not a fan of mode = 1, 2, 3, 4, 5, 6, 7,... arguments. But if you reaaalllly want it (or Didée does), I can add it.

Edit:
I noticed in other threads (which I'm not going to dig out now) that people are citing issues with LimitedSharpenFaster. If you do run into something like this, please try the earlier versions -- both Didée's versions and Socio's modification for MaskTools 2.0; this will pin down which change is responsible for the issue, *and then we can fix it*.
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.

Last edited by mg262; 9th January 2006 at 02:01.
mg262 is offline   Reply With Quote
Old 9th January 2006, 02:22   #406  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Ah, splendid.

It doesn't really matter too much if one hast to type >>,U=3,V=3<< or >>"process"<< instead. Different syntaxes keep the brain from getting rusty.

Just one question, I seem to have a dumb moment:
Quote:
The default mode is "ignore". "Copy first", etc. are just for convenience; obviously, you can just repeat the relevant argument.
Huh? What argument we could just repeat instead of typing e.g. "copy second"?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 9th January 2006, 02:28   #407  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
No, no, it was only out of deference to compatibility, I like schemes like yours better. I had written my own but left it off as unimportant. Thank you so much, you're the speedy gonzales of avisynth filters.

I tested the first 4 pretty thoroughly with a goofy width and caught no errors. Excellent! I wasn't sure about clamp until I realized it swapped the input clips on each. Copy second gives different results but is meaningless anyway, the rest work fine.

I simply have no idea what to compare prewitt with, although I'm guessing the results of an average of 8-part dedgemask? I'll let you handle that one. I'm just curious about how it fits into LimitedSharpen, if it does at all. Is it a replacement for
Code:
edge = mt_logic( tmp.mt_edge(thY1=0,thY2=255,"8 16 8 0 0 0 -8 -16 -8 4")
 \              ,tmp.mt_edge(thY1=0,thY2=255,"8 0 -8 16 0 -16 8 0 -8 4")
 \              ,"max") .mt_lut("x 128 / 0.86 ^ 255 *") #.levels(0,0.86,128,0,255,false)
?
foxyshadis is offline   Reply With Quote
Old 9th January 2006, 02:30   #408  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
Didée,

"copy first" behaves like this:
AddDiff(a, b, chroma = a)

"Copy second" behaves like this:
AddDiff(a, b, chroma = b)

Or you can take chroma from a completely different clip, like this
AddDiff(a, b, chroma = other_clip)

The "copy first" and "copy second" have a slight advantage when you are doing some processing inside the function call...
AddDiff(a.Invert(), b, chroma = a.Invert())

will call Invert twice. But
AddDiff(a.Invert(), b, chroma = "copy first")

will only call it once.

Edit + re-edit:
foxyshadis,

I'm extremely grateful for the testing! But I can't reproduce the clamp problem... this is the script I tried:
Code:
function scriptclamp(clip main, clip bright_limit, clip dark_limit, int overshoot, int undershoot)
{
OS = string(overshoot)
US = string(undershoot)
oss="y x "+OS+" + < y x "+OS+" + ?"
uss="y x "+US+" - > y x "+US+" - ?"
yv12lutxy( bright_limit, main,  yexpr=oss, uexpr=oss, vexpr=oss, u=3, v=3)
yv12lutxy( dark_limit,   last,  yexpr=uss, uexpr=uss, vexpr=uss, u=3, v=3)
return last
}

a=scriptclamp(o,p,q,1,2).MergeChroma(p)
b= clamp(o,p,q,1,2,chroma="copy second")
subtract(a,b)

Levels(128-15, 1, 128+15, 16, 235)
I forgot to mention that "copy third" also exists, though obviously it only makes sense for Clamp. Maybe I just documented it wrong (with second and third argument swapped)?

Prewitt:
Some time back I found a set of Photoshop scripts that contain huge numbers of edge masks:
http://members.ozemail.com.au/~binar...volcorner.html
(scroll down to Custom_Convolution_Actions_APS5.zip - 298KB)

There were a lot of scripts in there, but they were very quick to try (being one click each)... Prewitt stood out as being much better than the others. Method described here. Unlike all the other functions in this filter, it's only in C++ (though it could certainly be converted to assembly).

What else?
Source code

I haven't by any means squeezed out all the speed that is possible; the filterlets were chosen to be reusable and quick to assemblify as much as for the potential speedup. (Also replacing two-argument LUTs is something that I'm keen on doing because two-argument LUTs aren't friendly to 15-bit processing.) The next natural speedup would probably be to write a faster upsampling-resizer than the built-in AVISynth one... I'm pretty sure I know how to do it but it's a lot of work. When the LS successor appears and is declared to be in a stable version, then I might look at speedups again... .
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.

Last edited by mg262; 9th January 2006 at 03:08.
mg262 is offline   Reply With Quote
Old 9th January 2006, 03:21   #409  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Ah, see, mergechroma(p) is a better idea! I was just using u=2,v=2... on the two mt_lutxys. Obviously that's going to copy chroma of clip #3 instead! (u/v=4 vs "copy first" works perfectly.) Clamp doesn't accept "copy third" however.

I'll give prewitt a try, I'm developing something with sobel but I'd definitely like more fine details. (Another I'm developing just needs rough edges since it'll be blurred anyway.)

If you work on resizing down the line, would it be better just to start with the current avisynth code and optimize that to include in the next version? Or would it be more sensible to just make your own FastResize filter?
foxyshadis is offline   Reply With Quote
Old 9th January 2006, 03:58   #410  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
Quote:
Clamp doesn't accept "copy third" however.
Fixed!

LimitedSupport, 9 January 2006 (revised)

Quote:
I'll give prewitt a try, I'm developing something with sobel but I'd definitely like more fine details.
I also have a 'thin' version sitting around somewhere (that tries to give you 1 pixel thick edges)... I can dig it out (filter and source if you want it) if it would be of any use.

Quote:
If you work on resizing down the line, would it be better just to start with the current avisynth code and optimize that to include in the next version? Or would it be more sensible to just make your own FastResize filter?
IMO the latter... or at least, I can't speak for anyone else, but I need to understand code completely inside out to work on it, not just what every line does but e.g. why something is a virtual function rather than a template specialisation or vice versa. Reaching that level with someone else's code would take me a lot longer than coding from scratch. (Plus at the moment I have interface issues which make it very hard to work on code unless it is written in a particular way.)
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.
mg262 is offline   Reply With Quote
Old 9th January 2006, 15:07   #411  |  Link
morsa
the dumbest
 
Join Date: Oct 2002
Location: Malvinas
Posts: 494
Sorry guys to tell you but I guess a new thread should be started beginning with the last version of everything.I read the whole thread and it is quite difficult to follow the modifications of scripts and DLLs...
In fact I read it like four times to get things working...(like more than 2 hours)
morsa is offline   Reply With Quote
Old 9th January 2006, 19:06   #412  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Code:
LoadPlugIn("LimitedSupport_09Jan06B.dll")
LoadPlugIn("MaskTools.dll")
LoadPlugIn("mt_masktooks.dll")
LoadPlugIn("RemoveGrain.dll")
Import("LimitedSharpenFaster.avsi")

AVISource("xxx.avi")
LimitedSharpenFaster()

Last edited by Backwoods; 9th January 2006 at 19:10.
Backwoods is offline   Reply With Quote
Old 10th January 2006, 10:00   #413  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by morsa
Sorry guys to tell you but I guess a new thread should be started beginning with the last version of everything.I read the whole thread and it is quite difficult to follow the modifications of scripts and DLLs...
In fact I read it like four times to get things working...(like more than 2 hours)
http://www.avisynth.org/LimitedSharpen


Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 10th January 2006, 20:01   #414  |  Link
morsa
the dumbest
 
Join Date: Oct 2002
Location: Malvinas
Posts: 494
ok thanks.
morsa is offline   Reply With Quote
Old 14th January 2006, 09:31   #415  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
What am I going to speed up now ?

Didée,

May I ask whether these things which you occasionally use:

temporalsoften(1,255,0,32,2)

are meant to exploit the scene change detection in temporalsoften or circumvent it?
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.
mg262 is offline   Reply With Quote
Old 14th January 2006, 09:42   #416  |  Link
FredThompson
Registered User
 
FredThompson's Avatar
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
Quote:
Originally Posted by mg262
What am I going to speed up now ?
Rewrite DeHalo_alpha to use ffdshow filters instead of AVS native higher math...
__________________
Reclusive fart.
Collecting Military, Trains, Cooking, Woodworking, Fighting Illini, Auburn Tigers
FredThompson is offline   Reply With Quote
Old 14th January 2006, 12:02   #417  |  Link
buzzqw
HDConvertToX author
 
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
please build a limitedsharpen.dll that include all mask*.dll/warpsh*.dll limitedspeed*.dll or whatever is needed to load limited sharpen without checking what is to load and what is to not load (because too new/too old)

BHH
__________________
HDConvertToX: your tool for BD backup
MultiX264: The quick gui for x264
AutoMen: The Mencoder GUI
AutoWebM: supporting WebM/VP8
buzzqw is offline   Reply With Quote
Old 14th January 2006, 12:41   #418  |  Link
MetalPhreak
Registered User
 
Join Date: Jul 2005
Posts: 48
I second buzzqw's request, or at least explain properly on the avisynth.org what is needed and links - currently if I download everything from there I get errors and warnings popping up left and right.
MetalPhreak is offline   Reply With Quote
Old 14th January 2006, 13:46   #419  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Well, packaging everything in one archive would make it out of date as soon as an update to masktools was released. I guess I can list everything required for a particular function with its function though. And change the masktools2 link so you don't accidentally download an old one. See if you like it more now.

There should be no errors or warnings if you have the most recent versions of the dlls, as long as you just load them all from the script, unless there's some kind of versioning conflict with older ones.
foxyshadis is offline   Reply With Quote
Old 14th January 2006, 17:29   #420  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by mg262
May I ask whether these things which you occasionally use:

temporalsoften(1,255,0,32,2)

are meant to exploit the scene change detection in temporalsoften or circumvent it?
That's from LPprotect(), isn't it? It's meant to perform full temporal smoothing on Y, disregarding UV because that's not needed (and TS runs slightly faster not processing UV, which does pay out in the complex context of MCNR_simple), with a rather insensitive but still active SC detection.
Thinking about it, it could be the SC detection in fact isn't needed, and I could use average() ... but then, while average() (24Oct05) generally works nicely, sometimes it b0rks out with returning full green. Didn't find the cause up to know, and no reliable way to reproduce the bug.


Quote:
Originally Posted by FredThompson
>> (mg262) What am I going to speed up now ?

Rewrite DeHalo_alpha to use ffdshow filters instead of AVS native higher math...
What are your actual speeds, Fred? With maximum optimization (replacing all MT 1.5.x with MT 2.0 commands, and using ss=1.0), this weak Celeron 2600 here renders a 720x432 clip at 35~40 fps. With ss=1.25, it's ~17 fps, and ~15fps with ss=1.5 ... supersampling in Avisynth is expensive, but necessary (without any ss, the method will produce aliasing on sharp & strong-contrasted edges). Personally I would never run DeHalo_alpha without it.)
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.