NNEDI3 Functions

rvsfunc.NNEDI3.NNEDI3

A wrapper for the nnedi3 plugin.

rvsfunc.NNEDI3.NNEDI3CL

A wrapper for the NNEDI3CL plugin.

rvsfunc.NNEDI3.ZNEDI3

A wrapper for the znedi3 plugin.

Note

The implementing classes are also accessible from the top-level import using their names in full lowercase, e.g. rvsfunc.znedi3.

A module for functions built on NNEDI3 plugins in a more modern fashion.

This module defines a few classes that have been set up to wrap around NNEDI3 implementations. They allow for using them in a streamlined fashion with sane defaults. The main objective is to provide a collection of NNEDI3-based functions in a central place, as well as modernizing them.

class rvsfunc.NNEDI3.NNEDI3Base(shift=True, **nnedi_kwargs)

Abstract Base Class for NNEDI3 wrappers.

This is currently mainly in use for a modernized and properly functional version of nnedi3_rpow2, which is available as a classmethod for all of the implementing classes.

This is a generalized base class that aims to implement generic functions that can be performed with every NNEDI3 plugin. To define plugin-specific functionality and behavior, the implementing subclasses are used. Documentation in this class applies to all subclasses as well.

Parameters:
  • shift (bool) – Whether or not to fix the chroma shift caused by the upsampling of subsampled chroma.

  • nnedi_kwargs (Any) – Additional kwargs to pass on to the NNEDI3 plugin.

abstract nnedi(clip, field, **kwargs)

A simple wrapper function for calling a NNEDI3 implementation.

This abstractmethod and all concrete implementations only make the call to the NNEDI3 implementation a subclass wraps around. Any other logic being applied such as using NNEDI3 for AA must be a different function that calls this method instead of the actual plugin. *args should be blindly passed to the plugin and **kwargs should be used to update a predefined dict of defaults defined in the implementations of this method.

Parameters:
  • clip (VideoNode) – The clip to call the NNEDI3 plugin with.

  • field (int) – The field parameter for NNEDI3.

Return type:

VideoNode

double_size(clip, chroma=True, iterations=1, alternate=False)

nnedi3_rpow2, except not bad. This does the acual rpow2’ing.

Uses a much simpler API than the original that assumes kwargs were passed during instantiation of the class.

Parameters:
  • clip (VideoNode) – The clip to grow by powers of two.

  • chroma (bool) – Whether or not to process chroma.

  • iterations (int) – How often to double frame sizes. This growth is exponential (2x, 4x, 8, …)

Return type:

VideoNode

classmethod rpow2(clip, chroma=True, iterations=1, shift=True, alternate=False, **nnedi_kwargs)

nnedi3_rpow2 as a classmethod for easy use.

This function is NOT a drop-in replacement for 4re’s nnedi3_rpow2

Having gotten that out of the way, the function signature is heavily simplified compared to the old one and so is the iterations argument that replaces the old rfactor.

Parameters:
  • clip (VideoNode) – The clip to exponentially double in size.

  • chroma (bool) – Whether or not to process chroma.

  • iterations (int) – How often to double the clip’s sizes. This is exponential growth (2x, 4x, 8x, …)

  • shift (bool) – Whether or not to fix the chroma shift caused by upsampling video.

  • alternate (bool) – Whether to prefer alternating the shift on every iteration of doubling. Only useful for iterations >= 2 and entirely a preference thing. This will impact the output even when not fixing the normal chroma shift from supersampling, as the field interpolation shift is still compensated for.

  • nnedi_kwargs (Any) – Additional kwargs to pass to NNEDI3. See nnedi() for more information.

Return type:

VideoNode