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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 28th January 2020, 15:17   #5081  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanx P & Q. (No not Uma & Quentin).

This bug persists.

https://forum.doom9.org/showthread.p...29#post1893529


Code:
BITS=16
BlankClip.ConvertToYV12.ConvertBits(BITS)
X = 16
Y = 16
W = 128
H = 128
#COL=$00FFFFFF   # No Alpha
COL=$FFFFFFFF   # Full Alpha
WHT=BlankClip(Width=W,Height=H,Color=COL)   # Prob if RGB32 or YV12, but not YUV420P16
WHT=WHT.ConvertToYV12
#WHT=WHT.ConvertBits(BITS)
Overlay(WHT,x=X,y=Y)
crop(0,0,W+2*X,H+2*Y)                       # Crop Overlayed with 16 pixels border
PointResize(512,512)                        # for view
Rubbish at bottom of white
__________________
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  
Old 28th January 2020, 15:24   #5082  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by StainlessS View Post
Thanx P & Q. (No not Uma & Quentin).

This bug persists.

https://forum.doom9.org/showthread.p...29#post1893529


Code:
BITS=16
BlankClip.ConvertToYV12.ConvertBits(BITS)
X = 16
Y = 16
W = 128
H = 128
#COL=$00FFFFFF   # No Alpha
COL=$FFFFFFFF   # Full Alpha
WHT=BlankClip(Width=W,Height=H,Color=COL)   # Prob if RGB32 or YV12, but not YUV420P16
WHT=WHT.ConvertToYV12
#WHT=WHT.ConvertBits(BITS)
Overlay(WHT,x=X,y=Y)
crop(0,0,W+2*X,H+2*Y)                       # Crop Overlayed with 16 pixels border
PointResize(512,512)                        # for view
Yikes! Ugly like hell.
pinterf is offline  
Old 28th January 2020, 16:21   #5083  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Version Strings [3.4]

3.4 x86


3.4 x64


Version Strings [3.4.1] (well, as current)

3.4.1_x86


3.4.1_x64


Its a bit linuxy [but is 2020, nice]
__________________
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  
Old 28th January 2020, 16:46   #5084  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by StainlessS View Post
Thanx P & Q. (No not Uma & Quentin).

This bug persists.

https://forum.doom9.org/showthread.p...29#post1893529


Code:
BITS=16
BlankClip.ConvertToYV12.ConvertBits(BITS)
X = 16
Y = 16
W = 128
H = 128
#COL=$00FFFFFF   # No Alpha
COL=$FFFFFFFF   # Full Alpha
WHT=BlankClip(Width=W,Height=H,Color=COL)   # Prob if RGB32 or YV12, but not YUV420P16
WHT=WHT.ConvertToYV12
#WHT=WHT.ConvertBits(BITS)
Overlay(WHT,x=X,y=Y)
crop(0,0,W+2*X,H+2*Y)                       # Crop Overlayed with 16 pixels border
PointResize(512,512)                        # for view
Rubbish at bottom of white
I can see no bug save a missing sanity-check.
The script is using a 8 bit mask over a 16 bit base clip. Since no automatic bit-depth conversion happens, the result is undefined.
Unfortunately there is no error message for this case. I'll put one there later.
pinterf is offline  
Old 28th January 2020, 16:54   #5085  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yeh well, I need lots of sanity checks. [and maybe a few sobriety checks too]

Quote:
scripts that were parsing VersionString to get the build number at the exact 17th position no longer worked.
I'm doin' a Version/Build Number fix now, will detect "(r" as build number intro, and scan till non digit.
__________________
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 17:01.
StainlessS is offline  
Old 28th January 2020, 17:05   #5086  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by StainlessS View Post
I'm doin' a Version/Build Number fix now, will detect "(r" as build number intro, and scan till non digit.
Yep, present method probably fails even at 3.10
pinterf is offline  
Old 28th January 2020, 17:15   #5087  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Maybe I also add, "AvsPlusBugfixVersionNumber()", for the 3rd '.' separated part.
Then you can do mods when and where you like.

EDIT: I hate them there daft multiple dot version numbers, they are insane.
__________________
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  
Old 28th January 2020, 18:04   #5088  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Anyway, I have included (not commited yet) a new IsVersionOrGreater function which is checking the current version against the given parameters (similar to a Windows API function)
e.g.
if IsVersionOrGreater(3, 4) or IsVersionOrGreater(3, 5, 8)
and results in true if the current version is equal or greater than the required one in the parameters.
adding AvsPlusVersionNumber() to avs+ core (or any better name like VersionReleaseNumber()) will also welcome, will be better than add more code to old AvsPlusVersionNumber script function
__________________
See My Avisynth Stuff
real.finder is offline  
Old 28th January 2020, 18:49   #5089  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
The script is using a 8 bit mask over a 16 bit base clip. Since no automatic bit-depth conversion happens, the result is undefined.
The fact that it worked at all, made me think that it was supposed to work [8 bit Overlay normally works with any colorspace].
Kudos that it worked at all and did not go BANG!

# ...

Something like this (I've used PlusBuildNumber, maybe version number should return the 3.4 bit, dont know)

Code:
Function IsAvs26()                  { VersionNumber>=2.6}
Function IsAvsNeo()                 { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus()                { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function PlusBuildNumber()          { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int }  # OK Avs+ & Neo, up to build about 16Million
Function AvsPlusVersionNumber()     { Return PlusBuildNumber }  # Stub for PlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
ADDED

EDIT: Eval("2983,") would fail due to trailing comma, "2983,".Value.Int, Value ignores comma but produces float, Int converts to integer. [supports more than 4 digits, max 24 bit, ~16M]

EDIT: Version Strings
Code:
# AviSynth v2.58
AviSynth 2.58, build:Dec 22 2008 [08:46:51]

# AviSynth v2.60
AviSynth 2.60, build:Mar 31 2015 [16:38:54]

# AviSynth v2.61 Alpha
AviSynth 2.61, build:May 17 2016 [16:06:18] VC2008Exp

# Avisynth v2.60 ICL
AviSynth 2.60 (ICL10)

# Avisynth V2.60 MT
AviSynth 2.60, build:Feb 20 2015 [03:16:45]

# Avisynth NEO
AviSynth Neo 0.1 (r2822, Neo, i386)
AviSynth Neo 0.1 (r2822, Neo, x86_64)

# Avisynth NEO Forerunner Avisynth+ CUDA
AviSynth+ 0.1 (r2533, CUDA, i386)
AviSynth+ 0.1 (r2533, CUDA, x86_64)


# Avisynth+ v2.60 (older)
AviSynth+ 0.1 (r2772, MT, i386)
AviSynth+ 0.1 (r2772, MT, x86_64)

# Avisynth+ v3.4 (Prev)
AviSynth+ 3.4 (r2923, 3.4, i386)
AviSynth+ 3.4 (r2923, 3.4, x86_64)

# Avisynth+ v3.4.1 (NOW)
AviSynth+ 3.4 (r2983, linux3, i386)
AviSynth+ 3.4 (r2983, linux3, x86_64)
So, VersionNumber is 2.60, PlusBuildNumber is 2983 [ Previously known as AvsPlusVersionNumber(), see above in BLUE] , what do we call the 3.4.1 stuff ?
[ Something_MAJOR, Something_MINOR, something_BUGFIX ??? ]
__________________
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; 29th January 2020 at 02:15.
StainlessS is offline  
Old 28th January 2020, 20:40   #5090  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by pinterf View Post
Btw. as I have changed the test version to 3.4.1 instead of 3.5, scripts that were parsing VersionString to get the build number at the exact 17th position no longer worked. Aside from this fact, is there any other reason why the 3rd part of the version (BUGFIX_VERSION) was not included in AVS_FULLVERSION?
E.g. now it reports 3.4 even for 3.4.1?
I've done the modification to include this 3rd part in it but real.finder noted me the problem, so I temporarily reversed the change.
I think it was just an oversight, as one of my main concerns was getting a bugfix version into the pkg-config file. The lack of it when using Version had been bugging me too.

The test build's huge revision jump is due to the Linux support commits, shielding the Windows-only parts behind ifdefs and [amongst other changes to get it to build] switching the vast majority of the MSVC-specific types to stdint in places that aren't specific to one OS or the other. I just wasn't sure if any of those sorts of changes might end up impacting operations in any way, is all.

Oh, and I added the VersionEx() function, which - eventually - would be intended to provide a verbose list of different internal versioning or values thatan end user may want to check. It's still nearly identical to Version(), save for also including the compiler info (currently only tested with MSVC and GCC, not Clang, and definitely not ICL).
qyot27 is offline  
Old 28th January 2020, 20:43   #5091  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by StainlessS View Post
So, VersionNumber is 2.60, BuildNumber is 2983 [ Previously known as AvsPlusVersionNumber() ] , what do we call the 3.4.1 stuff ?
[ Something_MAJOR, Something_MINOR, something_BUGFIX ??? ]
VersionNumber returning 2.60 is pretty much just for legacy applications that expect to find 2.6 (and I'm not really sure how prevalent that ever was, vs. checking the AVISYNTH_INTERFACE_VERSION or some such). Honestly, if there's not a real threat of breaking anything if we actually bump it up to what the version number currently is, I wouldn't be opposed to it.
qyot27 is offline  
Old 28th January 2020, 21:10   #5092  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I use versionNumber only like so, [below originally posted here:- https://forum.doom9.org/showthread.p...99#post1894699 ]

Code:
    Function IsAvs26()               { VersionNumber>=2.6 }
    Function IsAvsPlus()             { FindStr(VersionString,"AviSynth+")!= 0||FindStr(VersionString," Neo")!=0 }
#   Function AvsPlusVersionNumber()  { IsAvsNeo?Eval(MidStr(VersionString,20,4)):IsAvsPlus?Eval(MidStr(VersionString,17,4)):0}
    Function PlusBuildNumber()       { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int }  # Avs+ & Neo
    Function AvsPlusVersionNumber()  { Return PlusBuildNumber }  # Stub for PlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.

    #
    Function X_PixelType(clip c)     { c IsAvs26   ? PixelType : IsYV12?"YV12":IsYUY2?"YUY2":IsRGB32?"RGB32":"RGB24" } # Eg "RGB32" or "YUV420P10"
    Function X_IsYV411(clip c)       { c IsAvs26   ? IsYV411          : False }
    Function X_IsY(clip c)           { c IsAvsPlus ? IsY : IsAvs26 ? IsY8 : False } # True=Single Plane : (!IsRGB)=True = Any type with Y, YUY2/YUVA/Y8 etc.
    Function X_Is420(clip c)         { c IsAvsPlus ? Is420            : IsYV12 }
    Function X_Is422(clip c)         { c IsAvsPlus ? Is422            : False }     # YUY2_Clip.Is422=False [ie not Planar]
    Function X_Is444(clip c)         { c IsAvsPlus ? Is444            : IsAvs26 ? IsYV24  : False }
    Function X_IsRGB48(clip c)       { c IsAvsPlus ? IsRGB48          : False }
    Function X_IsRGB64(clip c)       { c IsAvsPlus ? IsRGB64          : False }
    Function X_HasAlpha(clip c)      { c IsAvsPlus ? HasAlpha         : IsRGB32 }
    Function X_NumComponents(clip c) { c IsAvsPlus ? NumComponents    : IsAvs26&&IsY8 ? 1 : IsRGB32 ?4 : 3 }            # Num of channels
    Function X_Bpc(clip c)           { c IsAvsPlus ? BitsPerComponent : 8 }                                             # Bits per channel, 32 = Float
    Function X_YMod(clip c)          { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Height/ExtractU.Height):(IsYV12 ?2:1) } # Y Min crop multiple for Progressive
    Function X_XMod(clip c)          { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Width/ExtractU.Width):IsAvs26?(IsYV411?4:IsY8||IsRGB?1:2):(IsRGB?1:2)} # X Min crop multiple
I dont see any obvious problem using VersionNumber as eg 3.4 [with maybe something like AvsPlusBugfixVersion=1, where full version is 3.4.1]
__________________
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; 29th January 2020 at 02:12.
StainlessS is offline  
Old 28th January 2020, 21:24   #5093  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
what about adding PlusVersionNumber?

and PlusBuildNumber or PlusReleaseNumber
__________________
See My Avisynth Stuff
real.finder is offline  
Old 28th January 2020, 21:39   #5094  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by qyot27 View Post
VersionNumber returning 2.60 is pretty much just for legacy applications that expect to find 2.6 (and I'm not really sure how prevalent that ever was, vs. checking the AVISYNTH_INTERFACE_VERSION or some such). Honestly, if there's not a real threat of breaking anything if we actually bump it up to what the version number currently is, I wouldn't be opposed to it.
it will not breaking scripts as StainlessS said but if for some reason the classic avs lived in the future it will be "real threat"
__________________
See My Avisynth Stuff
real.finder is offline  
Old 28th January 2020, 21:59   #5095  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
but if for some reason the classic avs lived in the future it will be "real threat"
Something to worry about if it ever happens, we could always get around that [somehow].

EDIT: I'll change to PlusBuildNumber() [its shorter]
__________________
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 22:11.
StainlessS is offline  
Old 28th January 2020, 22:05   #5096  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StainlessS View Post
Something to worry about if it ever happens, we could always get around that [somehow].
but isn't better to add new one as I suggested? maybe avs neo will have it own Version (so maybe it will using something like this NeoVersionNumber etc...), or yet another Forks will show, who knows?

edit: Regarding PlusVersionNumber and (PlusBuildNumber or PlusReleaseNumber)

both can be merge in one function like PlusVersion(string "type")

PlusVersion("ReleaseNumber") and PlusVersion("VersionNumber")
__________________
See My Avisynth Stuff

Last edited by real.finder; 28th January 2020 at 22:31.
real.finder is offline  
Old 29th January 2020, 00:18   #5097  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Code:
Function IsAvs26()                  { VersionNumber>=2.6}
Function IsAvsNeo()                 { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus()                { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function PlusBuildNumber()          { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int }  # Avs+ & Neo, (Max 24 bit, ~16M)
Function AvsPlusVersionNumber()     { Return PlusBuildNumber }  # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
# Return extent of string s that matches any chr in pat. Enter with n=0
Function StrMatchExtent(String s,String Pat,int n) { c=s.MidStr(n+1,1)  Return (((c=="")?0:Pat.FindStr(c))==0) ? n : s.StrMatchExtent(Pat,n+1) }
Function AvsVersionNumberString()              {
    v=VersionString  off=(FindStr(V,"AviSynth+ ")!=0)?FindStr(V,"AviSynth+ ")+10:(FindStr(V," Neo ")!=0)?FindStr(V," Neo ")+5:10
    v=v.MidStr(Off)  return v.LeftStr(StrMatchExtent(v,"0123456789.",0))
}
client
Code:
s=AvsVersionNumberString()  # Returns string eg "3.4.1" from "AviSynth+ 3.4.1 (r2983, linux3, x86_64)", works with ALL previous/current versions, can extract numbers from the string
BlankClip
subtitle(String(s))  # "3.4" for current, "3.4.1" if was implemented as such, "2.58" if old v2.58 AVS, "2.60" for AvsStd 2.6, "2.61" Latest avs std, "0.1" if NEO or avs+ build r2772.
__________________
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; 29th January 2020 at 02:00.
StainlessS is offline  
Old 29th January 2020, 00:45   #5098  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
These string parsing acrobatics are making me dizzy.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 29th January 2020 at 10:07.
Groucho2004 is offline  
Old 29th January 2020, 08:56   #5099  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Some more acrobatics [might need a bit of testing, I'm gonna get some shut eye]

EDIT: Moved to new thread in Usage, here- https://forum.doom9.org/showthread.php?t=178243

See Post #5103 for Versioning ONLY routines:- https://forum.doom9.org/showthread.p...80#post1897680
__________________
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; 4th February 2020 at 16:47.
StainlessS is offline  
Old 29th January 2020, 10:34   #5100  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by StainlessS View Post
Something to worry about if it ever happens, we could always get around that [somehow].

EDIT: I'll change to PlusBuildNumber() [its shorter]
I wouldn't use the build number from now.
Our aim should be just using a plain 2 or three digits version number such as 3.4, 3.4.1, 3.5.0.
pinterf is offline  
Closed Thread

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 09:25.


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