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. |
14th April 2020, 09:14 | #5442 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Yes. But even if parameter definition allows arrays, for length=1 the parameter will appear as a single non-array of a specific value
(covering such cases when parameter list of variable number of elements is only a single integer for example and it is not put into an array, it remains as a single integer AVSValue) Plus: even is such single values are not IsArray, ArraySize will report 1, and you can access it as [0]. For example here, in ConditionalSelect, args[2] can be an array of clips or a single clip. https://github.com/pinterf/AviSynthP...ional.cpp#L228 NEW_AVSVALUE considerations: Arrays in the above form cannot be named parameters, nor can they be provided as the new [] syntax. Unnamed or named (and even zero sized) array can appear as specific parameter. With new AVSValue concept arrays can have arbitrary deepness, with mixed type of elements, and are always "deep copy"-ed (except on the plain C interface) Handling and parameter list https://github.com/pinterf/AviSynthP...ource.cpp#L419 https://github.com/pinterf/AviSynthP...urce.cpp#L2020 Definition (using specific 'a' as parameter type): As NEW_AVSVALUE is no in the mainstream Windows build, this option is not really documented other than in my readme_xxx.txt. Original BlankClip definitions Code:
"[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[stereo]b[sixteen_bit]b[color]i[color_yuv]i[clip]c []c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c Code:
[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[stereo]b[sixteen_bit]b[color]i[color_yuv]i[clip]c[colors]a []c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c[colors]a |
14th April 2020, 09:34 | #5443 | Link | |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
I understand that NEW_AVSVALUE is not yet on mainstream Windows, but it is expected to be on Windows at a later time, right?
Regarding to prefix 'a', it doesn't have a type that means it's weak typed, right? So basically I can pass anything in and the filter is responsible for checking the type. And what happens if I put 'a' in function declaration and filter is loaded by a version not supporting arrays? Do I have to keep 2 DLLs for different AVS version? And -- Quote:
|
|
14th April 2020, 09:46 | #5444 | Link | ||
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
For an 'a' typed parameter parser will allow explicitely defined constant (using [ and ]) or an array typed variable or function return value. Quote:
Yes, such parameters can even have zero length (like a = [], I think there are examples on that in the readme) |
||
14th April 2020, 12:23 | #5447 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
Feisty2, all the API here that we've been talking about would have to maintain enough compatibility all the way back to the date when C++03 was not even a thing.
My wrapper would take and return a std::vector which then should support all the fancy stuff ( for (auto &&item : array_param) ) but then the underlying code -- those doing heavy-lifting, would have to use an interface where technology is much outdated. |
14th April 2020, 12:32 | #5448 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
I wonder if avs+ could use some wrapper for AvisynthPluginInit2 to not interfere with avs+ features like HBD and Arrays
__________________
See My Avisynth Stuff |
14th April 2020, 12:32 | #5449 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
adding begin() and end() doesn't harm compatibility, these are the "magic" functions that automatically enable range-for syntax in c++11 and onwards, in older standards, they are simply regular member functions and do not correspond to any magic syntax.
|
14th April 2020, 14:01 | #5450 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Quote:
https://www.youtube.com/watch?v=PPvRsLWlDXw Says it all
__________________
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; 14th April 2020 at 14:05. |
||
14th April 2020, 17:17 | #5452 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Perhaps your results just show that the default value is actually optimal. |
|
15th April 2020, 00:04 | #5453 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
can someone make fmtconv port for avs+? https://forum.doom9.org/showthread.p...52#post1907352
__________________
See My Avisynth Stuff |
15th April 2020, 03:45 | #5454 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
So I tried it. Having 'a' as type, the filter would not be possible to be used on non-AVS-newvalue build.
Checking the avs core I noticed that it's possible to manipulate (i.e. abuse) param name to support array hinting. For example, dft has this: c[sstring]s[ssx]s[ssy]s[sst]s. If we can somehow do: c[sstring]s[ssx]s[ssy]s[sst]s[sstring()]f[ssx()]f[ssy()]f[sst()]f then we can make the filter working under both versions. In legacy version, because param names has () in it, we know it's not a valid name and you can't assign data to it by name. To support assigning values by order, obviously we can keep array declaration at the end of param list. In modern version, the core now knows that these 4 parameters are array of floats and will accept them as both single string or array of floats. Weak type arrays can be flagged as "[name()]." So if user writes v.dfttest("a", "b") you get [v, "a", "b", -, -] in both versions. And if user writes v.dfttest([1.0], [2.0]) you get [v, [1.0], [2.0], -, -] in newer versions. Within filter, simply check if args[1].isArray() to know if user passed in an array or a string. What do you think about this proposal? ========== EDIT: I'm generating parameter hinting like this: Code:
for (auto &&p : params) { ... if (p.IsOptional) { ss << '[' << p.Name << ']'; if (p.IsArray) { ss_arrays << '[' << p.Name << "()]" << type_name; type_name = 's'; } } ss << type_name; } return ss.str() + ss_arrays.str(); [sbeta]f[tbeta]f[zmean]b[f0beta]f[nlocation]s[alpha]f[slocation]s[ssx]s[ssy]s[sst]s[ssystem]i[sfile]s[sfile2]s [dither]i[y]i[u]i[v]i[opt]i[nlocation()]i[slocation()]f[ssx()]f[ssy()]f[sst()]f
__________________
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; 15th April 2020 at 04:06. |
15th April 2020, 05:04 | #5455 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
Within dfttest, I noticed that, when nstring="0,0,20,40" I get the following error:
Filter error: GetPlaneHeightSubsampling called with supported plane. Coming from const int height = proc_height >> vi.GetPlaneHeightSubsampling(b); const int width = vi_src.width >> vi.GetPlaneWidthSubsampling(b); where b == 0. |
15th April 2020, 07:41 | #5457 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
|
|
15th April 2020, 08:45 | #5459 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
When your SetMemoryMax parameter is significantly larger than the actual maximum value reported by avsmeter then all results should be identical within an error margin.
Multiple Avsmeter sessions can report fps values within a range. Just have measured a simple script, five runs, no mt, results varied from 6.53 to 6.69. (2,5%) |
15th April 2020, 13:53 | #5460 | Link | |
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,580
|
Quote:
SetMemoryMax() 5.83 fps no SetMemoryMax 5.69 fps I mean... has with AVS+ and x64 any matter anymore at this point to put SetMemoryMax(xxx)?
__________________
@turment on Telegram |
|
|
|