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 6th July 2021, 21:00   #1201  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,629
you go ahead delete your posts if you want, I won't, I am not a big fan of self-censorship.

edit: for davidh, the definition of self-censorship: the act or action of refraining from expressing something (such as a thought, point of view, or belief) that others could deem objectionable. the perfect word for what you just did.

Last edited by feisty2; 6th July 2021 at 21:10.
feisty2 is offline   Reply With Quote
Old 6th July 2021, 21:02   #1202  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
Not what the word means but okay...

Self-censoring is quite distinct from censorship. That's why it has "self-" in front of it.

I deleted my posts not for their objectionality but because they were off-topic.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 8th July 2021 at 22:18.
wonkey_monkey is offline   Reply With Quote
Old 7th July 2021, 09:46   #1203  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,964
O.K., by popular demand I consider integrating brainfuck language elements into Expr
pinterf is offline   Reply With Quote
Old 7th July 2021, 10:44   #1204  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,505
Finally something I can understand easily!
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository
ChaosKing is offline   Reply With Quote
Old 7th July 2021, 12:59   #1205  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,396
Quote:
Originally Posted by pinterf View Post
O.K., by popular demand I consider integrating brainfuck language elements into Expr
We'll soon announce a commercial implementation of Expr that uses whitespace as the programming language. It's the only way to ensure nobody can read secret corporate scripts and is one of the most requested features in VapourSynth. The backend will be obviously be based on freepascal.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 7th July 2021, 21:56   #1206  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
pinterf, do you know if there's any documentation for jitasm? I see references to a "GettingStarted wiki" but I don't know where to find that or if it still exists. I'm slowly grasping it through reading exprfilter.cpp but I could use the context of an actual guide.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 8th July 2021, 02:53   #1207  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 728
Quote:
Originally Posted by wonkey_monkey View Post
pinterf, do you know if there's any documentation for jitasm? I see references to a "GettingStarted wiki" but I don't know where to find that or if it still exists. I'm slowly grasping it through reading exprfilter.cpp but I could use the context of an actual guide.
Will this do?
Here
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 8th July 2021, 09:18   #1208  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 1,335
Thanks for the update pinterf. I got the Sorting Network to work, it is not THAT slow though. Given that the top speed one can get with a median in Expr is "undot" (min and max clamp), sorting is only 18% below in performance. It's fine for implementing exotic kernels and use in production. The only problem I see is that unlike ex_boxblur() median Expr can't match removegrain speed, and the only difference is the operator used (min and max), since pixel fetching is shown to give the same performance. I do think there might be room for improvement but can't actually tell as I don't understand CPP.

Code:
# 100% removegrain(1,-1)
#  83% ex_median(mode="undot",UV=1)
#  65% ex_median(mode="undot2",UV=1) # 301fps
#  1.2% MedianBlur(1,0,0)
I wanted to implement your median of 3 and 5 kernels, but didn't understand the code. What is the window size, 3x3? So I actually tested it and it matched removegrain(4,-1) (for radius 1). I think there's value for the MedianBlur plugin because it can use bigger kernels and also temporal, but the performance of 6fps struck me a bit.

Code:
# mode name prone to change (suggestions welcome :P )
mode == "undot2" ? "x[-1,1] A^ x[0,1] B^ x[1,1] C^ x[-1,0] D^ x[1,0] E^ x[-1,-1] F^ x[0,-1] G^ x[1,-1] H^ "  \
                  +"A C min AA^ A C max CC^ "                                                                \
                  +"B D min BB^ B D max DD^ "                                                                \
                  +"E G min EE^ E G max GG^ "                                                                \
                  +"F H min FF^ F H max HH^ "                                                                \
                  +"AA EE min A^ AA EE max E^ "                                                              \
                  +"BB FF min B^ BB FF max F^ "                                                              \
                  +"CC GG min C^ CC GG max G^ "                                                              \
                  +"DD HH min D^ DD HH max H^ "                                                              \
                  +"A B min AA^ A B max BB^ "                                                                \
                  +"C D min CC^ C D max DD^ "                                                                \
                  +"E F min EE^ E F max FF^ "                                                                \
                  +"G H min GG^ G H max HH^ "                                                                \
                  +"CC EE min C^ CC EE max E^ "                                                              \
                  +"DD FF min D^ DD FF max F^ "                                                              \
                  +"BB E min B^ BB E max EE^ "                                                               \
                  +"D GG min DD^ D GG max G^ "                                                               \
                  +"B C min BB^ B C max CC^ "                                                                \
                  +"DD EE min D^ DD EE max E^ "                                                              \
                  +"F G min FF^ F G max GG^ "                                                                \
                  +"x[0,0] BB GG clip"                                                                     : \


@wonkey_monkey: I tested with the ternary option as I thought one ternary might be faster than min+max but I don't think your code example works.
Code:
"A C < Q@ A AA^ C CC^ ? Z^ Q C CC^ A AA^ ? Z^ "
I think Expr ternaries don't look for a true or false (in case Q@ catches that at all) but expect a comparison operator.

PD: I had a look at the MSVC compiler size, 40Gb, ouch!
__________________
[i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub
Dogway is offline   Reply With Quote
Old 8th July 2021, 09:24   #1209  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
Quote:
Originally Posted by GMJCZP View Post
Will this do?
Here
That's asmjit rather than jitasm, but actually yes, it will make for informative reading, so thanks!
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 8th July 2021, 09:34   #1210  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
Quote:
Originally Posted by Dogway View Post
@wonkey_monkey: I tested with the ternary option as I thought one ternary might be faster than min+max but I don't think your code example works.
Code:
"A C < Q@ A AA^ C CC^ ? Z^ Q C CC^ A AA^ ? Z^ "
I think Expr ternaries don't look for a true or false (in case Q@ catches that at all) but expect a comparison operator.
A quick "fingers" test - lift a finger for each variable that gets added to the stack, lower a finger for each popstore or regular operator, lower two fingers for a "?" - suggests you've only got one item on the stack when you reach the "?"

Remember that everything before the "?" gets executed - all "?" does is select which of the two topmost stack items to remove. Maybe you meant AA@ and CC@, so as not to remove A and C from stack, but in any case both will then be overwritten by the next section anyway, as will the result you would have stored in Z.

So your code says:

Code:
Compare A and C (stack contains result)
Store result in Q (stack contains result)
Load A, but immediately store and pop into AA (stack contains result)
Load C, but immediate store and pop into CC (stack contains result)
? - needs three items on the stack so it fails
Also shouldn't the last line be:


Code:
                  x[0,0] FF GG clip"
?
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 8th July 2021 at 09:59.
wonkey_monkey is offline   Reply With Quote
Old 8th July 2021, 10:54   #1211  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,629
Quote:
PD: I had a look at the MSVC compiler size, 40Gb, ouch!
GCC 11 (mingw-w64 target) is less than 100MB, and msvc is far less than 40GB if you only need C++ components.
feisty2 is offline   Reply With Quote
Old 8th July 2021, 12:23   #1212  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 1,335
@wonkey_monkey: true, true, typo (^ for @). I was also overwriting the second ternary.

This thing is tricky, this should do it but it doesn't, so I will leave this here and think in the evening:

Code:
+"A C      < Q@ A   AA@ C   CC@ ? Z^ Q C   CC@ A   AA@ ? Z^ "
+"B D      < Q@ B   BB@ D   DD@ ? Z^ Q D   DD@ B   BB@ ? Z^ "
+"E G      < Q@ E   EE@ G   GG@ ? Z^ Q G   GG@ E   EE@ ? Z^ "
+"F H      < Q@ F   FF@ H   HH@ ? Z^ Q H   HH@ F   FF@ ? Z^ "
+"AA EE    < Q@ AA AAA@ EE EEE@ ? Z^ Q EE EEE@ AA AAA@ ? Z^ "
+"BB FF    < Q@ BB BBB@ FF FFF@ ? Z^ Q FF FFF@ BB BBB@ ? Z^ "
+"CC GG    < Q@ CC CCC@ GG GGG@ ? Z^ Q GG GGG@ CC CCC@ ? Z^ "
+"DD HH    < Q@ DD DDD@ HH HHH@ ? Z^ Q HH HHH@ DD DDD@ ? Z^ "
+"AAA BBB  < Q@ AAA  A@ BBB  B@ ? Z^ Q BBB  B@ AAA  A@ ? Z^ "
+"CCC DDD  < Q@ CCC  C@ DDD  D@ ? Z^ Q DDD  D@ CCC  C@ ? Z^ "
+"EEE FFF  < Q@ EEE  E@ FFF  F@ ? Z^ Q FFF  F@ EEE  E@ ? Z^ "
+"GGG HHH  < Q@ GGG  G@ HHH  H@ ? Z^ Q HHH  H@ GGG  G@ ? Z^ "
+"C E      < Q@ C   CC@ E   EE@ ? Z^ Q E   EE@ C   CC@ ? Z^ "
+"D F      < Q@ D   DD@ F   FF@ ? Z^ Q F   FF@ D   DD@ ? Z^ "
+"B EE     < Q@ B   BB@ EE EEE@ ? Z^ Q EE EEE@ B   BB@ ? Z^ "
+"DD G     < Q@ DD DDD@ G   GG@ ? Z^ Q G   GG@ DD DDD@ ? Z^ "
+"BB CC    < Q@ BB BBB@ CC CCC@ ? Z^ Q CC CCC@ BB BBB@ ? Z^ "
+"DDD EEE  < Q@ DDD  D@ EEE  E@ ? Z^ Q EEE  E@ DDD  D@ ? Z^ "
+"FF GG    < Q@ FF FFF@ GG GGG@ ? Z^ Q GG GGG@ FF FFF@ ? Z^ "

The last line should be the second from the minimum and second from the maximum, since order is A B C D E F G H, I chose B G. I compared it against removegrain(2) anyway.
__________________
[i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub
Dogway is offline   Reply With Quote
Old 8th July 2021, 12:40   #1213  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
Quote:
Originally Posted by Dogway
This thing is tricky, this should do it but it doesn't, so I will leave this here and think in the evening:
I'm afraid you're still misunderstanding how "?" works. Could you start a new thread so we can discuss it there, or I can PM you?
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 8th July 2021, 13:02   #1214  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 1,335
I have used ternaries for years now, this is rather a stack issue, posted here a simplified code.
__________________
[i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub
Dogway is offline   Reply With Quote
Old 13th July 2021, 06:16   #1215  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,286
It took several months, but I finally got around to working on a macOS installer package. 3.7.0 is available on the normal Releases page, in two forms:
High Sierra and Mojave builds (10.13 & 10.14)
Catalina and higher builds (10.15+)

And also filesonly tarballs if you'd rather skip the installer (although they do have shell scripts to help users unfamiliar with the process).
qyot27 is offline   Reply With Quote
Old 14th July 2021, 23:07   #1216  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,270
Is there any way to load the contents of a text file as a string using built-in Avisynth functions? I can't seem to find one but maybe there is a trick.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 15th July 2021, 09:56   #1217  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,494
Quote:
Is there any way to load the contents of a text file as a string
Not that I ever found. [even trying to abuse Import() failed for me].

Only thing I'm aware of,
Code:
RT_ReadTxtFromFile(String ,Int "Lines"=0,Int "Start"=0)
 Non-clip function.
 String Filename, Name of text file to load into a string.
 Lines=0=unlimited. Set to number of leading lines in text file to load, eg 1 = load only the first line of text file.
 The return string is n/l ie Chr(10) separated, and carriage returns are removed from the returned string.
 If source file was missing newline on very last line, it will append a newline so that all lines are similarly formatted.
 v1.03, Added Start arg default=0=very first line (relative 0). Would have been nice to have start and lines in reverse
 order but implemented as above to not break scripts.
 Throws an error if your requested Start is >= to the number of lines in the file, or zero len file.
 To fetch the last line of a text file, use eg Start = RT_FileQueryLines(Filename) - 1 (Start is zero relative).
 You could eg get the last line of a d2v file which might look like this:- "FINISHED  100.00% VIDEO"
__________________
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 online now   Reply With Quote
Old 16th July 2021, 08:11   #1218  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,964
Quote:
Originally Posted by wonkey_monkey View Post
Is there any way to load the contents of a text file as a string using built-in Avisynth functions? I can't seem to find one but maybe there is a trick.
Abusing ConditionalReader?
http://avisynth.nl/index.php/ConditionalReader
pinterf is offline   Reply With Quote
Old 16th July 2021, 08:12   #1219  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,964
Quote:
Originally Posted by qyot27 View Post
It took several months, but I finally got around to working on a macOS installer package. 3.7.0 is available on the normal Releases page, in two forms:
High Sierra and Mojave builds (10.13 & 10.14)
Catalina and higher builds (10.15+)

And also filesonly tarballs if you'd rather skip the installer (although they do have shell scripts to help users unfamiliar with the process).
Congratulations!
pinterf is offline   Reply With Quote
Old 16th July 2021, 10:22   #1220  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,459
AviSynth+ on Mac? Selur might enjoy that for Hybrid...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH 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 23:00.


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