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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th August 2019, 16:00   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
AvsInit.avsi v1.09 - 27/Jan/2020

Script to perform some tasks before user script is executed.

Also makes a few script functions later available to any other user scripts.
Also assists in removing AVS+ GScript incompatibilites so that an avsi script may run under Avs+, or when Gscript installed, then also v2.58, v2.60.

Code:
# AvsInit.avsi
Global AVSINIT_VER = 1.09
/*
    AvsInit.avsi, (c) StainlessS @ Doom9

    Req:-
        RT_Stats v1.43+ [Mandatory],     (c) StainlessS
        SysInfo v0.114+[Mandatory],      (c) Groucho2004
        GScript [Mandatory if non AVS+], (c) Gavino

    Script Called on Avisynth startup, (place in your Plugins directory), used for whatever startup initialization is required
    eg SetMemoryMax(). Makes some Functions available to User Scripts later, when user Avisynth scripts are being processed.

        IsAvsNeo()                              Return True if using Avisynth Neo.
        IsAvsPlus()                             Return True if using Avisynth Plus
        AvsPlusVersionNumber()                  Return Avisynth Plus version number(0 if non AvsPlus).
        IsAvs26()                               Return true if Avisynth v2.60 or higher.
        SystemInfoExists()                      Returns true if Groucho2004 SysInfo v0.114 plugin is present.
        GScriptExists()                         Returns true if Gavino GScript plugin is present.
        SystemEnvTemp()                         Returns Path to USER System environment TEMP folder.
        SystemEnvComSpec()                      Returns Path to System environment command line processor
                                                    eg "C:\Windows\system32\cmd.exe".
        SystemEnvComputerName()                 Returns System environment Commputer Name eg "Colossus".
        SystemEnvUserName()                     Returns System environment User Name eg "Yahweh".
        ###
        IsAvs64Bit()                            Return Avisynth Process Bitness, True = 64 bit.
        IsOS64Bit()                             Return Operating System Bitness, True = 64 bit (CPU could still be 64 bit if false).
        IsWinXP()                               Return true if Windows XP (NT 5.1 XP32, 5.2 XP64)
        IsWinVista()                            Return true if Windows Vista (NT 6.0)
        IsWin7()                                Return true if Windows Windows 7 (NT 6.1)
        IsWin8()                                Return true if Windows 8 (NT 6.2)
        IsWin81()                               Return true if Windows 8.1 (NT 6.3)
        IsWin10()                               Return true if Windows 10 (NT 10.0)
        HasMMX()                                Return true if has MXX
        HasSSE()                                Return true if has SSE
        HasSSE2()                               Return true if has SSE2
        HasSSE3()                               Return true if has SSE3
        HasSSE41()                              Return true if has SSE4.1
        HasSSE42()                              Return true if has SSE4.2
        HasAVX()                                Return true if has AVX
        HasAVX2()                               Return true if has AVX2
        ###
        AvsInit_ShowInfo()                      Send some System/Avs related Info to DebugView [google].
        ###
                                                Single file load/import functions. Return true on Success.
        AvsInit_LoadPlugin(fn)                  Load CPP dll with filename FN, sending debug stuff (success/fail) to DebugView window.
                                                [Avs+ will also load C plugins].
        AvsInit_LoadCPlugin(fn)                 Load C dll with filename FN, sending debug stuff (success/fail) to DebugView window.
        AvsInit_Import(fn)                      Import[GImport() if GScript Present] avs/avsi script with filename FN, sending debug
                                                stuff (success/fail) to DebugView window.
        ###
                                                Directory of files load/Import functions. Return total number of scripts imported,
                                                or dll's loaded,
        AvsInit_DImport(Dir)                    Import[GImport() if GScript Present] All avs/avsi scripts in folder Dir, sending debug
                                                stuff (success/fail) to DebugView window.
        AvsInit_DLoad(Dir)                      Load all CPP/C plugin dll's in folder Dir, sending debug stuff (success/fail) to
                                                DebugView window.

                                                Both DImport and DLoad, funcs may be of use in user functions to satisfy some script
                                                dependency, where a complex script requires multiple dll's or script loaded.

        The Import style functions use GImport() when GScript is available, otherwise Import(). Any scripts imported should have any
        GScript style wrappers removed, eg

        >>>>    CODE  >>>>
            GScript("""         # <<<<<<<<<<========= REMOVE THIS LINE
                ...
                Some gscript stuff, if/else/for/next while etc
                ...
            """)                # <<<<<<<<<<========= REMOVE THIS LINE
        <<<< END CODE <<<<

        With GScript wrappers removed and imported via this library, then should be able to use same scripts in any version of avs
        standard(with Gscript plugin) or avs+, whether it be avs v2.58, avs v2.60/2.61 Standard, avs+ x86 or x64.


    AvsInit_DLoadConditional(String "DLL_DIR",String "AVSI_DIR")         OS/Avisynth_Version/CPU_Extensions Specific DLL loader. DIR = Path
                                                to directory containing folders, dll and Script files.
                                                Both directories are optional, DLL_Dir defaults to "" ie dont scan, AVSI_DIR defaults to DLL_DIR.
                                                First Level Directories:- 0_XP, 1_VISTA, 2_WIN7_0, 3_WIN8_0, 4_WIN8_1, 5_WIN10_0. One of each in
                                                above DLL_DIR or AVSI_DIR directories.
                                                Second Level Directories:  0_AVS25x86, 1_Avs26Stdx86, 2_AVS26x86, 3_Avs25x64, 4_Avs26Stdx64, 5_AVS26x64. One of each in above 1st levels
                                                directories. 1_AVS26Stdx86 is standard Avisynth v2.60/2.61, 2_AVS26x86 is Avisynth+ v2.60.
                                                Third Level Directories: 0_CPP, 1_MMX, 2_SSE, 3_SSE2, 4_SSE3, 5_SSE41, 6_SSE42, 7_AVX, 8_AVX2.
                                                One of each in above 2nd levels directories.
                                                DLLs/Scripts should be in Third Level directories, ie CPU Extension Directories.
                                                NOTE, All alternative dll's should have exact same name, eg if xyz.dll loaded from AVX2
                                                directory, then similar named dlls' skipped in AVX, SSE42, etc.
                                                Only directories containing files are necessary, but maybe easier to keep entire directory layout,
                                                than to add them back where required.
                                                Zip contains a template full directory layout in "MACHINE" folder (but without any
                                                dll's/scripts).
                                                Any Scripts containing GScript code should also be stripped of GScript Wrappers.
                                                ONLY put awkward dll's or scripts in MACHINE folder, so that you can use eg specific dll
                                                for XP, and another where Vista+ in use.
                                                Do NOT have similar named dll's in both Plugins folder AND MACHINE folders, they will
                                                always be replaced by those in MACHINE folder as we cannot tell if an already Plugins
                                                loaded dll is present. v1.07, Now prescans folder containing AvsInit.avsi script (ie Plugins)
                                                and does not load dll's or scripts with same names as those in that Plugins folder.
                                                If CPU extensions are not explicitly mentioned in SysInfo SI_CPUExtensions string, then
                                                any dll's for that extension will now be skipped, eg if MMX not mentioned for an AMD
                                                processor, then no dll's will be loaded from MMX directories even if later/higher CPU extensions
                                                are available.

                                                Private Internal use only Functions.
    Function FuncNameExists(String Fn)          Check for RT_Stats v1.43+, thereafter uses RT_FunctionExist()
    AvsInit_OneTime_Install_GScript_Funcs()     Install functions AvsInit_DImport(), AvsInit_DLoad() and AvsInit_DLoadConditional(),
                                                and makes available for use in this script or user scripts.
*/
As Supplied, Might output something like below to Debugview
Code:
00000051    0.00000000  AvsInit:
00000052    0.00003333  AvsInit: Auto load plugins script ENTRY
00000053    0.00006630  AvsInit:
00000054    0.00322313  AvsInit:AvsInit_ShowInfo:
00000055    0.00326444  AvsInit:AvsInit_ShowInfo: AvsInit_Version     = 1.07
00000056    0.00330030  AvsInit:AvsInit_ShowInfo: RT_Stats Version    = 2.00Beta12
00000057    0.00333328  AvsInit:AvsInit_ShowInfo: SysInfo Version     = 0.114000
00000058    0.00336625  AvsInit:AvsInit_ShowInfo: VersionString       = AviSynth+ 3.4 (r2923, 3.4, x86_64)
00000059    0.00339922  AvsInit:AvsInit_ShowInfo: SetMemoryMax        = 3055
00000060    0.00343219  AvsInit:AvsInit_ShowInfo: GScript Available   = AVS+
00000061    0.00346516  AvsInit:AvsInit_ShowInfo: OS Bitness          = 64
00000062    0.00349813  AvsInit:AvsInit_ShowInfo: Avisynth Bitness    = 64
00000063    0.00358508  AvsInit:AvsInit_ShowInfo: WorkingDir          = C:\VideoTools\AvisynthRepository\AVSPLUS_x64\plugins\
00000064    0.00362530  AvsInit:AvsInit_ShowInfo: ProcessName         = C:\NON-INSTALL\VDUB\VDUB2\VirtualDub64.exe
00000065    0.00365827  AvsInit:AvsInit_ShowInfo: ParentProcessName   = explorer.exe
00000066    0.00369124  AvsInit:AvsInit_ShowInfo: OSVersionString     = Windows 7 (x64) Service Pack 1.0 (Build 7601)
00000067    0.00372421  AvsInit:AvsInit_ShowInfo: OSVersionNumber     = 6.100000
00000068    0.00376298  AvsInit:AvsInit_ShowInfo: CPUName             = Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz / Yorkfield (Core 2 Quad) 6M
00000069    0.00379631  AvsInit:AvsInit_ShowInfo: Cores               = 04:04 (Phy:Log)
00000070    0.00382892  AvsInit:AvsInit_ShowInfo: CPU Extensions      = MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
00000071    0.00386225  AvsInit:AvsInit_ShowInfo: Total Memory        = 12221MB
00000072    0.00389848  AvsInit:AvsInit_ShowInfo: Avail Memory        = 9622MB'
00000073    0.00393182  AvsInit:AvsInit_ShowInfo: Screen Res          = 1920x1080
00000074    0.00396479  AvsInit:AvsInit_ShowInfo: Screen BitsPerPixel = 32
00000075    0.00399812  AvsInit:AvsInit_ShowInfo: Time                = Friday 01 November 2019 13:40:03[GMT Standard Time]
00000076    0.00403109  AvsInit:AvsInit_ShowInfo: User TEMP Dir       = C:\Users\BeatRoot\AppData\Local\Temp
00000077    0.00406406  AvsInit:AvsInit_ShowInfo: ComSpec             = C:\Windows\system32\cmd.exe
00000078    0.00409703  AvsInit:AvsInit_ShowInfo: Computer Name       = PLEX-P2
00000079    0.00412964  AvsInit:AvsInit_ShowInfo: User Name           = BeatRoot
00000080    0.00416261  AvsInit:AvsInit_ShowInfo:
00000081    0.01395447  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\AutoContrast.avsi
00000082    0.01494503  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\AWB.avsi
00000083    0.01868228  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\colors_rgb.avsi
00000084    0.01956125  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\dither.avsi
00000085    0.03792434  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\Favc.avsi
00000086    0.04047900  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\MCDegrain.avsi
00000087    0.04146414  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\MIFO_Library.avsi
00000088    0.04745135  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\Misc.avsi
00000089    0.05038463  AvsInit:AvsInit_DImport:     Importing ... C:\VideoTools\AvisynthRepository\GIMPORT\RoboSplice.avsi
00000090    0.05376392  AvsInit:AvsInit_DImport:         IMPORTED 9 scripts from 'C:\VideoTools\AvisynthRepository\GIMPORT'
00000091    0.05975911  AvsInit:AvsInit_DImport:         IMPORTED 0 scripts from 'C:\VideoTools\AvisynthRepository\AVSPLUS_x64\plugins\GIMPORT'
00000092    0.07859827  AvsInit_DLoadConditional: STARTING DLL SCAN on C:\VideoTools\AvisynthRepository\MACHINE
00000093    0.08219458  AvsInit_DLoadConditional: !!! Skipping File XP+\AVS26x64+\SSE2+\AutoLevels_x64.dll, already loaded from PLUGINS
00000094    0.08341304  AvsInit_DLoadConditional: STARTING SCRIPT SCAN on C:\VideoTools\AvisynthRepository\MACHINE
00000095    0.08972163  AvsInit_DLoadConditional:   0 dll's   LOADED : 1 dll's   SKIPPED : 0 dll's   FAILED
00000096    0.08977307  AvsInit_DLoadConditional:   0 scripts LOADED : 0 Scripts SKIPPED : 0 scripts FAILED
EDIT: Above dlls and scripts just test samples, not necessarily those you might want to choose. [nor are they necessarily in the correct directories]

DebugView(from Micro$oft):- https://docs.microsoft.com/en-us/sys...oads/debugview

Script too big for D9 limit (16KB), so see posts #13 and #14 and #15 for headerless script.

See MediaFire in my sig below this post for 7z(~8KB):- AvsInit_v1.08_20191102.7z

RT_Stats:- https://forum.doom9.org/showthread.php?t=165479
SysInfo:- https://forum.doom9.org/showthread.php?t=176131
GScript:- https://forum.doom9.org/showthread.php?t=147846
__________________
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; 28th January 2020 at 00:20. Reason: Update
StainlessS is offline   Reply With Quote
Old 11th August 2019, 17:34   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Hmm maybe I'm missing something, but the most usefull function for me would be to import a folder with avs(i) files. Like AvsInit_GImport() without the GScript restriction.
AvsInit_Import_Avs() can only import a single avs file.. I mean I could also just write import() so I don't really see the benefit for it. Otherwise good idea.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 11th August 2019, 17:39   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Well, assuming that either Avs+ or Gscript is installed, then there is nothing whatever stopping you from importing any entire directory of avs/avsi scripts.

Does that answer your question ? [use the AvsInit_GImport(FolderName) thing] # EDIT: Func name change to AvsInit_DImport(FolderName)
EDIT: Avs+ x86/x64, or non avs+ with GScript (even v2.58, probably even v2.57 assuming that GScript works with it ok).
__________________
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; 13th August 2019 at 02:58.
StainlessS is offline   Reply With Quote
Old 11th August 2019, 17:42   #4  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
It imports always 0 scripts. Path is valid :/

EDIT
I'm so dumb. The line was commented out
So all good, forget what I wrote
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 11th August 2019 at 17:45.
ChaosKing is offline   Reply With Quote
Old 11th August 2019, 17:52   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Chaos, if you have any suggestions for stuff/user functions that may be generally useful, then say and I'll add them.
__________________
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 11th August 2019, 19:07   #6  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I think you covered all useful cases now. Now it is easy to benchmarks with avx / avx2 etc versions.
The only thing that I noticed is that you can create a loop if you point it to the folder with the initScript. Idk if a "protection" could be added easily ... not that it's really necessary.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 12th August 2019, 19:40   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
EDIT:
Quote:
create a loop if you point it to the folder with the initScript
EDIT: We resolved ChaosKing concerns above, some posts have been deleted to conserve space, and remove superfluous 'fluff'. [EDIT: @TheFluff, no offence intended ]

Updated see first post. [EDIT: Changed name to AvsInit.avsi]
Some name changes to functions.

SCRIPT REMOVED
__________________
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; 20th October 2019 at 05:04.
StainlessS is offline   Reply With Quote
Old 22nd August 2019, 18:24   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Anybody object if I changed name of this script to "AvsInit.avsi", it might seem to make sense as all of the contained functions have an "AvsInit_" Prefix. ?

[Might make source of any error messages more obvious]
__________________
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 22nd August 2019, 19:05   #9  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by StainlessS View Post
Anybody object if I changed name of this script to "AvsInit.avsi", it might seem to make sense as all of the contained functions have an "AvsInit_" Prefix. ?

[Might make source of any error messages more obvious]
I'm for AvsInit.avsi
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 22nd August 2019, 19:27   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks Chaos, Ill probably update tomorrow.
__________________
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 10th September 2019, 13:05   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
AvsInit.avsi v1.02, bugfix update, see 1st post. (bug introduced in v1.01 for avs v2.58)

Fix bug for v2.58, we used ScriptFile where not implemented till v2.60, changed to RT_ScriptFile().
__________________
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; 10th September 2019 at 13:35.
StainlessS is offline   Reply With Quote
Old 21st September 2019, 07:58   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Oops, nuther bugfix, update to v1.03.

Code block in post #7 changed as below (in RED is fix, was "val" should have been "eval", we lost an 'e' somehow.
Problem jumped up if calling AvsPlusVersionNumber(). Zip also updated.
Code:
Function IsAvsNeo()                 { FindStr(VersionString, " Neo")  != 0 }
Function IsAvsPlus()                { FindStr(VersionString, "AviSynth+")  != 0 || IsAvsNeo }
Function AvsPlusVersionNumber()     { IsAvsNeo  ? eval(MidStr(VersionString(),20,4)) : IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0 }
Function IsAvs26()                  { VersionNumber >= 2.6 }
__________________
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; 21st September 2019 at 11:07.
StainlessS is offline   Reply With Quote
Old 20th October 2019, 05:06   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Script update to v1.09

Header in post 1, (copy/Paste)

Post #2 of 4 parts

Code:
Function IsAvsNeo()                 { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus()                { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function AvsPlusVersionNumber()     { IsAvsNeo?Eval(MidStr(VersionString,20,4)):IsAvsPlus?Eval(MidStr(VersionString,17,4)):0}
Function IsAvs26()                  { VersionNumber>=2.6}
Function SystemInfoExists()         { Return RT_FunctionExist("SI_FileVersion")}
Function GScriptExists()            { Return RT_FunctionExist("GScript")}
Function SystemEnvTemp()            { Return RT_GetSystemEnv("TEMP")}               # Path to USER System environment TEMP folder
Function SystemEnvComSpec()         { Return RT_GetSystemEnv("COMSPEC")}            # Path to System environment command line processor
                                                                                    #   eg "C:\Windows\system32\cmd.exe"
Function SystemEnvComputerName()    { Return RT_GetSystemEnv("COMPUTERNAME")}       # System environment Commputer Name eg "Colossus"
Function SystemEnvUserName()        { Return RT_GetSystemEnv("USERNAME")}           # System environment User Name eg "God".
#
Function IsAvs64Bit()               { SI_ProcessBitness==64}
Function IsOS64Bit()                { Return Findstr(SI_OSVersionString,"x64")!=0}
Function IsWinXP()                  { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista()               { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7()                   { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8()                   { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81()                  { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10()                  { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
Function HasMMX()                   { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE()                   { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2()                  { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3()                  { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41()                 { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42()                 { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX()                   { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2()                  { Return Findstr(SI_CPUExtensions,"AVX2")!=0}

Function AvsInit_ShowInfo() {
    myName="AvsInit:AvsInit_ShowInfo: "
    S=RT_String("\nAvsInit_Version     = %.2f\n",                AVSInit_VER)
    S=RT_String("%sRT_Stats Version    = %s\n",                  S,RT_VersionString)
    S=RT_String("%sSysInfo Version     = %f\n",                  S,SI_FileVersion)
    S=RT_String("%sVersionString       = %s\n",                  S,VersionString)
    S=RT_String("%sSetMemoryMax        = %d\n",                  S,SetMemoryMax)
    S=RT_String("%sGScript Available   = %s\n",                  S,GScriptExists?"YES":IsAvsPLus?"AVS+":"NO")
    S=RT_String("%sOS Bitness          = %s\n",                  S,IsOS64Bit?"64":"32")
    S=RT_String("%sAvisynth Bitness    = %d\n",                  S,SI_ProcessBitness)
    S=RT_String("%sWorkingDir          = %s\n",                  S,RT_GetWorkingDir)
    S=RT_String("%sProcessName         = %s\n",                  S,SI_ProcessName)
    TmpS=RT_GetProcessName(True)                                 # "" Means parent process has closed and gone 4E4.
    S=(Tmps!="") ? RT_String("%sParentProcessName   = %s\n", S,TmpS) : S
    S=RT_String("%sOSVersionString     = %s\n",                  S,SI_OSVersionString)
    S=RT_String("%sOSVersionNumber     = %f\n",                  S,SI_OSVersionNumber)
    S=RT_String("%sCPUName             = %s\n",                  S,SI_CPUName)
    S=RT_String("%sCores               = %02d:%02d (Phy:Log)\n", S,SI_PhysicalCores,SI_LogicalCores)
    S=RT_String("%sCPU Extensions      = %s\n",                  S,SI_CPUExtensions)
    S=RT_String("%sTotal Memory        = %dMB\n",                S,SI_TotalSystemMemory)
    S=RT_String("%sAvail Memory        = %dMB'\n",               S,SI_AvailableSystemMemory)
    S=RT_String("%sScreen Res          = %dx%d\n",               S,SI_ScreenResX,SI_ScreenResY)
    S=RT_String("%sScreen BitsPerPixel = %d\n",                  S,SI_ScreenBitsPerPixel)
    S=RT_String("%sTime                = %s\n",                  S,Time("%A %d %B %Y %H:%M:%S[%Z]"))
    S=RT_String("%sUser TEMP Dir       = %s\n",                  S,SystemEnvTemp)
    S=RT_String("%sComSpec             = %s\n",                  S,SystemEnvComSpec)
    S=RT_String("%sComputer Name       = %s\n",                  S,SystemEnvComputerName)
    S=RT_String("%sUser Name           = %s\n",                  S,SystemEnvUserName)
    RT_DebugF("%s",S,name=myName)
}

Function AvsInit_LoadPlugin(String fn) {
    myName = "AvsInit:AvsInit_LoadPlugin:  "
    Assert(fn != "", + RT_String("%sFn cannot be empty string",myName))
    FN = RT_GetFullPathName(fn)
    Bingo=False
    EX = Exist(FN)
    Try {
        EX ? LoadPlugin(FN) : NOP
        EX ? RT_DebugF("%s LOADED   OK",RT_FilenameSplit(FN,12).RT_StrPad(32),name=myName) : RT_DebugF("%s NOT FOUND",FN,name=myName)
        Bingo=true
    } catch( msg ) { RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",FN,msg,name=myName) }
    Return Bingo
}

Function AvsInit_LoadCPlugin(String fn) {
    myName = "AvsInit:AvsInit_LoadCPlugin: "
    Assert(fn != "", + RT_String("%sFn cannot be empty string",myName))
    FN = RT_GetFullPathName(fn)
    Bingo=False
    EX = Exist(FN)
    Try {
        EX ? Load_Stdcall_Plugin(FN)                   : NOP
        EX ? RT_DebugF("%s LOADED   OK",RT_FilenameSplit(FN,12).RT_StrPad(32),name=myName) : RT_DebugF("%s NOT FOUND",FN,name=myName)
        Bingo=true
    } catch( msg ) { RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",Fn,msg,name=myName) }
    Return Bingo
}

Function AvsInit_Import(String fn) {
    myName = "AvsInit:AvsInit_Import:     "
    Assert(fn != "", + RT_String("%sFn cannot be empty string",myName))
    HasGScript=GScriptExists
    FN = RT_GetFullPathName(fn)
    node=RT_FilenameSplit(fn,4)
    selfnode=RT_FilenameSplit(RT_Scriptfile,4)
    Bingo=False
    EX = (node!=selfnode) ? Exist(FN) : False   # Coerce to non existing, if trying to load self.
    Try {
        EX ? (HasGScript ? GImport(FN) : Import(FN) ) : NOP
        EX ? RT_DebugF(" %s %sIMPORTED OK",RT_FilenameSplit(FN,12).RT_StrPad(32),HasGScript?"G":"",name=myName)
           \ : RT_DebugF("%s NOT FOUND",FN,name=myName)
        Bingo=True
    } catch( msg ) { RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",FN,msg,name=myName) }
    Return Bingo
}
__________________
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; 28th January 2020 at 00:43. Reason: Update
StainlessS is offline   Reply With Quote
Old 20th October 2019, 05:06   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Post #3 of 4 parts

Code:
Global GScript_OneTime_Install_String = """

    Function AvsInit_DImport(String dir) {
        myName = "AvsInit:AvsInit_DImport:     "
        Got=0  HasGScript=GScriptExists
        Assert(dir != "", + RT_String("%sdir cannot be empty string",myName))
        Dir = RT_GetFullPathName(Dir)
        TEMP=SystemEnvTemp() + "\~" + RT_LocalTimeString + ".tmp"
        nwr = RT_WriteFileList(Dir+"\*.avs|avsi",TEMP)
        selfnode=RT_FilenameSplit(RT_Scriptfile,4)
        for(i=0,nwr-1) {
            fn = RT_ReadTxtFromFile(TEMP,Lines=1,Start=i).RT_TxtGetLine  # Strip NL
            node=RT_FilenameSplit(fn,4)
            if(node != selfnode) { # Ignore if trying to load self.
                try {
                    if(HasGScript)  { RT_DebugF("GImporting ... %s",fn,name=myName) GImport(fn) }
                    Else            { RT_DebugF("Importing ... %s",fn,name=myName)  Import(fn)  }
                    got=got+1
                } catch ( msg ) { RT_DebugF(" *** Catch *** %s",msg,name=myName) }
            }
        }
        RT_FileDelete(TEMP)     RT_DebugF("    IMPORTED %d scripts from '%s'",got,Dir,name=myName)
        Return Got
    }

    Function AvsInit_DLoad(String dir) {
        myName = "AvsInit:AvsInit_DLoad:     "
        CPP_DLL_GOT=0  C_DLL_GOT=0
        Assert(dir != "", + RT_String("%sdir cannot be empty string",myName))
        Dir = RT_GetFullPathName(Dir)
        TEMP=SystemEnvTemp() + "\~" + RT_LocalTimeString + ".tmp"
        nwr = RT_WriteFileList(Dir+"\*.dll",TEMP)
        for(i=0,nwr-1) {
            fn = RT_ReadTxtFromFile(TEMP,Lines=1,Start=i).RT_TxtGetLine  # Strip NL
            Bingo=false
            try {
                RT_DebugF("LoadPlugin ... %s",fn,name=myName)   LoadPlugin(fn)  Bingo=True  CPP_DLL_GOT=CPP_DLL_GOT+1
            } catch ( msg ) { RT_DebugF(" *** Catch *** %s",msg,name=myName) }
            if(!Bingo) {
                try {
                    RT_DebugF("LoadCPlugin ... %s",fn,name=myName)  Load_Stdcall_Plugin(fn) Bingo=True  C_DLL_GOT=C_DLL_GOT+1
                } catch ( msg ) { RT_DebugF(" *** Catch *** %s",msg,name=myName) }
            }
        }
        RT_FileDelete(TEMP)
        RT_DebugF("    LoadPlugin  LOADED %d dll's",CPP_DLL_GOT,name=myName)
        RT_DebugF("    LoadCPlugin LOADED %d dll's from '%s'",C_DLL_GOT,Dir,name=myName)
        Return CPP_DLL_GOT + C_DLL_GOT
    }

    Function AvsInit_DLoadConditional(String "DLL_DIR",String "AVSI_DIR") {
        Function AvsInit_CPU_Capability()    { Return 1+(HasMMX?2:0)+(HasSSE?4:0)+(HasSSE2?8:0)+(HasSSE3?16:0)+(HasSSE41?32:0)+
                                             \ (HasSSE42?64:0)+(HasAVX?128:0)+(HasAVX2?256:0)}
        Function AvsInit_CPU_CapMax(int n)   { r=-1 for(i=8,0,-1) { if(RT_BitTst(n,i)) { r=i i=0} } Return r}
        Function AvsInit_CPU_DirName(int i)  { Return (i<0||i>8) ? "" :
                                                \ Select(i,"0_CPP","1_MMX","2_SSE","3_SSE2","4_SSE3","5_SSE41","6_SSE42","7_AVX","8_AVX2") }
        Function AvsInit_AVS_DirIx()         { Return !IsAvs64bit ? (!IsAvs26 ? 0 : !IsAvsPlus ? 1 : 2) : (!IsAvs26 ? 3 : !IsAvsPlus ? 4 : 5) }
        Function AvsInit_AVS_DirName(int i)  { Return (i<0||i>5) ? "" : Select(i,"0_AVS25x86","1_AVS26Stdx86","2_AVS26x86",  "3_AVS25x64","4_AVS26Stdx64","5_AVS26x64") }
        Function AvsInit_OS_DirIx()          { Return IsWin10?5:IsWin81?4:IsWin8?3:IsWin7?2:IsWinVista?1:0 }
        Function AvsInit_OS_DirName(Int i)   { Return (i<0||i>5) ? "" : Select(i,"0_XP","1_VISTA","2_WIN7_0","3_WIN8_0","4_WIN8_1","5_WIN10_0") }
        myName="AvsInit_DLoadConditional: "
        DLL_Dir =Default(DLL_Dir ,"")
        AVSI_Dir=Default(AVSI_Dir,DLL_Dir)
        HasGScript=GScriptExists
        TEMP=SystemEnvTemp()
        TempList=TEMP + "\~" + RT_LocalTimeString + ".tmp"
        DirIx = AvsInit_AVS_DirIx()
        Caps  = AvsInit_CPU_Capability
        AvsStartIx=DirIx
        AvsEndIx=(IsAvs64bit)?3:0
        CapMax=AvsInit_CPU_CapMax(Caps)
        OsStartIx=AvsInit_OS_DirIx()
        GOT_DLL=0 GOT_AVS=0 FAIL_DLL=0 FAIL_AVS=0 SKIP_DLL=0 SKIP_AVS=0
        for(Pass=0,1) {
            Dir = (Pass==0) ? DLL_DIR : AVSI_DIR
            if(Dir!="") {
                DoneStr=""
                Plugs = RT_ScriptDir # Directory of this script Including final BackSlash (ie Plugins)
                WildCard = (Pass==0) ? "*.dll" : "*.avs|avsi"
                nwr = RT_WriteFileList(Plugs+WildCard,TempList)
                for(i=0,nwr-1) { # Avoid reload of plugins/scripts already loaded from PLUGINS directory
                    Node = RT_ReadTxtFromFile(TempList,Lines=1,Start=i).RT_TxtGetLine.RT_FilenameSplit(4)   # NAME part only, no path, no extension
                    DoneStr=RT_String("%s%s:PLUGINS\n",DoneStr,Node)                                        # Add line Eg "AvsInit:PLUGINS\n"
                }
                Dir = RT_GetFullPathName(Dir)
                RT_DebugF("STARTING %s SCAN on %s",Pass==0?"DLL":"SCRIPT",Dir,name=myName)
                for(o=OsStartIx,0,-1) { # OS
                    Pext1 = AvsInit_OS_DirName(o)
                    Od=DIR+"\"+Pext1
                    if(Od.Exist) {
                        for(i=AvsStartIx,AvsEndIx,-1) { # AVS Ver
                            Pext2=AvsInit_AVS_DirName(i)
                            Sd=od+"\"+Pext2
                            if(Sd.Exist) {
                                for(j=CapMax,0,-1) { # Caps
                                    if(Caps.RT_BitTst(j)) { # Dont do it unless explicitly has capability [eg AMD may not have MMX]
                                        PExtFull=Pext1+"\"+Pext2+"\"+AvsInit_CPU_DirName(J)
                                        ESd=Dir+"\"+PextFull
                                        #RT_debugF("CAPS=%s",Esd)   # Show full Scan Path
                                        if(ESd.Exist) {
                                            nwr = RT_WriteFileList(ESd+"\"+WildCard,TempList)
                                            for(k=0,nwr-1) {
                                                # Get dll/script filename, Strip NL
                                                fn = RT_ReadTxtFromFile(TempList,Lines=1,Start=k).RT_TxtGetLine
                                                NodeExt=fn.RT_FilenameSplit(12)
                                                Node=NodeExt.RT_FilenameSplit(4)
                                                DoneS=""
                                                Start=0
                                                While(Start>=0) {
                                                    FoundLine=DoneStr.RT_TxtFindStr(Node+":",Sig=False,Start=Start)
                                                    if(FoundLine>=0) {
                                                        TestS=DoneStr.RT_TxtGetLine(Line=FoundLine)
                                                        Pos=TestS.RT_FindStr(Node+":",Sig=False)
                                                        if(Pos==1) {
                                                            DoneS=TestS.MidStr(Node.StrLen+2)
                                                            Start=-1                                # Break
                                                        } else { Start=FoundLine+1 }
                                                    } else { Start=-1 }
                                                }
                                                if(DoneS=="") {
                                                    Bingo=False
                                                    Try {
                                                        if(Pass==0) {
                                                            LoadPlugin(fn)
                                                            S=RT_String("%-32s LoadPlugin OK from %s",NodeExt,PextFull)
                                                            RT_DebugF("%s",S,name=myName)
                                                            GOT_DLL=GOT_DLL+1
                                                        } Else {
                                                            Dummy = HasGScript ? GImport(fn) : Import(fn)
                                                            S=RT_String("%-32s %sImport OK from %s",NodeExt,HasGScript?"G":"",PextFull)
                                                            RT_DebugF("%s",S,name=myName)
                                                            GOT_AVS=GOT_AVS+1
                                                        }
                                                        Bingo=true
                                                    } catch( msg ) {
                                                        if(Pass==0) {
                                                            RT_DebugF("*** LoadPlugin ERROR on '%s'\nSysErr='%s'\n",PextFull+
                                                                \ "\"+NodeExt,msg,name=myName)
                                                            Try {
                                                                Load_Stdcall_Plugin(fn)
                                                                RT_DebugF("%-32s LoadCPlugin OK",PextFull+"\"+NodeExt,name=myName)
                                                                Bingo=true
                                                            } catch(msg) {
                                                                RT_DebugF("*** LoadCPlugin ERROR on '%s'\nSysErr='%s'\n",PextFull+
                                                                    \ "\"+NodeExt,msg,name=myName)
                                                                FAIL_DLL=FAIL_DLL+1
                                                            }
                                                        } Else {
                                                            S=RT_String("*** %sImport ERROR on '%s'\nSysErr='%s'\n",HasGScript?"G"
                                                                \ :"",PextFull+"\"+NodeExt,msg)
                                                            RT_DebugF("%s",S,name=myName)
                                                            FAIL_AVS=FAIL_AVS+1
                                                        }
                                                    }
                                                    if(Bingo) { DoneStr=RT_String("%s%s:%s\n",DoneStr,Node,PextFull) }
                                                } Else {
                                                    RT_DebugF("!!! Skipping File %s, already loaded from %s",PextFull+
                                                             \ "\"+NodeExt,DoneS,name=mYName)
                                                    if(Pass==0) { SKIP_DLL=SKIP_DLL+1 } Else {SKIP_AVS=SKIP_AVS+1}
                                                }
                                            }
                                        }
                                    } # End of, If caps BitTst
                                } # end of Caps
                            }
                        } # End of AVS Ver
                    }
                } # End of OS
            }
        }
        RT_FileDelete(TempList)
        If(DLL_DIR  != "") { RT_DebugF("  %d dll's   LOADED : %d dll's   SKIPPED : %d dll's   FAILED",GOT_DLL,SKIP_DLL,FAIL_DLL,name=myName) }
        If(AVSI_DIR != "") { RT_DebugF("  %d scripts LOADED : %d Scripts SKIPPED : %d scripts FAILED",GOT_AVS,SKIP_AVS,FAIL_AVS,name=myName) }
        Return (GOT_DLL+GOT_AVS)
    }

"""

Function FuncNameExists(String Fn)  {Try{Eval(Fn+"()")B=True}catch(e){Assert(e.FindStr("syntax")==0,"FuncNameExists: Error in Function Name '"+Fn+"'")
   \ B=(e.FindStr("no function named")==0)}Return B}

Function AvsInit_OneTime_Install_GScript_Funcs() {
# Install Directory processing funcs AvsInit_DImport(), AvsInit_DLoad() and AvsInit_DLoadConditional(). Call ONCE ONLY else error.
    myName = "AvsInit:AvsInit_OneTime_Install_GScript_Funcs:     "
    IsPlus=IsAvsPlus  HasGScript=GScriptExists
    Assert(IsPlus || HasGScript,RT_String("%sMust have Avs+ or GScript",myName))
    Assert(GScript_OneTime_Install_String!="",RT_String("%sGScript_Funcs Already Installed",myName))
    (HasGScript) ? GSCript(GScript_OneTime_Install_String) : Eval(GScript_OneTime_Install_String)
    RT_DebugF("Functions AvsInit_DImport() and AvsInit_DLoad() Installed",name=myName)
    Global GScript_OneTime_Install_String = ""                     # Prevent repeat Install
}


### END OF FUNCTION CODE ########################################################################################################
__________________
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; 28th January 2020 at 00:43.
StainlessS is offline   Reply With Quote
Old 20th October 2019, 05:10   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Code:
################################################
# Check Mandatory RT_Stats and SysInfo Plugins #
################################################
Assert(FuncNameExists("RT_Version") && RT_Version>=1.43,"AvsInit: RT_Stats v1.43 mandatory plugin requirement")
Assert(SystemInfoExists,"AvsInit: Groucho2004 SysInfo v0.114+ mandatory plugin requirement")


################################################                # Enables use of DIRECTORY avs Import/Load/AvsInit_DLoadConditional dll stuff.
# ONE TIME CALL, ADVISE, LEAVE ALONE           #                # If this NOT called, then any AvsInit_DImport(), AvsInit_DLoad(),
#                                              #                # or AvsInit_DLoadConditional() will FAIL.
################################################
AvsInit_OneTime_Install_GScript_Funcs()                         # Can Comment out ONLY if NOT using DIRECTORY
                                                                # DImport/DLoad/AvsInit_DLoadConditional (Not using in this
                                                                # script nor in user scripts)


################################################
### CONFIG FOR YOUR SYSTEM AFTER THIS LINE   ###
################################################
# SetMemoryMax(512) # whatever


################################################
# Clear DebugView window                       #                # 'DBGVIEWCLEAR' sent to Debugview window clears the window.
################################################
RT_DebugF("DBGVIEWCLEAR\n\nAuto load plugins script ENTRY\n",name="AvsInit: ") # Thanx Wonkey.


################################################
#    Show INFO                                 #
################################################
AvsInit_ShowInfo()                                              # Output ShowAvsInitInfo() stuff to DebugView : Comment out if you wish

################################################
#  Load Plug/Script from some other directory  #
################################################


################################################                # Import of GScript scripts, for either AVS+, or AVS standard
# IMPORT/GIMPORT ENTIRE DIRECTORY of AVS       #                #   (Mandatory GScript when non AVS+). Import() when AVS+,
#                                              #                #   & GImport() when GScript installed.
#                                              #                # Scripts should NOT have GScript wrappers ie no GScript(""" ... """).
################################################                # AvsInit_DImport() / AvsInit_DLoadConditional() scripts dont have to
                                                                # contain GScript code, but may contain GScript code if GScript Wrappers
                                                                # are removed

AvsInit_DImport("..\..\GIMPORT")                                # 2 Directories ABOVE plugins, if using Groucho2004 Universal installer,
                                                                # then is in AvisynthRepository same level as all AVS distro folders.

AvsInit_DImport(".\GIMPORT")                                    # GIMPORT folder inside your Plugins directory. [Maybe for GScripts &
                                                                # a particular version of Avs].

######################################################
# Load OS && Bittage Specific dll's and scripts      #
######################################################
# Below DEMO, examples using MAC directory, 2 Directories ABOVE plugins as for Groucho2004 Universal Avisynth Installer.
MAC = "..\..\MACHINE"
AvsInit_DLoadConditional(MAC,MAC)                               # Conditional load of Dlls, and Scripts from two levels above
                                                                # Universal_Avisynth_Installer distributions folders.
return 0

###################################
__END__                                                         # NOTHING is PROCESSED after this line [maybe use later lines for
                                                                # temp storage, or something].

################################################
#  Load Plug/Script from some other directory  #
################################################
#AvsInit_LoadPlugin  (".\DGDecode\DGDecode.DLL")                 # DGDecode CPP
#AvsInit_LoadCPlugin (".\FFMS2_C\ffms2.dll")                     # FFMpegSource C Plugin
#AvsInit_Import      (".\FFMS2_C\ffms2.avsi")                    # FFMpegSource C Avsi file *** with LoadCPlugin line commented OUT ***.
#AvsInit_LoadPlugin  (".\LSMASH_CPP\LSMASHSource.dll")           # L-Smash CPP

###################################
# Load DIRECTORY of CPP/C plugins #
###################################
# NOT in use
#AvsInit_DLoad(".\TEST")

###################################
#  NOT USING - PLACEHOLDER ONLY   #
###################################
#AvsInit_LoadPlugin (".\FFMS2000_CPP\ffms2.dll")                # FFMpegSource CPP Plugin
#AvsInit_Import     (".\FFMS2000_CPP\ffms2.avsi")               # FFMpegSource CPP Avsi file * with LoadCPlugin line commented OUT [if present] *.
__________________
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; 28th January 2020 at 00:43. Reason: Update
StainlessS is offline   Reply With Quote
Old 20th October 2019, 11:49   #16  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Wouldn't it be better to make a separate examples file for everything under "END OF FUNCTION CODE" ? I would then just need to replace the script when a new version comes out
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 20th October 2019, 14:52   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I'll dwell on that a little bit.
Was not really intended that everybody use the exact provided script, I dont know what your setup is nor how you want to segregate OS, Avs version, Bitness.
Even the ffms2/LSmash stuff should maybe be put in OS Bittage section, I know my current ffms/LSmash dont work on XP, gotta find best-est most recent workable ones for XP.

I'll have a think.

EDIT: As it is, it gives clue where you might want to add similar stuff, moving it somewhere else would not.
__________________
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; 20th October 2019 at 15:04.
StainlessS is offline   Reply With Quote
Old 30th October 2019, 20:38   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
EDIT: HANG ON, I'M GETTIN aN EXCEPTION PRODUCING BUG under v2.58, update again soon

AvsInit.avsi, version v1.05 Update, see first post.

SysInfo(), now mandatory.
Several bug fixes.
Is64Bit() renamed to IsAvs64Bit().
AvsInit_LoadOsPlugs() replaced with AvsInit_DLoadConditional().

Code:
    AvsInit_DLoadConditional(String DLL_DIR,String "AVSI_DIR")         OS/Avisynth_Version/CPU_Extensions Specific DLL loader. DIR = Path to directory containing folders, dll and Script files.
                                                AVSI_DIR defaults to DLL_DIR.
                                                First Level Directories:- XP+, VISTA+, WIN7+, WIN80+, WIN81+, WIN10+. One of each in above DLL_DIR or AVSI_DIR directories.
                                                Second Level Directories:  AVS25+, AVS26+, AVSx64. One of each in above 1st levels directories.
                                                Third Level Directories: CPP+, MMX+, SSE+, SSE2+, SSE3+, SSE41+, SSE42+, AVX+, AVX2+. One of each in above 2nd levels directories.
                                                DLLs/Scripts should be in Third Level directories, ie CPU Extension Directories.
                                                NOTE, All alternative dll's should have exact same name, eg if xyz.dll loaded from AVX2 directory, then similar named dlls' skipped
                                                in AVX, SSE42, etc.
                                                Only directories containing files are necessary, but easier to keep entire directory layout, than to add them back where required.
                                                Zip contains a template full directory layout in "MACHINE" folder (but without any dll's/scripts).
                                                Any Scripts containing GScript code should also be stripped of GScript Wrappers.
                                                ONLY put awkward dll's or scripts in MACHINE folder, so that you can use eg specific dll for XP, and another where Vista+ in use.
                                                Do NOT have similar named dll's in both Plugins folder AND MACHINE folders, they will always be replaced by those in MACHINe folder as
                                                we cannot tell if an already Plugins loaded dll is present.
__________________
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; 31st October 2019 at 11:59.
StainlessS is offline   Reply With Quote
Old 31st October 2019, 12:05   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Update to v1.06, several bugs squashed, Added IsOS64Bit(). See First post.
Now requires mandatory Groucho2004 SysInfo v0.114.
[seems to be working well on v2.58, v2.60/61, avs+x86 and x64]

And may all ye gentle folk have a horrific and enjoyable All Hallows Eve
__________________
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; 31st October 2019 at 12:36.
StainlessS is offline   Reply With Quote
Old 31st October 2019, 12:30   #20  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Update to v1.06, several bugs fixed, Added IsOS64Bit(). See First post.

And all ye gentle folk have an horrific and enjoyable All Hallows Eve

EDIT: Now requires manatory Groucho2004 SysInfo v0.114.
Nice work. How about putting (direct) links to all dependencies (GScript, RT_Stats, Sysinfo,...) in the first post?
__________________
Groucho's Avisynth Stuff
Groucho2004 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 02:59.


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