Hello community, here is the log from the commit of package vapoursynth for openSUSE:Leap:15.2 checked in at 2020-05-18 10:59:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/vapoursynth (Old) and /work/SRC/openSUSE:Leap:15.2/.vapoursynth.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vapoursynth" Mon May 18 10:59:30 2020 rev:18 rq:805994 version:50 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/vapoursynth/vapoursynth.changes 2020-04-28 20:11:19.404554960 +0200 +++ /work/SRC/openSUSE:Leap:15.2/.vapoursynth.new.2738/vapoursynth.changes 2020-05-18 10:59:30.606650840 +0200 @@ -1,0 +2,17 @@ +Thu May 14 08:48:43 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 50: + * Updated zimg to latest v2.9 so grayscale colorspace are supported + * Fixed several minor issues related to path handling in vsrepo + * Added version and api_version to python module to make + detecting version mismatches easier + * Improved rounding in averageframes + * Fixed averageframes not properly rejecting more than 31 + weights or nodes + * Fixed crash in textfilter line wrapping introduced in r49 + * Fixed regression introduced in r48 where expr, sobel and + prewitt wouldn't clamp 9-15 bit output to valid range + * Fixed crash due to null pointer dereference when instantiation + many vapoursynth classes directly in python + +------------------------------------------------------------------- Old: ---- vapoursynth-R49.tar.gz New: ---- vapoursynth-R50.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ vapoursynth.spec ++++++ --- /var/tmp/diff_new_pack.JKSc2s/_old 2020-05-18 10:59:30.990651635 +0200 +++ /var/tmp/diff_new_pack.JKSc2s/_new 2020-05-18 10:59:30.994651643 +0200 @@ -17,7 +17,7 @@ Name: vapoursynth -Version: 49 +Version: 50 Release: 0 Summary: A video processing framework License: LGPL-2.1-only AND OFL-1.1 ++++++ vapoursynth-R49.tar.gz -> vapoursynth-R50.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/ChangeLog new/vapoursynth-R50/ChangeLog --- old/vapoursynth-R49/ChangeLog 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/ChangeLog 2020-05-08 17:10:41.000000000 +0200 @@ -1,3 +1,14 @@ +r50: +updated zimg to latest v2.9 so grayscale colorspace are supported +fixed several minor issues related to path handling in vsrepo +added __version__ and __api_version__ to python module to make detecting version mismatches easier +improved rounding in averageframes (sekrit-twc) +fixed averageframes not properly rejecting more than 31 weights or nodes +fixed crash in textfilter line wrapping introduced in r49 (sekrit-twc) +fixed regression introduced in r48 where expr, sobel and prewitt wouldn't clamp 9-15 bit output to valid range (sekrit-twc) +fixed crash due to null pointer dereference when instantiation many vapoursynth classes directly in python +fixed regression in r49 where the python dll could only be located when in the PATH on windows + r49: updated to python 3.8 on windows updated visual studio 2019 runtime version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/configure.ac new/vapoursynth-R50/configure.ac --- old/vapoursynth-R49/configure.ac 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/configure.ac 2020-05-08 17:10:41.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([vapoursynth], [49], [https://github.com/vapoursynth/vapoursynth/issues], [vapoursynth], [http://www.vapoursynth.com/]) +AC_INIT([vapoursynth], [50], [https://github.com/vapoursynth/vapoursynth/issues], [vapoursynth], [http://www.vapoursynth.com/]) : ${CFLAGS=""} : ${CXXFLAGS=""} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/doc/applications.rst new/vapoursynth-R50/doc/applications.rst --- old/vapoursynth-R49/doc/applications.rst 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/doc/applications.rst 2020-05-08 17:10:41.000000000 +0200 @@ -4,14 +4,17 @@ Applications ############ * `D2V Witch <https://github.com/dubhater/D2VWitch>`_ -- creates indexes that can be opened by d2vsource +* `mpv.net <https://github.com/stax76/mpv.net>`_ -- a media player with VapourSynth built-in * `SmoothVideo Project (SVP) <https://www.svp-team.com/wiki/Main_Page>`_ -- a plugin/video player component for realtime frame interpolation +* `StaxRip <https://github.com/staxrip/staxrip>`_ -- encoding GUI with extended VapourSynth scripting support * `VapourSynth Editor <https://bitbucket.org/mystery_keeper/vapoursynth-editor>`_ `(Doom9) <https://forum.doom9.org/showthread.php?t=170965>`__ -- an editor with syntax completion and fast preview support -* `VirtualDub1 <https://sourceforge.net/projects/vdfiltermod/>`_ `(Doom9) <https://forum.doom9.org/showthread.php?t=172021>`__ -- VirtualDub with added support for high bitdepth colorspaces, useful for previewing +* `VirtualDub2 <https://sourceforge.net/projects/vdfiltermod/>`_ `(Doom9) <https://forum.doom9.org/showthread.php?t=172021>`__ -- VirtualDub with added support for high bitdepth colorspaces, useful for previewing * `vsmkv <https://github.com/fluxamp/vsmkv>`_ -- a FUSE-based virtual filesystem for exporting VapourSynth scripts as uncompressed videos in the Matroska (MKV) file format * `Wobbly <https://github.com/dubhater/Wobbly>`_ `(Doom9) <https://forum.doom9.org/showthread.php?t=172496>`__ -- IVTC assistant similar to YATTA * `Yuuno <https://git.encode.moe/irrational-encoding-wizardry/yuuno>`_ -- incorporates VapourSynth into Jupyter Libraries ######### +* `VapourSynth.nim <https://forum.doom9.org/showthread.php?p=1905351#post1905351>`_ -- Bindings for the Nim programming language * `vsxx <https://github.com/sekrit-twc/vsxx>`_ -- VapourSynth C++ API wrapper * `vapoursynth-rs <https://crates.io/crates/vapoursynth>`_ -- VapourSynth Rust wrapper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/doc/conf.py new/vapoursynth-R50/doc/conf.py --- old/vapoursynth-R49/doc/conf.py 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/doc/conf.py 2020-05-08 17:10:41.000000000 +0200 @@ -42,14 +42,14 @@ # General information about the project. project = 'VapourSynth' -copyright = '2012-2019, Fredrik Mellbin' +copyright = '2012-2020, Fredrik Mellbin' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = 'R49' +version = 'R50' # The full version, including alpha/beta/rc tags. release = version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/doc/pythonreference.rst new/vapoursynth-R50/doc/pythonreference.rst --- old/vapoursynth-R49/doc/pythonreference.rst 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/doc/pythonreference.rst 2020-05-08 17:10:41.000000000 +0200 @@ -97,6 +97,9 @@ args = { "lambda": 1 } clip = core.plugin.Filter(clip, **args) + +VapourSynth will also support the PEP8 convention of using a single trailing +underscore to prevent collisions with python keywords. Windows File Paths (Strings With Backslashes) ############################################# @@ -330,6 +333,7 @@ :param cb: A callback in the form `cb(node, n, result)` .. py:method:: get_frame_async_raw(n, cb: Future[, wrapper: callable = None]) + :noindex: Second form of this method. It will take a Future-like object (including asyncio.Future or similar) and set its result or exception according to the result of the function. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/installer/setup.py new/vapoursynth-R50/installer/setup.py --- old/vapoursynth-R49/installer/setup.py 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/installer/setup.py 2020-05-08 17:10:41.000000000 +0200 @@ -1,4 +1,4 @@ -CURRENT_RELEASE = "49" +CURRENT_RELEASE = "50" # Always prefer setuptools over distutils from setuptools import setup, find_packages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/installer/vsinstaller.iss new/vapoursynth-R50/installer/vsinstaller.iss --- old/vapoursynth-R49/installer/vsinstaller.iss 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/installer/vsinstaller.iss 2020-05-08 17:10:41.000000000 +0200 @@ -1,4 +1,4 @@ -#define Version '49' +#define Version '50' #define VersionExtra '' #define PythonVersion '3.8' #define PythonCompactVersion '38' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/msvc_project/VSScript/VSScript.vcxproj new/vapoursynth-R50/msvc_project/VSScript/VSScript.vcxproj --- old/vapoursynth-R49/msvc_project/VSScript/VSScript.vcxproj 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/msvc_project/VSScript/VSScript.vcxproj 2020-05-08 17:10:41.000000000 +0200 @@ -96,7 +96,7 @@ <Link> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> - <DelayLoadDLLs>python37.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>python38.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> @@ -113,7 +113,7 @@ <Link> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> - <DelayLoadDLLs>python37.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>python38.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> @@ -133,7 +133,7 @@ <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <SubSystem>Windows</SubSystem> - <DelayLoadDLLs>python37.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>python38.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> @@ -151,7 +151,7 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <DelayLoadDLLs>python37.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <DelayLoadDLLs>python38.dll;%(DelayLoadDLLs)</DelayLoadDLLs> </Link> </ItemDefinitionGroup> <ItemGroup> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/setup.py new/vapoursynth-R50/setup.py --- old/vapoursynth-R49/setup.py 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/setup.py 2020-05-08 17:10:41.000000000 +0200 @@ -85,7 +85,7 @@ author = "Fredrik Mellbin", author_email = "[email protected]", license = "LGPL 2.1 or later", - version = "49", + version = "50", long_description = "A portable replacement for Avisynth", platforms = "All", ext_modules = [Extension("vapoursynth", [join("src", "cython", "vapoursynth.pyx")], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/exprfilter.cpp new/vapoursynth-R50/src/core/exprfilter.cpp --- old/vapoursynth-R49/src/core/exprfilter.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/exprfilter.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -78,7 +78,7 @@ enum class FMAType { FMADD = 0, // (b * c) + a - FMSUB = 1, // (b * c) - a + FMSUB = 1, // (b * c) - a FNMADD = 2, // -(b * c) + a FNMSUB = 3, // -(b * c) - a }; @@ -238,7 +238,7 @@ friend struct jitasm::function_cdecl<void, ExprCompiler128, uint8_t *, const intptr_t *, intptr_t>; #define SPLAT(x) { (x), (x), (x), (x) } - static constexpr ExprUnion constData alignas(16)[32][4] = { + static constexpr ExprUnion constData alignas(16)[39][4] = { SPLAT(0x7FFFFFFF), // absmask SPLAT(0x80000000), // negmask SPLAT(0x7F), // x7F @@ -247,6 +247,13 @@ SPLAT(1.0f), // float_one SPLAT(0.5f), // float_half SPLAT(255.0f), // float_255 + SPLAT(511.0f), // float_511 + SPLAT(1023.0f), // float_1023 + SPLAT(2047.0f), // float_2047 + SPLAT(4095.0f), // float_4095 + SPLAT(8191.0f), // float_8191 + SPLAT(16383.0f), // float_16383 + SPLAT(32767.0f), // float_32767 SPLAT(65535.0f), // float_65535 SPLAT(static_cast<int32_t>(0x80008000)), // i16min_epi16 SPLAT(static_cast<int32_t>(0xFFFF8000)), // i16min_epi32 @@ -282,30 +289,37 @@ static constexpr int float_one = 5; static constexpr int float_half = 6; static constexpr int float_255 = 7; - static constexpr int float_65535 = 8; - static constexpr int i16min_epi16 = 9; - static constexpr int i16min_epi32 = 10; - static constexpr int exp_hi = 11; - static constexpr int exp_lo = 12; - static constexpr int log2e = 13; - static constexpr int exp_c1 = 14; - static constexpr int exp_c2 = 15; - static constexpr int exp_p0 = 16; - static constexpr int exp_p1 = 17; - static constexpr int exp_p2 = 18; - static constexpr int exp_p3 = 19; - static constexpr int exp_p4 = 20; - static constexpr int exp_p5 = 21; - static constexpr int sqrt_1_2 = 22; - static constexpr int log_p0 = 23; - static constexpr int log_p1 = 24; - static constexpr int log_p2 = 25; - static constexpr int log_p3 = 26; - static constexpr int log_p4 = 27; - static constexpr int log_p5 = 28; - static constexpr int log_p6 = 29; - static constexpr int log_p7 = 30; - static constexpr int log_p8 = 31; + static constexpr int float_511 = 8; + static constexpr int float_1023 = 9; + static constexpr int float_2047 = 10; + static constexpr int float_4095 = 11; + static constexpr int float_8191 = 12; + static constexpr int float_16383 = 13; + static constexpr int float_32767 = 14; + static constexpr int float_65535 = 15; + static constexpr int i16min_epi16 = 16; + static constexpr int i16min_epi32 = 17; + static constexpr int exp_hi = 18; + static constexpr int exp_lo = 19; + static constexpr int log2e = 20; + static constexpr int exp_c1 = 21; + static constexpr int exp_c2 = 22; + static constexpr int exp_p0 = 23; + static constexpr int exp_p1 = 24; + static constexpr int exp_p2 = 25; + static constexpr int exp_p3 = 26; + static constexpr int exp_p4 = 27; + static constexpr int exp_p5 = 28; + static constexpr int sqrt_1_2 = 29; + static constexpr int log_p0 = 30; + static constexpr int log_p1 = 31; + static constexpr int log_p2 = 32; + static constexpr int log_p3 = 33; + static constexpr int log_p4 = 34; + static constexpr int log_p5 = 35; + static constexpr int log_p6 = 36; + static constexpr int log_p7 = 37; + static constexpr int log_p8 = 38; static constexpr int log_q1 = exp_c2; static constexpr int log_q2 = exp_c1; }; @@ -468,10 +482,11 @@ { deferred.push_back(EMIT() { + int depth = insn.op.imm.u; auto t1 = bytecodeRegs[insn.src1]; XmmReg r1, r2, limit; Reg a; - VEX1(movaps, limit, xmmword_ptr[constants + ConstantIndex::float_65535 * 16]); + VEX1(movaps, limit, xmmword_ptr[constants + (ConstantIndex::float_255 + depth - 8) * 16]); VEX2IMM(shufps, limit, limit, limit, 0); VEX2(minps, r1, t1.first, limit); VEX2(minps, r2, t1.second, limit); @@ -481,11 +496,14 @@ if (cpuFeatures.sse4_1) { VEX2(packusdw, r1, r1, r2); } else { - VEX1(movaps, limit, xmmword_ptr[constants + ConstantIndex::i16min_epi32 * 16]); - VEX2(paddd, r1, r1, limit); - VEX2(paddd, r2, r2, limit); + if (depth >= 16) { + VEX1(movaps, limit, xmmword_ptr[constants + ConstantIndex::i16min_epi32 * 16]); + VEX2(paddd, r1, r1, limit); + VEX2(paddd, r2, r2, limit); + } VEX2(packssdw, r1, r1, r2); - VEX2(psubw, r1, r1, xmmword_ptr[constants + ConstantIndex::i16min_epi16 * 16]); + if (depth >= 16) + VEX2(psubw, r1, r1, xmmword_ptr[constants + ConstantIndex::i16min_epi16 * 16]); } mov(a, ptr[regptrs]); VEX1(movaps, xmmword_ptr[a], r1); @@ -1016,7 +1034,7 @@ #undef EMIT }; -constexpr ExprUnion ExprCompiler128::constData alignas(16)[32][4]; +constexpr ExprUnion ExprCompiler128::constData alignas(16)[39][4]; class ExprCompiler256 : public ExprCompiler, private jitasm::function<void, ExprCompiler256, uint8_t *, const intptr_t *, intptr_t> { typedef jitasm::function<void, ExprCompiler256, uint8_t *, const intptr_t *, intptr_t> jit; @@ -1024,7 +1042,7 @@ friend struct jitasm::function_cdecl<void, ExprCompiler256, uint8_t *, const intptr_t *, intptr_t>; #define SPLAT(x) { (x), (x), (x), (x), (x), (x), (x), (x) } - static constexpr ExprUnion constData alignas(32)[32][8] = { + static constexpr ExprUnion constData alignas(32)[39][8] = { SPLAT(0x7FFFFFFF), // absmask SPLAT(0x80000000), // negmask SPLAT(0x7F), // x7F @@ -1033,6 +1051,13 @@ SPLAT(1.0f), // float_one SPLAT(0.5f), // float_half SPLAT(255.0f), // float_255 + SPLAT(511.0f), // float_511 + SPLAT(1023.0f), // float_1023 + SPLAT(2047.0f), // float_2047 + SPLAT(4095.0f), // float_4095 + SPLAT(8191.0f), // float_8191 + SPLAT(16383.0f), // float_16383 + SPLAT(32767.0f), // float_32767 SPLAT(65535.0f), // float_65535 SPLAT(static_cast<int32_t>(0x80008000)), // i16min_epi16 SPLAT(static_cast<int32_t>(0xFFFF8000)), // i16min_epi32 @@ -1068,30 +1093,37 @@ static constexpr int float_one = 5; static constexpr int float_half = 6; static constexpr int float_255 = 7; - static constexpr int float_65535 = 8; - static constexpr int i16min_epi16 = 9; - static constexpr int i16min_epi32 = 10; - static constexpr int exp_hi = 11; - static constexpr int exp_lo = 12; - static constexpr int log2e = 13; - static constexpr int exp_c1 = 14; - static constexpr int exp_c2 = 15; - static constexpr int exp_p0 = 16; - static constexpr int exp_p1 = 17; - static constexpr int exp_p2 = 18; - static constexpr int exp_p3 = 19; - static constexpr int exp_p4 = 20; - static constexpr int exp_p5 = 21; - static constexpr int sqrt_1_2 = 22; - static constexpr int log_p0 = 23; - static constexpr int log_p1 = 24; - static constexpr int log_p2 = 25; - static constexpr int log_p3 = 26; - static constexpr int log_p4 = 27; - static constexpr int log_p5 = 28; - static constexpr int log_p6 = 29; - static constexpr int log_p7 = 30; - static constexpr int log_p8 = 31; + static constexpr int float_511 = 8; + static constexpr int float_1023 = 9; + static constexpr int float_2047 = 10; + static constexpr int float_4095 = 11; + static constexpr int float_8191 = 12; + static constexpr int float_16383 = 13; + static constexpr int float_32767 = 14; + static constexpr int float_65535 = 15; + static constexpr int i16min_epi16 = 16; + static constexpr int i16min_epi32 = 17; + static constexpr int exp_hi = 18; + static constexpr int exp_lo = 19; + static constexpr int log2e = 20; + static constexpr int exp_c1 = 21; + static constexpr int exp_c2 = 22; + static constexpr int exp_p0 = 23; + static constexpr int exp_p1 = 24; + static constexpr int exp_p2 = 25; + static constexpr int exp_p3 = 26; + static constexpr int exp_p4 = 27; + static constexpr int exp_p5 = 28; + static constexpr int sqrt_1_2 = 29; + static constexpr int log_p0 = 30; + static constexpr int log_p1 = 31; + static constexpr int log_p2 = 32; + static constexpr int log_p3 = 33; + static constexpr int log_p4 = 34; + static constexpr int log_p5 = 35; + static constexpr int log_p6 = 36; + static constexpr int log_p7 = 37; + static constexpr int log_p8 = 38; static constexpr int log_q1 = exp_c2; static constexpr int log_q2 = exp_c1; }; @@ -1192,10 +1224,11 @@ { deferred.push_back(EMIT() { + int depth = insn.op.imm.u; auto t1 = bytecodeRegs[insn.src1]; YmmReg r1, limit; Reg a; - vminps(r1, t1, ymmword_ptr[constants + ConstantIndex::float_65535 * 32]); + vminps(r1, t1, ymmword_ptr[constants + (ConstantIndex::float_255 + depth - 8) * 32]); vcvtps2dq(r1, r1); vpackusdw(r1, r1, r1); vpermq(r1, r1, 0x08); @@ -1589,7 +1622,7 @@ #undef EMIT }; -constexpr ExprUnion ExprCompiler256::constData alignas(32)[32][8]; +constexpr ExprUnion ExprCompiler256::constData alignas(32)[39][8]; std::unique_ptr<ExprCompiler> make_compiler(int numInputs, int cpulevel) { @@ -1606,10 +1639,14 @@ std::vector<float> registers; template <class T> - static T clamp_int(float x) + static T clamp_int(float x, int depth = std::numeric_limits<T>::digits) { - return static_cast<T>(std::lrint(std::min(std::max(x, static_cast<float>(std::numeric_limits<T>::min())), static_cast<float>(std::numeric_limits<T>::max())))); + float maxval = static_cast<float>((1U << depth) - 1); + return static_cast<T>(std::lrint(std::min(std::max(x, static_cast<float>(std::numeric_limits<T>::min())), maxval))); } + + static float bool2float(bool x) { return x ? 1.0f : 0.0f; } + static bool float2bool(float x) { return x > 0.0f; } public: ExprInterpreter(const ExprInstruction *bytecode, size_t numInsns) : bytecode(bytecode), numInsns(numInsns) { @@ -1622,9 +1659,6 @@ void eval(const uint8_t * const *srcp, uint8_t *dstp, int x) { - auto bool2float = [](bool x) { return x ? 1.0f : 0.0f; }; - auto float2bool = [](float x) { return x > 0.0f; }; - for (size_t i = 0; i < numInsns; ++i) { const ExprInstruction &insn = bytecode[i]; @@ -1674,7 +1708,7 @@ case ExprOpType::XOR: DST = bool2float((float2bool(SRC1) != float2bool(SRC2))); break; case ExprOpType::NOT: DST = bool2float(!float2bool(SRC1)); break; case ExprOpType::MEM_STORE_U8: reinterpret_cast<uint8_t *>(dstp)[x] = clamp_int<uint8_t>(SRC1); return; - case ExprOpType::MEM_STORE_U16: reinterpret_cast<uint16_t *>(dstp)[x] = clamp_int<uint16_t>(SRC1); return; + case ExprOpType::MEM_STORE_U16: reinterpret_cast<uint16_t *>(dstp)[x] = clamp_int<uint16_t>(SRC1, insn.op.imm.u); return; case ExprOpType::MEM_STORE_F16: reinterpret_cast<uint16_t *>(dstp)[x] = 0; return; case ExprOpType::MEM_STORE_F32: reinterpret_cast<float *>(dstp)[x] = SRC1; return; default: vsFatal("illegal opcode"); return; @@ -3059,6 +3093,9 @@ else if (format->sampleType == stFloat && format->bytesPerSample == 4) store.op.type = ExprOpType::MEM_STORE_F32; + if (store.op.type == ExprOpType::MEM_STORE_U16) + store.op.imm.u = format->bitsPerSample; + store.src1 = code.back().dst; code.push_back(store); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/kernel/x86/generic_avx2.cpp new/vapoursynth-R50/src/core/kernel/x86/generic_avx2.cpp --- old/vapoursynth-R49/src/core/kernel/x86/generic_avx2.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/kernel/x86/generic_avx2.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -202,7 +202,7 @@ template <bool Sobel> struct PrewittSobelWord : PrewittSobelTraits, WordTraits { - __m128 maxval; + __m256i maxval; static uint32_t interleave(uint16_t a, uint16_t b) { @@ -211,7 +211,7 @@ explicit PrewittSobelWord(const vs_generic_params ¶ms) : PrewittSobelTraits(params), - maxval(_mm_set_ps1(params.maxval)) + maxval(_mm256_set1_epi16(params.maxval)) {} FORCE_INLINE __m256i op(OP_ARGS) @@ -264,11 +264,8 @@ __m256i tmpi_lo = _mm256_cvtps_epi32(gxy_lo); __m256i tmpi_hi = _mm256_cvtps_epi32(gxy_hi); - tmpi_lo = _mm256_add_epi32(tmpi_lo, _mm256_set1_epi32(INT16_MIN)); - tmpi_hi = _mm256_add_epi32(tmpi_hi, _mm256_set1_epi32(INT16_MIN)); - - __m256i tmp = _mm256_packs_epi32(tmpi_lo, tmpi_hi); - tmp = _mm256_sub_epi16(tmp, _mm256_set1_epi16(INT16_MIN)); + __m256i tmp = _mm256_packus_epi32(tmpi_lo, tmpi_hi); + tmp = _mm256_min_epu16(tmp, maxval); return tmp; #undef UNPCKHI #undef UNPCKLO @@ -355,12 +352,10 @@ } template <bool Max> -static __m256i limit_diff_epi16(__m256i val, __m256i orig, __m256i threshold) +static __m256i limit_diff_epu16(__m256i val, __m256i orig, __m256i threshold) { - // val in signed domain. orig and threshold in unsigned domain. __m256i limit = Max ? _mm256_adds_epu16(orig, threshold) : _mm256_subs_epu16(orig, threshold); - limit = _mm256_add_epi16(limit, _mm256_set1_epi16(INT16_MIN)); - val = Max ? _mm256_min_epi16(val, limit) : _mm256_max_epi16(val, limit); + val = Max ? _mm256_min_epu16(val, limit) : _mm256_max_epu16(val, limit); return val; } @@ -409,10 +404,7 @@ FORCE_INLINE static __m256i reduce(__m256i lhs, __m256i rhs, __m256i mask) { - // lhs is in signed domain. rhs is in unsigned domain (for masking). - rhs = Max ? _mm256_and_si256(mask, rhs) : _mm256_or_si256(mask, rhs); - rhs = _mm256_add_epi16(rhs, _mm256_set1_epi16(INT16_MIN)); - return Max ? _mm256_max_epi16(lhs, rhs) : _mm256_min_epi16(lhs, rhs); + return Max ? _mm256_max_epu16(lhs, _mm256_and_si256(mask, rhs)) : _mm256_min_epu16(lhs, _mm256_or_si256(mask, rhs)); } explicit MinMaxWord(const vs_generic_params ¶ms) : @@ -424,11 +416,8 @@ { PROLOGUE(); - __m256i a11_signed = _mm256_add_epi16(a11, _mm256_set1_epi16(INT16_MIN)); - __m256i val = MinMaxTraitsT::apply_stencil(a00, a01, a02, a10, a11_signed, a12, a20, a21, a22); - val = limit_diff_epi16<Max>(val, a11, threshold); - val = _mm256_sub_epi16(val, _mm256_set1_epi16(INT16_MIN)); - return val; + __m256i val = MinMaxTraitsT::apply_stencil(a00, a01, a02, a10, a11, a12, a20, a21, a22); + return limit_diff_epu16<Max>(val, a11, threshold); } }; @@ -514,8 +503,7 @@ static __m256i reduce(__m256i lhs, __m256i rhs) { - // lhs in signed domain. rhs in unsigned domain. - return Max ? _mm256_max_epi16(lhs, _mm256_add_epi16(rhs, _mm256_set1_epi16(INT16_MIN))) : _mm256_min_epi16(lhs, _mm256_add_epi16(rhs, _mm256_set1_epi16(INT16_MIN))); + return Max ? _mm256_max_epu16(lhs, rhs) : _mm256_min_epu16(lhs, rhs); } explicit MinMaxFixedWord(const vs_generic_params ¶ms) : @@ -526,11 +514,8 @@ { PROLOGUE(); - __m256i a11_signed = _mm256_add_epi16(a11, _mm256_set1_epi16(INT16_MIN)); - __m256i val = MinMaxFixedTraitsT::apply_stencil(a00, a01, a02, a10, a11_signed, a12, a20, a21, a22); - val = limit_diff_epi16<Max>(val, a11, threshold); - val = _mm256_sub_epi16(val, _mm256_set1_epi16(INT16_MIN)); - return val; + __m256i val = MinMaxFixedTraitsT::apply_stencil(a00, a01, a02, a10, a11, a12, a20, a21, a22); + return limit_diff_epu16<Max>(val, a11, threshold); } }; @@ -606,33 +591,18 @@ }; struct MedianWord : MedianTraits<MedianWord, __m256i>, WordTraits { - static __m256i min(__m256i lhs, __m256i rhs) { return _mm256_min_epi16(lhs, rhs); } - static __m256i max(__m256i lhs, __m256i rhs) { return _mm256_max_epi16(lhs, rhs); } + static __m256i min(__m256i lhs, __m256i rhs) { return _mm256_min_epu16(lhs, rhs); } + static __m256i max(__m256i lhs, __m256i rhs) { return _mm256_max_epu16(lhs, rhs); } static FORCE_INLINE void compare_exchange(__m256i &lhs, __m256i &rhs) { __m256i a = lhs; __m256i b = rhs; - lhs = _mm256_min_epi16(a, b); - rhs = _mm256_max_epi16(a, b); + lhs = _mm256_min_epu16(a, b); + rhs = _mm256_max_epu16(a, b); } explicit MedianWord(const vs_generic_params &) {} - - FORCE_INLINE vec_type op(OP_ARGS) - { - PROLOGUE(); - -#define SIGNED16(x) (_mm256_add_epi16((x), _mm256_set1_epi16(INT16_MIN))) - a00 = SIGNED16(a00); a01 = SIGNED16(a01); a02 = SIGNED16(a02); - a10 = SIGNED16(a10); a11 = SIGNED16(a11); a12 = SIGNED16(a12); - a20 = SIGNED16(a20); a21 = SIGNED16(a21); a22 = SIGNED16(a22); -#undef SIGNED16 - - __m256i val = MedianTraits<MedianWord, __m256i>::op(a00, a01, a02, a10, a11, a12, a20, a21, a22); - val = _mm256_sub_epi16(val, _mm256_set1_epi16(INT16_MIN)); - return val; - } }; struct MedianFloat : MedianTraits<MedianFloat, __m256>, FloatTraits { @@ -731,17 +701,12 @@ accum_lo = _mm256_srli_epi32(accum_lo, 3); accum_hi = _mm256_srli_epi32(accum_hi, 3); - accum_lo = _mm256_add_epi32(accum_lo, _mm256_set1_epi32(INT16_MIN)); - accum_hi = _mm256_add_epi32(accum_hi, _mm256_set1_epi32(INT16_MIN)); - __m256i tmp = _mm256_packs_epi32(accum_lo, accum_hi); - __m256i a11_signed = _mm256_add_epi16(a11, _mm256_set1_epi16(INT16_MIN)); - tmp = Inflate ? _mm256_max_epi16(tmp, a11_signed) : _mm256_min_epi16(tmp, a11_signed); + __m256i tmp = _mm256_packus_epi32(accum_lo, accum_hi); + tmp = Inflate ? _mm256_max_epu16(tmp, a11) : _mm256_min_epu16(tmp, a11); __m256i limit = Inflate ? _mm256_adds_epu16(a11, threshold) : _mm256_subs_epu16(a11, threshold); - limit = _mm256_add_epi16(limit, _mm256_set1_epi16(INT16_MIN)); - tmp = Inflate ? _mm256_min_epi16(tmp, limit) : _mm256_max_epi16(tmp, limit); - tmp = _mm256_sub_epi16(tmp, _mm256_set1_epi16(INT16_MIN)); + tmp = Inflate ? _mm256_min_epu16(tmp, limit) : _mm256_max_epu16(tmp, limit); return tmp; #undef UNPCKHI @@ -891,7 +856,7 @@ explicit ConvolutionWord(const vs_generic_params ¶ms) : ConvolutionIntTraits(params), - maxval(_mm256_set1_epi16(static_cast<int16_t>(static_cast<int32_t>(params.maxval) + INT16_MIN))) + maxval(_mm256_set1_epi16(params.maxval)) { int32_t x = 0; @@ -939,13 +904,9 @@ accum_lo = _mm256_cvtps_epi32(tmpf_lo); accum_hi = _mm256_cvtps_epi32(tmpf_hi); - accum_lo = _mm256_add_epi32(accum_lo, _mm256_set1_epi32(INT16_MIN)); - accum_hi = _mm256_add_epi32(accum_hi, _mm256_set1_epi32(INT16_MIN)); - __m256i tmp = _mm256_packs_epi32(accum_lo, accum_hi); - tmp = _mm256_min_epi16(tmp, maxval); - tmp = _mm256_sub_epi16(tmp, _mm256_set1_epi16(INT16_MIN)); - return tmp; + __m256i tmp = _mm256_packus_epi32(accum_lo, accum_hi); + return _mm256_min_epu16(tmp, maxval); } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/kernel/x86/generic_sse2.cpp new/vapoursynth-R50/src/core/kernel/x86/generic_sse2.cpp --- old/vapoursynth-R49/src/core/kernel/x86/generic_sse2.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/kernel/x86/generic_sse2.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -187,7 +187,7 @@ template <bool Sobel> struct PrewittSobelWord : PrewittSobelTraits, WordTraits { - __m128 maxval; + __m128i maxval; static uint32_t interleave(uint16_t a, uint16_t b) { @@ -196,7 +196,7 @@ explicit PrewittSobelWord(const vs_generic_params ¶ms) : PrewittSobelTraits(params), - maxval(_mm_set_ps1(params.maxval)) + maxval(_mm_set1_epi16(params.maxval + INT16_MIN)) {} FORCE_INLINE __m128i op(OP_ARGS) @@ -253,6 +253,7 @@ tmpi_hi = _mm_add_epi32(tmpi_hi, _mm_set1_epi32(INT16_MIN)); __m128i tmp = _mm_packs_epi32(tmpi_lo, tmpi_hi); + tmp = _mm_min_epi16(tmp, maxval); tmp = _mm_sub_epi16(tmp, _mm_set1_epi16(INT16_MIN)); return tmp; #undef UNPCKHI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/kernel/x86/merge_avx2.c new/vapoursynth-R50/src/core/kernel/x86/merge_avx2.c --- old/vapoursynth-R49/src/core/kernel/x86/merge_avx2.c 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/kernel/x86/merge_avx2.c 2020-05-08 17:10:41.000000000 +0200 @@ -187,11 +187,8 @@ tmp1d_hi = _mm256_add_epi32(tmp1d_hi, _mm256_set1_epi32(maxval / 2)); tmp1d_lo = divX_epu32(tmp1d_lo, depth); - tmp1d_lo = _mm256_add_epi32(tmp1d_lo, _mm256_set1_epi32(INT16_MIN)); tmp1d_hi = divX_epu32(tmp1d_hi, depth); - tmp1d_hi = _mm256_add_epi32(tmp1d_hi, _mm256_set1_epi32(INT16_MIN)); - tmp = _mm256_packs_epi32(tmp1d_lo, tmp1d_hi); - tmp = _mm256_sub_epi16(tmp, _mm256_set1_epi16(INT16_MIN)); + tmp = _mm256_packus_epi32(tmp1d_lo, tmp1d_hi); _mm256_store_si256((__m256i *)(dstp + i), tmp); } } @@ -281,16 +278,12 @@ tmpd_lo = _mm256_unpacklo_epi16(tmp_lo, tmp_hi); tmpd_lo = _mm256_add_epi32(tmpd_lo, _mm256_set1_epi32(maxval / 2)); tmpd_lo = divX_epu32(tmpd_lo, depth); - tmpd_lo = _mm256_add_epi32(tmpd_lo, _mm256_set1_epi32(INT16_MIN)); tmpd_hi = _mm256_unpackhi_epi16(tmp_lo, tmp_hi); tmpd_hi = _mm256_add_epi32(tmpd_hi, _mm256_set1_epi32(maxval / 2)); tmpd_hi = divX_epu32(tmpd_hi, depth); - tmpd_hi = _mm256_add_epi32(tmpd_hi, _mm256_set1_epi32(INT16_MIN)); - - tmp = _mm256_packs_epi32(tmpd_lo, tmpd_hi); - tmp = _mm256_sub_epi16(tmp, _mm256_set1_epi16(INT16_MIN)); + tmp = _mm256_packus_epi32(tmpd_lo, tmpd_hi); neg = _mm256_sub_epi16(_mm256_setzero_si256(), tmp); tmp = _mm256_blendv_epi8(tmp, neg, sign); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/kernel/x86/planestats_avx2.c new/vapoursynth-R50/src/core/kernel/x86/planestats_avx2.c --- old/vapoursynth-R49/src/core/kernel/x86/planestats_avx2.c 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/kernel/x86/planestats_avx2.c 2020-05-08 17:10:41.000000000 +0200 @@ -46,22 +46,22 @@ return _mm_cvtsi128_si32(tmp) & 0xFF; } -static int hmax_epi16(__m256i x) +static unsigned hmax_epu16(__m256i x) { - __m128i tmp = _mm_max_epi16(_mm256_castsi256_si128(x), _mm256_extractf128_si256(x, 1)); - tmp = _mm_max_epi16(tmp, _mm_srli_si128(tmp, 8)); - tmp = _mm_max_epi16(tmp, _mm_srli_si128(tmp, 4)); - tmp = _mm_max_epi16(tmp, _mm_srli_si128(tmp, 2)); - return (int16_t)_mm_extract_epi16(tmp, 0); -} - -static int hmin_epi16(__m256i x) -{ - __m128i tmp = _mm_min_epi16(_mm256_castsi256_si128(x), _mm256_extractf128_si256(x, 1)); - tmp = _mm_min_epi16(tmp, _mm_srli_si128(tmp, 8)); - tmp = _mm_min_epi16(tmp, _mm_srli_si128(tmp, 4)); - tmp = _mm_min_epi16(tmp, _mm_srli_si128(tmp, 2)); - return (int16_t)_mm_extract_epi16(tmp, 0); + __m128i tmp = _mm_max_epu16(_mm256_castsi256_si128(x), _mm256_extractf128_si256(x, 1)); + tmp = _mm_max_epu16(tmp, _mm_srli_si128(tmp, 8)); + tmp = _mm_max_epu16(tmp, _mm_srli_si128(tmp, 4)); + tmp = _mm_max_epu16(tmp, _mm_srli_si128(tmp, 2)); + return (uint16_t)_mm_extract_epi16(tmp, 0); +} + +static unsigned hmin_epu16(__m256i x) +{ + __m128i tmp = _mm_min_epu16(_mm256_castsi256_si128(x), _mm256_extractf128_si256(x, 1)); + tmp = _mm_min_epu16(tmp, _mm_srli_si128(tmp, 8)); + tmp = _mm_min_epu16(tmp, _mm_srli_si128(tmp, 4)); + tmp = _mm_min_epu16(tmp, _mm_srli_si128(tmp, 2)); + return (uint16_t)_mm_extract_epi16(tmp, 0); } static float hmax_ps(__m256 x) @@ -133,8 +133,8 @@ unsigned tail = width & ~15; unsigned x, y; - __m256i mmin = _mm256_set1_epi16(INT16_MAX); - __m256i mmax = _mm256_set1_epi16(INT16_MIN); + __m256i mmin = _mm256_set1_epi16(UINT16_MAX); + __m256i mmax = _mm256_setzero_si256(); __m256i macc_lo = _mm256_setzero_si256(); __m256i macc_hi = _mm256_setzero_si256(); __m256i mask = _mm256_cmpgt_epi16(_mm256_set1_epi16(width % 16), _mm256_loadu_si256((const __m256i *)ascend16)); @@ -145,17 +145,16 @@ for (y = 0; y < height; y++) { for (x = 0; x < tail; x += 16) { __m256i v = _mm256_load_si256((const __m256i *)((const uint16_t *)srcp + x)); - __m256i v_signed = _mm256_add_epi16(v, _mm256_set1_epi16(INT16_MIN)); - mmin = _mm256_min_epi16(mmin, v_signed); - mmax = _mm256_max_epi16(mmax, v_signed); + mmin = _mm256_min_epu16(mmin, v); + mmax = _mm256_max_epu16(mmax, v); macc_lo = _mm256_add_epi64(macc_lo, _mm256_sad_epu8(_mm256_and_si256(low8mask, v), _mm256_setzero_si256())); macc_hi = _mm256_add_epi64(macc_hi, _mm256_sad_epu8(_mm256_andnot_si256(low8mask, v), _mm256_setzero_si256())); } if (width != tail) { __m256i v = _mm256_and_si256(_mm256_load_si256((const __m256i *)((const uint16_t *)srcp + tail)), mask); - mmin = _mm256_min_epi16(mmin, _mm256_add_epi16(_mm256_or_si256(v, onesmask), _mm256_set1_epi16(INT16_MIN))); - mmax = _mm256_max_epi16(mmax, _mm256_add_epi16(v, _mm256_set1_epi16(INT16_MIN))); + mmin = _mm256_min_epu16(mmin, _mm256_or_si256(v, onesmask)); + mmax = _mm256_max_epu16(mmax, v); macc_lo = _mm256_add_epi64(macc_lo, _mm256_sad_epu8(_mm256_and_si256(low8mask, v), _mm256_setzero_si256())); macc_hi = _mm256_add_epi64(macc_hi, _mm256_sad_epu8(_mm256_andnot_si256(low8mask, v), _mm256_setzero_si256())); @@ -163,8 +162,8 @@ srcp += stride; } - stats->i.min = hmin_epi16(mmin) - INT16_MIN; - stats->i.max = hmax_epi16(mmax) - INT16_MIN; + stats->i.min = hmin_epu16(mmin); + stats->i.max = hmax_epu16(mmax); tmp = _mm256_add_epi64(_mm256_unpacklo_epi64(macc_lo, macc_hi), _mm256_unpackhi_epi64(macc_lo, macc_hi)); tmp = _mm256_add_epi64(tmp, _mm256_slli_epi64(_mm256_unpackhi_epi64(tmp, tmp), 8)); @@ -255,8 +254,8 @@ unsigned tail = width & ~15; unsigned x, y; - __m256i mmin = _mm256_set1_epi16(INT16_MAX); - __m256i mmax = _mm256_set1_epi16(INT16_MIN); + __m256i mmin = _mm256_set1_epi16(UINT16_MAX); + __m256i mmax = _mm256_setzero_si256(); __m256i macc_lo = _mm256_setzero_si256(); __m256i macc_hi = _mm256_setzero_si256(); __m256i mdiffacc_lo = _mm256_setzero_si256(); @@ -270,11 +269,10 @@ for (x = 0; x < tail; x += 16) { __m256i v1 = _mm256_load_si256((const __m256i *)((const uint16_t *)srcp1 + x)); __m256i v2 = _mm256_load_si256((const __m256i *)((const uint16_t *)srcp2 + x)); - __m256i v1_signed = _mm256_add_epi16(v1, _mm256_set1_epi16(INT16_MIN)); __m256i udiff = _mm256_or_si256(_mm256_subs_epu16(v1, v2), _mm256_subs_epu16(v2, v1)); - mmin = _mm256_min_epi16(mmin, v1_signed); - mmax = _mm256_max_epi16(mmax, v1_signed); + mmin = _mm256_min_epu16(mmin, v1); + mmax = _mm256_max_epu16(mmax, v1); macc_lo = _mm256_add_epi64(macc_lo, _mm256_sad_epu8(_mm256_and_si256(low8mask, v1), _mm256_setzero_si256())); macc_hi = _mm256_add_epi64(macc_hi, _mm256_sad_epu8(_mm256_andnot_si256(low8mask, v1), _mm256_setzero_si256())); @@ -287,8 +285,8 @@ __m256i v2 = _mm256_and_si256(_mm256_load_si256((const __m256i *)((const uint16_t *)srcp2 + tail)), mask); __m256i udiff = _mm256_or_si256(_mm256_subs_epu16(v1, v2), _mm256_subs_epu16(v2, v1)); - mmin = _mm256_min_epi16(mmin, _mm256_add_epi16(_mm256_or_si256(v1, onesmask), _mm256_set1_epi16(INT16_MIN))); - mmax = _mm256_max_epi16(mmax, _mm256_add_epi16(v1, _mm256_set1_epi16(INT16_MIN))); + mmin = _mm256_min_epu16(mmin, _mm256_or_si256(v1, onesmask)); + mmax = _mm256_max_epu16(mmax, v1); macc_lo = _mm256_add_epi64(macc_lo, _mm256_sad_epu8(_mm256_and_si256(low8mask, v1), _mm256_setzero_si256())); macc_hi = _mm256_add_epi64(macc_hi, _mm256_sad_epu8(_mm256_andnot_si256(low8mask, v1), _mm256_setzero_si256())); @@ -300,8 +298,8 @@ srcp2 += src2_stride; } - stats->i.min = hmin_epi16(mmin) - INT16_MIN; - stats->i.max = hmax_epi16(mmax) - INT16_MIN; + stats->i.min = hmin_epu16(mmin); + stats->i.max = hmax_epu16(mmax); tmp = _mm256_add_epi64(_mm256_unpacklo_epi64(macc_lo, macc_hi), _mm256_unpackhi_epi64(macc_lo, macc_hi)); tmp = _mm256_add_epi64(tmp, _mm256_slli_epi64(_mm256_unpackhi_epi64(tmp, tmp), 8)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/textfilter.cpp new/vapoursynth-R50/src/core/textfilter.cpp --- old/vapoursynth-R49/src/core/textfilter.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/textfilter.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -145,7 +145,7 @@ size_t horizontal_capacity = width / character_width; for (stringlist::iterator iter = lines.begin(); iter != lines.end(); iter++) { if (iter->size() > horizontal_capacity) { - lines.insert(std::next(iter), iter->substr(horizontal_capacity)); + iter = std::prev(lines.insert(std::next(iter), iter->substr(horizontal_capacity))); iter->erase(horizontal_capacity); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/version.h new/vapoursynth-R50/src/core/version.h --- old/vapoursynth-R49/src/core/version.h 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/version.h 2020-05-08 17:10:41.000000000 +0200 @@ -23,6 +23,7 @@ /* Note that the version is stored in several places, in addition to version.h it's also in: + src/cython/vapoursynth.pyx (__version__) setup.py (version = "" near the bottom) configure.ac (number on first line in []) installer/vsinstaller.iss (Version define at top) @@ -33,7 +34,7 @@ #define XSTR(x) STR(x) #define STR(x) #x -#define VAPOURSYNTH_CORE_VERSION 49 +#define VAPOURSYNTH_CORE_VERSION 50 #if defined(VS_FRAME_GUARD) && !defined(NDEBUG) #define VS_OPTIONS_TEXT "Options: Frame Guard + Extra Assertions\n" #elif defined(VS_FRAME_GUARD) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/core/vsresize.cpp new/vapoursynth-R50/src/core/vsresize.cpp --- old/vapoursynth-R49/src/core/vsresize.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/core/vsresize.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -616,7 +616,7 @@ VSNodeRef *m_node; VSVideoInfo m_vi; bool m_prefer_props; - double src_left, src_top, src_width, src_height; + double m_src_left, m_src_top, m_src_width, m_src_height; vszimgxx::zfilter_graph_builder_params m_params; frame_params m_frame_params; @@ -662,7 +662,11 @@ vszimg(const VSMap *in, void *userData, VSCore *core, const VSAPI *vsapi) : m_node{ nullptr }, m_vi(), - m_prefer_props(false) + m_prefer_props(false), + m_src_left(), + m_src_top(), + m_src_width(), + m_src_height() { try { m_node = vsapi->propGetNode(in, "clip", 0, nullptr); @@ -710,10 +714,10 @@ lookup_enum_str_opt(in, "cpu_type", g_cpu_type_table, &m_params.cpu_type, vsapi); m_prefer_props = !!propGetScalarDef<int>(in, "prefer_props", 0, vsapi); - src_left = propGetScalarDef<double>(in, "src_left", NAN, vsapi); - src_top = propGetScalarDef<double>(in, "src_top", NAN, vsapi); - src_width = propGetScalarDef<double>(in, "src_width", NAN, vsapi); - src_height = propGetScalarDef<double>(in, "src_height", NAN, vsapi); + m_src_left = propGetScalarDef<double>(in, "src_left", NAN, vsapi); + m_src_top = propGetScalarDef<double>(in, "src_top", NAN, vsapi); + m_src_width = propGetScalarDef<double>(in, "src_width", NAN, vsapi); + m_src_height = propGetScalarDef<double>(in, "src_height", NAN, vsapi); m_params.nominal_peak_luminance = propGetScalarDef<double>(in, "nominal_luminance", NAN, vsapi); // Basic compatibility check. @@ -806,10 +810,10 @@ dst_format.width = m_vi.width ? static_cast<unsigned>(m_vi.width) : src_format.width; dst_format.height = m_vi.height ? static_cast<unsigned>(m_vi.height) : src_format.height; - src_format.active_region.left = src_left; - src_format.active_region.top = src_top; - src_format.active_region.width = src_width; - src_format.active_region.height = src_height; + src_format.active_region.left = m_src_left; + src_format.active_region.top = m_src_top; + src_format.active_region.width = m_src_width; + src_format.active_region.height = m_src_height; translate_vsformat(src_vsformat, &src_format); translate_vsformat(dst_vsformat, &dst_format); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/cython/vapoursynth.pyx new/vapoursynth-R50/src/cython/vapoursynth.pyx --- old/vapoursynth-R49/src/cython/vapoursynth.pyx 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/cython/vapoursynth.pyx 2020-05-08 17:10:41.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2017 Fredrik Mellbin +# Copyright (c) 2012-2020 Fredrik Mellbin # # This file is part of VapourSynth. # @@ -44,6 +44,8 @@ except ImportError as e: typing = None +__version__ = namedtuple("VapourSynthVersion", "release_major release_minor")(50, 0) +__api_version__ = namedtuple("VapourSynthAPIVersion", "api_major api_minor")(VAPOURSYNTH_API_MAJOR, VAPOURSYNTH_API_MINOR) _using_vsscript = False cdef object _environment_state = ThreadLocal() @@ -311,7 +313,8 @@ raise Error('Class cannot be instantiated directly') def __dealloc__(self): - self.funcs.freeFunc(self.ref) + if self.funcs: + self.funcs.freeFunc(self.ref) def __call__(self, **kwargs): cdef VSMap *outm @@ -437,7 +440,8 @@ raise Error('Class cannot be instantiated directly') def __dealloc__(self): - self.funcs.freeFrame(self.f) + if self.funcs: + self.funcs.freeFrame(self.f) cdef FramePtr createFramePtr(const VSFrameRef *f, const VSAPI *funcs): cdef FramePtr instance = FramePtr.__new__(FramePtr) @@ -751,7 +755,8 @@ raise Error('Class cannot be instantiated directly') def __dealloc__(self): - self.funcs.freeFrame(self.constf) + if self.funcs: + self.funcs.freeFrame(self.constf) def __contains__(self, str name): cdef const VSMap *m = self.funcs.getFramePropsRO(self.constf) @@ -992,7 +997,8 @@ raise Error('Class cannot be instantiated directly') def __dealloc__(self): - self.funcs.freeFrame(self.constf) + if self.funcs: + self.funcs.freeFrame(self.constf) def copy(self): return createVideoFrame(self.funcs.copyFrame(self.constf, self.core), self.funcs, self.core) @@ -1211,7 +1217,8 @@ raise Error('Class cannot be instantiated directly') def __dealloc__(self): - self.funcs.freeNode(self.node) + if self.funcs: + self.funcs.freeNode(self.node) def __getattr__(self, name): err = False @@ -1793,6 +1800,9 @@ for key in kwargs: if key[0] == '_': nkey = key[1:] + # PEP8 tells us single_trailing_underscore_ for collisions with Python-keywords. + elif key[-1] == "_": + nkey = key[:-1] else: nkey = key ndict[nkey] = kwargs[key] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vapoursynth-R49/src/filters/misc/miscfilters.cpp new/vapoursynth-R50/src/filters/misc/miscfilters.cpp --- old/vapoursynth-R49/src/filters/misc/miscfilters.cpp 2020-03-17 20:36:27.000000000 +0100 +++ new/vapoursynth-R50/src/filters/misc/miscfilters.cpp 2020-05-08 17:10:41.000000000 +0200 @@ -164,8 +164,7 @@ acc += srcpp[i][w] * weights[i]; unsigned acc2 = std::max(0, acc); - acc2 += scale - 1; - acc2 /= scale; + acc2 = (acc + scale / 2) / scale; acc2 = std::min(acc2, maxVal); dstp[w] = static_cast<T>(acc2); } @@ -506,7 +505,9 @@ throw std::runtime_error("Number of weights must be odd when only one clip supplied"); } else if (numWeights != numNodes) { throw std::runtime_error("Number of weights must match number of clips supplied"); - } else if (numWeights > 31 || numNodes > 31) { + } + + if (numWeights > 31 || numNodes > 31) { throw std::runtime_error("Must use between 1 and 31 weights and input clips"); } ++++++ vapoursynth-version.patch ++++++ --- /var/tmp/diff_new_pack.JKSc2s/_old 2020-05-18 10:59:31.242652155 +0200 +++ /var/tmp/diff_new_pack.JKSc2s/_new 2020-05-18 10:59:31.242652155 +0200 @@ -1,6 +1,6 @@ -diff -urEbw vapoursynth-R49/Makefile.am vapoursynth-R49.new/Makefile.am ---- vapoursynth-R49/Makefile.am 2020-03-17 20:36:27.000000000 +0100 -+++ vapoursynth-R49.new/Makefile.am 2020-04-24 11:15:20.952389928 +0200 +diff -urEbw vapoursynth-R50/Makefile.am vapoursynth-R50.new/Makefile.am +--- vapoursynth-R50/Makefile.am 2020-05-08 17:10:41.000000000 +0200 ++++ vapoursynth-R50.new/Makefile.am 2020-05-14 10:50:38.446478782 +0200 @@ -79,7 +79,7 @@ pkgconfig_DATA += pc/vapoursynth.pc
