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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#61 | Link | |
|
Registered User
Join Date: Jan 2014
Posts: 2,540
|
Quote:
The necessary changes, which appeared in interface version 12, are still in a not-yet-released development version of Avisynth+. - install 3.7.5 from the installer, wonkey_monkey linked - download the latest development DLLs from here https://github.com/pinterf/AviSynthP...3.7.6pre-r4356 - and overwrite the existing 3.7.5 one, presumably in your system32 folder. |
|
|
|
|
|
|
#62 | Link |
|
Registered User
Join Date: Jul 2003
Location: India
Posts: 914
|
Many thanks pinterif. I installed following steps you mentioned.
I am having some doubts. 1. in my manyPlus plugin there are several functions which use fftw dll, I am thinking of having one global lock class code for all of them, Each will communicate its own env ptr to this class code. The code for preventing copying is raising concern. 2. various versions of header files avisynthPlus.h use differing #ifndef ..... Since I was using version 8 header in many other functions I ran into problem immediately. Is there some reason for using differing defines? |
|
|
|
|
|
#63 | Link |
|
Registered User
Join Date: Jul 2003
Location: India
Posts: 914
|
While trying to compile with new avisynth.h file I am getting error /warning C26495 for all AVSValue(....) in the AVSValue class. There appears to be other errors/warnings also. Am I doing something wrong?
|
|
|
|
|
|
#64 | Link | ||
|
Registered User
Join Date: Jan 2014
Posts: 2,540
|
Quote:
You should use the locker class only for a short time, just around the risky, non-thread safe fftw call. If you use C++ the automatic declaration of the shown locking class, then when the class goes out of scope, it just does the unlock automatically. The class itself is not part of Avisynth.h, it is just provided in the docs as a convenient ready-made example for using global locks. What is important, that you should call the lock and unlock with the same env pointer. When you use the GlobalLockGuard class, seen in the documentation example, then you don't even need to call unlock, since going out of scope, the class is destroyed and the unlock happens automatically. You have to guard as short code part as you can, around those fftw functions (plans like fftwf_plan_many_dft_r2c, fftwf_malloc, fftwf_init_threads) This was my commit when I made fft3dfilter global-thread-safe: https://github.com/pinterf/fft3dfilt...c3a426b4003fbc As you can see, I was already using a mutex there, but it ensured only the in-filter safety. I simply replaced it with the example GlobalLockGuard class. I had problems with making fftw calls thread-safe in the desctructor (freeing up fftwf allocations), you can see in the fft3dfilter commit changes that there is a env_saved which I used here. I save end_saved in the constructor, just to be able to pass it to the GlobalLockGuard object (which in turn is using it for lock acquire and unlocking). Internally, the global mutex - which Avisynth's core provides - exists only once for all plugins which use the same avisynth dll. Quote:
Anyway, you can use the new headers without problem on older systems as well. But note: global-lock environment function call is valid only since v12 interface capable Avisynth. Your plugin will crash if someone use your modernized plugin with older Avisynths, unless you use the class with v12-awareness. Whether the actual avisynth interface version is v12 or newer, can be established easily, see examples. In order to be able to tolerate both old and new Avisynth.dll, the above mentioned locker-class has a dedicated bool v12 flag, when you create it. If it is set to false, the object won't call the new interface function, but will still use a filter-local mutex, which is still way better than nothing. And as another example of a real-life filter modification: this is what Asd-g's changed in neo_DFTTest: https://github.com/HomeOfAviSynthPlu...261908ada1527b I think the documentation and looking at fft3dfilter and neo_DTFTest changes can help you a lot. |
||
|
|
|
|
|
#65 | Link | |
|
Registered User
Join Date: Jan 2014
Posts: 2,540
|
Quote:
(please note that only avisynth.h is not enough to update, the avs/ folder has additional includes, which must exist there as well.) It C26495 is really only a warning, ignore it. Btw, which Visual Studio are you using? |
|
|
|
|
|
|
#68 | Link |
|
Registered User
Join Date: Jan 2014
Posts: 2,540
|
Dear vcmohan.
The interface version checker would crash on pre-V9 Avisynth interface, due to call env->GetEnvProperty without checking its availibility. If you used the earlier example, please update your code to this modified one. Code:
IScriptEnvironment *env = ...
avisynth_if_ver = 6; // guessed minimum
avisynth_bugfix_ver = 0;
try { env->CheckVersion(8); avisynth_if_ver = 8; }
catch (const AvisynthError&) {}
try {
env->CheckVersion(9); // if this works, we are at least V9, can use GetEnvProperty with AEP_INTERFACE_VERSION
avisynth_if_ver = env->GetEnvProperty(AEP_INTERFACE_VERSION); // only since V9!
avisynth_bugfix_ver = env->GetEnvProperty(AEP_INTERFACE_BUGFIX);
}
catch (const AvisynthError&) {}
has_at_least_v8 = avisynth_if_ver >= 8; // frame properties, NewVideoFrameP, other V8 environment functions
has_at_least_v12 = avisynth_if_ver >= 12; // global locks, GetCPUFlagsEx, query L2 cache size
|
|
|
|
|
|
#69 | Link | |
|
Registered User
Join Date: Jan 2014
Posts: 2,540
|
Quote:
- you have to load and call multiple fftw plugins - without the locks, only an occasional garbage would sign that the different fftw planners are using each others data. If things work, it is just shown as no user report processing artifacts. - After introducing the lock mechanism these disapperared. - Here, in our original working conversation, asd-g prepared me very nice fftw wrapper DLLs, which created very detailed log files (what is called, when is called, detected concurrent - non-guarded - calls). This was a huge help to me in the development. This is where it is mentioned: https://github.com/AviSynth/AviSynth...ent-2925664910 After the changes I wrote: "Thank you very much. 100% failure without, 100% success with v12 GlobalLock." Before the fix, such lines appeared in the log: "[TID: 11744] !!! CONCURRENT PLANNER ACCESS DETECTED !!! fftwf_plan_dft_r2c_2d entered while 1 other planner call(s) active." |
|
|
|
|
|
|
#71 | Link |
|
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,693
|
any news?
__________________
See My Avisynth Stuff |
|
|
|
|
|
#72 | Link |
|
Registered User
Join Date: Jul 2003
Location: India
Posts: 914
|
A month back I have updated the manyPlus plugin functions using fftw dll to avoid racing. But unfortunately the avisynth site for uploading at present is not accessible due to some problem. I have brought this to the notice of the administrator Wilbert and awaiting the resolution. Meanwhile you can use the dll presently available on my page. Suggest use single thread only for the functions using fftw dll, Regards
|
|
|
|
|
|
#75 | Link | |
|
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 3,080
|
Quote:
I don't know if I can achieve what I am looking for with your frequency functions.
__________________
@turment on Telegram |
|
|
|
|
|
|
#77 | Link | |
|
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,693
|
Quote:
__________________
See My Avisynth Stuff |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|