Skip to content
master
Go to file
Code

Latest commit

This makes it possible to specify the active region of the initial upscale
7ea0ca1

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Apr 10, 2020

README.md

Descale

VapourSynth plugin to undo upscaling.

Usage

The plugin itself only supports GrayS, RGBS, and YUV444PS input. The included python wrapper supports YUV (every subsampling), Gray, and RGB of every bitdepth.

descale.Debilinear(clip src, int width, int height, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

descale.Debicubic(clip src, int width, int height, float b=0.0, float c=0.5, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

descale.Delanczos(clip src, int width, int height, int taps=3, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

descale.Despline16(clip src, int width, int height, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

descale.Despline36(clip src, int width, int height, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

descale.Despline64(clip src, int width, int height, float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height)

How does this work?

Resampling can be described as A x = b.

A is an n x m matrix with m being the input dimension and n the output dimension. x is the original vector with m elements, b is the vector after resampling with n elements. We want to solve this equation for x.

To do this, we extend the equation with the transpose of A: A' A x = A' b.

A' A is now a banded symmetrical m x m matrix and A' b is a vector with m elements.

This enables us to use LDLT decomposition on A' A to get LD L' = A' A. LD and L are both triangular matrices.

Then we solve LD y = A' b with forward substitution, and finally L' x = y with back substitution.

We now have the original vector x.

Compilation

Linux

$ meson build
$ ninja -C build

Cross-compilation for Windows

$ meson build --cross-file cross-mingw-x86_64.txt
$ ninja -C build
You can’t perform that action at this time.