Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
19th October 2012, 15:08 | #1 | Link |
Advanced Blogging
Join Date: May 2009
Posts: 480
|
Example plugins for Vapoursynth
Download link.
Here are some simple plugin examples for vapoursynth. Included are: vsmatrix -- do arbitrary affine transformations on RGB/YUV triplets vsrandom -- generate normally distributed random numbers These examples show one way of supporting extended colorspaces in VapourSynth without duplicating large blocks of code. More practically, vsmatrix may be used to convert between Rec.601 and Rec.709 matrix coefficients, as documented in matrix_conversions.txt. Both plugins support all sample types allowed by VapourSynth. Performance is quite reasonable as well, at 16 ms/frame for vsmatrix and 45 ms/frame for vsrand at 1920x1080x8bpp. Note that I've never written a line of code in my life before this, so please excuse any errors (but feel free to note them). Last edited by thewebchat; 20th October 2013 at 07:53. Reason: fix link |
19th October 2012, 15:53 | #2 | Link |
Guest
Posts: n/a
|
What's the license on the code? Also, the vsmatrix is nice although am I reading your code correctly in that it requires you to pass in the coefficients manually? I'm considering now to just take your code and extend it a bit and just make that the new ColorMatrix base and throw away the other code completely.
Last edited by SassBot; 19th October 2012 at 16:00. |
16th November 2012, 02:23 | #5 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
what do i need to make these compile in MSYS?
i'm getting piles of errors about _malloc type stuff. Code:
$ make g++ -std=c++11 -Wall -Wextra -Wno-unused-parameter -O3 -shared -g vsmatrix.cpp -o vsmatrix.dylib In file included from vsmatrix.cpp:3:0: VapourSynth/VSHelper.h: In function 'T* vs_aligned_malloc(size_t, size_t)': VapourSynth/VSHelper.h:48:44: error: there are no arguments to '_aligned_malloc' that depend on a template parameter, so a declaration of '_aligned_malloc' must be available [-fpermissive] VapourSynth/VSHelper.h:48:44: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) VapourSynth/VSHelper.h: In function 'void vs_aligned_free(void*)': VapourSynth/VSHelper.h:58:2: error: '_aligned_free' was not declared in this scope make: *** [vsmatrix.dylib] Error 1
__________________
sucking the life out of your videos since 2004 |
16th November 2012, 02:37 | #6 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
g++ -o vsmatrix.dll -shared -std=c++11 -Wall -Wextra -Wno-unused-parameter -O3 -g0 -Wl,--dll,--add-stdcall-alias vsmatrix.cpp
maybe, this is OK. EDIT: hmm, VSHelper.h does not consider about mingw. Code:
@@ -32,6 +32,11 @@ #define inline _inline #endif +#ifdef __MINGW32__ +#define __MSVCRT_VERSION__ 0x0700 +#include <malloc.h> +#endif + #ifdef _WIN32 #define VS_ALIGNED_MALLOC(pptr, size, alignment) *(pptr) = _aligned_malloc((size), (alignment)) #define VS_ALIGNED_FREE(ptr) _aligned_free((ptr))
__________________
my repositories Last edited by Chikuzen; 16th November 2012 at 03:17. |
16th November 2012, 16:21 | #8 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
11th December 2012, 02:16 | #9 | Link |
Advanced Blogging
Join Date: May 2009
Posts: 480
|
Added a (slow) method of directly computing random numbers instead of looking it up in a giant LUT. If someone is actually interested in using this, I may consider adding functionality to actually put noise on a frame.
|
18th October 2013, 23:32 | #11 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
Here you go.
Quote:
Would be nice to have an AddGrain equivalent for VS. Last edited by Reel.Deel; 18th October 2013 at 23:34. Reason: Link |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|