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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 6th December 2011, 19:15   #1  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
AntiAliasHQ - Oh snap!

Oh snap, it's me!

And it's another antialiasing script, argh!!


Anyways, this is a new (whoah!) script by (silly) me.
It's made to kill jaggies, using both the old SangNom and the RemoveGrain mode 21.

And since it uses nothing else, it doesn't really smooth much.
It does include a no-edge sharpening, though it gets outside edges a lot at thr<5

It's kinda fast (read: kinda), too. Because a good additional script is a fast additional script.

Feel free to try it out, also brownie points to redfordxx for the awesome plugin. (I love messing with differences.)

Have fun!

Code:
function AntiAliasHQ(clip clp,int "thr",int "aa",bool "sharpen",float "sharp") {
# Another antialiasing script by, you guessed it - Bloax.
# Extra cookies to redfordxx for the masking simplification idea. (Now there are two masks, instead of two masks and two inversions!)

# I doubt this one's really usable for much, but I'll just go ahead and post it -
# Since it 'bypasses' a SangNom issue hackily, and combines it with RemoveGrain mode 21.

# It's also pretty fast. No supersampling for you though!
# But overall, it doesn't really "smooth" much, it does kill jaggies quite nicely though. (Game footage, anyone?)

# Requirements: RemoveGrain, RedAverage.dll (You can google it), SangNom, MaskTools2

# "thr" Is the threshold for detecting edges, higher values INCREASE the amount of edges found.
# It's operating in Pow2, so be careful about the values. (6 is 64, while 8 is >256< :P) [/basicmath]
# > Seems like lower values are softer. Lower values sharpen more though, whilst higher sharpen less.
# Due to the fact that when more edges are "detected", there's less overall space in the inverse edge mask.
# Which is what the sharpening is limited to.

# "aa" Is a silly little value for SangNom, I have no idea about what it does above 48-64.
# "sharpen" Controls whenever there's internal (non-edge) sharpening, and "sharp" controls the strength.

# Enjoy!

thr = Default(thr, 5)
aa = Default(aa, 1024)
sharpen = Default(sharpen, true)
sharp = Default(sharp, 0.33)

thrval = Pow(2,thr)

clp2 = IsYV12(clp) ? clp : clp.ConvertToYV12() # Don't we love to copy this? :-)

edgemsk=RAverageW(clp2,-thrval,clp2.RemoveGrain(19,-1),thrval,mode=4,u=0,v=0,bias=256)
aa1=clp2.SangNom(0,aa)
msk1=RAverageW(clp2,-64,aa1,64,mode=4,u=0,v=0,bias=-64)
aa2=clp2.SangNom(1,aa)
merge=RMerge(aa2,aa1,msk1.Mt_Expand().Mt_Deflate().Mt_Inflate(),mode=255)
clean=sharpen ? RMerge(merge,clp2.Sharpen(sharp),edgemsk.Mt_Deflate(),mode=255) : RMerge(clp2,merge,edgemsk.Mt_Deflate(),mode=255)
RMerge(clean.RemoveGrain(21),clean,edgemsk,mode=255)
}
P.S: Yes, I do mask PROPERLY here.
..Or do I!?

[Previous version]

Last edited by Bloax; 8th December 2011 at 09:22.
Bloax is offline   Reply With Quote
 

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 09:52.


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