Log in

View Full Version : swscaler


Ma-Xell
19th May 2009, 00:24
In ffdshow there is a sharpening filter called swscaler, which produces nice results.
Is this filter available for avisynth or vdub?
What sharpening filter do you people recommend? :thanks:

Myrsloik
19th May 2009, 01:22
After looking at the source code for it, all it appears to be capable of doing is to apply a typical gaussian blur or the normal [-1 2 -1] sharpening kernel blended with the original image. Try sharpen(), I think it works about the same really. I am now officially disappointed after looking at the code.

I was going to add it to my FFMS2 package but now it seems completely redundant...

martino
19th May 2009, 11:50
# SWScalerSharpen() v1.00 (28/08/08)
# - a function that provides easy access to ffdshow's swscaler sharpener
#
# Requierments:
# ffavisynth and YV12/YUY2/RGB colorspace
#
# Parameters:
# lsharp (integer) - swscaler luma sharpnening strength (32)
# csharp (integer) - swscaler chroma sharpnening strength (32)
# ssw (integer) - supersample factor horizontally (1)
# ssh (integer) - supersample factor vertically (1)

function SWScalerSharpen(clip c, int "lsharp", int "csharp", int "ssw", int "ssh") {

lsharp = Default(lsharp,32)
csharp = Default(csharp,32)
ssw = Default(ssw,1)
ssh = Default(ssh,1)

Assert(ssh>=1 && ssw>=1, "SWScalerSharpen(): ssw and ssh cannot be less than one")

main = (ssw==1 && ssh==1) ? c.ffdshow(options="xsharpen=1,sharpenMethod=5,mplayerSharpLuma="+String(lsharp)+",mplayerSharpChroma="+String(csharp)) : \
c.LanczosResize(c.width*ssw,c.height*ssh). \
ffdshow(options="xsharpen=1,sharpenMethod=5,mplayerSharpLuma="+String(lsharp)+",mplayerSharpChroma="+String(csharp)). \
LanczosResize(c.width,c.height)

return main

}

# Changelog:
# 28/08/2008 v1.00
# - initial version


Make sure to load ffdshow's AviSynth plugin in your script, also I can't guarantee for the correctness of the above code. I haven't looked at it, or used it, ever since I decided to waste my time to play with it. Also, the sharpening isn't that great; read Myrsloik's post.

rfmmars
19th May 2009, 14:59
In ffdshow there is a sharpening filter called swscaler, which produces nice results.
Is this filter available for avisynth or vdub?
What sharpening filter do you people recommend? :thanks:

Yes there's a Vdub plugin, when you install ffdshow, a plugin call "ffvdub.vdf" is unpacked in the ffdshow folder. Copy it to the Vdub plugin folder.

Richard
photorecall.net

Ma-Xell
19th May 2009, 17:31
thanks :thanks: