Coder Social home page Coder Social logo

Comments (3)

Frechdachs avatar Frechdachs commented on June 16, 2024

The only time nnedi3 is used inside GradFun3 is with resizer="lineart_rpow2" or resizer="lineart_rpow2_bicubic". Also, it is not called directly but within 4re's nnedi3_rpow2.py, so it would have to be changed in his script.

A quick and dirty way for you would be to add core.nnedi3.nnedi3 = core.nnedi3cl.NNEDI3CL right below of core = vs.get_core() inside nnedi3_rpow2.py.

NNEDI3 is used directly in JIVTC, though. There I might add automatic detection of znedi in the future.

from fvsfunc.

Frechdachs avatar Frechdachs commented on June 16, 2024

A quick and dirty way for you would be to add core.nnedi3.nnedi3 = core.nnedi3cl.NNEDI3CL right below of core = vs.get_core() inside nnedi3_rpow2.py.

Or rather just change every occurrence of core.nnedi3.nnedi3. It's only two times in the script.

from fvsfunc.

kgrabs avatar kgrabs commented on June 16, 2024

Since DescaleAA is hardcoded to use rpow=2 anyway, you could drop this thing in and lose the nnedi3_rpow2 dependency altogether

def lumadouble(clip, w, h, nsize=0, nns=3, qual=2, opencl=False):
    core = vs.core
    
    # Resizing between nnedi3 calls can either be faster or slower
    # When doubling from 720p to 1080p, the 2nd nnedi3 call will be interpolating a 2560x720 clip
    # It's faster to downscale to 720x1920, transpose, then interpolate the 1920x720 clip
    # However, it is counter-intuitive to do this with i.e. 720x480 to 1920x1080
    # So it needs to be decided on a case-by-case basis
    resize_last = clip.width * 2 <= w
    
    if opencl and hasattr(core, 'nnedi3cl'):
        # only nnedi3cl has a dw parameter anyway so it's easier to just stick it here
        if resize_last:
            nnclip = core.nnedi3cl.NNEDI3CL(clip, field=0, dh=True, dw=True, nsize=nsize, nns=nns, qual=qual)
            return core.resize.Spline36(nnclip, w, h, src_left=0.5, src_top=0.5)
        nnedi3 = core.nnedi3cl.NNEDI3CL
    elif hasattr(core, 'znedi3'):
        nnedi3 = core.znedi3.nnedi3
    else:
        nnedi3 = core.nnedi3.nnedi3
    
    nnclip = core.std.Transpose(clip)
    nnclip = nnedi3(nnclip, field=0, dh=True, nsize=nsize, nns=nns, qual=qual)
    
    if resize_last:
        src_left = 0.5
    else:
        src_left = 0
        nnclip = core.resize.Spline36(nnclip, height=w, src_top=0.5)
        
    nnclip = core.std.Transpose(nnclip)
    nnclip = nnedi3(nnclip, field=0, dh=True, nsize=nsize, nns=nns, qual=qual)
    
    return core.resize.Spline36(nnclip, w, h, src_left=src_left, src_top=0.5)

from fvsfunc.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.