# LSFmod

### From Avisynth

Abstract
Author | LaTo
Version | v1.9 - Update 2009/10/05
Download | LSFmod
Category | Sharpeners
Requirements | YV12
License |

LSFmod( clip clp, int "strength", int "Smode", int "Smethod", int "Skernel", 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", string "defaults" )

## [edit] Abstract

A LimitedSharpenFaster mod with a lot of new features and optimizations.

## [edit] Description

Some of these informations may be outdated and/or incomplete, check the Doom9 Thread for up-to-date version !!!

## [edit] Required Filters

- Masktools (v2a35) http://manao4.free.fr/?M=D
- Removegrain (v1.0pre)
- Warpsharp (2003.11.03) http://niiyan.net/?WarpSharpPackage
- Variableblur (v0.40) http://forum.doom9.org/showthread.php?t=88645

## [edit] Parameters

strength (int)
  Strength of the sharpening

Smode (int)
  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)
  Sharpen method: (not used for Smode=1&2)
    1 : 3x3 Kernel
    2 : Min/Max (original)
    3 : Min/Max (enhanced)
    4 : Min/Max (original) + 3x3 Kernel
    5 : Min/Max (enhanced) + 3x3 Kernel

Skernel (int)
  Kernel used for Smethod=1,4,5
  In strength order: + 19 > 12 >> 20 > 11 -

### [edit] 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)

### [edit] Limiting

Lmode (int)
  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

### [edit] Post-Processing

soft (int)
  Soften the sharpening effect
    0-100 : amount of softening
    -1 : old autocalculate
    -2 : new autocalculate

soothe (bool)

  true : Enable soothe temporal stabilization

  false : Disable soothe temporal stabilization

keep (int)
  Minimum percent (0-100) of the original sharpening to keep (only with soothe=true)

### [edit] Others

edgemode (int)

  -1 : Show edgemask

  0 : Sharpening all
  1 : Sharpening only edges
  2 : Sharpening only not-edges

edgemaskHQ (bool)

  true : Original edgemask

  false : Faster edgemask

ss_x ; ss_y (float)
  Supersampling factor (reduce aliasing on edges)

dest_x ; dest_y (int)
  Output resolution after sharpening (avoid a resizing step)

defaults (string)

  "old" : Reset settings to original version

  "new" : Enable modded version settings (default)

## [edit] Defaults

    defaults="old" : - strength    = 100
    ---------------- - Smode       = 1
                     - Smethod     = Smode==3?2:1
                     - Skernel     = 11
                     - Szrp        = 16
                     - Spwr        = 2
                     - SdmpLo      = strength/25
                     - SdmpHi      = 0
                     - Lmode       = 1
                     - overshoot   = 1
                     - undershoot  = overshoot
                     - overshoot2  = overshoot*2
                     - undershoot2 = overshoot2
                     - soft        = 0
                     - edgemode    = 0
                     - edgemaskHQ  = true
                     - soothe      = false
                     - keep        = 25
                     - ss_x        = 1.50
                     - ss_y        = ss_x
                     - dest_x      = ox
                     - dest_y      = oy

    defaults="new" : - strength    = 100
    ---------------- - Smode       = 3
                     - Smethod     = Smode==3?5:3
                     - Skernel     = 11
                     - Szrp        = 16
                     - Spwr        = 4
                     - SdmpLo      = 4
                     - SdmpHi      = 24
                     - Lmode       = 4
                     - overshoot   = strength/100
                     - undershoot  = overshoot
                     - overshoot2  = overshoot*2
                     - undershoot2 = overshoot2
                     - soft        = -2
                     - edgemode    = 0
                     - edgemaskHQ  = false
                     - soothe      = true
                     - keep        = 50
                     - ss_x        = 1.25
                     - ss_y        = ss_x
                     - dest_x      = ox
                     - dest_y      = oy

## [edit] Links

Doom9 Thread

Retrieved from "http://avisynth.org/mediawiki/LSFmod"

##### Views

- Page
- Discussion
- Edit
- History

##### Personal tools

- Log in / create account

##### Search

##### Toolbox

- What links here
- Related changes
- Upload file
- Special pages
- Printable version
- Permanent link