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. |
|
|
Thread Tools | Search this Thread | Display Modes |
7th April 2020, 09:17 | #21 | Link |
Registered User
Join Date: Apr 2010
Posts: 16
|
Could you try the convolution and the filter? Those are just linux binaries that return:
Code:
$ ./modifyframe Time : 164.1971027851105 Num. frames: 100000 FPS : 609.0241441767271 Last edited by josemaria.alkala; 7th April 2020 at 09:21. |
8th April 2020, 13:26 | #22 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
I was thinking how fast can you run temporal median considering it'll be a lot slower if the radius is large.
If done in SIMD, probably I can use a sorting network but I can imagine it still runs at O(n^2). |
8th April 2020, 20:27 | #23 | Link |
Registered User
Join Date: Apr 2010
Posts: 16
|
I manage to compare in my computer the pure C++ filter and a Nim based version.
C++ Version I took it from here. I compiled with: Code:
g++ -Wall -O3 -shared -fPIC -I. -o libfilter.so GaussBlur.cxx Code:
import vapoursynth as vs core = vs.get_core() core.std.LoadPlugin(path='./libfilter.so') core.std.SetMaxCPU('none') clip = core.std.BlankClip(format=vs.GRAYS, length=100000, fpsnum=24000, fpsden=1001, keep=True) clip = core.testc.GaussBlur(clip) clip.set_output() Code:
$ vspipe test_filter.vpy /dev/null Output 100000 frames in 29.53 seconds (3386.27 fps) I use custom_filter.nim which uses DrawFrame.nim. I compile it like: Code:
$ nim c -f --threads:on -d:release -d:danger custom_filter Code:
$ ./custom_filter Time : 9.394126653671265 Num. frames: 100000 FPS : 10644.94909283766 If I use float32: Code:
$ ./custom_filter Time : 16.52139902114868 Num. frames: 100000 FPS : 6052.756178335272 |
8th April 2020, 20:33 | #24 | Link |
Registered User
Join Date: Apr 2010
Posts: 16
|
Another test that I have done is using the Convolution filter from Nim: convolution.nim and I get:
Code:
$ ./convolution Time : 5.210163354873657 Num. frames: 100000 FPS : 19193.25617813089 Code:
$ vspipe convolution.vpy /dev/null Output 100000 frames in 26.87 seconds (3721.76 fps) |
8th April 2020, 20:45 | #25 | 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 |
|
8th April 2020, 23:41 | #27 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
v = core.std.BlankClip(format=vs.GRAY8, length=10000, fpsnum=24000, fpsden=1001, keep=True)
v = core.neo_tmedian.TemporalMedian(v, radius=3) v.set_output() Output 10000 frames in 6.10 seconds (1638.35 fps) radius=10 Output 10000 frames in 18.55 seconds (539.06 fps) That uses the same algorithms as F2's, std::nth_element. EDIT: * On radius=2 C code: Output 10000 frames in 5.83 seconds (1714.24 fps) AVX2 code: Output 10000 frames in 0.41 seconds (24321.61 fps) * On radius=3 C code: Output 10000 frames in 6.10 seconds (1638.35 fps) AVX2 code: Output 10000 frames in 0.52 seconds (19154.49 fps) * On radius=4 C code: Output 10000 frames in 9.45 seconds (1057.94 fps) AVX2 code: Output 10000 frames in 0.64 seconds (15681.07 fps)
__________________
Projects x265 - Yuuki-Asuna-mod Download / GitHub TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median Last edited by MeteorRain; 9th April 2020 at 01:47. |
11th April 2020, 14:19 | #28 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
new functionality: Buffer, a writable matrix similar to a Plane, you may access the buffer as a plane to enable automatic padding when're done writing it, useful to filters that generate intermediate representations of the input clip. revamped: the argument extracting process now has a prettier syntax, and looks more pythonic. to get the argument for a parameter: Code:
param = Arguments["param"]; Code:
if (Arguments["param"].Exists()) param = Arguments["param"]; Code:
for (auto x : Range{ param_arr.size() }) if (Arguments["param"][x].Exists()) param_arr[x] = Arguments["param"][x]; Code:
for (auto x : Range{ Arguments["param"].Size() }) param_arr[x] = Arguments["param"][x]; Last edited by feisty2; 11th April 2020 at 14:26. |
11th April 2020, 21:06 | #29 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
revamped: even prettier syntax for parameter arrays you may also fetch each element for a parameter array with range-for syntax Code:
for (auto x : Arguments["param"]) param_arr.push_back(x); Code:
// this is now deprecated Console.RaiseError(Name + ": some error message"s); //do this instead Console.RaiseError("some error message"); Last edited by feisty2; 11th April 2020 at 21:57. |
12th April 2020, 21:44 | #32 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
bug fixes: apparently in rare cases stride / sizeof(PixelType) != width, fixed. new functionality: ability to manipulate frame properties, you could read the properties attached to the source frame similarly to how you fetch arguments for parameters, except that you may have to manually cast the property back to its original type. to get the "_Matrix" property: Code:
auto matrix = static_cast<int>(srcFrame["_Matrix"]); Code:
auto prop_arr = std::vector<PropType>{}; for (auto x : srcFrame["_Prop"]) prop_arr.push_back(x); to assign a property: Code:
dstFrame["_Prop"] = prop_value; Code:
for (auto x : prop_arr) dstFrame["_Prop"] += x; Code:
dstFrame["_Prop"].Erase(); the semantics of "someFrame[x]" is dependent on the type of x if x is an integer, someFrame[x] is the x-th channel of the frame. if x is a string (of type char*, const char*, std::string, std::string_view), someFrame[x] is the property x attached to the frame. Last edited by feisty2; 12th April 2020 at 21:52. |
14th April 2020, 19:46 | #33 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
revamped: dropped support for multiple outputs, I've never seen a single filter that uses this feature and my implementation was incorrect anyways. revamped: eliminated all indirect addressing Code:
// no more the following InputClip.Info->Width InputFrame.Format->PlaneCount InputClip.Info->Format->BitsPerSample // now you have direct access to all these items InputClip.Width InputFrame.PlaneCount InputClip.BitsPerSample new example: Crop, this example shows you how to write filters that modify the measures of the input (e.g. frame size) and filters that adapt to inputs with arbitrary bitdepths. new example: Rec601ToRGB, this example converts a YUV444 clip to RGB using the Rec601 matrix, it shows you how to write filters that modify the format of the input (e.g. YUV->RGB) and how to manipulate frame properties. I think this thing is almost feature complete now. |
17th April 2020, 12:13 | #34 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
new functionality: ability to call external filters before the actual filtering (DrawFrame()) begins, you may define a Preprocess() function to do things that happen before DrawFrame() is invoked. you don't need to define an empty Preprocess() if there's no preprocessing required, the wrapper will automatically detect if your filter has the Preprocess() member via hasattr reflection, if Preprocess() exists, it will be invoked. Likewise, you don't need to define DrawFrame() and its relevant functions or attributes if the filter itself does not do any filtering (something like nnedi3_rpow2), in such case, you should pass the output clip to Console with Console.Receive(), see Transpose for a concrete example. new functionality: calling external filters. the syntax to invoke external filters is as follows: Code:
Core["namespace"]["filter name"]("param1", argument1, "param2", argument2, ...); it is now no longer possible to apply some trivial patches and compile vsFilterScript with GCC9.3, the hasattr reflection is implemented by core language features of C++20 (concepts and constraints). |
18th April 2020, 11:07 | #35 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
bug fixes: fixed a bug where std::string and std::string_view were assumed to be containers when forwarded as arguments. revamped: if you allocate a temporary plane with Buffer, each row is now guaranteed to have a 32-byte alignment. revamped: you can now alter the padding policy of a plane at runtime Code:
frame[c].PaddingPolicy = new_policy; |
18th April 2020, 20:22 | #37 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
this thing relies heavily on c++20 features and currently, the only known compiler that has implemented all required features is the yet unreleased GCC10. you have to first compile master branch GCC then you get to play with vsFilterScript
Last edited by feisty2; 19th April 2020 at 10:23. |
19th April 2020, 10:15 | #39 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Too many 'p' s
I dont as yet use Linux very much, but a couple of days back I think Cinnamon Mint [EDIT: 19.3 Tricia] installed GCC10 as update. Just saying. EDIT: some stuff extracted from /var/log/dpkg.log Code:
2020-04-11 22:14:35 startup archives unpack 2020-04-11 22:14:44 install gcc-10-base:amd64 <none> 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status half-installed gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status unpacked gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status unpacked gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 install gcc-10-base:i386 <none> 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status half-installed gcc-10-base:i386 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status unpacked gcc-10-base:i386 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:44 status unpacked gcc-10-base:i386 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 startup packages configure 2020-04-11 22:14:45 configure gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 <none> 2020-04-11 22:14:45 status unpacked gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 status half-configured gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 status installed gcc-10-base:amd64 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 configure gcc-10-base:i386 10-20200405-0ubuntu1~18.04 <none> 2020-04-11 22:14:45 status unpacked gcc-10-base:i386 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 status half-configured gcc-10-base:i386 10-20200405-0ubuntu1~18.04 2020-04-11 22:14:45 status installed gcc-10-base:i386 10-20200405-0ubuntu1~18.04
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th April 2020 at 11:19. |
19th April 2020, 11:17 | #40 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
SssS: Yes that's the 20200405 snapshot of GCC 10 that's still in development. I don't know why a distribution would put a software still in development on users' computer.
Clang 10 however, has just released. But that doesn't support all the features I believe. |
Thread Tools | Search this Thread |
Display Modes | |
|
|