This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[INFO] Fixed a problem with Vapoursynth version of "Stab"
#1
Lightbulb 
The Vapoursynth version of "Stab" doesn't use DePanEstimate, so it doesn't use the "range" parameter, which can cause random jerking around in some cases, and is less accurate than the AviSynth version.

Hybrid loads the Vapoursynth version of DePan.dll but doesn't use it... DePanEstimate is included in the this dll. Havsfunc instead uses libmvtools.dll, which has ports of DePan and DePanEstimate, but those don't include the "range" function.

So to add DePanEstimate and Range using DePan.dll, I changed the script in havsfunc.py from this:

##############################################################################
# Original script by g-force converted into a stand alone script by McCauley #
# latest version from December 10, 2008                                      #
##############################################################################
def Stab(clp, dxmax=4, dymax=4, mirror=0):
    if not isinstance(clp, vs.VideoNode):
        raise vs.Error('Stab: This is not a clip')

    temp = AverageFrames(clp, weights=[1] * 15, scenechange=25 / 255)
    inter = core.std.Interleave([core.rgvs.Repair(temp, AverageFrames(clp, weights=[1] * 3, scenechange=25 / 255), mode=[1]), clp])
    mdata = inter.mv.DepanEstimate(trust=0, dxmax=dxmax, dymax=dymax)
    last = inter.mv.DepanCompensate(data=mdata, offset=-1, mirror=mirror)
    return last[::2]

To this:

# Stab function that uses DePanEstimate from "Depan" plugin which supports
# the range parameter. DePanEstimate from MvTools is missing that paramater.
# Function copied from https://github.com/HomeOfVapourSynthEvolution/havsfunc
##############################################################################
# Original script by g-force converted into a stand alone script by McCauley #
# latest version from December 10, 2008                                      #
##############################################################################
def Stab(clp, range=1, dxmax=4, dymax=4, mirror=0):
    if not isinstance(clp, vs.VideoNode):
        raise vs.Error('Stab: This is not a clip')

    temp = AverageFrames(clp, weights=[1] * 15, scenechange=25 / 255)
    inter = core.std.Interleave([core.rgvs.Repair(temp, AverageFrames(clp, weights=[1] * 3, scenechange=25 / 255), mode=[1]), clp])
    mdata = core.depan.DePanEstimate(inter, range=range, trust=0, dxmax=dxmax, dymax=dymax)
    last = core.depan.DePan(inter, data=mdata, offset=-1, mirror=mirror)
    return last[::2]

I am not a coder, so this was adapted from this, which has incorrect syntax.

This came from an issue that I posted about on the havsfunc Github issues board, so I'm not sure if this will be included officially or not.
Reply
#2
Nice, will change the code in Hybrid to use Stab from 'lostfunc' instead of 'havsfunc'. Smile

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)