Hi,
Was trying to use some code but an not able to get it to perform correctly. Keeping getting a script error that there is no function named "LimitedSharpenFaster". I've been trying to add many different .dll's to find out what I'm missing... but to no avail. Could anyone help me get this to work?
Thanks
Master File
Base FileCode:avisource("C:\Documents and Settings\Desktop\test1.avi") LoadPlugin("C:\Documents and Settings\Desktop\VirtualDub\plugins\EEDI2.dll") LoadPlugin("C:\Documents and Settings\Desktop\VirtualDub\Avisynth Scripts\SeeSawSharpen\MaskTools-v1.5.8\MaskTools.dll") LoadPlugin("C:\Documents and Settings\Desktop\AutoMKV 0.84b\exe\Filter\hqdn3d.dll") LoadPlugin("C:\Documents and Settings\\Desktop\AutoMKV 0.84b\exe\Filter\RemoveGrainS.dll") LoadPlugin("C:\Documents and Settings\Desktop\AutoMKV 0.84b\exe\Filter\RepairS.dll") LoadPlugin("C:\Documents and Settings\Desktop\AutoMKV 0.84b\exe\Filter\UnDot.dll") import("C:\Documents and Settings\DesktopVirtualDub\Avisynth Scripts\SeeSawSharpen\SeeSaw.avs") import("C:\Documents and Settings\Desktop\VirtualDub\Avisynth Scripts\SeeSawSharpen\Soothe.avsi") import("C:\Documents and Settings\Desktop\VirtualDub\Avisynth Scripts\SeeSawSharpen\Base.avs") import("C:\Documents and Settings\Desktop\AutoMKV 0.84b\exe\Filter\LimitedSharpenFaster.avsi") a= last b=a.hqdn3d() SeeSaw(a,b, NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=5, Spower=5, Sdamplo=6, Szp=16) EEDI2().TurnRight().EEDI2().TurnLeft() Spline36Resize(852,480)
Soothe FileCode:undot() hqdn3d() dull=last sharp=LimitedSharpenFaster(ss_x=2, ss_y=2, smode=4, strength=250, overshoot=1, undershoot=1) Soothe(sharp, dull, 30)
SeeSaw FileCode:function Soothe(clip sharp, clip orig, int "keep") { Assert(sharp.width == orig.width && sharp.height == orig.height, \ "Soothe: clip dimentions must match!") keep = default(keep, 24) keep = (keep>100) ? 100 : (keep<0) ? 0 : keep KP = string(keep) diff = mt_makediff(orig,sharp) diff2 = diff.temporalsoften(1,255,0,32,2) diff3 = mt_lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP \ + " * 128 + x 128 - abs y 128 - abs > x " + KP \ + " * y 100 " + KP + " - * + 100 / x ? ?") return( mt_makediff(orig,diff3,chroma="copy first") ) }
LimitedSharpenFaster FileCode:# SeeSaw v0.3e (02 Jan 2006) # # (Full Name: "Denoiser-and-Sharpener-are-riding-the-SeeSaw" ) # # This function provides a (simple) implementation of the "crystality sharpen" principle. # In conjunction with a user-specified denoised clip, the aim is to enhance # weak detail, hopefully without oversharpening or creating jaggies on strong # detail, and produce a result that is temporally stable without detail shimmering, # while keeping everything within reasonable bitrate requirements. # This is done by intermixing source, denoised source and a modified sharpening process, # in a seesaw-like manner. # # This version is considered alpha. # # Usage: # # a = TheNoisySource # b = a.YourPreferredDenoising() # SeeSaw( a, b, [parameters] ) # # You're very much encouraged to feed your own custom denoised clip into SeeSaw. # If the "denoised" clip parameter is omitted, a simple "spatial pressdown" filter is used. # # # Fiddled together by Didée, for your pleasure. # # ======= Main function ======= function SeeSaw( clip clp, clip "denoised", \ int "NRlimit",int "NRlimit2", \ float "Sstr", int "Slimit", float "Spower", float "SdampLo", float "SdampHi", float "Szp", \ float "bias", int "Smode", int "sootheT", int "sootheS", float "ssx", float "ssy") { ssx = default( ssx, 1.0 ) # supersampling factor x / SeeSaw doesn't require supersampling urgently. ssy = default( ssy, ssx ) # supersampling factor y / if at all, small values ~1.25 seem to be enough. NRlimit = default( NRlimit, 2 ) # absolute limit for pixel change by denoising NRlimit2 = default( NRlimit2, NRlimit+1) # limit for intermediate denoising Sstr = default( Sstr, 1.5 ) # Sharpening strength (don't touch this too much) Slimit = default( Slimit, NRlimit+2 ) # positive: absolute limit for pixel change by sharpening # negative: pixel's sharpening difference is reduced to diff=pow(diff,1/abs(limit)) Spower = default( Spower, 4 ) # exponent for modified sharpener Szp = default( Szp, 16+2 ) # zero point - below: overdrive sharpening - above: reduced sharpening SdampLo = default( SdampLo, Spower+1 ) # reduces overdrive sharpening for very small changes SdampHi = default( SdampHi, 24 ) # further reduces sharpening for big sharpening changes. Try 15~30. "0" disables. bias = default( bias, 49 ) # bias towards detail ( >= 50 ) , or towards calm result ( < 50 ) Smode = default( Smode, ssx<1.35 ? 11 : ssx<1.51 ? 20 : 19 ) sootheT = default( sootheT, 49 ) # 0=minimum, 100=maximum soothing of sharpener's temporal instableness. # (-100 .. -1 : will chain 2 instances of temporal soothing.) sootheS = default( sootheS, 0 ) # 0=minimum, 100=maximum smoothing of sharpener's spatial effect. Szp = Szp / pow(Sstr, 1.0/4.0) / pow( (ssx+ssy)/2.0, 1.0/2.0 ) SdampLo = SdampLo / pow(Sstr, 1.0/4.0) / pow( (ssx+ssy)/2.0, 1.0/2.0 ) ox=clp.width oy=clp.height xss = m4(ox*ssx) yss = m4(oy*ssy) NRL = string( NRlimit ) NRL2 = string( NRlimit2 ) NRLL = string( int(round( NRlimit2 * 100.0/bias - 1.0 )) ) SLIM = string( abs(Slimit) ) BIAS1 = string( bias ) BIAS2 = string( 100-bias ) #ZRP = string( abs(Szp) ) #PWR = string( abs(Spower) ) #DMP = string( SdampLo ) denoised = defined(denoised) ? denoised : yv12lutxy(clp,clp.removegrain(4,-1),"x "+NRL+" + y < x "+NRL+" + x "+NRL+" - y > x "+NRL+" - y ? ?",U=2,V=2) NRdiff = yv12lutxy(clp,denoised,"x y - 128 +","x y - 128 +","x y - 128 +",U=3,V=3) tame = yv12lutxy(clp,denoised,"x "+NRLL+" + y < x "+NRL2+" + x "+NRLL+" - y > x "+NRL2+" - x "+BIAS1+" * y "+BIAS2+" * + 100 / ? ?") head = tame.sharpen2(Sstr,Spower,Szp,SdampLo,SdampHi,4) # head = head.maskedmerge(tame,tame.prewitt(multiplier=1.0).expand().removegrain(20)) (ssx==1.0 && ssy==1.0) ? repair(tame.sharpen2(Sstr,Spower,Szp,SdampLo,SdampHi,Smode),head,1,-1,-1) \ : repair(tame.lanczosresize(xss,yss).sharpen2(Sstr,Spower,Szp,SdampLo,SdampHi,Smode),head.bicubicresize(xss,yss,-.2,.6),1,-1,-1).lanczosresize(ox,oy) Soothe(last,tame,sootheT,sootheS) sharpdiff= yv12lutxy(tame,last,"x y - 128 +",U=1,V=1) (NRlimit==0) ? clp : \ yv12lutxy(clp,NRdiff,"y 128 "+NRL+" + > x "+NRL+" - y 128 "+NRL+" - < x "+NRL+" + x y 128 - - ? ?", \ "y 128 "+NRL+" + > x "+NRL+" - y 128 "+NRL+" - < x "+NRL+" + x y 128 - - ? ?", \ "y 128 "+NRL+" + > x "+NRL+" - y 128 "+NRL+" - < x "+NRL+" + x y 128 - - ? ?",U=3,V=3) Slimit>=0 ? yv12lutxy(last,sharpdiff,"y 128 "+SLIM+" + > x "+SLIM+" - y 128 "+SLIM+" - < x "+SLIM+" + x y 128 - - ? ?",U=2,V=2) \ : yv12lutxy(last,sharpdiff,"y 128 = x x y 128 - abs 1 "+SlIM+" / ^ y 128 - y 128 - abs / * - ?",U=2,V=2) return( last ) } # ======= Modified sharpening function ======= function sharpen2(clip clp, float strength, int power, float zp, float lodmp, float hidmp, int rgmode) { STR = string( strength ) PWR = string( 1.0/float(power) ) ZRP = string( ZP ) DMP = string( lodmp ) HDMP = (hidmp==0) ? "1" : "1 x y - abs "+string(hidmp)+" / 4 ^ +" yv12lutxy( clp, clp.RemoveGrain(rgmode,-1,-1), \ "x y = x x x y - abs "+ZRP+" / "+PWR+" ^ "+ZRP+" * "+STR+" * x y - 2 ^ x y - 2 ^ "+DMP+" + / * x y - x y - abs / * "+HDMP+" / + ?",U=2,V=2) return( last ) } # ======= Soothe() function to stabilze sharpening ======= function Soothe(clip sharp, clip orig, int "sootheT", int "sootheS") { sootheT = default(sootheT, 25 ) sootheS = default(sootheS, 0 ) sootheT = (sootheT > 100) ? 100 : (sootheT < -100) ? -100 : sootheT sootheS = (sootheS > 100) ? 100 : (sootheS < 0) ? 0 : sootheS ST = string( 100 - abs(sootheT)) SSPT = string( 100 - abs(sootheS)) yv12lutxy(orig,sharp,"x y - 128 +","x y - 128 +","x y - 128 +", U=1,V=1) (sootheS==0) ? last \ : yv12lutxy( last, last.removegrain(20,-1,-1), \ "x 128 - y 128 - * 0 < x 128 - 100 / "+SSPT+" * 128 + x 128 - abs y 128 - abs > x "+SSPT+" * y 100 "+SSPT+" - * + 100 / x ? ?", U=1,V=1) (sootheT==0) ? last \ : yv12lutxy( last, last.temporalsoften(1,255,0,32,2), \ "x 128 - y 128 - * 0 < x 128 - 100 / "+ST+" * 128 + x 128 - abs y 128 - abs > x "+ST+" * y 100 "+ST+" - * + 100 / x ? ?", U=1,V=1) (sootheT > -1) ? last \ : yv12lutxy( last, last.temporalsoften(1,255,0,32,2), \ "x 128 - y 128 - * 0 < x 128 - 100 / "+ST+" * 128 + x 128 - abs y 128 - abs > x "+ST+" * y 100 "+ST+" - * + 100 / x ? ?", U=1,V=1) yv12lutxy(orig,last,"x y 128 - -","x y 128 - -","x y 128 - -",U=1,V=1) # mergechroma(sharp) # not needed in SeeSaw return( last ) } # ======= MOD4-and-atleast-16 helper function ======= function m4(float x) {x<16?16:int(round(x/4.0)*4)}
Code:# LimitedSharpen() ( a modded version, 29 Oct 2005 ) # # A multi-purpose sharpener by Didée # # # Changes in this mod: # # - RemoveGrain >= v0.9 IS REQUIRED!! # ================================== # # - Smode=4 / sometimes does the magic ;-) # - a separate "undershoot" parameter, to allow for some line darkening in comic or Anime # - Lmode=3 / on edges, limited sharpening with zero OS & US. On not-edges, limited sharpening with specified OS + LS # - "soft" acts different now: no more boolean true/false, but instead integer 0 - 100 (or -1 -> automatic) # instead of blurring before finding minima/maxima, it now softens the "effect-of-sharpening" # - edgemode=-1 now shows the edgemask. (scaling still not implemented :p ) # ## - MODIFIED version using MaskTools 2.0 function LimitedSharpenFaster( clip clp, \ float "ss_x", float "ss_y", \ int "dest_x", int "dest_y", \ int "Smode" , int "strength", int "radius", \ int "Lmode", bool "wide", int "overshoot", int "undershoot", \ int "soft", int "edgemode", bool "special", \ int "exborder" ) { ox = clp.width oy = clp.height Smode = default( Smode, 3 ) ss_x = (Smode==4) \ ? default( ss_x, 1.25) \ : default( ss_x, 1.5 ) ss_y = (Smode==4) \ ? default( ss_y, 1.25) \ : default( ss_y, 1.5 ) dest_x = default( dest_x, ox ) dest_y = default( dest_y, oy ) strength = (Smode==1) \ ? default( strength, 160 ) \ : default( strength, 100 ) strength = (Smode==2&&strength>100) ? 100 : strength radius = default( radius, 2 ) Lmode = default( Lmode, 1 ) wide = default( wide, false ) overshoot = default( overshoot, 1) undershoot= default( undershoot, overshoot) softdec = default( soft, 0 ) soft = softdec!=-1 ? softdec : sqrt( (((ss_x+ss_y)/2.0-1.0)*100.0) ) * 10 soft = soft>100 ? 100 : soft edgemode = default( edgemode, 0 ) special = default( special, false ) exborder = default( exborder, 0) #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 smx=exborder==0?dest_x:round(dest_x/Exborder/4)*4 smy=exborder==0?dest_y:round(dest_y/Exborder/4)*4 clp.isYV12() ? clp : clp.converttoyv12() ss_x != 1.0 || ss_y != 1.0 ? last.lanczosresize(xxs,yys) : last tmp = last 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) tmpsoft = tmp.removegrain(11,-1) dark_limit1 = tmp.mt_inpand() bright_limit1 = tmp.mt_expand() dark_limit = (wide==false) ? dark_limit1 : dark_limit1 .removegrain(20,-1).mt_inpand() bright_limit = (wide==false) ? bright_limit1 : bright_limit1.removegrain(20,-1).mt_expand() minmaxavg = special==false \ ? mt_average(dark_limit1, bright_limit1) \ : mt_merge(dark_limit,bright_limit,tmp.removegrain(11,-1),Y=3,U=-128,V=-128) Str=string(float(strength)/100.0) normsharp = Smode==1 ? unsharpmask(strength,radius,0) \ : Smode==2 ? sharpen(float(strength)/100.0) \ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +") \ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+ \ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?") OS = string(overshoot) US = string(undershoot) mt_lutxy( bright_limit, normsharp, yexpr="y x "+OS+" + < y x y x - "+OS+" - 1 2 / ^ + "+OS+" + ?") mt_lutxy( dark_limit, last, yexpr="y x "+US+" - > y x x y - "+US+" - 1 2 / ^ - "+US+" - ?") Lmode==1 ? mt_clamp(normsharp, bright_limit, dark_limit, overshoot, undershoot) : last normal = last zero = mt_clamp(normsharp, bright_limit, dark_limit, 0,0) Lmode==3 ? mt_merge(normal,zero,edge.mt_inflate()) : normal edgemode==0 ? last \ : edgemode==1 ? mt_merge(tmp,last,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1) \ : mt_merge(last,tmp,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1) AMNT = string(soft) AMNT2 = string(100-soft) sharpdiff=mt_makediff(tmp,last) sharpdiff2=mt_lutxy(sharpdiff,sharpdiff.removegrain(19,-1), \ "x 128 - abs y 128 - abs > y "+AMNT+" * x "+AMNT2+" * + 100 / x ?") soft==0 ? last : mt_makediff(tmp,sharpdiff2) (ss_x != 1.0 || ss_y != 1.0) \ || (dest_x != ox || dest_y != oy) ? lanczosresize(dest_x,dest_y) : last ex=blankclip(last,width=smx,height=smy,color=$FFFFFF).addborders(2,2,2,2).coloryuv(levels="TV->PC") \.blur(1.3).mt_inpand().blur(1.3).bicubicresize(dest_x,dest_y,1.0,.0) tmp = clp.lanczosresize(dest_x,dest_y) clp.isYV12() ? ( exborder==0 ? tmp.mergeluma(last) \ : mt_merge(tmp,last,ex,Y=3,U=1,V=1) ) \ : ( exborder==0 ? tmp.mergeluma(last.converttoyuy2()) \ : tmp.mergeluma( mt_merge(tmp.converttoyv12(),last,ex,Y=3,U=1,V=1) \ .converttoyuy2()) ) (edgemode!= -1) ? last : edge.lanczosresize(dest_x,dest_y).greyscale return last }
+ Reply to Thread
Results 1 to 12 of 12
-
-
- You need MT_masktools.dll for limitedsharpenfaster.
- RemoveGrain(mode=1) is a faster and newer replacement for undot()
- no need to overshoot=1 AND undershoot=1
- you shouldn't load both Soothe AND SeeSaw, as they both have differing Soothe commands in them.
- way too many filters and plugins. Post a short (20 sec) clip of your source material. I'll bet it can be enhanced with 1/2 the filters. -
Originally Posted by Soopafresh
Yeah, I've tried that one too but it didn't seem to help. Although, it's called "mt_masktools.dll" and maybe it's a different version?
- Alright, I'll give RemoveGrain(mode=1) a try then
- Which shoot command would be recommended to keep?
- Ah, so you're saying drop the SeeSaw.avs and the below?
Code:a= last b=a.hqdn3d() SeeSaw(a,b, NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=5, Spower=5, Sdamplo=6, Szp=16)
-
If you make an .avsi of LimitedSharpenFaster (and Seesaw), it should be in your AviSynth Plugins folder. You won't have to import it as it gets loaded automatically into VDubMod when you open it. If you want to import it, rename it back to .avs.
Maybe it's a different version?
AviSynth doesn't care about capital letters. You need both MaskTools:
http://avisynth.org/mediawiki/LimitedSharpen -
You need to simplify. You'll have to time this encode with a calendar with the number of things you're trying to do. Post a short clip (20 seconds). We'll help you determine the appropriate filters for your source. Manono is well versed in this stuff.
Also -
EEDI2().TurnRight().EEDI2().TurnLeft()
Spline36Resize(852,480)
A cool trick, but EEDI2 has a warping quality to it which makes enlargements look...weird.
Also -
LoadPlugin("C:\Documents and Settings\\Desktop\AutoMKV 0.84b\exe\Filter\RemoveGrainS.dll")
that extra slash is going to create problems. -
manono and Soopafresh, appreciate both your help. But, just so you know, I'm somewhat new to all this and trying to learn.
Yes, I'll post two clips, just give me a few minutes.
Also, the two clips I'm posting are from a Playstation 2 game with its output mode set to 16x9 and captured at 720x480. Thus, I'm trying to find the best way to upscale it to 852x480 (853x480 won't work it seems since it's odd number) widescreen.
Yeah, I see that error, but the real file doesn't have that. For the post I removed my windows account name and it seems I left an extra character. -
No problemo. We're all learning. That's part of the fun. No judgements here.
-
Alright, it will be a little while more before I get them uploaded. But, if you can, check them out tomorrow.
-
Took awhile, but below are the clips (about 22 seconds each). Both videos in each section are the same, just one has had its fields aligned the other had not.
Anyway, like I said, my goal is it upscale these to wide-screen (as they were intended) and have them still look good (so I'm going to look into what filters can help). I also need to do some research as to what resolution would be better to capture the 16x9 mode with (640x480 or 720x480) as I'm not really sure which would work better for the upscaling. You see, I have two capture cards. One is (released a few years ago) and does several resolutions up to 640x480 and the other (released a few months ago) and it does just 720x480 (both have S-Video). As you can see, I have a lot to consider, or maybe I'm over-analyzing. Any thoughts? -
Hey Seraphic-, saw your posts over on Doom9. Those guys provided a lot of information for the exact questions you're asking, and when it comes to Avisynth, they're the experts. I mean, they develop the app after all. And you're certainly asking them the right questions.
Please be open to some constructive suggestions, as I'm not trying to sound condescending. When I started with Avisynth, I also wanted to try everything. Some of the functions like LimitedSharpen and SeeSaw are nothing short of amazing when used in the proper manner.
I think you need to spend a week understanding plugin and function locations - where to put the files and how to call them within an Avisynth script. Secondly, you need to understand where to place these commands and functions within the script (which is a continuous learning process). Finally, give yourself a bit of time to try each function alone, on a non-problematic source, just to see what the results look like. Understand each one before you try combining them.
Like I said, we're all learning. I'm 2 years into Avisynth and I've barely scratched the surface of it's functionality, even though I use it all the time. Give yourself the chance to learn the basics.
Start with this, and you'll reduce 50% of your headaches:
-
Originally Posted by Soopafresh
Most of the filters I was using come as part of AutoMKV 0.84b, so I didn't want to move them around, that was the reason I call from different locations. Like I said, I'm trying to learn, just hard to find guide to help for what I'm looking to do.
One last question if you can. I was using EEDI2 to add some anti-aliasing, but you're right it does add some blurring/warping.
Originally Posted by Soopafresh
Similar Threads
-
Virtualdub and audio codec missing.
By nzdreamer55 in forum EditingReplies: 20Last Post: 29th Dec 2013, 23:32 -
VirtualDub Compression Codecs All missing?
By blazr in forum Newbie / General discussionsReplies: 0Last Post: 29th Feb 2012, 05:14 -
Codec missing virtualdub
By tkitez in forum Video ConversionReplies: 25Last Post: 12th Jan 2011, 20:42 -
Audio Source Missing from VirtualDub
By Flynn in forum Capturing and VCRReplies: 3Last Post: 5th Jun 2010, 05:58 -
Audio missing when opening an Avisynth script in WMP & VirtualDubMOD
By aln688 in forum Video ConversionReplies: 3Last Post: 2nd Apr 2010, 05:09