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 4th February 2013, 08:01   #21  |  Link
maxxon
Registered User
 
maxxon's Avatar
 
Join Date: Jan 2012
Location: On the net
Posts: 76
Thanks StainlesS, I'm sorta going to be in and out as I am looking for a job and need one soon.

That's great about your string code. I think I had a workaround, but dunno if I implemented it. I'll have to go back into the code and see. If not, I'll implement using your dll for a fix. Need to see if Gavino's GScript has been updated and do some benchmarking on that too. Good to know that there are fixes out there.

As for using a character separator to make a string into an array, that can be kinda slow due to searching and breaking up strings (that's how AvsLib worked) and is why I implemented the reference array. However, this was within the confines of the AviSynth language, and if you have implemented this as a dll, it would not be as slow (though how fast would have to be determined).

Will definitely take a look at your lib. Thanks again for the regreet and the heads up.


|\/|x
__________________
Are you finding that you are missing some functionality such as arrays, profiling, regression testing, iteration ability and more? Check out AviSynthLib, it may have what you are looking for.
maxxon is offline   Reply With Quote
Old 27th October 2013, 21:46   #22  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
maxxon, your work looks, I admit, somewhat strange, but powerful to me.
I was unable to use it just with the given documentation.
Could you please post an example that does the following:

- define (allocate) two one dimensional arrays with lower bound 0 and upper bound clip.FrameCount-1, one containing bools, the other float values.

- Show how to put data into elements of the array and read data from elements, from the runtime environment.

- deallocate the arrays the proper way - you state that RA_ arrays need to.


The using script might look like this
Code:
function SetSceneChangeProbability(clip c, int framenumber) {
    # this function runs completely in RTE
    Evaluate frame [framenumber]
    put result to float array[framenumber]
    set bool array[framenumber] to true
}
function Show3SceneChangeProbabilities(clip c) {
    c.ScriptClip("""
        check if bool array[current_frame -1] is true
        if not, call SetSceneChangeProbability(c, current_frame-1)
        check if bool array[current_frame] is true
        if not, call SetSceneChangeProbability(c, current_frame)
        check if bool array[current_frame +1] is true
        if not, call SetSceneChangeProbability(c, current_frame+1)
        display values for current_frame-1, current_frame and current_frame+1 from float array as subtitles
    """)
}
    Create bool array and init to all false
    Create float array
    ColorBars()
    Show3SceneChangeProbabilities()
    deallocate float array
    deallocate bool array
I need advice with the red parts. in advance - also to everyone else who can help, of course!
martin53 is offline   Reply With Quote
Old 3rd November 2013, 15:56   #23  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@Martin53, I recently took a peek at this quite amazing library and it looks to me (on brief inspection) that it is
intended only for small arrays maybe max dim of about 100, but I did not really understand without spending
a lot more time on it.
Perhaps wanting array of max dim FrameCount is ambitious expectation of the script language.
Perhaps others who have mastered usage could advise.
__________________
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 1st April 2016, 17:24   #24  |  Link
maxxon
Registered User
 
maxxon's Avatar
 
Join Date: Jan 2012
Location: On the net
Posts: 76
Sorry I've not been around everyone. Been doing other things and lost track of this library.

StainlessS, this library should be able to hold a very large array. It can only initialize an array of 100 elements at a time. From there you can splice them together. The max array size is limited to how much memory is available and how big a string can be. My RA library relies on my Mem library which can allocate 16^8 or 4G elements, which would probably blow up your application before it ever got that big. The max application address space under Windows is 3Gb on a 32 bit app that is Large Address Aware, or around 1.5GB if not Large Address Aware. If AviSynth is a 64 bit application, then you might be able to use it to it's maximum if something else doesn't blow up first as the application space gets beyond the 100s of GBs. However, as my arrays are in reality string objects, depending on how strings are manipulated internally, this will possibly start to bog down if you start passing very large arrays around.

Just a FYI on how these libraries are interconnected:

The Mem library allocates a variable that has a 8 character suffix. That suffix is a 8 character hex number. That is what limits how many objects can be allocated. The handle value returned by the Mem library is that 8 character string.

The SESA library is a library that allows O(1) access to string which represents an array of elements whose size are all the same length. It generates a string of these concatenated elements of the same length, thus allowing to pick off an element through a simple offset calculation.

The RA library joins the Mem library to the SESA library to allow O(1) access to any object type. Please note that by O(1), I mean that the library can look up the variable name in O(1) time. How AviSynth does name lookups internally is another matter that is beyond my knowledge, but I'd hope that it would use at least an O(ln(N)) search routine.

If you want to see how to use a RA object, please see the AviSynthLib Usage document. There's a section entitled Reference Array (page 11) that should help.

As for you martin53, I apologize that I didn't get your message sooner. After a while, when I didn't get any messages, I just stopped looking. I only bothered doing a filter today to see if I got any messages just because I stumbled on my work again while googling.

If you have any other questions after reading the Usage doc, please feel free to post or email.

Thanks for your interest.

|V|x
__________________
Are you finding that you are missing some functionality such as arrays, profiling, regression testing, iteration ability and more? Check out AviSynthLib, it may have what you are looking for.

Last edited by maxxon; 4th April 2016 at 17:30.
maxxon is offline   Reply With Quote
Old 2nd April 2016, 10:51   #25  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Maxxon, nice to see you back again.

For your info, RT_Stats has had both DBase (up to 1024 fields / 2 billion records) and Array (up to 3 Dims) implemented for some time, coming version extended for arrays and DBase over 2GB.
(Both Implemented as File)

http://forum.doom9.org/showthread.ph...light=rt_stats
__________________
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; 2nd April 2016 at 13:24.
StainlessS is offline   Reply With Quote
Old 2nd April 2016, 21:41   #26  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
why do you guys insist on this kind of stuff? why? it makes me want to scream

I mean, you can code in C++, so you're definitely aware that there is more than one programming language. Have you ever reflected on why there are so many programming languages in wide use? They're all Turing-complete, right, so you can solve any problem with any of them. So why don't we just pick one, like you guys seem to have picked Avisynth script?

The thing here is that programming is about expressing yourself. You want to describe your solution to the problem in a clear and concise way, and hopefully in a way that the compiler can translate into something that the machine will be able to execute quickly. This is why we have so many different programming languages: they're good at different things, and different people like to express themselves in different ways. Avisynth script is a domain-specific language, or a language that's custom tailored to solving a specific type of problems. It's very good at what it was designed for, but since it's basically a toy language that was hacked together by BenRG a decade and a half ago on a whim, it gets really clunky if you try to solve basically any problem that isn't "build a filter chain". If I wanted to, I could write the equivalent of any Avisynth filter chain in C, but I don't do that because it'd be much more tedious than just writing it in Avisynth script. Likewise, I could write a C compiler in Avisynth script if I absolutely had to, but that would just be retarded, so I don't do that either.

The thing you're trying to do here is kinda like trying to dress up a pig. You're not solving any of the problems inherent to Avisynth script, you're just tacking on a very ugly, inconsistent and slow implementation of a general-purpose language on top of it. Almost anything you can do with these language extensions would be better done either with a plugin or by writing some utility in a high level language that interfaces directly with the Avisynth API and/or generates Avisynth scripts. You're missing the entire point of having a domain-specific language in the first place.

Back in the early 1990's, the UNIX-Haters Handbook called this kind of thing "power tools for power fools".

Last edited by TheFluff; 2nd April 2016 at 21:47.
TheFluff is offline   Reply With Quote
Old 2nd April 2016, 22:02   #27  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Why dont you go be 'jovial' somewhere else.
__________________
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 4th April 2016, 17:30   #28  |  Link
maxxon
Registered User
 
maxxon's Avatar
 
Join Date: Jan 2012
Location: On the net
Posts: 76
Quote:
Originally Posted by TheFluff View Post
why do you guys insist on this kind of stuff? why? it makes me want to scream
Because, it wasn't available at the time, I didn't know that it could be extended, and wasn't interested in doing so after I wrote the library. Also, I find functional languages and scripting languages kinda interesting, and I wanted to see how far I could push it. And I think most would say that I pushed it really far. Could also be possible that some people don't want to download DLLs.

Note that my library isn't just about arrays. I did do some other pretty good stuff in it, which would allow programming in AviSynth easier. I think the profiler, regression testing and the assertion libs are the better ones, but there are others too.

Also seems that there are still people who download my library even now, which I find kinda cool.

Quote:
Originally Posted by StainlessS View Post
Why dont you go be 'jovial' somewhere else.


Quote:
Originally Posted by StainlessS View Post
Maxxon, nice to see you back again.
Thanks. Not sure how long I'll be here. We'll see.

Quote:
Originally Posted by StainlessS View Post
For your info, RT_Stats has had both DBase (up to 1024 fields / 2 billion records) and Array (up to 3 Dims) implemented for some time, coming version extended for arrays and DBase over 2GB.
(Both Implemented as File)
Nice. Good to know.


|V|x
__________________
Are you finding that you are missing some functionality such as arrays, profiling, regression testing, iteration ability and more? Check out AviSynthLib, it may have what you are looking for.

Last edited by maxxon; 4th April 2016 at 17:47.
maxxon is offline   Reply With Quote
Reply

Tags
array, avisynthlib, fast, o(1)

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 14:35.


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