VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. Hello guys,

    I hope someone can tell me or explain what kind of filters applied to sharpening the Picture 2 (video screenshot). I am trying to search on the net but I can't find the answer coz I really dont know how or what it is.
    If you can see theres a difference between Picture 1 & Picture 2, the picture 2 is more clear than the picture 1, note, the picture 1 is the source of the video. Hoping someone can help me

    Thanks in advance

    Picture 1
    http://www.freeimagehosting.net/onlcj

    Picture 2
    http://www.freeimagehosting.net/xht7p
    Quote Quote  
  2. ~Sharpen(0.5)

    Or look into LSFMod() and variants.
    Quote Quote  
  3. Take your pick:

    http://avisynth.org/mediawiki/External_filters#Sharpeners

    Something like in the picture is sometimes done using IIP:

    forum.doom9.org/showthread.php?t=70916

    But it's difficult to set up, is mainly designed for clean sources (such as yours), and is very slow. Me, I use LimitedSharpenFaster.

    Also be aware that a sharpened video requires many more bits for the same quality and if doing it for the same size (such as a DVDR), often all the results of the sharpening are negated by the higher average quants used.
    Quote Quote  
  4. I didn't mention this before, but in my opinion, the second picture is over sharpened. It's got halos at sharp edges and unnatural looking edges. Rather than sharpening the first picture, the second should be softened.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    ~Sharpen(0.5)

    Or look into LSFMod() and variants.
    When I used Sharpen(0.5) in picture 1 its looks the same sharp like picture 2 but the problem is its looks like raining (dots), how can I remove the dots to make it clear with the same sharp like picture 2?

    Originally Posted by manono View Post

    Something like in the picture is sometimes done using IIP:

    forum.doom9.org/showthread.php?t=70916
    More IIP.avs need plugins I couldn't find

    undot.dll - found
    MaskTools_v1.4.9.dll - found MaskTools-v1.5.8
    WarpSharp.dll - found aWarpSharp.dll
    LoadPluginEx.dll - not
    dustv5.dll - not
    Quote Quote  
  6. If you use Sharpen() on a compressed image with a lot of blocking artifacts the edges, and especially corners, of the blocks will be accentuated. For example (4x point resize):

    before:
    Name:  before.png
Views: 10804
Size:  14.9 KB

    after Sharpen(1.0):
    Name:  after.png
Views: 11003
Size:  26.8 KB

    As you can see, before sharpening there are 8x8 block artifacts in the source image (from compression). After sharpening the edges and the corners of the blocks are accentuated. Optimally, you want to get the image before those block artifacts have been introduced. If you can't get that image you can try using deblocking filters before sharpening. The same image, deblocked before sharpening:

    After Deblock_QED().Sharpen(1.0):
    Name:  deblock.png
Views: 10847
Size:  28.3 KB

    There are now fewer blocking artfacts. Increasing the deblocking strength would have further reduced blocking artifacts but also blurred the overall image more.

    Simple sharpening also increases grain noise (conversely, the opposite, Blur(), reduces grain noise). Sharpening can also create halos (darker and lighter bands) around already sharp edges*. This is why filters like LSFMod (a variation of the LimitedSharpenFaster() filter) exist. They attempt to sharpen edges without increasing noise and without producing halos.

    * if you look at your "sharp" image in your first post you'll see halos at the boundary between the guy's dark shirt and the lighter background. That is one reason why I said that picture was over sharpened.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    This is why filters like LSFMod (a variation of the LimitedSharpenFaster() filter) exist. They attempt to sharpen edges without increasing noise and without producing halos.
    .
    I've got an error on script for LSFMod.

    Here is the script

    import("H:\Sharpen Tools\LSFmod.v1.9.avsi")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\MaskTools.dll")
    LoadPlugin("H:\Sharpen Tools\removegrain_1.0\RemoveGrain.dll")
    LoadPlugin("H:\Sharpen Tools\variableblur_25_dll_20050524\VariableBlur.dl l")
    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")

    movie = mpeg2source("E:\movie.d2v")

    LSFmod(smode=5,smethod=4,defaults="fast", soft=-2,edgemaskHQ=true)


    Here is the error
    Avisynth open failure:
    LoadPlugin:unable to load "H:\Sharpen Tools\variableblur_25_dll_20050524\VariableBlur.dl l"
    (C:\users\desktop\movie.avs, line 4)

    How can I fix it? Any suggestions how to make a script?

    Thanks in advance
    Quote Quote  
  8. Is that extra space between the dl and l in the variable blur line in you script or did the forum software add it?
    Quote Quote  
  9. Originally Posted by jagabo View Post
    Is that extra space between the dl and l in the variable blur line in you script or did the forum software add it?
    I checked it again the script and it has no space between dl and l
    Quote Quote  
  10. The default settings of LSFMod() don't even use VariableBlur. So you may be able to leave that line out of your script. Otherwise, just make sure the path to VariableBlur.dll is correct. Or use LimitedShapenFaster() instead (which doesn't use VariableBlur).
    Quote Quote  
  11. Still I've got error

    import("H:\Sharpen Tools\LSFmod.v1.9.avsi")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\MaskTools.dll")
    LoadPlugin("H:\Sharpen Tools\removegrain_1.0\RemoveGrain.dll")

    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")

    movie = mpeg2source("E:\movie.d2v")

    LSFmod(smode=5,smethod=4,defaults="fast", soft=-2,edgemaskHQ=true)

    Avisynth open failure:
    Script error: Invalid arguments to function "LSFmod"
    (C:\users\desktop\movie.avs, line 9)

    I change line 9 to this

    LSFmod(ss_x=1.0,ss_y=1.0,Lmode=1,soothe=false,Smod e=5,strength=40)

    and it show the same error
    Quote Quote  
  12. Error for LimitedSharpenFaster

    import("H:\Sharpen Tools\LimitedSharpenFaster.avs")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\MaskTools.dll")
    LoadPlugin("H:\Sharpen Tools\removegrain_1.0\RemoveGrain.dll")
    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")

    movie = mpeg2source("E:\movie.d2v")

    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40 )

    Avisynth open failure:
    Script error: Invalid arguments to function "LimitedSharpenFaster"
    (C:\users\desktop\movie.avs, line 8)
    Quote Quote  
  13. Originally Posted by slarke View Post
    movie = mpeg2source("E:\movie.d2v")

    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40 )
    You have imported a stream and named it "movie". You then call LimitedSharpenFaster() without a video stream. Change your script to:

    Code:
    movie = mpeg2source("E:\movie.d2v")
    LimitedSharpenFaster(movie, ss_x=1.0,ss_y=1.0,strength=40)
    If you don't explicitly name a video stream it will default to "last". For example:

    Code:
    mpeg2source("E:\movie.d2v")
    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40)
    is the same as:

    Code:
    last=mpeg2source("E:\movie.d2v")
    last=LimitedSharpenFaster(last, ss_x=1.0,ss_y=1.0,strength=40)
    return(last)
    Quote Quote  
  14. Originally Posted by jagabo View Post
    Originally Posted by slarke View Post
    movie = mpeg2source("E:\movie.d2v")

    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40 )
    You have imported a stream and named it "movie". You then call LimitedSharpenFaster() without a video stream. Change your script to:

    Code:
    movie = mpeg2source("E:\movie.d2v")
    LimitedSharpenFaster(movie, ss_x=1.0,ss_y=1.0,strength=40)
    If you don't explicitly name a video stream it will default to "last". For example:

    Code:
    mpeg2source("E:\movie.d2v")
    LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=40)
    is the same as:

    Code:
    last=mpeg2source("E:\movie.d2v")
    last=LimitedSharpenFaster(last, ss_x=1.0,ss_y=1.0,strength=40)
    return(last)
    I tried all the script and its show this

    import("H:\Sharpen Tools\LimitedSharpenFaster.avs")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\MaskTools.dll")
    LoadPlugin("H:\Sharpen Tools\removegrain_1.0\RemoveGrain.dll")
    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")

    last=mpeg2source("E:\movie.d2v")
    last=LimitedSharpenFaster(last, ss_x=1.0,ss_y=1.0,strength=40)
    return(last)

    Avisynth open failure:
    Script error: there is no function named "mt_edge"
    (H:\Sharpen Tools\LimitedSharpenFaster.avs, line 64)
    (C:\users\desktop\movie.avs, line 7)


    LimitedSharpenFaster.avs

    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      = default( ss_y,      ss_x)
    Assert(ss_x >= 1.0 && ss_y >= 1.0,"ss_x and ss_y must be at least 1.0!")
    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.spline36resize(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) ? spline36resize(dest_x,dest_y) : last
    
    ex=blankclip(last,width=smx,height=smy,color=$FFFFFF).addborders(2,2,2,2).coloryuv(levels="TV->PC")
     \.removegrain(mode=19).mt_inpand().removegrain(mode=19).bicubicresize(dest_x,dest_y,1.0,.0)
    tmp =  clp.spline36resize(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.spline36resize(dest_x,dest_y).greyscale
    
    return last
    }
    Quote Quote  
  15. mt_edge() is a part of Mask Tools 2.0.

    http://manao4.free.fr/mt_masktools.html

    I think this is the one you want:

    http://manao4.free.fr/mt_masktools_26.dll
    Quote Quote  
  16. Originally Posted by jagabo View Post
    mt_edge() is a part of Mask Tools 2.0.

    http://manao4.free.fr/mt_masktools.html

    I think this is the one you want:

    http://manao4.free.fr/mt_masktools_26.dll
    Now its working for the LimitedSharpenFaster.avs, thanks
    I change also for the LSFmod but not work

    import("H:\Sharpen Tools\LSFmod.v1.9.avsi")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\mt_masktools_26.dll")
    LoadPlugin("H:\Sharpen Tools\removegrain_1.0\RemoveGrain.dll")
    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")

    last=mpeg2source("E:\movie.d2v")
    last=LSFmod(smode=5,smethod=4,defaults="fast", soft=-2,edgemaskHQ=true)
    return(last)

    Avisynth open failure:
    Script error: there is no function named "repair"
    (H:\Sharpen Tools\LSFmod.v1.9.avsi, line 558)
    (C:\users\desktop\movie.avs, line 7)

    LSFmod.v1.9.avsi

    Code:
    ################################################################################################
    ###                                                                                          ###
    ###                       LimitedSharpenFaster MOD : function LSFmod()                       ###
    ###                                                                                          ###
    ###                                Modded Version by LaTo INV.                               ###
    ###                                                                                          ###
    ###                                  v1.9 - 05 October 2009                                  ###
    ###                                                                                          ###
    ################################################################################################
    ###
    ### +-----------+
    ### | CHANGELOG |
    ### +-----------+
    ###
    ### v1.9 : - tweaked settings
    ###        - default preset is now defaults="fast" /!\
    ###
    ### v1.8 : - changed preblur to allow more tweaking (bool->string)
    ###        - tweaked settings
    ###        - cleaned the code
    ###        - updated documentation
    ###
    ### v1.7 : - changed Smethod=4 to "source"
    ###
    ### v1.6 : - added preblur option
    ###        - added new Smethod=4
    ###
    ### v1.5 : - fixed LUT expression (thanks to Didée)
    ###        - changed Smethod to Smethod+secure
    ###
    ### v1.4 : - changed defaults="new" to defaults="slow" & defaults="fast"
    ###        - added show parameter
    ###        - cleaned a little the code
    ###
    ### v1.3 : - changed a little Smethod=3&5 (same effect, but more precise)
    ###        - added new calculation for soft (soft=-2) [default on]
    ###        - added warning about bad settings (no more silent)
    ###        - updated the documentation
    ###
    ### v1.2 : - added new Lmode<0 (limit with repair)
    ###        - added 2 new Smode (unsharp masking)
    ###        - changed Smode order: now old Smode3-4 is new Smode3-4 to avoid mistake
    ###
    ### v1.1 : - fixed a bug with dest_x!=ox or dest_y!=oy
    ###        - replaced Lfactor by over/undershoot2
    ###
    ### v1.0 : - deleted old Smode(1-4), added new Smode(1-3) & Smethod(1-5)
    ###        - added parameters for nonlinear sharpening (S2zp,S2pwr,S2dmpLo,S2dmpHi)
    ###        - corrected the nonlinear formula
    ###        - added new Lmode 2 & 4 + fixed Lmode 0
    ###        - added faster edgemask
    ###        - added soothe temporal stabilization, 2 parameters: soothe & keep
    ###        - replaced lanczosresize by spline36resize
    ###        - moved "strength" parameter (first place)
    ###        - deleted wide, special and exborder
    ###        - changed some code (cosmetic)
    ###        - added "defaults" parameter (to switch between original and modded version)
    ###        - added documentation
    ###
    ###
    ###
    ### +--------------+
    ### | DEPENDENCIES |
    ### +--------------+
    ###
    ### -> Masktools    (v2a36)
    ### -> Removegrain  (v1.0pre)
    ### -> Warpsharp    (2003.11.03) [for Smode=1]
    ### -> Variableblur (v0.30)      [for Smode=2]
    ###
    ###
    ###
    ### +-------+
    ### | USAGE |
    ### +-------+
    ###
    ### LSFmod( strength, Smode, Smethod, kernel, 
    ###         preblur, secure, source,
    ###         Szrp, Spwr, SdmpLo, SdmpHi,
    ###         Lmode, overshoot, undershoot, overshoot2, undershoot2,
    ###         soft, soothe, keep,
    ###         edgemode, edgemaskHQ,
    ###         ss_x, ss_y, dest_x, dest_y,
    ###         show, screenW, screenH,
    ###         defaults )
    ###
    ###
    ###
    ### +---------+
    ### | GENERAL |
    ### +---------+
    ###
    ### strength [int]
    ### --------------
    ### Strength of the sharpening
    ###
    ### Smode [int: 1,2,3,4,5]
    ### ----------------------
    ### Sharpen mode:
    ###    =1 : Unsharp masking (from warpsharp)
    ###    =2 : Unsharp masking (from variableblur) 
    ###    =3 : Range sharpening
    ###    =4 : Nonlinear sharpening (original  version)
    ###    =5 : Nonlinear sharpening (corrected version)
    ###
    ### Smethod [int: 1,2,3]
    ### --------------------
    ### Sharpen method: (only used in Smode=3,4,5)
    ###    =1 : 3x3 kernel
    ###    =2 : Min/Max
    ###    =3 : Min/Max + 3x3 kernel
    ###
    ### kernel [int: 11,12,19,20]
    ### -------------------------
    ### Kernel used in Smethod=1&3
    ### In strength order: + 19 > 12 >> 20 > 11 -
    ###
    ###
    ###
    ### +---------+
    ### | SPECIAL |
    ### +---------+
    ###
    ### preblur [string: "ON","OFF",...]
    ### --------------------------------
    ### Mode to avoid noise sharpening & ringing (only used in Smode=3,4,5)
    ### "ON" is sufficient to prevent ringing, but to prevent noise sharpening you should set your own denoiser
    ###    Usage:   LSFmod(preblur="YourFavoriteDenoiser()")
    ###    Example: LSFmod(preblur="FFT3Dfilter(sigma=4,plane=0)")
    ###
    ###
    ### secure [bool]
    ### -------------
    ### Mode to avoid banding & oil painting (or face wax) effect of sharpening
    ### (only used in Smode=3,4,5)
    ###
    ### source [clip]
    ### -------------
    ### If source is defined, LSFmod doesn't sharp more a denoised clip than this source clip
    ### In this mode, you can safely set Lmode=0 & PP=off
    ###    Usage:   denoised.LSFmod(source=source)
    ###    Example: last.FFT3Dfilter().LSFmod(source=last,Lmode=0,soft=0)
    ###
    ###
    ###
    ### +----------------------+
    ### | NONLINEAR SHARPENING |
    ### +----------------------+
    ###
    ### Szrp [int]
    ### ----------
    ### Zero Point:
    ###    - differences below Szrp are amplified (overdrive sharpening)
    ###    - differences above Szrp are reduced   (reduced sharpening)
    ###
    ### Spwr [int]
    ### ----------
    ### Power: exponent for sharpener
    ###
    ### SdmpLo [int]
    ### ------------
    ### Damp Low: reduce sharpening for small changes [0:disable]
    ###
    ### SdmpHi [int]
    ### ------------
    ### Damp High: reduce sharpening for big changes [0:disable]
    ###
    ###
    ###
    ### +----------+
    ### | LIMITING |
    ### +----------+
    ###
    ### Lmode [int: ...,0,1,2,3,4]
    ### --------------------------
    ### Limit mode:
    ###    <0 : Limit with repair (ex: Lmode=-1 --> repair(1), Lmode=-5 --> repair(5)...)
    ###    =0 : No limit
    ###    =1 : Limit to over/undershoot
    ###    =2 : Limit to over/undershoot on edges and no limit on not-edges
    ###    =3 : Limit to zero on edges and to over/undershoot on not-edges
    ###    =4 : Limit to over/undershoot on edges and to over/undershoot2 on not-edges
    ###
    ### overshoot [int]
    ### ---------------
    ### Limit for pixels that get brighter during sharpening
    ###
    ### undershoot [int]
    ### ----------------
    ### Limit for pixels that get darker during sharpening
    ###
    ### overshoot2 [int]
    ### ----------------
    ### Same as overshoot, only for Lmode=4
    ###
    ### undershoot2 [int]
    ### -----------------
    ### Same as undershoot, only for Lmode=4
    ###
    ###
    ###
    ### +-----------------+
    ### | POST-PROCESSING |
    ### +-----------------+
    ###
    ### soft [int: -2,-1,0...100]
    ### -------------------------
    ### Soft the sharpening effect (-1 = old autocalculate, -2 = new autocalculate)
    ###
    ### soothe [bool]
    ### -------------
    ###    =true  : Enable soothe temporal stabilization
    ###    =false : Disable soothe temporal stabilization
    ###
    ### keep [int: 0...100]
    ### -------------------
    ### Minimum percent of the original sharpening to keep (only with soothe=true)
    ###
    ###
    ###
    ### +-------+
    ### | EDGES |
    ### +-------+
    ###
    ### edgemode [int: -1,0,1,2]
    ### ------------------------
    ###    =-1 : Show edgemask
    ###    = 0 : Sharpening all
    ###    = 1 : Sharpening only edges
    ###    = 2 : Sharpening only not-edges
    ###
    ### edgemaskHQ [bool]
    ### -----------------
    ###    =true  : Original edgemask
    ###    =false : Faster edgemask
    ###
    ###
    ###
    ### +------------+
    ### | UPSAMPLING |
    ### +------------+
    ###
    ### ss_x ; ss_y [float]
    ### -------------------
    ### Supersampling factor (reduce aliasing on edges)
    ###
    ### dest_x ; dest_y [int]
    ### ---------------------
    ### Output resolution after sharpening (avoid a resizing step)
    ###
    ###
    ###
    ### +-------+
    ### | DEBUG |
    ### +-------+
    ###
    ### show [bool]
    ### -----------
    ### Show debug clip & informations
    ###
    ### screenW ; screenH [int]
    ### -----------------------
    ### Screen resolution (for show clip)
    ###
    ###
    ###
    ### +----------+
    ### | SETTINGS |
    ### +----------+
    ###
    ### defaults [string: "old" or "slow" or "fast"]
    ### --------------------------------------------
    ###    = "old"  : Reset settings to original version (output will be THE SAME AS LSF)
    ###    = "slow" : Enable SLOW modded version settings
    ###    = "fast" : Enable FAST modded version settings
    ###  --> /!\ [default:"fast"]
    ###
    ###
    ### defaults="old" :  - strength    = 100
    ### ----------------  - Smode       = 3
    ###                   - Smethod     = Smode==3?2:1
    ###                   - kernel      = 11
    ###
    ###                   - preblur     = "OFF"
    ###                   - secure      = false
    ###                   - source      = undefined
    ###
    ###                   - Szrp        = 16
    ###                   - Spwr        = 2
    ###                   - SdmpLo      = strength/25
    ###                   - SdmpHi      = 0
    ###
    ###                   - Lmode       = 1
    ###                   - overshoot   = 1
    ###                   - undershoot  = overshoot
    ###                   - overshoot2  = overshoot*2
    ###                   - undershoot2 = overshoot2
    ###
    ###                   - soft        = 0
    ###                   - soothe      = false
    ###                   - keep        = 25
    ###
    ###                   - edgemode    = 0
    ###                   - edgemaskHQ  = true
    ###
    ###                   - ss_x        = Smode==3?1.50:1.25
    ###                   - ss_y        = ss_x
    ###                   - dest_x      = ox
    ###                   - dest_y      = oy
    ###
    ###                   - show        = false
    ###                   - screenW     = 1280
    ###                   - screenH     = 1024
    ###
    ###
    ### defaults="slow" : - strength    = 100
    ### ----------------- - Smode       = 5
    ###                   - Smethod     = 3
    ###                   - kernel      = 11
    ###
    ###                   - preblur     = "OFF"
    ###                   - secure      = true
    ###                   - source      = undefined
    ###
    ###                   - Szrp        = 16
    ###                   - Spwr        = 4
    ###                   - SdmpLo      = 4
    ###                   - SdmpHi      = 48
    ###
    ###                   - Lmode       = 4
    ###                   - overshoot   = strength/100
    ###                   - undershoot  = overshoot
    ###                   - overshoot2  = overshoot*2
    ###                   - undershoot2 = overshoot2
    ###
    ###                   - soft        = -2
    ###                   - soothe      = true
    ###                   - keep        = 20
    ###
    ###                   - edgemode    = 0
    ###                   - edgemaskHQ  = true
    ###
    ###                   - ss_x        = 1.50
    ###                   - ss_y        = ss_x
    ###                   - dest_x      = ox
    ###                   - dest_y      = oy
    ###
    ###                   - show        = false
    ###                   - screenW     = 1280
    ###                   - screenH     = 1024
    ###
    ###
    ### defaults="fast" : - strength    = 100
    ### ----------------- - Smode       = 3
    ###                   - Smethod     = 2
    ###                   - kernel      = 11
    ###
    ###                   - preblur     = "OFF"
    ###                   - secure      = true
    ###                   - source      = undefined
    ###
    ###                   - Szrp        = 16
    ###                   - Spwr        = 4
    ###                   - SdmpLo      = 4
    ###                   - SdmpHi      = 48
    ###
    ###                   - Lmode       = 1
    ###                   - overshoot   = strength/100
    ###                   - undershoot  = overshoot
    ###                   - overshoot2  = overshoot*2
    ###                   - undershoot2 = overshoot2
    ###
    ###                   - soft        = 0
    ###                   - soothe      = true
    ###                   - keep        = 20
    ###
    ###                   - edgemode    = 0
    ###                   - edgemaskHQ  = false
    ###
    ###                   - ss_x        = 1.25
    ###                   - ss_y        = ss_x
    ###                   - dest_x      = ox
    ###                   - dest_y      = oy
    ###
    ###                   - show        = false
    ###                   - screenW     = 1280
    ###                   - screenH     = 1024
    ###
    ################################################################################################
    
    function LSFmod( clip input, int "strength", int "Smode", int "Smethod", int "kernel",
    \                string "preblur", bool "secure", clip "source",
    \                int "Szrp", int "Spwr", int "SdmpLo", int "SdmpHi",
    \                int "Lmode", int "overshoot", int "undershoot", int "overshoot2", int "undershoot2",
    \                int "soft", bool "soothe", int "keep",
    \                int "edgemode", bool "edgemaskHQ",
    \                float "ss_x", float "ss_y", int "dest_x", int "dest_y",
    \                bool "show", int "screenW", int "screenH",
    \                string "defaults" )
    {
    ### DEFAULTS
    version  = "v1.9"
    defaults = default(defaults,"fast")
    num      = defaults=="old" ? 0 : defaults=="slow" ? 1 : defaults=="fast" ? 2 : 3
    
    ox = input.width
    oy = input.height
    
    Assert(isYV12(input) == True ? true : false, chr(10) + "This is not an YV12 clip !" + chr(10))
    Assert(num         != 3      ? true : false, chr(10) + """Defaults must be "old" or "slow" or "fast" !""" + chr(10))
    
    strength    = default( strength,    Select(num,                100 ,                100 ,                100 ) )
    Smode       = default( Smode,       Select(num,                  3 ,                  5 ,                  3 ) )
    Smethod     = default( Smethod,     Select(num,       Smode==3?2:1 ,                  3 ,                  2 ) )
    kernel      = default( kernel,      Select(num,                 11 ,                 11 ,                 11 ) )
    
    preblur     = default( preblur,     Select(num,              "OFF" ,              "OFF" ,              "OFF" ) )
    secure      = default( secure,      Select(num,              false ,               true ,               true ) )
    
    Szrp        = default( Szrp,        Select(num,                 16 ,                 16 ,                 16 ) )
    Spwr        = default( Spwr,        Select(num,                  2 ,                  4 ,                  4 ) )
    SdmpLo      = default( SdmpLo,      Select(num,        strength/25 ,                  4 ,                  4 ) )
    SdmpHi      = default( SdmpHi,      Select(num,                  0 ,                 48 ,                 48 ) )
    
    Lmode       = default( Lmode,       Select(num,                  1 ,                  4 ,                  1 ) )
    overshoot   = default( overshoot,   Select(num,                  1 ,       strength/100 ,       strength/100 ) )
    undershoot  = default( undershoot,  Select(num,          overshoot ,          overshoot ,          overshoot ) )
    overshoot2  = default( overshoot2,  Select(num,        overshoot*2 ,        overshoot*2 ,        overshoot*2 ) )
    undershoot2 = default( undershoot2, Select(num,         overshoot2 ,         overshoot2 ,         overshoot2 ) )
    
    soft        = default( soft,        Select(num,                  0 ,                 -2 ,                  0 ) )
    soothe      = default( soothe,      Select(num,              false ,               true ,               true ) )
    keep        = default( keep,        Select(num,                 25 ,                 20 ,                 20 ) )
    
    edgemode    = default( edgemode,    Select(num,                  0 ,                  0 ,                  0 ) )
    edgemaskHQ  = default( edgemaskHQ,  Select(num,               true ,               true ,              false ) )
    
    ss_x        = default( ss_x,        Select(num, Smode==3?1.50:1.25 ,               1.50 ,               1.25 ) )
    ss_y        = default( ss_y,        Select(num,               ss_x ,               ss_x ,               ss_x ) )
    dest_x      = default( dest_x,      Select(num,                 ox ,                 ox ,                 ox ) )
    dest_y      = default( dest_y,      Select(num,                 oy ,                 oy ,                 oy ) )
    
    show        = default( show,        Select(num,              false ,              false ,              false ) )
    screenW     = default( screenW,     Select(num,               1280 ,               1280 ,               1280 ) )
    screenH     = default( screenH,     Select(num,               1024 ,               1024 ,               1024 ) )
    
    Assert( ( strength >= 0 )                                                ? true : false, chr(10) + "'strength' have not a correct value! [>=0]" + chr(10))
    Assert( ( Smode >= 1 && Smode <= 5 )                                     ? true : false, chr(10) + "'Smode' have not a correct value! [1,2,3,4,5]" + chr(10))
    Assert( ( Smethod >= 1 && Smethod <= 4 )                                 ? true : false, chr(10) + "'Smethod' have not a correct value! [1,2,3,4]" + chr(10))
    Assert( ( kernel == 19 || kernel == 20 || kernel == 11 || kernel == 12 ) ? true : false, chr(10) + "'kernel' have not a correct value! [19,20,11,12]" + chr(10))
    Assert( ( Szrp >= 1 && Szrp <= 255 )                                     ? true : false, chr(10) + "'Szrp' have not a correct value! [1...255]" + chr(10))
    Assert( ( Spwr >= 1 )                                                    ? true : false, chr(10) + "'Spwr' have not a correct value! [>=1]" + chr(10))
    Assert( ( SdmpLo >= 0 && SdmpLo <= 255 )                                 ? true : false, chr(10) + "'SdmpLo' have not a correct value! [0...255]" + chr(10))
    Assert( ( SdmpHi >= 0 && SdmpHi <= 255 )                                 ? true : false, chr(10) + "'SdmpHi' have not a correct value! [0...255]" + chr(10))
    Assert( ( Lmode <= 4 )                                                   ? true : false, chr(10) + "'Lmode' have not a correct value! [...-1,0,1,2,3,4]" + chr(10))
    Assert( ( overshoot >= 0 && overshoot <= 255 )                           ? true : false, chr(10) + "'overshoot' have not a correct value! [0...255]" + chr(10))
    Assert( ( undershoot >= 0 && undershoot <= 255 )                         ? true : false, chr(10) + "'undershoot' have not a correct value! [0...255]" + chr(10))
    Assert( ( overshoot2 >= 0 && overshoot2 <= 255 )                         ? true : false, chr(10) + "'overshoot2' have not a correct value! [0...255]" + chr(10))
    Assert( ( undershoot2 >= 0 && undershoot2 <= 255 )                       ? true : false, chr(10) + "'undershoot2' have not a correct value! [0...255]" + chr(10))
    Assert( ( soft >= -2 && soft <= 100 )                                    ? true : false, chr(10) + "'soft' have not a correct value! [-2,-1,0,1...100]" + chr(10))
    Assert( ( keep >= 0 && keep <= 100 )                                     ? true : false, chr(10) + "'keep' have not a correct value! [0...100]" + chr(10))
    Assert( ( edgemode >= -1 && edgemode <= 2 )                              ? true : false, chr(10) + "'edgemode' have not a correct value! [-1,0,1,2]" + chr(10))
    Assert( ( ss_x >= 1.0 )                                                  ? true : false, chr(10) + "'ss_x' have not a correct value! [>=1.0]" + chr(10))
    Assert( ( ss_y >= 1.0 )                                                  ? true : false, chr(10) + "'ss_y' have not a correct value! [>=1.0]" + chr(10))
    
    soft = soft!=-1  ? soft : sqrt( (((ss_x+ss_y)/2.0-1.0)*100.0) ) * 10
    soft = soft!=-2  ? soft : int( (1.0+(2.0/(ss_x+ss_y))) * sqrt(strength) )
    soft = soft<=100 ? soft : 100
    
    xxs  = round(ox*ss_x/8)*8
    yys  = round(oy*ss_y/8)*8
    
    str  = float(strength)/100.0
    
    
    ### SHARP
    tmp  = ss_x > 1.0 || ss_y > 1.0 ? input.spline36resize(xxs,yys) : input
    pre  = preblur=="OFF" ? tmp
    \    : preblur=="ON"  ? tmp.mt_makediff( mt_lutxy(mt_makediff(tmp,tmp.removegrain(11,-1),U=1,V=1)
    \                                       ,mt_makediff(tmp,tmp.removegrain(4,-1),U=1,V=1)
    \                                       ,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=1,V=1) ,U=1,V=1)
    \    : eval("tmp."+preblur)
    
    dark_limit   = pre.mt_inpand(U=1,V=1)
    bright_limit = pre.mt_expand(U=1,V=1)
    minmaxavg    = mt_average(dark_limit,bright_limit,U=1,V=1)
    
    method = Smethod==1   ? pre.removegrain(kernel,-1)
    \      : Smethod==2   ? minmaxavg
    \      :                minmaxavg.removegrain(kernel,-1)
    
    method = secure==true ? method.mt_lutxy(pre,"x y < x 1 + x y > x 1 - x ? ?",U=1,V=1)
    \      :                method
    
    method = preblur=="OFF" ? method : tmp.mt_makediff(mt_makediff(pre,method,U=1,V=1),U=1,V=1)
    
    normsharp = Smode==1 ? tmp.unsharpmask(strength=int(str*100),radius=round(1.0+((ss_x+ss_y)/2.0)),threshold=0)
    \         : Smode==2 ? tmp.unsharp(strength=str,vary=((ss_x+ss_y)/2.0),varc=1,border=3,U=1,V=1)
    \         : Smode==3 ? mt_lutxy(tmp, method, yexpr="x x y - "+string(str)+" * +",U=1,V=1)
    \         : Smode==4 ? mt_lutxy(tmp, method, yexpr="x y == x x x y - abs "+string(Szrp)+" / 1 "+string(Spwr)+" / ^ "+string(Szrp)+" * "+string(str)+" * x y - 2 ^ x y - 2 ^ "
    \                                                   +string(SdmpLo)+" + / * x y - x y - abs / * 1 "+string(SdmpHi)+" 0 == 0 x y - abs "+string(SdmpHi)+" / 4 ^ ? + / + ?",U=1,V=1)
    \         :            mt_lutxy(tmp, method, yexpr="x y == x x x y - abs "+string(Szrp)+" / 1 "+string(Spwr)+" / ^ "+string(Szrp)+" * "+string(str)+" * x y - x y - abs / * x y - 2 ^ "
    \                                                   +string(Szrp)+" 2 ^ "+string(SdmpLo)+" + * x y - 2 ^ "+string(SdmpLo)+" + "+string(Szrp)+" 2 ^ * / * 1 "
    \                                                   +string(SdmpHi)+" 0 == 0 "+string(Szrp)+" "+string(SdmpHi)+" / 4 ^ ? + 1 "+string(SdmpHi)+" 0 == 0 x y - abs "+string(SdmpHi)+" / 4 ^ ? + / * + ?",U=1,V=1)
    
    
    ### LIMIT
    normal = mt_clamp(normsharp, bright_limit, dark_limit, overshoot,  undershoot,  U=1, V=1)
    second = mt_clamp(normsharp, bright_limit, dark_limit, overshoot2, undershoot2, U=1, V=1)
    zero   = mt_clamp(normsharp, bright_limit, dark_limit, 0,          0,           U=1, V=1)
    
    edge  = edgemaskHQ ? mt_logic( tmp.mt_edge(thY1=0,thY2=255,"8 16 8 0 0 0 -8 -16 -8 4",U=1,V=1)
    \                             ,tmp.mt_edge(thY1=0,thY2=255,"8 0 -8 16 0 -16 8 0 -8 4",U=1,V=1)
    \                             ,"max",U=1,V=1).mt_lut("x 128 / 0.86 ^ 255 *",U=1,V=1)
    \     :              tmp.mt_edge(thY1=0,thY2=255,mode="min/max",U=1,V=1).mt_lut("x 32 / 0.86 ^ 255 *",U=1,V=1)
    
    limit1 = Lmode<0  ? normsharp.repair(tmp,abs(Lmode),-1)
    \      : Lmode==0 ? normsharp
    \      : Lmode==1 ? normal
    \      : Lmode==2 ? mt_merge(normsharp, normal, edge.mt_inflate(U=1,V=1), U=1, V=1)
    \      : Lmode==3 ? mt_merge(normal,    zero,   edge.mt_inflate(U=1,V=1), U=1, V=1) 
    \      :            mt_merge(second,    normal, edge.mt_inflate(U=1,V=1), U=1, V=1)
    
    limit2 = edgemode==0 ? limit1
    \      : edgemode==1 ? mt_merge(tmp,limit1,edge.mt_inflate(U=1,V=1).mt_inflate(U=1,V=1).removegrain(11,-1),U=1,V=1)
    \      :               mt_merge(limit1,tmp,edge.mt_inflate(U=1,V=1).mt_inflate(U=1,V=1).removegrain(11,-1),U=1,V=1)
    
    
    ### SOFT
    sharpdiff = mt_makediff(tmp,limit2,U=1,V=1)
    sharpdiff = mt_lutxy(sharpdiff,sharpdiff.removegrain(19,-1),
    \                    "x 128 - abs y 128 - abs > y "+string(soft)+" * x "+string(100-soft)+" * + 100 / x ?",U=1,V=1)
    
    PP1 = soft==0 ? limit2 : mt_makediff(tmp,sharpdiff,U=1,V=1)
    
    
    ### SOOTHE
    diff  = mt_makediff(tmp,PP1,U=1,V=1)
    diff2 = diff.temporalsoften(1,255,0,32,2)
    diff3 = mt_lutxy(diff,diff2,"x 128 - y 128 - * 0 < x 128 - 100 / "+string(keep)+
    \                           " * 128 + x 128 - abs y 128 - abs > x "+string(keep)+" * y 100 "+string(keep)+" - * + 100 / x ? ?",U=1,V=1)
    
    PP2 = soothe ? mt_makediff(tmp,diff3,U=1,V=1) : PP1
    
    
    ### OUTPUT
    out = (dest_x != ox || dest_y != oy) ? PP2.mergechroma(tmp).spline36resize(dest_x,dest_y)
    \   : (ss_x > 1.0 || ss_y > 1.0)     ? PP2.spline36resize(dest_x,dest_y).mergechroma(input)
    \   :                                  PP2.mergechroma(input)
    
    src = defined(source)==false         ? blankclip
    \   : (dest_x != ox || dest_y != oy) ? source.spline36resize(dest_x,dest_y)
    \   :                                  source
    in  = (dest_x != ox || dest_y != oy) ? input.spline36resize(dest_x,dest_y)
    \   :                                  input
    
    shrpD  = mt_makediff(in,out,U=1,V=1)
    shrpL  = shrpD.repair(mt_makediff(in,src,U=1,V=1),1,-1,-1).mt_lutxy(shrpD,"x 128 - abs y 128 - abs < x y ?",U=1,V=1)
    output = defined(source) ? mt_makediff(in,shrpL,U=2,V=2)
    \      :                   out
    
    output = edgemode!=-1    ? output
    \      :                   edge.spline36resize(dest_x,dest_y).greyscale()
    
    
    ### SHOW
       function LSFM_Show(clip input, clip output, string "version", string "defaults",
       \                  int "strength", int "Smode", int "Smethod", int "kernel",
       \                  string "preblur", bool "secure", string "source",
       \                  int "Szrp", int "Spwr", int "SdmpLo", int "SdmpHi",
       \                  int "Lmode", int "overshoot", int "undershoot", int "overshoot2", int "undershoot2",
       \                  int "soft", bool "soothe", int "keep",
       \                  int "edgemode", bool "edgemaskHQ",
       \                  float "ss_x", float "ss_y", int "dest_x", int "dest_y",
       \                  bool "show", int "screenW", int "screenH")
       {
       resoW = screenW - 384
       resoH = screenH
    
       inW   = input.width()
       inH   = input.height()
       outW  = round( resoW / 4 ) * 4
       outH  = round( (outW * inH) / (4 * inW) ) * 4
       scale = resoH - ( 2 * outH )
    
       i = input.spline36resize(outW,outH)
       i = scale > 0 ? i.addborders(0,scale/4,0,scale/4) : i
       i = scale < 0 ? i.crop(0,-scale/4,0,scale/4) : i
    
       o = output.spline36resize(outW,outH)
       o = scale > 0 ? o.addborders(0,scale/4,0,scale/4) : o
       o = scale < 0 ? o.crop(0,-scale/4,0,scale/4) : o
    
       e = blankclip(input, width=384, height=resoH)
       e = e.SubTitle("LSFmod " + string(version)                ,text_color=$FFFFFF,font="COURIER NEW",size=24,x=40,y=40)
       e = e.SubTitle("DEFAULTS      = " + string(defaults)      ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=100)
    
       e = e.SubTitle("GENERAL:"                                 ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=150)
       e = e.SubTitle("--------"                                 ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=160)
       e = e.SubTitle("strength      = " + string(strength)      ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=180)
       e = e.SubTitle("Smode         = " + string(Smode)         ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=190)
       e = e.SubTitle("Smethod       = " + string(Smethod)       ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=200)
       e = e.SubTitle("kernel        = " + string(kernel)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=210)
    
       e = e.SubTitle("SPECIAL:"                                 ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=250)
       e = e.SubTitle("--------"                                 ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=260)
       e = e.SubTitle("preblur       = " + string(preblur)       ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=280)
       e = e.SubTitle("secure        = " + string(secure)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=290)
       e = e.SubTitle("source        = " + string(source)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=300)
    
       e = e.SubTitle("NONLINEAR SHARPENING:"                    ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=340)
       e = e.SubTitle("---------------------"                    ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=350)
       e = e.SubTitle("Szrp          = " + string(Szrp)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=370)
       e = e.SubTitle("Spwr          = " + string(Spwr)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=380)
       e = e.SubTitle("SdmpLo        = " + string(SdmpLo)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=390)
       e = e.SubTitle("SdmpHi        = " + string(SdmpHi)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=400)
    
       e = e.SubTitle("LIMITING:"                                ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=440)
       e = e.SubTitle("---------"                                ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=450)
       e = e.SubTitle("Lmode         = " + string(Lmode)         ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=470)
       e = e.SubTitle("overshoot     = " + string(overshoot)     ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=480)
       e = e.SubTitle("undershoot    = " + string(undershoot)    ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=490)
       e = e.SubTitle("overshoot2    = " + string(overshoot2)    ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=500)
       e = e.SubTitle("undershoot2   = " + string(undershoot2)   ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=510)
    
       e = e.SubTitle("POST-PROCESSING:"                         ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=550)
       e = e.SubTitle("----------------"                         ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=560)
       e = e.SubTitle("soft          = " + string(soft)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=580)
       e = e.SubTitle("soothe        = " + string(soothe)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=590)
       e = e.SubTitle("keep          = " + string(keep)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=600)
    
       e = e.SubTitle("EDGES:"                                   ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=640)
       e = e.SubTitle("------"                                   ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=650)
       e = e.SubTitle("edgemode      = " + string(edgemode)      ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=670)
       e = e.SubTitle("edgemaskHQ    = " + string(edgemaskHQ)    ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=680)
    
       e = e.SubTitle("UPSAMPLING:"                              ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=720)
       e = e.SubTitle("-----------"                              ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=730)
       e = e.SubTitle("ss_x          = " + string(ss_x)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=750)
       e = e.SubTitle("ss_y          = " + string(ss_y)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=760)
       e = e.SubTitle("dest_x        = " + string(dest_x)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=770)
       e = e.SubTitle("dest_y        = " + string(dest_y)        ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=780)
    
       e = e.SubTitle("DEBUG:"                                   ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=820)
       e = e.SubTitle("------"                                   ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=830)
       e = e.SubTitle("show          = " + string(show)          ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=850)
       e = e.SubTitle("screenW       = " + string(screenW)       ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=860)
       e = e.SubTitle("screenH       = " + string(screenH)       ,text_color=$FFFFFF,font="COURIER NEW",size=12,x=40,y=870)
    
       debug = stackhorizontal( e ,
       \                        stackvertical( i.subtitle("Input",text_color=$FFFFFF,size=20,x=40,y=20) ,
       \                                       o.subtitle("Output",text_color=$FFFFFF,size=20,x=40,y=20) )
       \                      )
    
       return debug
       }
    
    output = show==false ? output
    \                    : LSFM_Show(input, output, version, defaults,
    \                                strength, Smode, Smethod, kernel,
    \                                preblur, secure, defined(source)?"defined":"undefined",
    \                                Szrp, Spwr, SdmpLo, SdmpHi,
    \                                Lmode, overshoot, undershoot, overshoot2, undershoot2,
    \                                soft, soothe, keep,
    \                                edgemode, edgemaskHQ,
    \                                ss_x, ss_y, dest_x, dest_y,
    \                                show, screenW, screenH)
    
    return output
    }
    Quote Quote  
  17. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by slarke View Post
    Avisynth open failure:
    Script error: there is no function named "repair"
    (H:\Sharpen Tools\LSFmod.v1.9.avsi, line 558)
    (C:\users\desktop\movie.avs, line 7)
    repair.dll is part of the RemoveGrain package: http://avisynth.org/mediawiki/RemoveGrain
    Last edited by sanlyn; 22nd Mar 2014 at 04:03.
    Quote Quote  
  18. Yes, it's a tangled web of third party filters.
    Quote Quote  
  19. the script is working now. Thanks for the help guys, really appreciated
    Quote Quote  
  20. another thing, Im trying to use MCTemporalDenoise.v1.4.20.avs but there is an error message

    import("H:\MCTemporalDenoise - Sharpen\MCTemporalDenoise.v1.4.20.avs")
    import("H:\MCTemporalDenoise - Sharpen\GradFun2DBmod.v1.5.avsi")
    import("H:\MCTemporalDenoise - Sharpen\Deblock QED MT2.avs")
    import("H:\Sharpen Tools\LSFmod.v1.9.avsi")
    LoadPlugin("H:\Sharpen Tools\MaskTools-v1.5.8\mt_masktools_26.dll")
    LoadPlugin("H:\Sharpen Tools\RemoveGrain-1.0\RemoveGrainSSE3.dll")
    LoadPlugin("H:\Sharpen Tools\RemoveGrain-1.0\Repair.dll")
    LoadPlugin("H:\Sharpen Tools\warpsharp_25_dll_20030103\WarpSharp.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\AddGrainC.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\DctFilter.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\deblock.dll")
    LoadPlugin("H:\Mine\REmux\MCTemporalDenoise - Sharpen\EEDI2.dll")
    LoadPlugin("H:\Mine\REmux\MCTemporalDenoise - Sharpen\FFT3dGPU.dll")
    LoadPlugin("H:\Mine\REmux\MCTemporalDenoise - Sharpen\gradfun2db.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\mvtools2.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\SangNom.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\TTempSmooth.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\mt_masktools.dll")
    LoadPlugin("H:\MCTemporalDenoise - Sharpen\FFT3DFilter.dll")
    LoadPlugin("C:\Windows\System32\fftw3.dll")
    LoadPlugin("H:\dgavcdec109\DGAVCDecode.dll")
    AVCSource("G:\Folder 2\movie.dga")


    LSFmod(Strength=80, Smode=5)
    MCTemporalDenoise(settings="high")


    Heres the error

    Avisynth open failure:
    LoadPlugin C:\Windows\System32\fftw3.dll is not an AviSynth 2.5 plugin
    (C:\users\desktop\movie.avs, line 20)


    MCTemporalDenoise.v1.4.20.avsi
    Last edited by slarke; 9th Jun 2012 at 01:57.
    Quote Quote  
  21. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by slarke View Post
    ...
    LoadPlugin("C:\Windows\System32\fftw3.dll")
    ...

    Avisynth open failure:
    LoadPlugin C:\Windows\System32\fftw3.dll is not an AviSynth 2.5 plugin
    As the message says, fftw3.dll is not itself an Avisynth plugin (although it is needed indirectly by some plugins), so you should not use LoadPlugin() for it.

    Since you have done the right thing by installing it in C:\Windows\System32, it will be loaded automatically by Windows where needed.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!