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

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th August 2021, 00:58   #1261  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,657
Ah, then probably Average just doesn't handle arrays as input. It's getting only one parameter, the array, which is not the right number as far as it is concerned. You need to separate out the elements and send them as individual parameters (if you can do such a thing).
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 14th August 2021, 01:04   #1262  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,631
yes, that why I said "way to convert array to arguments"
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 14th August 2021, 10:11   #1263  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 720
Another thing: is the Avisynth+ ABI still restricted to MSVC? Or could Clang/MSYS2 or GCC compile plug-ins now?
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 14th August 2021, 12:38   #1264  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,213
Quote:
Originally Posted by cretindesalpes View Post
Another thing: is the Avisynth+ ABI still restricted to MSVC? Or could Clang/MSYS2 or GCC compile plug-ins now?
If I remember correctly MSVC yes, Clang yes, GCC no, in the sense that if you compile a plugin with GCC, then you need an Avisynth build compiled with GCC as well, otherwise you're not gonna be able to run such plugin, so you can't mix GCC builds of plugins with MSVC builds of Avisynth and since almost every build of everything is done with MSVC, then no one compiles with GCC.
Stephen (also called "qyot" for the Doom9 friends) did some successful experiments a while ago in which he compiled Avisynth with GCC and tried to use GCC Compiled plugins with it and it worked, however no one uses it for obvious reasons...
At least this is true on Windows, but it's different for Linux and Mac OSX (yep, as hard to believe as it is, Avisynth is cross platform now eheheheh)

Last edited by FranceBB; 14th August 2021 at 13:38.
FranceBB is offline   Reply With Quote
Old 14th August 2021, 12:54   #1265  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,472
Quote:
Originally Posted by cretindesalpes View Post
Another thing: is the Avisynth+ ABI still restricted to MSVC? Or could Clang/MSYS2 or GCC compile plug-ins now?
Clang is probably okay if you're using clang-cl. Other than that, there be dragons. The only way that's guaranteed would be as a C plugin (in which case the GCC-centric symbol logic is the assumed default), not a C++ plugin.

And currently something has broken the ability for FFmpeg to use GCC builds, although the GCC builds actually compile. It definitely is something on our side, since archived builds (r2831, from 2019) work with the same newer (May 2021) FFmpeg binary.
qyot27 is offline   Reply With Quote
Old 14th August 2021, 14:49   #1266  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,612
Quote:
Originally Posted by cretindesalpes View Post
Another thing: is the Avisynth+ ABI still restricted to MSVC? Or could Clang/MSYS2 or GCC compile plug-ins now?
It's still the MS C++ ABI only. The only two compilers that support it are MSVC and clang-cl (not other variants of clang, they use the GCC ABI). It's trivial to try out clang-cl, simply select clang in the visual studio installer and then you can choose it as the platform toolset. Binaries are usually noticeable faster.

Do however note that clang-cl doesn't understand the instruction set selection (as done through property pages) very well which can cause problems with intrinsics being rejected.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th August 2021, 19:39   #1267  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 720
I see. So I’ll stick with MSVC for the Avisynth+ version of fmtconv for the moment.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 14th August 2021, 19:45   #1268  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,631
Quote:
Originally Posted by cretindesalpes View Post
I see. So I’ll stick with MSVC for the Avisynth+ version of fmtconv for the moment.
if MSVC is not good for you, you can always use C API of avs/avs+ https://github.com/Asd-g/AviSynth-VM...c9cac81f082269

AviSynth+ can even autoload C plugins unlike the old AviSynth, also you don't need to use loadCplugin in avs+, loadplugin work with it too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 22nd August 2021, 13:24   #1269  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Sorry for asking a simple question. How does one read a double value for an input parameter by the plugin? args[n].AsFloat() I vaguely remembered actually outputs a double but when I tried args[n].AsFloat(0.001) I got a warning of truncating double to float. The input string has f for the value.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 22nd August 2021, 13:35   #1270  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 720
You can use AsDblDef(), but anyway the stored type within the AVSValue is always a float.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 22nd August 2021, 14:48   #1271  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,151
You can append default value with trailing 'f', args[n].AsFloat(0.001f)
[not sure if Avs+/visual studio, gives warning now for default value as double without trailing f]
EDIT: AsDblDef() probably better way, never used it.
With VS2008 and earlier, I sometimes had to use something like eg
Code:
d = (double)args[n].AsFloat(0.001f)
f = (float)args[n].AsFloat(0.001f)
__________________
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; 22nd August 2021 at 15:00.
StainlessS is offline   Reply With Quote
Old 22nd August 2021, 15:32   #1272  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 569
Quote:
Originally Posted by vcmohan View Post
Sorry for asking a simple question. How does one read a double value for an input parameter by the plugin? args[n].AsFloat() I vaguely remembered actually outputs a double but when I tried args[n].AsFloat(0.001) I got a warning of truncating double to float. The input string has f for the value.
The original post.

Quote:
Originally Posted by pinterf View Post
There is an AsFloatf version of AsFloat that should be used to avoid warnings. This function exists for this very reason.
EDIT: maybe I explained the opposite: to avoid return value warning. You can use AsDblDef, but since there is no double in AVSValue there is no point of doing that.

Side note: internally there is no double type in Avisynth. Double and 64 bit integer types are impossible to implement. Reason: AVSValue defined in avisynth.h has its maximum value size dependent of the size of pointer - pointer type is 4 bytes on a 32 bit system - so only a 32 bit float can be held there, no 64 bit double. 64 bit systems would easily support them - of course this needs an interface update - I had plans for that but there are always more important stuffs in the development queue. With the extinction of 32 bit Avisynth versions nobody will care if interface would change.
StvG is offline   Reply With Quote
Old 23rd August 2021, 11:03   #1273  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,320
Some idea to Avisynth core clip properties:

Add property to indicate full-band color 4:4:4 clip and half-color band (half vertical, half-horizontal or half-both, may be bitmask ?).

For example fresh non-distorted in spectrum 4:4:4 clip upconverted from 4:2:0 source is half-banded in color in both vertical and horizontal directions. But the next in chain filters can not get this information currently. Also this property need to be user-controllable so if user damage half-banding it may set property to full-band.

It may be useful hint for processing like color subsampling processing and other.

Also use it automatically in Convert4:4:4To4:2:0 and from 4:4:4To4:2:2 operations with defaulting chromaresample to sinc for half-band marked clips and may be current default bicubic (gauss prefferable with fixed p-param adjusted after tuning) for full-band marked 4:4:4 sources.
Also it is very great to add to Contert() the abiliti to pass kernel chromaresampler params (for example p for gauss) because currently used defaults (?) may be far from good for chromaresample.
DTL is offline   Reply With Quote
Old 23rd August 2021, 12:14   #1274  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,213
Quote:
Originally Posted by DTL View Post
Also it is very great to add to Contert() the ability to pass kernel chromaresampler params (for example p for gauss) because currently used defaults (?) may be far from good for chromaresample.
^This^
As result of this discussion: Link

In Converttoyv12, YUY2, yv16, yv24, YUV420, YUV422, YUV444 etc only the built in resizing kernels are supported and with no additional parameters, so that is actually limiting.
I know that just only around 5% of the Doom9 population is actually even bothering to specify the resizing kernel when changing chroma, but anyway I'm in favor of a full args support in the default built-in conversion, to be fair.
FranceBB is offline   Reply With Quote
Old 26th August 2021, 08:26   #1275  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by StainlessS View Post
You can append default value with trailing 'f', args[n].AsFloat(0.001f)
[not sure if Avs+/visual studio, gives warning now for default value as double without trailing f]
On MS VC 2019 community version tried:-
float d = args[].AsFloat(0.5f)
warning conversion double to float
float d = args[].AsFloat(0.5)
argument truncation from double to float
initializing from double to float.
So it always expects a trailing f in default value, but outputs a double. A bit confusing and is not right.
double d = args[].AsDblDef(0.5) works ok
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 26th August 2021, 08:38   #1276  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 720
You also can use AsFloatf() which takes a float and returns a float.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 26th August 2021, 16:23   #1277  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,151
Dont think AsDblDef() or AsFloatf() work in avs 2.58, so I dont use either.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 27th August 2021, 10:12   #1278  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,320
An idea - it looks avisynth support dropping out only error messages. But it may be good for hinting and warning of user to have some method to output warning messages too. In complex processing it may be method to put info about not very best current processing path or where developer not sure and/or ask to pay special attention (where quality may be degraded or where parameter in most cases need adjustment etc).
DTL is offline   Reply With Quote
Old 27th August 2021, 10:25   #1279  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,375
Is there a way to know how string floats get converted to single floats in Expr? I was reading IEEE 754 but nothing on it hinted the following findings:
Code:
Merge(a,b,0.25)

equals

Expr(a,b,"x 0.749999 * y 0.249999 * + ")
or
Code:
Merge(a,b,0.5)

equals

Expr(a,b,"x y + 0.500001 * ")

For example I tested in this online converter, and 0.25 turns out as 0.25 and 0.5 as 0.5.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 27th August 2021, 11:40   #1280  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 720
Expr only works with float (no double). Integer multiples of powers of 2 can be represented exactly (like 0.75 = 3 * 2^-2). Other values are rounded, and the exact rounding process depends on the implementation of the standard library used to compile the program. Generally you can expect about 6 digits of precision.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Reply

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 08:15.


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