From 3d0f0f2fe5a2e29899599d9de4334272b7d8a1c6 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Fri, 11 Nov 2022 08:29:41 +1300 Subject: [PATCH] minideen: init at 2 --- default.nix | 1 + plugins/minideen/default.nix | 42 ++++++++++++++++++++++++++++++++++++ plugins/minideen/junk.patch | 13 +++++++++++ 3 files changed, 56 insertions(+) create mode 100644 plugins/minideen/default.nix create mode 100644 plugins/minideen/junk.patch diff --git a/default.nix b/default.nix index 7991494..18bbf09 100644 --- a/default.nix +++ b/default.nix @@ -43,6 +43,7 @@ in knlmeanscl = prev.callPackage ./plugins/knlmeanscl { }; lsmashsource = prev.callPackage ./plugins/lsmashsource { }; median = prev.callPackage ./plugins/median { }; + minideen = prev.callPackage ./plugins/minideen { }; miscfilters-obsolete = prev.callPackage ./plugins/miscfilters-obsolete { }; motionmask = prev.callPackage ./plugins/motionmask { }; msmoosh = prev.callPackage ./plugins/msmoosh { }; diff --git a/plugins/minideen/default.nix b/plugins/minideen/default.nix new file mode 100644 index 0000000..f720918 --- /dev/null +++ b/plugins/minideen/default.nix @@ -0,0 +1,42 @@ +{ lib +, stdenv +, fetchFromGitHub +, meson +, ninja +, pkg-config +, vapoursynth +}: + +stdenv.mkDerivation rec { + pname = "vapoursynth-minideen"; + version = "2"; + + src = fetchFromGitHub { + owner = "dubhater"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-nwKK/dojmYEG/8d3shxyynNh0BbZbMk5ilvWtFBYzms="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; + + buildInputs = [ vapoursynth ]; + + NIX_CFLAGS_COMPILE = [ + "-O3" + ]; + + mesonFlags = [ "--libdir=${placeholder "out"}/lib/vapoursynth" ]; + + meta = with lib; { + description = "Spatial denoising plugin for VapourSynth"; + homepage = "https://github.com/dubhater/vapoursynth-minideen"; + license = licenses.isc; + maintainers = with maintainers; [ aidalgol ]; + platforms = platforms.all; + }; +} diff --git a/plugins/minideen/junk.patch b/plugins/minideen/junk.patch new file mode 100644 index 0000000..9fff5c1 --- /dev/null +++ b/plugins/minideen/junk.patch @@ -0,0 +1,13 @@ +diff --git a/src/minideen.cpp b/src/minideen.cpp +index d138888..2b81d6e 100644 +--- a/src/minideen.cpp ++++ b/src/minideen.cpp +@@ -119,7 +119,7 @@ static void process_plane_sse2_8bit(const uint8_t *srcp, uint8_t *dstp, int firs + __m128i magic_hi = zeroes; + + for (int i = 0; i < 8; i++) { +- uint16_t e_lo = _mm_extract_epi16(counter_lo, i); ++ uint16_t e_lo = _mm_extract_epi16(counter_lo, 0); + uint16_t e_hi = _mm_extract_epi16(counter_hi, i); + magic_lo = _mm_insert_epi16(magic_lo, magic[e_lo], i); + magic_hi = _mm_insert_epi16(magic_hi, magic[e_hi], i);