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. |
28th May 2016, 15:13 | #1621 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
From what I understand,
MT_NICE_FILTER means there is one class instance and GetFrame gets called several times at once from various threads on the same class. When Pinterf went through my code, he wrote "Say no to globalism!" No global variables unless they are read-only. All working buffers must be created within GetFrame. MT_MULTI_INSTANCE means that one instance of the class gets created for each thread and each instance is single-threaded. One thread may process frames 1, 4, 7 and 9 while other threads process other frames. I'm not yet sure what impact MT_SERIALIZED has on the code. The way to define it is in the Init function Code:
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit3(IScriptEnvironment* env, const AVS_Linkage* const vectors) { AVS_linkage = vectors; env->AddFunction("ConvertToShader", "c[Precision]i[lsb]b", Create_ConvertToShader, 0); env->AddFunction("ConvertFromShader", "c[Precision]i[Format]s[lsb]b", Create_ConvertFromShader, 0); env->AddFunction("Shader", "c[Path]s[EntryPoint]s[ShaderModel]s[Param0]s[Param1]s[Param2]s[Param3]s[Param4]s[Param5]s[Param6]s[Param7]s[Param8]s[Clip1]i[Clip2]i[Clip3]i[Clip4]i[Clip5]i[Clip6]i[Clip7]i[Clip8]i[Clip9]i[Output]i[Width]i[Height]i", Create_Shader, 0); env->AddFunction("ExecuteShader", "c[Clip1]c[Clip2]c[Clip3]c[Clip4]c[Clip5]c[Clip6]c[Clip7]c[Clip8]c[Clip9]c[Clip1Precision]i[Clip2Precision]i[Clip3Precision]i[Clip4Precision]i[Clip5Precision]i[Clip6Precision]i[Clip7Precision]i[Clip8Precision]i[Clip9Precision]i[Precision]i[OutputPrecision]i", Create_ExecuteShader, 0); void* is_plus = env->FunctionExists("SetFilterMTMode") ? "true" : nullptr; if (is_plus != nullptr) { auto env2 = static_cast<IScriptEnvironment2*>(env); env2->SetFilterMTMode("ConvertToShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ConvertFromShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("Shader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ExecuteShader", MT_MULTI_INSTANCE, true); } return "Shader plugin"; } |
28th May 2016, 15:59 | #1622 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
Quote:
Code:
if (env->FunctionExists("SetFilterMTMode")) { auto env2 = static_cast<IScriptEnvironment2*>(env); env2->SetFilterMTMode("ConvertToShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ConvertFromShader", MT_NICE_FILTER, true); env2->SetFilterMTMode("Shader", MT_NICE_FILTER, true); env2->SetFilterMTMode("ExecuteShader", MT_MULTI_INSTANCE, true); }
__________________
my repositories |
|
28th May 2016, 20:32 | #1624 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
Last edited by Reel.Deel; 28th May 2016 at 21:46. Reason: fix link |
|
28th May 2016, 21:31 | #1625 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Every time I click on one of your links I get transported to some random place since I don't use the default. I suggest you use the "Link" reference, top right of every post. Last edited by Groucho2004; 28th May 2016 at 21:39. |
|
28th May 2016, 21:45 | #1626 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
The links have always worked for me so I never noticed. I'll try to fix the wiki links as I come across them. |
|
28th May 2016, 22:16 | #1629 | Link | ||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
Sorry to anyone who was directed to a random place. That was not my intent. Quote:
|
||
29th May 2016, 09:42 | #1630 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Ok, i think i understand the differences between the 3.
MT_NICE_FILTER : Not possible if you have to use global internal buffer. Personnaly, i'll never malloc/free on each get frame, and don't want to use MT specific features making the filter working only on MT versions. But on something so simple as brigthness/contrast (for exemple), it will work. MT_MULTI_INSTANCE : You can use global internal buffer, no several getframe from the same instance, but input frames are "random", so works only if, basicaly, the filter needs only the actual frame. I think it's this case for the actual nnedi3. MT_SERIALIZED : The filter needs the frames to be entered in the correct order, and probably also have buffer. A simple example would be something like an RII filter (like y[n]=0.5*x[n]+0.25*x[n-1]+0.25*y[n-1]). A such filter is not compatible with the others two modes. Thanks, things are clear now. I think... Last edited by jpsdr; 29th May 2016 at 09:45. |
29th May 2016, 10:23 | #1631 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
I believe even a filter which requires a temporal range of frames can be MT-friendly if the AviSynth(+) core knows about it working on a temporal window and buffering such a range...
|
29th May 2016, 19:43 | #1632 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
It's really not that bad. The VapourSynth plugin with work buffers allocated in the getframe function is about as fast as the Avisynth plugin. See http://forum.doom9.org/showthread.ph...99#post1600999 and some posts below.
__________________
Buy me a "coffee" and/or hire me to write code! |
30th May 2016, 08:00 | #1634 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
For 32 bit applications, only one DLL can be registered system-wide as AviSynth frameserver, either the "vanilla" AviSynth DLL or the AviSynth+ DLL.
But it is possible to place one of the DLLs next to the application into the same directory, and if the application loads "the next available avisynth.dll", it will probably look first in its own directory before looking into the Windows system directory. This way it may be possible to exchange the AviSynth version used by a specific application independently of the system-wide AviSynth installation, by installing the application in two directories (preferably outside an UAC protected branch, means: not in "Program files") and copying either DLL to either directory. For 64 bit applications, there is no reliable 64-bit "vanilla" AviSynth build, anyway. |
30th May 2016, 08:54 | #1635 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
However, only Avisynth+ has the option of specifying separate plugin directories which is needed for auto-loading filters. To answer your question - yes, you can install just 64 bit AVS+ alongside your existing 32 bit Avisynth. Last edited by Groucho2004; 30th May 2016 at 09:38. |
|
30th May 2016, 09:09 | #1636 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
I find AVS+ r1576 and the latest build from pinterf very usable. |
|
30th May 2016, 09:17 | #1637 | Link | |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,781
|
Quote:
A 64-bit AviSynth (without "plus") does exist; but it was mainly known as unstable (I guess many of the programming tricks the 32-bit version survived would crash the 64-bit version, and only few plugins were ported before this project was abandoned). |
|
30th May 2016, 09:37 | #1638 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
I just pointed out that there are a couple of very usable 64 bit builds because your statement "there is no reliable 64-bit "vanilla" AviSynth build, anyway" may be misleading for folks not familiar with vanilla flavour in this context. Last edited by Groucho2004; 30th May 2016 at 12:13. |
|
30th May 2016, 11:10 | #1639 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I posted some time ago about AviSynth+ x64 taking HUGE amounts of memory. The fault is mine. AviSynthShader takes more than twice the memory in x64, trying to figure out why. If I remove that, all the other filters take slightly more memory but perform faster.
From what I tested so far, AviSynthShader may be the only x64 filter that isn't working as expected. |
30th May 2016, 21:01 | #1640 | Link | |
Registered User
Join Date: Jun 2010
Posts: 91
|
Quote:
avs-plus suggests otherwise |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|