#######################################################################################
function AA(clip clip, bool "edge", string "cspace"){
###############################################################################
# #
# AA - Antialias #
# #
# Requires Sangnom!! #
# #
# Simplified version of AAA() by someone else. #
# Required for mode2 of DotKill #
# #
# History: #
# v0.1 take aaa() and remove everything that allows tweaking. voila #
# v0.2 added "edge" mode to limit antialiasing to edges. #
# colorspace conversions added #
# #
###############################################################################
LoadPlugin(Avisynth_plugin_directory+"sangnom.dll")
edge = default(edge,false)
cspace = default(cspace,"useless")
yv12 = clip.isYV12() ? clip : clip.converttoyv12()
aa_clip = yv12.LanczosResize(width(clip)*2,height(clip)*2). \
TurnLeft().SangNom().TurnRight().SangNom(). \
LanczosResize(width(clip),height(clip)).MergeChroma(yv12)
maske = yv12.EdgeMask(7,7,5,5,"sobel").inflate()
new = (edge==false) ? aa_clip : MaskedMerge(yv12,aa_clip,maske)
orig_cspace = clip.isRGB32() ? new.converttoRGB32() :
\ clip.isRGB24() ? new.converttoRGB24() :
\ clip.isYUY2() ? new.converttoYUY2() :
\ new
final = (cspace == "YV12") ? new :
\ (cspace == "YUY2") ? new.converttoYUY2() :
\ (cspace == "RGB24") ? new.converttoRGB24() :
\ (cspace == "RGB32") ? new.converttoRGB32() :
\ orig_cspace
return final }
#######################################################################################