Skip to main content

Enhanced Edge Directed Interpolation 3, using Vulkan compute

Project description

eedi3vk2

EEDI3 works by finding the best non-decreasing (non-crossing) warping between two lines by minimizing a cost functional. The cost is based on neighborhood similarity (favor connecting regions that look similar), the vertical difference created by the interpolated values (favor small differences), the interpolation directions (favor short connections vs long), and the change in interpolation direction from pixel to pixel (favor small changes).

Requirement

A Vulkan 1.4 capable GPU and driver.

Usage

eedi3vk2.EEDI3(vnode clip, int field[, bint dh=False, int[] planes=[0, 1, 2], float alpha=0.2, float beta=0.25, float gamma=20.0, int nrad=2, int mdis=20, bint hp=False, int vcheck=2, float vthresh0=32.0, float vthresh1=64.0, float vthresh2=4.0, vnode sclip=None, vnode mclip=None, int device_index=0, bint list_device=False, int num_streams=2])
  • clip: Clip to process. Any format with either 8-16 bit integer or 16/32 bit float is supported.

  • field: Controls the mode of operation (double vs same rate) and which field is kept.

    • 0 = same rate, keep bottom field
    • 1 = same rate, keep top field
    • 2 = double rate (alternates each frame), starts with bottom
    • 3 = double rate (alternates each frame), starts with top
  • dh: Doubles the height of the input. Each line of the input is copied to every other line of the output and the missing lines are interpolated. If field=0, the input is copied to the odd lines of the output. If field=1, the input is copied to the even lines of the output. field must be set to either 0 or 1 when using dh=True.

  • planes: Specifies which planes will be processed. Planes that are not processed will contain uninitialized memory.

  • alpha/beta/gamma: These trade off line/edge connection vs artifacts created. alpha and beta must be in the range [0,1], and the sum alpha+beta must be in the range [0,1]. alpha is the weight given to connecting similar neighborhoods. The larger alpha is the more lines/edges should be connected. beta is the weight given to vertical difference created by the interpolation. The larger beta is the less edges/lines will be connected (at 1.0 you get no edge directedness at all). The remaining weight (1.0-alpha-beta) is given to interpolation direction (large directions (away from vertical) cost more). So the more weight you have here the more shorter connections will be favored. Finally, gamma penalizes changes in interpolation direction. The larger gamma is the smoother the interpolation field between two lines (range is [0,inf]). If lines aren't getting connected then increase alpha and maybe decrease beta/gamma. Go the other way if you are getting unwanted artifacts.

  • nrad/mdis: nrad sets the radius used for computing neighborhood similarity. Valid range is [0,3]. mdis sets the maximum connection radius. Valid range is [1,40]. If mdis=20, then when interpolating pixel (50,10) (x,y), the farthest connections allowed would be between (30,9)/(70,11) and (70,9)/(30,11). Larger mdis will allow connecting lines of smaller slope, but also increases the chance of artifacts. Larger mdis will be slower. Larger nrad will be slower.

  • hp: A speed vs quality option. hp=True, use half pel steps, hp=False, use full pel steps.

  • vcheck/vthresh0/vthresh1/vthresh2/sclip:

  vcheck settings:

      0 - no reliability check
      1 - weak reliability check
      2 - med reliability check
      3 - strong reliability check

  If vcheck is greater than 0, then the resulting interpolation is checked for reliability/consistency. Assume
  we interpolated pixel 'fh' below using dir=4 (i.e. averaging pixels bl and cd).

       aa ab ac ad ae af ag ah ai aj ak al am an ao ap
                            eh          el
       ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp
                fd          fh          fl
       ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp
                gd          gh
       da db dc dd de df dg dh di dj dk dl dm dn do dp

  When checking pixel 'fh' the following is computed:

        d0 = abs((el+fd)/2 - bh)
        d1 = abs((fl+gd)/2 - ch)

        q2 = abs(bh-fh)+abs(ch-fh)
        q3 = abs(el-bl)+abs(fl-bl)
        q4 = abs(fd-cd)+abs(gd-cd)

        d2 = abs(q2-q3)
        d3 = abs(q2-q4)

        mdiff0 = vcheck == 1 ? min(d0,d1) : vcheck == 2 ? ((d0+d1+1)>>1) : max(d0,d1)
        mdiff1 = vcheck == 1 ? min(d2,d3) : vcheck == 2 ? ((d2+d3+1)>>1) : max(d2,d3)

        a0 = mdiff0/vthresh0;
        a1 = mdiff1/vthresh1;
        a2 = max((vthresh2-abs(dir))/vthresh2,0.0f)

        a = min(max(max(a0,a1),a2),1.0f)

        final_value = (1.0-a)*fh + a*cint


    ** If sclip is supplied, cint is the corresponding value from sclip. If sclip isn't supplied,
       then vertical cubic interpolation is used to create it.
  • mclip: A mask to use edge-directed interpolation only on specified pixels. Pixels where the mask is 0 are generated using cubic linear or bicubic interpolation. The main goal of the mask is to save calculations.

  • device_index: Index of the Vulkan device to use.

  • list_device: If True, raises an error listing the available Vulkan devices and their indices.

  • num_streams: Number of streams to run kernels in parallel on the Vulkan device.

Installation

pip install -U vapoursynth-eedi3vk2

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vapoursynth_eedi3vk2-1.0.tar.gz (47.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vapoursynth_eedi3vk2-1.0-py3-none-win_amd64.whl (330.8 kB view details)

Uploaded Python 3Windows x86-64

vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_aarch64.whl (1.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_x86_64.whl (236.6 kB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_aarch64.whl (230.3 kB view details)

Uploaded Python 3manylinux: glibc 2.34+ ARM64

vapoursynth_eedi3vk2-1.0-py3-none-macosx_11_0_arm64.whl (220.3 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

vapoursynth_eedi3vk2-1.0-py3-none-macosx_10_15_x86_64.whl (223.1 kB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file vapoursynth_eedi3vk2-1.0.tar.gz.

File metadata

  • Download URL: vapoursynth_eedi3vk2-1.0.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vapoursynth_eedi3vk2-1.0.tar.gz
Algorithm Hash digest
SHA256 8452b7a07ba94102fa89aa276eb344199f3f54134ad99bc8cf6b86ca743d7e02
MD5 79589af598c5d6d28a8114f96fd8ed78
BLAKE2b-256 e4f88d954ce0f4cb1890810b655b4133d5dd1ef0137a438cabeb87ddb7b450d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0.tar.gz:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2f3108942a01c0be7a439554898a7aa162024c1567a71d25b9ac2843fd3fb06c
MD5 eb27325e7dfb25028adf59f99ca1febd
BLAKE2b-256 1c2ef958c8ef9f2df8069fcc9db9a56afcc9f1d663762e92744b52adba48a202

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-win_amd64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 235abcf51eaa4424374c9015323a8eb96498e1c7ba48c70d00893e6fadf44b16
MD5 a21077b6b007fcb2b307c0de8c6aad86
BLAKE2b-256 32221c51cf256fe219442853d099867f5e28c731e64f0fb319857c31b081a934

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_x86_64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 76ca6800386747d3370eaff2652e06a5f7554888be07d908804df2bb36eda5b7
MD5 6044b0a509a8ee05208fb40a77e8c8e9
BLAKE2b-256 47a8c15d8178f7e6852c6f9dba14ca97322233ba4f8d047f3e851f9fa6ff467a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-musllinux_1_2_aarch64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 94bdb1ead46b6125fc8908a67268039a1980935655f1ef34c804002d657211ed
MD5 dbb3b3bf6045411f19907baa95054437
BLAKE2b-256 ab98353d4c03f62d742763becd12f3121526c16a1dac1db74c6b88fde3d5c7bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_x86_64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 2ece8f3749ce3d56282829cc8b2d1e16c3a68317ae0c29b6133b8ada8868fa63
MD5 c9dbf33679ecd26fbe41988df1692ab8
BLAKE2b-256 a609f3d765549d4663cd4245369628f73c7514afd16fdada8f9f662642d83dc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-manylinux_2_34_aarch64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c864731788dd2395a76614d1e2cbc6e2c7fbcf77b4a13d272768db1344f21d3f
MD5 d39c16c269bf00e5bfdfc581d9d686c4
BLAKE2b-256 c32ca3618190b6ab47bf5e2d0a345820b098c77b4749955504e96e8eaa831d4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_eedi3vk2-1.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_eedi3vk2-1.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7ad8c2d205f7d0f4932fb28b094b0dd3993cd5d3228968e35ed28b47f2bf822f
MD5 34e4cec50edb5bb8fddc9b5be1be05af
BLAKE2b-256 96decb72fb80cbc4b1bc37c2da7319a57abd57cdea5638bc6ce4de57b81bb6c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_eedi3vk2-1.0-py3-none-macosx_10_15_x86_64.whl:

Publisher: build.yml on HolyWu/VapourSynth-eedi3vk2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page