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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 27th June 2017, 14:08   #3481  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Some time ago, I had issues with threading in complex functions (probably QTGMC?) and was recommended to remove avstp.dll from the auto-load directory, but that was with AviSynth 2.6 MT (SEt). Unfortunately, I do not remember the details of the circumstances, only the conclusion. Is the cooperation different under AviSynth+?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 27th June 2017, 14:36   #3482  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by LigH View Post
Is the cooperation different under AviSynth+?
Since AVS+ has a different multi-threading implementation I would say yes, it's different. If it's better or worse, I don't know.

Either way, I don't think it's a good idea to mix Avisynth's multi-threading with plugins that have internal MT. It's not only less efficient because of increased scheduling overhead, it also adds unnecessary complexity.
Groucho2004 is offline  
Old 27th June 2017, 14:44   #3483  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
One reason why QTGMC exposes the parameter EDIThreads...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 27th June 2017, 16:31   #3484  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Groucho2004 View Post
I should mention that pinterf's latest mvtools2 still supports multi-threading through avstp.dll and that it is enabled by default (mt = true).
Adding avstp.dll to your plugin directory may improve things - or not.
Which function(s) exposes mt parameter?

Perhaps if avstp.dll is using internal multi-threading and was never meant to be called several times, and it is being called multiple times, then the various threads lock each other.

Last edited by MysteryX; 27th June 2017 at 16:35.
MysteryX is offline  
Old 27th June 2017, 16:33   #3485  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by mysteryx View Post
which function(s) exposes mt parameter?
rtfm
Groucho2004 is offline  
Old 27th June 2017, 20:54   #3486  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
Perhaps if avstp.dll is using internal multi-threading and was never meant to be called several times, and it is being called multiple times, then the various threads lock each other.
You should really read the documentation.
Groucho2004 is offline  
Old 28th June 2017, 00:45   #3487  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Adding and loading avstp.dll really doesn't change much at all -- and if it's not loaded, then I assume it's using single-threaded mode.
MysteryX is offline  
Old 28th June 2017, 06:57   #3488  |  Link
postscripter
Registered User
 
Join Date: Jun 2017
Posts: 2
Hello, guys. I've switched from AVS 2.6 to AVS+ and got my plugin broken. It can not even load the dll and says this:
Code:
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
'D:/Личные папки/Projects/Ретранслятор/Osd/MyOSD.dll' cannot be used as a plugin for AviSynth.
(D:\Личные папки\Projects\Ретранслятор\Измерения\Скрипт.avs, line 29)
---------------------------
The plugin is C-plugin written in Delphi, and the classic AVS 2,5 - 2,6 had no problem with it.

The error I mentioned can be found on the line 534 and next on the 659. And the only check there is this:
Code:
AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init@4");
if (AvisynthCPluginInit == NULL) return false;
In russian we say that the dog is buried somewhere here, meaning the heart of the matter, which is close enough. As close, as the symbol [@], which is the dog in russian C-dlls usually have this @4 in export table after the name of the function, but delphi does not know about such things, and so do I. Google says, it's called function decoration. This is the first time I see such notation. Could anyone explain, what is it for and what to do with it? I can just recompile my plugin, of course, but wouldn't it be better to submit an issue (or the developers are already here)? Looks like a regression.

Last edited by postscripter; 28th June 2017 at 07:09.
postscripter is offline  
Old 28th June 2017, 07:57   #3489  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by postscripter View Post
Hello, guys. I've switched from AVS 2.6 to AVS+ and got my plugin broken.
Avisynth+ does not support C/CPP 2.0 plugins.
Groucho2004 is offline  
Old 28th June 2017, 08:11   #3490  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Yes, you are using probably the old, not supported interface.
Quote:
Originally Posted by postscripter View Post
The error I mentioned can be found on the line 534 and next on the 659. And the only check there is this:
Code:
AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init@4");
if (AvisynthCPluginInit == NULL) return false;
The same part in current version looks like this:
https://github.com/pinterf/AviSynthP...nager.cpp#L942

Code:
#ifdef _WIN64
  AvisynthCPluginInitFunc AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init");
  if (!AvisynthCPluginInit)
    AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "_avisynth_c_plugin_init@4");
#else // _WIN32
  AvisynthCPluginInitFunc AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "_avisynth_c_plugin_init@4");
  if (!AvisynthCPluginInit)
    AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init@4");
#endif
pinterf is offline  
Old 28th June 2017, 11:10   #3491  |  Link
postscripter
Registered User
 
Join Date: Jun 2017
Posts: 2
Quote:
Originally Posted by Groucho2004 View Post
Avisynth+ does not support C/CPP 2.0 plugins.
Absolutely no idea what 2.0 means, but I've just changed the export name and have it usable now. Magic?

Quote:
Originally Posted by pinterf View Post
The same part in current version looks like this:
Well.. yeah. By the way. About current versions. Which one is the latest? Which is the latest for those, who need MT? What happened with the original AviSynth repo, which is referred by in Wiki and on avs-plus.net? I can see the same contributors there and last activity in 2014'th... Did they lost the password?


Quote:
looks like this
Looks the same for me) I see changes for 64 bit only. I reckon, you did it for Studio compiler, which introduce a big mess, adding @x for 32-bit DLLs only. But Delphi compiler does not add @x at all, unless you write it by yourself. Why don't you keep it simple, like this:
Code:
AvisynthCPluginInitFunc AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "_avisynth_c_plugin_init");
 if (!AvisynthCPluginInit) AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init");
  if (!AvisynthCPluginInit) AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "_avisynth_c_plugin_init@4");
   if (!AvisynthCPluginInit) AvisynthCPluginInit = (AvisynthCPluginInitFunc)GetProcAddress(plugin.Library, "avisynth_c_plugin_init@4");
Or you can make an array of names))

Last edited by postscripter; 28th June 2017 at 11:25.
postscripter is offline  
Old 28th June 2017, 11:30   #3492  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by postscripter View Post
Absolutely no idea what 2.0 means
The Avisynth C 2.0 API was the first C implementation by Kevin Atkinson. See here.

Quote:
Originally Posted by postscripter View Post
I've just changed the export name and have it usable now. Magic?
Right now I don't have a reference table that lists the differences between the 2.0, 2.5 and 2.6 APIs but I suppose it's possible that just changing the export name might do the trick. Here's some documentation but I'm not sure how helpful this is for your Delphi plugin thingy.
Groucho2004 is offline  
Old 28th June 2017, 14:18   #3493  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
Adding and loading avstp.dll really doesn't change much at all
It works better with something "simple" such as MDegrainN().

Last edited by Groucho2004; 29th June 2017 at 07:21.
Groucho2004 is offline  
Old 28th June 2017, 19:19   #3494  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by postscripter View Post
Well.. yeah. By the way. About current versions. Which one is the latest? Which is the latest for those, who need MT? What happened with the original AviSynth repo, which is referred by in Wiki and on avs-plus.net? I can see the same contributors there and last activity in 2014'th... Did they lost the password?
The MT branch is the most up-to-date on the upstream repo:
https://github.com/AviSynth/AviSynthPlus/commits/MT

The stuff pinterf is working on is currently being treated as an ad hoc development HEAD, there's an open pull request for it.

The reason MT hasn't been merged into the master branch has less to do with stability (to wit, you have to use builds from the MT branch if you want to use AviSynth+ with FFmpeg, since only the MT branch is synced up with AviSynth 2.6.0/2.6.1), and more to do with ultim going on hiatus every so often and wanting bugs that had existed in the MT branch to be resolved first. They mostly have*, but like I previously mentioned, hiatus. The same largely applies to pinterf's pull request, although the recent Unicode fixes broke GCC again.

*save for the problems inherent to synchronous access, as discussed at length over the last few pages of this thread.

Supported compilers are Visual Studio 2015 and higher, and GCC (experimental). I was in the middle of testing weird function decoration stuff with GCC and the C plugin back in April, but since I can only use 64-bit Wine or take a huge performance hit and run 64-bit Windows in a VM, that stalled out somewhat.

Last edited by qyot27; 29th June 2017 at 22:59. Reason: decoration
qyot27 is offline  
Old 29th June 2017, 10:37   #3495  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
New release with TemporalSoften fix.
Thanks to Sharc for the report.

Download Avisynth+ r2508-MT

Code:
20170629 r2508
  - Fix TemporalSoften: threshold < 255 (bug exists probably since r1576)
pinterf is offline  
Old 29th June 2017, 18:24   #3496  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by pinterf View Post
New release with TemporalSoften fix.
Thanks to Sharc for the report.

Download Avisynth+ r2508-MT

Code:
20170629 r2508
  - Fix TemporalSoften: threshold < 255 (bug exists probably since r1576)
I confirm it's working now. Thank you.
Sharc is offline  
Old 1st July 2017, 03:46   #3497  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
Is it normal that using Levels with high-bitdepth input and enabled dithering eats incredibly much RAM? Is this a gigantic LUT?
Code:
Video = BlankClip(10000,pixel_type="YUV420P10")

Return Video.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
            /*.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)\
			.Levels(0,1.0,1023,0,1023,coring=false,dither=true)*/
uses 82 MB. Each Levels that I uncomment adds about 64 MB to that. This does not happen without dither or with 8bit input.
On a related note: Would it be possible to add a switch to avsmeter to disable the "Script runtime is too short for meaningful measurements" error? I needed to increase the framecount of the blankclip
mkver is offline  
Old 1st July 2017, 07:23   #3498  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by mkver View Post
Is it normal that using Levels with high-bitdepth input and enabled dithering eats incredibly much RAM? Is this a gigantic LUT?
That's the reason LUT is disabled for 14-16 bit clips and it is using runtime evaluation.
MysteryX is offline  
Old 1st July 2017, 09:44   #3499  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
Quote:
Originally Posted by MysteryX View Post
That's the reason LUT is disabled for 14-16 bit clips and it is using runtime evaluation.
Are you sure about this? avsmeter reports exactly the same memory usage for 10, 12, 14 and 16 bits. And strangely: It doesn't matter if it is a greyscale format or what chroma subsampling it uses, the difference is negligible. I always thought that Levels treats Luma and Chroma differently (i.e. knows that luma should be scaled normally, but that chroma should be scaled from 128 so that one should need two LUTs for them).
mkver is offline  
Old 1st July 2017, 19:29   #3500  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Take a look at release notes of v2.2.2 and play with realtime argument.

When realtime is enabled is well documented here
MysteryX is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.