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. |
![]() |
#42 | Link | ||
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Can't work with Vapoursynth, so comparison would not be possible.
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#43 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
I want to demonstrate the source filter handling penalty of Avisynth+. Recall that the same DGSource executable is used by both Vapoursynth and Avisynth+. Here are the two scripts:
Vapoursynth: Code:
import vapoursynth as vs core = vs.get_core() core.avs.LoadPlugin(path="D:/Don/Programming/C++/DGDecNV/DGDecodeNV/x64/release/DGDecodeNV.dll") video = core.avs.DGSource('THE GREAT WALL.dgi',fulldepth=True) video=core.std.AssumeFPS(video,fpsnum=1000, fpsden=1) video.set_output() Code:
loadplugin("d:\don\Programming\C++\dgdecnv\DGDecodeNV\x64\release\dgdecodenv.dll") SetFilterMTMode("DGSource", MT_MULTI_INSTANCE) dgsource("THE GREAT WALL.dgi",fulldepth=true) assumefps(1000.0) prefetch(8) Vapoursynth: 6 seconds Avisynth+: 12 seconds If I remove the prefetch then Avisynth+ finishes in 7 seconds. But that will disable multithreading for anything else in the script. This together with the inefficient conversions makes Avisynth+ unusable for me. I remind of the overall result for the simple process of tonemapping a UHD stream: Vapoursynth: 13 seconds Avisynth+ with avsresize: 45 seconds Which one do you think a sensible person would use? |
![]() |
![]() |
![]() |
#44 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
As much as I approve of demonstrating the superiority of Vapoursynth, I really don't think setting a source filter to MT_MULTI_INSTANCE is a good idea. MT_SERIALIZED forces everything upstream of the filter to be synchronous and single threaded, but source filters have no upstream so it doesn't matter. VS source filters tend to be serial in nature too.
|
![]() |
![]() |
![]() |
#45 | Link |
Registered User
Join Date: Nov 2009
Posts: 327
|
It is because the avsresize was never tested with gamma function operations. It is missing this statement from the VS z.lib filter that enables certain speed-ups:
Code:
vsresize.cpp:L683: m_params.allow_approximate_gamma = 1; |
![]() |
![]() |
![]() |
#46 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#47 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,285
|
You would expect prefetch(2) should be faster in that script
For the src filter threading issue, it did not affect the old avisynth(-) mt (at least no reports as bad as this) - what is different about the threading model here in avisynth(+) ? |
![]() |
![]() |
![]() |
#49 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
Now let's try to figure out the second issue. Last edited by videoh; 21st March 2018 at 18:25. |
|
![]() |
![]() |
![]() |
#51 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
Code:
loadplugin("d:\don\Programming\C++\dgdecnv\DGDecodeNV\x64\release\dgdecodenv.dll") loadplugin("D:\Don\Programming\C++\Avisynth filters\ToneMap float\x64\release\tonemap.dll") loadplugin("D:\Don\Programming\C++\avsresize-r1c\x64\release\avsresize.dll") SetFilterMTMode("z_ConvertFormat", MT_MULTI_INSTANCE) dgsource("THE GREAT WALL.dgi",fulldepth=true) z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none") tonemap() z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered") prefetch(2) The prefetch number didn't affect the timing but value 2 made things smooth and 8 made it go in stops and starts. So, hey, Avisynth+ lives on. ![]() ![]() Last edited by videoh; 21st March 2018 at 17:37. |
|
![]() |
![]() |
![]() |
#52 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
I'll release an Avisynth+ port of Phillip Blucas's tonemap filter within a few days (with some performance improvements). Then there will be a full HDR->SDR solution for Avisynth+.
It's close to being realtime for UHD (22fps on my machine) when playing in VirtualDub2. It would be nice if we could squeeze a little more performance out of zimg (or port equivalent conversions to CUDA). Last edited by videoh; 22nd March 2018 at 11:35. |
![]() |
![]() |
![]() |
#54 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Setting the source filter to MT_MULTI_INSTANCE with prefetch(2) is functionally much like doing something like
Code:
src1 = dgsource("file.dgi") src2 = dgsource("file.dgi") interleave(src1.selecteven(), src2.selectodd()) In VS, all Avisynth filters are always run single threaded and in a single instance, but VS attempts to fit them into its nonblocking frame request framework as well as it can, and it will also automatically attempt to request frames from source filters linearly in order. I'd expect it to run most source filters slightly faster than Avs+ would with MT_SERIALIZED. I wrote a very long and boring attempt to explain the differences between the concurrency models here a while ago. Last edited by TheFluff; 21st March 2018 at 17:52. |
![]() |
![]() |
![]() |
#56 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
For a source filter I don’t think there’s anything significant to gain performance-wise, no. Not sure about how complete the VS compatibility layer is in terms of various exotic colorspaces and/or bitdepths though.
|
![]() |
![]() |
![]() |
#60 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Please give the script that plays that fast for UHD content (3840x2160 16-bit). Just to be clear, I am talking about playing the script in VitualDub2.
Will you release a fixed avsresize so I don't have to include one? Thanks. Last edited by videoh; 21st March 2018 at 22:29. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|