function antialiasing(clip orig,int "th_luma",int "th_croma",string "type",int "aath") { # "th_luma" & "th_croma" are the edge detection thres.: lower values=more edges filtered # "type" is the matrix used for edge detection: with "sobel" (default) only the # hi-contrast edges, where artefacts are more noticeable, are filtered. If you want # to test other matrices, read the MaskTools Guide for more info. # "aath" = anti-aliasing strenght (default should be fine) th_luma = Default(th_luma, 20) th_croma = Default(th_croma, 20) type = Default(type, "sobel") aath = Default(aath, 48) ox = orig.width oy = orig.height dx = orig.width * 2 dy = orig.height * 2 clp = orig.IsYV12() ? orig : orig.ConvertToYV12() a=clp b=clp.Lanczos4Resize(dx,dy).TurnLeft().SangNom(aa=aath).TurnRight().SangNom(aa=aath) \ .LanczosResize(ox,oy) c=clp.EdgeMask(th_luma,th_luma,th_croma,th_croma,type) MaskedMerge(a,b,c) }