Log in

View Full Version : All AVS+ Colorspaces [for testing]


StainlessS
5th April 2021, 21:56
Hi,
Here just a script to provide all [I hope] avs+ colorspaces, if I've missed any please say which.
(I had posted similar somewhere else but missed out some, eg 8 bit with Alpha).

AllColorSpacesTest.avs

#BlankClip(Length=60*60*24,width=1024,height=768)
colorbars(width=1024,height=768)
###################
# Un-Comment one of below.
###################

# 8 Bit Interleaved
#ConvertToRGB32 # RGB32
#ConvertToRGB24 # RGB24
#ConvertToYUY2 # YUY2
# 8 Bit
#ConvertToYV12 # YV12
# v2.60 +
#ConvertToY8 # Y8
#ConvertToYV411 # YV411 : 411 not suppored in higher bit depth nor with ALPHA
#ConvertToYV16 # YV16
#ConvertToYV24 # YV24
# Avs+
#ConvertToYV12.AddAlphaPlane # YUVA420
#ConvertToYV16.AddAlphaPlane # YUVA422
#ConvertToYV24.AddAlphaPlane # YUVA444
#ConvertToPlanarRGB # RGBP
#ConvertToPlanarRGBA # RGBAP

# 10 Bit
#ConvertToY8.ConvertBits(10) # Y10
#ConvertToYV12.ConvertBits(10) # YUV420P10
#ConvertToYV16.ConvertBits(10) # YUV422P10
#ConvertToYV24.ConvertBits(10) # YUV444P10
#ConvertToYV12.ConvertBits(10).AddAlphaPlane # YUVA420P10
#ConvertToYV16.ConvertBits(10).AddAlphaPlane # YUVA422P10
#ConvertToYV24.ConvertBits(10).AddAlphaPlane # YUVA444P10
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(10) # RGBP10
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(10) # RGBAP10

# 12 Bit
#ConvertToY8.ConvertBits(12) # Y12
#ConvertToYV12.ConvertBits(12) # YUV420P12
#ConvertToYV16.ConvertBits(12) # YUV422P12
#ConvertToYV24.ConvertBits(12) # YUV444P12
#ConvertToYV12.ConvertBits(12).AddAlphaPlane # YUVA420P12
#ConvertToYV16.ConvertBits(12).AddAlphaPlane # YUVA422P12
#ConvertToYV24.ConvertBits(12).AddAlphaPlane # YUVA444P12
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(12) # RGBP12
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(12) # RGBAP12

# 14 Bit
#ConvertToY8.ConvertBits(14) # Y14
#ConvertToYV12.ConvertBits(14) # YUV420P14
#ConvertToYV16.ConvertBits(14) # YUV422P14
#ConvertToYV24.ConvertBits(14) # YUV444P14
#ConvertToYV12.ConvertBits(14).AddAlphaPlane # YUVA420P14
#ConvertToYV16.ConvertBits(14).AddAlphaPlane # YUVA422P14
#ConvertToYV24.ConvertBits(14).AddAlphaPlane # YUVA444P14
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(14) # RGBP14
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(14) # RGBAP14

# 16 Bit
#ConvertToY8.ConvertBits(16) # Y16
#ConvertToYV12.ConvertBits(16) # YUV420P16
#ConvertToYV16.ConvertBits(16) # YUV422P16
#ConvertToYV24.ConvertBits(16) # YUV444P16
#ConvertToYV12.ConvertBits(16).AddAlphaPlane # YUVA420P16
#ConvertToYV16.ConvertBits(16).AddAlphaPlane # YUVA422P16
#ConvertToYV24.ConvertBits(16).AddAlphaPlane # YUVA444P16
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(16) # RGBP16
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(16) # RGBAP16
# 16 Bit RGB Interleaved
#ConvertToRGB48 # RGB48 Intereleaved RGB 16 bit
#ConvertToRGB64 # RGB64 Intereleaved RGBA 16 bit

# 32 Bit Float
#ConvertToY8.ConvertBits(32) # Y32
#ConvertToYV12.ConvertBits(32) # YUV420PS
#ConvertToYV16.ConvertBits(32) # YUV422PS
#ConvertToYV24.ConvertBits(32) # YUV444PS
#ConvertToYV12.ConvertBits(32).AddAlphaPlane # YUVA420PS
#ConvertToYV16.ConvertBits(32).AddAlphaPlane # YUVA422PS
#ConvertToYV24.ConvertBits(32).AddAlphaPlane # YUVA444PS
#ConvertToRGB48.ConvertToPlanarRGB.ConvertBits(32) # RGBPS
#ConvertToRGB64.ConvertToPlanarRGBA.ConvertBits(32) # RGBAPS
###################
#DDigitTest() # Some Filter
info

ConvertToRGB32 # For View


EDIT: Info on AVS+ colorpsaces, post by Pinterf:- https://forum.doom9.org/showthread.php?p=1783714#post1783714

FranceBB
5th April 2021, 22:02
It will definitely come in handy when I have to test plugins.
I actually made something like this myself with color bars when I had to test VideoTek() (which you helped me with, remember? :) ) but I was fool enough to delete it instead of saving it down. DX
Anyway, thanks, it's gonna be an easy copy-paste to test plugins. :)

StainlessS
5th April 2021, 22:11
I moved below from 8 to 16 bit, make sure you have update.

#ConvertToRGB48 # RGB48 Intereleaved RGB 16 bit
#ConvertToRGB64 # RGB64 Intereleaved RGBA 16 bit

wonkey_monkey
5th April 2021, 22:32
I was thinking about this the other day. How hard would it be to write a function that would take an input clip, a filter name (and possibly some parameters, somehow) which would apply the filter to the input clip converted to every colour space, convert all the results back to (say) 32-bit RGB and then stack them into a nice labelled layout?

StainlessS
5th April 2021, 22:39
converted to every colour space, convert all the results back to (say) 32-bit RGB and then stack them into a nice labelled layout?
You got a real big display ? [or just tiny sample clip]

wonkey_monkey
5th April 2021, 22:45
There could be multiple output options - all-in-one, separate interleaved frames, or some combination (all 8-bit formats on frame 0, 10-bit on frame 1, etc).

StainlessS
5th April 2021, 22:49
Sounds interesting, I admire your self confidence and look forward to giving it a whirl.

StainlessS
6th April 2021, 15:12
@ Wonkey,
OK, you know how to screw with my head too !
You got any ideas how to specify required colorspaces in arg to script function ?

What I got [is preliminary],


Function CSpace_Data(int "i") {
Default(i,0) # i=0, returns the number of Colorspace names. Otherwise returns the colorspace name with index i.
Assert(0 <= i <= 60,"CSpace_Data: 0 <= i <= 60"+String(i,"(%.0f)"))
/*
nn = bit depth
R = is any RGB
P = Planar
Included Y8 etc, AVS say Y8 is both Planar and Interleaved, however as not interleaved with any other channel we say Planar only.
[Less complicated]
C = Has Chroma
A = Has Alpha
H = Horizontal subsampled
V = Vertical subsampled

*/
s = CSpace_Names(i) # Gets Colorspace name via index from script function, fn not shown.
# nnRPCAHV
if (s== "YUY2") { d = "08001010" }
else if (s=="RGB24") { d = "08100000" }
else if (s=="RGB32") { d = "08100100" }
else if (s== "YV12") { d = "08011011" }
else if (s== "YV16") { d = "08011010" }
else if (s== "YV24") { d = "08011000" }
else if (s=="YV411") { d = "08011010" }
else if (s== "Y8") { d = "08010000" }
# nnRPCAHV
else if (s=="YUVA420") { d = "08011111" }
else if (s=="YUVA422") { d = "08011110" }
else if (s=="YUVA444") { d = "08011100" }
else if (s=="RGBP") { d = "08110000" }
else if (s=="RGBAP") { d = "08110100" }
# nnRPCAHV
else if (s== "Y10") { d = "10010000" }
else if (s== "YUV420P10") { d = "10011011" }
else if (s== "YUV422P10") { d = "10011010" }
else if (s== "YUV444P10") { d = "10011000" }
else if (s=="YUVA420P10") { d = "10011111" }
else if (s=="YUVA422P10") { d = "10011110" }
else if (s=="YUVA444P10") { d = "10011100" }
else if (s== "RGBP10") { d = "10110100" }
else if (s== "RGBAP10") { d = "10110100" }
# nnRPCAHV
else if (s== "Y12") { d = "12010000" }
else if (s== "YUV420P12") { d = "12011011" }
else if (s== "YUV422P12") { d = "12011010" }
else if (s== "YUV444P12") { d = "12011000" }
else if (s=="YUVA420P12") { d = "12011111" }
else if (s=="YUVA422P12") { d = "12011110" }
else if (s=="YUVA444P12") { d = "12011100" }
else if (s== "RGBP12") { d = "12110100" }
else if (s== "RGBAP12") { d = "12110100" }
# nnRPCAHV
else if (s== "Y14") { d = "14010000" }
else if (s== "YUV420P14") { d = "14011011" }
else if (s== "YUV422P14") { d = "14011010" }
else if (s== "YUV444P14") { d = "14011000" }
else if (s=="YUVA420P14") { d = "14011111" }
else if (s=="YUVA422P14") { d = "14011110" }
else if (s=="YUVA444P14") { d = "14011100" }
else if (s== "RGBP14") { d = "14110100" }
else if (s== "RGBAP14") { d = "14110100" }
# nnRPCAHV
else if (s== "Y16") { d = "16010000" }
else if (s== "YUV420P16") { d = "16011011" }
else if (s== "YUV422P16") { d = "16011010" }
else if (s== "YUV444P16") { d = "16011000" }
else if (s=="YUVA420P16") { d = "16011111" }
else if (s=="YUVA422P16") { d = "16011110" }
else if (s=="YUVA444P16") { d = "16011100" }
else if (s== "RGBP16") { d = "16110100" }
else if (s== "RGBAP16") { d = "16110100" }
else if (s== "RGB48") { d = "16100000" } # Interleaved
else if (s== "RGB64") { d = "16100100" } # Interleaved
# nnRPCAHV
else if (s== "Y32") { d = "32010000" }
else if (s== "YUV420PS") { d = "32011011" }
else if (s== "YUV422PS") { d = "32011010" }
else if (s== "YUV444PS") { d = "32011000" }
else if (s=="YUVA420PS") { d = "32011111" }
else if (s=="YUVA422PS") { d = "32011110" }
else if (s=="YUVA444PS") { d = "32011100" }
else if (s== "RGBPS") { d = "32110100" }
else if (s== "RGBAPS") { d = "32110100" }
return d
}

Above is only to check I got it correct [can display on frame with colorspace name, via other functions],
order etc might change, and will be finally packed into an int [rather than string, and gotten similarly to names rather than string compare].

EDIT: OK, might as well post entire script
EDIT: Script removed, mod posted a bit later.

StainlessS
6th April 2021, 22:57
Repost of update so far.
Only showing frames 1 to 60 is useful, error message on frame 61.

Function CSpace_Names(int "i") {
Default(i,0) # i=0, returns the number of Colorspace names. Otherwise returns the colorspace name with index i.
Assert(0 <= i <= 60,"CSpace_Names: 0 <= i <= 60"+String(i,"(%.0f)"))
Return Select(i,60,
\ "YUY2","RGB24","RGB32","YV12","YV16","YV24","YV411","Y8","YUVA420","YUVA422","YUVA444","RGBP","RGBAP",
\ "Y10","YUV420P10","YUV422P10","YUV444P10","YUVA420P10","YUVA422P10","YUVA444P10","RGBP10","RGBAP10",
\ "Y12","YUV420P12","YUV422P12","YUV444P12","YUVA420P12","YUVA422P12","YUVA444P12","RGBP12","RGBAP12",
\ "Y14","YUV420P14","YUV422P14","YUV444P14","YUVA420P14","YUVA422P14","YUVA444P14","RGBP14","RGBAP14",
\ "Y16","YUV420P16","YUV422P16","YUV444P16","YUVA420P16","YUVA422P16","YUVA444P16","RGBP16","RGBAP16","RGB48","RGB64",
\ "Y32","YUV420PS" ,"YUV422PS" ,"YUV444PS" ,"YUVA420PS" ,"YUVA422PS" ,"YUVA444PS" ,"RGBPS" ,"RGBAPS")
}

Function CSpace_Data(int "i") {
Default(i,0) # i=0, returns the number of Colorspace names. Otherwise returns the colorspace name with index i.
Assert(0 <= i <= 60,"CSpace_Data: 0 <= i <= 60"+String(i,"(%.0f)"))
/*
nn = bit depth
R = 1 is any RGB, else 0
C = number of components, 1=Y, 3=RGB or YUV, 4=RGBA or YUVA
P = Planar
Included Y8 etc, AVS say Y8 is both Planar and Interleaved, however as not interleaved with any other channel we say Planar only.
[Less complicated]
H = Horizontal subsampled, 0=not subsampled, 1=horizontal subsampling as for YV16, 2 as for YV411,
V = Vertical subsampled, 0=not subsampled, 1=vertical subsampling as for YV12
I = Implemented AVS version, 0=v2.58, 1=v2.60std,2=Avs+
*/
s = CSpace_Names(i) # nnRCPHVI
if (s== "YUY2") { d = "08030100" }
else if (s=="RGB24") { d = "08130000" }
else if (s=="RGB32") { d = "08140000" }
else if (s== "YV12") { d = "08031110" }
else if (s== "YV16") { d = "08031101" }
else if (s== "YV24") { d = "08031001" }
else if (s=="YV411") { d = "08031201" }
else if (s== "Y8") { d = "08011001" }

else if (s=="YUVA420") { d = "08041112" }
else if (s=="YUVA422") { d = "08041102" }
else if (s=="YUVA444") { d = "08041002" }
else if (s=="RGBP") { d = "08131002" }
else if (s=="RGBAP") { d = "08141002" }

else if (s== "Y10") { d = "10011002" }
else if (s== "YUV420P10") { d = "10031112" }
else if (s== "YUV422P10") { d = "10031102" }
else if (s== "YUV444P10") { d = "10031002" }
else if (s=="YUVA420P10") { d = "10041112" }
else if (s=="YUVA422P10") { d = "10041102" }
else if (s=="YUVA444P10") { d = "10041002" }
else if (s== "RGBP10") { d = "10131002" }
else if (s== "RGBAP10") { d = "10141002" }

else if (s== "Y12") { d = "12011002" }
else if (s== "YUV420P12") { d = "12031112" }
else if (s== "YUV422P12") { d = "12031102" }
else if (s== "YUV444P12") { d = "12031002" }
else if (s=="YUVA420P12") { d = "12041112" }
else if (s=="YUVA422P12") { d = "12041102" }
else if (s=="YUVA444P12") { d = "12041002" }
else if (s== "RGBP12") { d = "12131002" }
else if (s== "RGBAP12") { d = "12141002" }

else if (s== "Y14") { d = "14011002" }
else if (s== "YUV420P14") { d = "14031112" }
else if (s== "YUV422P14") { d = "14031102" }
else if (s== "YUV444P14") { d = "14031002" }
else if (s=="YUVA420P14") { d = "14041112" }
else if (s=="YUVA422P14") { d = "14041102" }
else if (s=="YUVA444P14") { d = "14041002" }
else if (s== "RGBP14") { d = "14131002" }
else if (s== "RGBAP14") { d = "14141002" }

else if (s== "Y16") { d = "16011002" }
else if (s== "YUV420P16") { d = "16031112" }
else if (s== "YUV422P16") { d = "16031102" }
else if (s== "YUV444P16") { d = "16031002" }
else if (s=="YUVA420P16") { d = "16041112" }
else if (s=="YUVA422P16") { d = "16041102" }
else if (s=="YUVA444P16") { d = "16041002" }
else if (s== "RGBP16") { d = "16131002" }
else if (s== "RGBAP16") { d = "16141002" }
else if (s== "RGB48") { d = "16130002" } # Interleaved
else if (s== "RGB64") { d = "16140002" } # Interleaved

else if (s== "Y32") { d = "32011002" }
else if (s== "YUV420PS") { d = "32031112" }
else if (s== "YUV422PS") { d = "32031102" }
else if (s== "YUV444PS") { d = "32031002" }
else if (s=="YUVA420PS") { d = "32041112" }
else if (s=="YUVA422PS") { d = "32041102" }
else if (s=="YUVA444PS") { d = "32041002" }
else if (s== "RGBPS") { d = "32131002" }
else if (s== "RGBAPS") { d = "32141002" }
return d
}

Function CSpace_fn(string d) {
s=""
c = d.LeftStr(2) d=d.MidStr(3)
s = "BPC=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " RGB=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " Chans=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " Planar=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " H-Sub=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " V-Sub=" + c
c = d.LeftStr(1) d=d.MidStr(2)
s = s + " AVS=" + (c=="0"?"v2.58":c=="1"?"v2.60Std":"Avs+ v3.70")
return s
}

BlankClip
SSS="""
n=current_frame
s=CSpace_Names(n)
d=(n>0) ? CSpace_Data(n) : "Nothing"
f=(n>0) ? CSpace_fn(d) : "Nothing"
RT_Subtitle("%s\nData=%s\nFn=%s",string(s),string(d),string(f))
"""
ScriptClip(SSS)

Still work in progress.

https://i.postimg.cc/8jH5tK9R/a-00.jpg (https://postimg.cc/8jH5tK9R)

Wonkey, you come up with a way to spec required colorspaces yet, we're counting on you as we're too stupid and not in the same class as you.

EDIT: I'm probably gonna do away with the CSpace_Names() as it stands, and do same with Int instead of name strings
[Name string in Select() evaluate each string for every name request, obviously a bit heavy on string use].
Will construct names based on flags in Select(int,int,int,int) etc.
Flags will give info on colorspace and also be used to construct the CS name.
When happy with above style script, will generate the CS int descriptor from those strings.

wonkey_monkey
6th April 2021, 23:28
How about a parameter bits, if you only want one bit depth (default of 0 means all bit depths). Then some booleans: rgb (RGB colour spaces only), yuv (YUV colour spaces only), alpha (include colourspaces with alpha)... it'll take a lot of logic to make sensible combinations, though.

My only other thought is a whitespace separated string of desired colourspaces, e.g. "YUV422P8 YUV444P16 RGB24 RGBP8" but that's probably nightmarish to decode with Avisynth scripting (if it can even be done) and to handle all variations of common colourspace names (e.g. YV12 = YUV420P8).

Maybe I should write a proper plugin.

StainlessS
6th April 2021, 23:31
Maybe I should write a proper plugin.
You really think you could do that :eek:

EDIT:
I dont like spec by names, way to tedious, however, when above script thing finished, would easily be able to
find CS data by scanning though each of the 60 available colorspaces.
Its all the AND and OR type way of speccing required list of colorspaces that I'm stuck with, not an easy task.
[I'm drawing a bit of a blank on how to do it in a few function args].

wonkey_monkey
6th April 2021, 23:33
Are you saying my plugins aren't proper? :sly:

StainlessS
6th April 2021, 23:38
NOPE, I was trying to screw with your head to try make you do it :)
[However, did not work at all with WaveForm_FilmStrip(), despite worming the idea into your head]
EDIT: In the case of WaveForm_FilmStrip(), script is all that is really necessary, plugin would not be
any great improvment in any respect, probably, just a lot of work for no real payback.

EDIT: Obviously to be able to do it properley, you would havta be able to spec just the colorspaces that a particular
filter supported, so it would have to be very flexible.

EDIT:
Maybe something like that RegEx stuff [forgot how it works],
[YUV*|RGB*][42*|444]P[10|12]
For [YUV or YUVA, or RGB, or RGBA], [420 or 422 or 444], [P10 or P12],
Trouble is writing docs on RegEx, entire books have been written about it. [also writing script/code would not be any picnic]
I would not know how to do that in either script nor C [although I'm sure that there is a big source bank on RegEx].

StainlessS
7th April 2021, 05:30
OK, here is latest stuff I've been playing with, several of the names are not the same, have you got to swap and change naming
convention depending upon which plugin you use ???,
hope to hell not, but we could provide some alternatives with some kind of Alt arg.

The string name thing is heavy on string usage as every string is evaluated at every Select(), this func is
only for comparison at the moment and will disappear.

Function CSpace_NameString(int "i") { # This is heavy on string usage. [every name is evaluated at every inquiry by Select()]
Default(i,0) # i=0, returns the number of Colorspace Monikers(names). Otherwise returns the colorspace Moniker with index i.
Assert(0 <= i <= 60,"CSpace_NameString: 0 <= i <= 60"+String(i,"(%.0f)"))
Return Select(i,60,
\ "YUY2","RGB24","RGB32","YV12","YV16","YV24","YV411","Y8","YUVA420","YUVA422","YUVA444","RGBP","RGBAP",
\ "Y10","YUV420P10","YUV422P10","YUV444P10","YUVA420P10","YUVA422P10","YUVA444P10","RGBP10","RGBAP10",
\ "Y12","YUV420P12","YUV422P12","YUV444P12","YUVA420P12","YUVA422P12","YUVA444P12","RGBP12","RGBAP12",
\ "Y14","YUV420P14","YUV422P14","YUV444P14","YUVA420P14","YUVA422P14","YUVA444P14","RGBP14","RGBAP14",
\ "Y16","YUV420P16","YUV422P16","YUV444P16","YUVA420P16","YUVA422P16","YUVA444P16","RGBP16","RGBAP16","RGB48","RGB64",
\ "Y32","YUV420PS" ,"YUV422PS" ,"YUV444PS" ,"YUVA420PS" ,"YUVA422PS" ,"YUVA444PS" ,"RGBPS" ,"RGBAPS")
}

Function CSpace_Info(int "i") {
Default(i,0) # i=0, returns the number of Colorspace Infos. Otherwise returns the colorspace Info for index i.
Assert(0 <= i <= 60,"CSpace_Info: 0 <= i <= 60"+String(i,"(%.0f)"))
# x:BITS ::: (msb) V:2 H:2 P:1 C:2 R:1 nn:3 I:2 (lsb)
Return Select(i,60,
\ $0240,$0060,$00A0,$0B40,$0341,$0141,$0541,$0101,$0B82,$0382,$0182,$0162,$01A2,
\ $0106,$0B46,$0346,$0146,$0B86,$0386,$0186,$0166,$01A6,
\ $010A,$0B4A,$034A,$014A,$0B8A,$038A,$018A,$016A,$01AA,
\ $010E,$0B4E,$034E,$014E,$0B8E,$038E,$018E,$016E,$01AE,
\ $0112,$0B52,$0352,$0152,$0B92,$0392,$0192,$0172,$01B2,$0072,$00B2,
\ $0116,$0B56,$0356,$0156,$0B96,$0396,$0196,$0176,$01B6
\ )
}

Function CSpace_Implemented(int i) { # 0=2.58, 1=2.60, 2=Avs+
Assert(1 <= i <= CSpace_Info(0),"CSpace_Implemented: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Return CSpace_Info(i).BitAnd(3)
}

Function CSpace_BPC(int i) { # BitsPerComponenet: 8, 10, 12, 14, 16, 32
Assert(1 <= i <= CSpace_Info(0),"CSpace_BPC: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Bits = CSpace_Info(i).BitRshifts(2).BitAnd(7) # 0=8, 1=10, 2=12, 3=14, 4=16, 5=32
Assert(0 <= Bits <= 5,"CSpace_BPC: 0 <= Bits <= 5"+String(Bits,"(%.0f)") )
Return Bits==0?8:Bits==1?10:Bits==2?12:Bits==3?14:Bits==4?16:32
}

Function CSpace_RGB(int i) { # False=Not RGB, ie something with Y, True=Some Kind of RGB.
Assert(1 <= i <= CSpace_Info(0),"CSpace_RGB: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Return CSpace_Info(i).BitRshifts(5).BitAnd(1) != 0
}

Function CSpace_Components(int i) { # Number of Channels: 1(Y Only), 3 or 4
Assert(1 <= i <= CSpace_Info(0),"CSpace_Components: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Bits = CSpace_Info(i).BitRshifts(6).BitAnd(3) # 0=1, 1=3, 2=4
Assert(0 <= Bits <= 2,"CSpace_Components: 0 <= Bits <= 2"+String(Bits,"(%.0f)") )
Return Bits==0?1:Bits==1?3:4
}

Function CSpace_Planar(int i) { # False=Not Planar(Interleaved excluding Y only), True=Planar
Assert(1 <= i <= CSpace_Info(0),"CSpace_Planar: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Return CSpace_Info(i).BitRshifts(8).BitAnd(1) != 0
}

Function CSpace_HSubS(int i) { # Horizontal SubSampling. 0=Not Subsampled, 1=U+V twice as wide as Y, 2=U+V 4 times wider than Y
Assert(1 <= i <= CSpace_Info(0),"CSpace_HSubS: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Bits = CSpace_Info(i).BitRshifts(9).BitAnd(3) # 0=1, 1=2, 2=4, ie 2 ^ bits
Assert(0 <= Bits <= 2,"CSpace_HSubS: 0 <= Bits <= 2"+String(Bits,"(%.0f)") )
Return Bits
}

Function CSpace_VSubS(int i) { # Vertical SubSampling. 0=Not Subsampled, 1=U+V twice as tall as Y
Assert(1 <= i <= CSpace_Info(0),"CSpace_HSubS: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Bits = CSpace_Info(i).BitRshifts(11).BitAnd(3) # 0=1, 1=2, ie 2 ^ bits
Assert(0 <= Bits <= 2,"CSpace_VSubS: 0 <= Bits <= 1"+String(Bits,"(%.0f)") )
Return Bits
}

Function CSpace_Name(int "i") { # Lighter on String usage
Assert(1 <= i <= CSpace_Info(0),"CSpace_Name: 1 <= i <= CSpace_Info(0)" + string(i,"(%.0f)") )
Implemented=CSpace_Implemented(i) rgb=CSpace_RGB(i) Chans=CSpace_Components(i) Planar=CSpace_Planar(i)
if(Implemented==0) { Result = Planar?"YV12":!RGB?"YUY2":Chans==3?"RGB24":"RGB32" }
else {
HSubS = CSpace_HSubS(i) VSubS = CSpace_VSubS(i)
if(Implemented==1) { Result = Chans==1?"Y8":HSubs==0?"YV24":HSubS==1?"YV16":"YV411" }
else if(!Planar) { Result = Chans==3?"RGB48":"RGB64" }
else {
bpc=CSpace_BPC(i)
if(Chans==1) { Result="Y" }
else if(RGB) { Result=Chans==3?"RGB":"RGBA"}
else { Result= (Chans==3?"YUV":"YUVA") + (VSubS==1?"420":HSubS==1?"422":"444") }
Result = Result + (Chans==1?String(bpc):bpc==32?"PS":"P"+ String(bpc))
}
}
Return Result
}

CS_Count = CSpace_Info(0)
For(i=1,CS_Count) {
S1 = CSpace_NameString(i) # Name from String Select()
S2 = CSpace_Name(i) # Name from Int Select Infos
RT_DebugF("%d] %16s %16s : %s",i,S1,S2,S1==S2?"SAME":"NOT SAME")
}
BlankClip


Output

00000112 05:08:19 [680] RT_DebugF: 1] YUY2 YUY2 : SAME
00000113 05:08:19 [680] RT_DebugF: 2] RGB24 RGB24 : SAME
00000114 05:08:19 [680] RT_DebugF: 3] RGB32 RGB32 : SAME
00000115 05:08:19 [680] RT_DebugF: 4] YV12 YV12 : SAME
00000116 05:08:19 [680] RT_DebugF: 5] YV16 YV16 : SAME
00000117 05:08:19 [680] RT_DebugF: 6] YV24 YV24 : SAME
00000118 05:08:19 [680] RT_DebugF: 7] YV411 YV411 : SAME
00000119 05:08:19 [680] RT_DebugF: 8] Y8 Y8 : SAME
00000120 05:08:19 [680] RT_DebugF: 9] YUVA420 YUVA420P8 : NOT SAME
00000121 05:08:19 [680] RT_DebugF: 10] YUVA422 YUVA422P8 : NOT SAME
00000122 05:08:19 [680] RT_DebugF: 11] YUVA444 YUVA444P8 : NOT SAME
00000123 05:08:19 [680] RT_DebugF: 12] RGBP RGBP8 : NOT SAME
00000124 05:08:19 [680] RT_DebugF: 13] RGBAP RGBAP8 : NOT SAME
00000125 05:08:19 [680] RT_DebugF: 14] Y10 Y10 : SAME
00000126 05:08:19 [680] RT_DebugF: 15] YUV420P10 YUV420P10 : SAME
00000127 05:08:19 [680] RT_DebugF: 16] YUV422P10 YUV422P10 : SAME
00000128 05:08:19 [680] RT_DebugF: 17] YUV444P10 YUV444P10 : SAME
00000129 05:08:19 [680] RT_DebugF: 18] YUVA420P10 YUVA420P10 : SAME
00000130 05:08:19 [680] RT_DebugF: 19] YUVA422P10 YUVA422P10 : SAME
00000131 05:08:19 [680] RT_DebugF: 20] YUVA444P10 YUVA444P10 : SAME
00000132 05:08:19 [680] RT_DebugF: 21] RGBP10 RGBP10 : SAME
00000133 05:08:19 [680] RT_DebugF: 22] RGBAP10 RGBAP10 : SAME
00000134 05:08:19 [680] RT_DebugF: 23] Y12 Y12 : SAME
00000135 05:08:19 [680] RT_DebugF: 24] YUV420P12 YUV420P12 : SAME
00000136 05:08:19 [680] RT_DebugF: 25] YUV422P12 YUV422P12 : SAME
00000137 05:08:19 [680] RT_DebugF: 26] YUV444P12 YUV444P12 : SAME
00000138 05:08:19 [680] RT_DebugF: 27] YUVA420P12 YUVA420P12 : SAME
00000139 05:08:19 [680] RT_DebugF: 28] YUVA422P12 YUVA422P12 : SAME
00000140 05:08:19 [680] RT_DebugF: 29] YUVA444P12 YUVA444P12 : SAME
00000141 05:08:19 [680] RT_DebugF: 30] RGBP12 RGBP12 : SAME
00000142 05:08:19 [680] RT_DebugF: 31] RGBAP12 RGBAP12 : SAME
00000143 05:08:19 [680] RT_DebugF: 32] Y14 Y14 : SAME
00000144 05:08:19 [680] RT_DebugF: 33] YUV420P14 YUV420P14 : SAME
00000145 05:08:19 [680] RT_DebugF: 34] YUV422P14 YUV422P14 : SAME
00000146 05:08:19 [680] RT_DebugF: 35] YUV444P14 YUV444P14 : SAME
00000147 05:08:19 [680] RT_DebugF: 36] YUVA420P14 YUVA420P14 : SAME
00000148 05:08:19 [680] RT_DebugF: 37] YUVA422P14 YUVA422P14 : SAME
00000149 05:08:19 [680] RT_DebugF: 38] YUVA444P14 YUVA444P14 : SAME
00000150 05:08:19 [680] RT_DebugF: 39] RGBP14 RGBP14 : SAME
00000151 05:08:19 [680] RT_DebugF: 40] RGBAP14 RGBAP14 : SAME
00000152 05:08:19 [680] RT_DebugF: 41] Y16 Y16 : SAME
00000153 05:08:19 [680] RT_DebugF: 42] YUV420P16 YUV420P16 : SAME
00000154 05:08:19 [680] RT_DebugF: 43] YUV422P16 YUV422P16 : SAME
00000155 05:08:19 [680] RT_DebugF: 44] YUV444P16 YUV444P16 : SAME
00000156 05:08:19 [680] RT_DebugF: 45] YUVA420P16 YUVA420P16 : SAME
00000157 05:08:19 [680] RT_DebugF: 46] YUVA422P16 YUVA422P16 : SAME
00000158 05:08:19 [680] RT_DebugF: 47] YUVA444P16 YUVA444P16 : SAME
00000159 05:08:19 [680] RT_DebugF: 48] RGBP16 RGBP16 : SAME
00000160 05:08:19 [680] RT_DebugF: 49] RGBAP16 RGBAP16 : SAME
00000161 05:08:19 [680] RT_DebugF: 50] RGB48 RGB48 : SAME
00000162 05:08:19 [680] RT_DebugF: 51] RGB64 RGB64 : SAME
00000163 05:08:19 [680] RT_DebugF: 52] Y32 Y32 : SAME
00000164 05:08:19 [680] RT_DebugF: 53] YUV420PS YUV420PS : SAME
00000165 05:08:19 [680] RT_DebugF: 54] YUV422PS YUV422PS : SAME
00000166 05:08:19 [680] RT_DebugF: 55] YUV444PS YUV444PS : SAME
00000167 05:08:19 [680] RT_DebugF: 56] YUVA420PS YUVA420PS : SAME
00000168 05:08:19 [680] RT_DebugF: 57] YUVA422PS YUVA422PS : SAME
00000169 05:08:19 [680] RT_DebugF: 58] YUVA444PS YUVA444PS : SAME
00000170 05:08:19 [680] RT_DebugF: 59] RGBPS RGBPS : SAME
00000171 05:08:19 [680] RT_DebugF: 60] RGBAPS RGBAPS : SAME


Which name version is prefereable and is alt necessary.
Using the other funcs, you can inquire the properties of a colorspace name [without a clip].

StainlessS
8th April 2021, 04:09
Wonkey, maybe this gives you some ideas.

ColorSpaceInfo.Avs

#####################
# ColorSpaceInfo.Avs, v0.0. (c) StainlessS @ Doom9. https://forum.doom9.org/showthread.php?p=1940347#post1940347
# Req:- Avs+, OR v2.60 Std if GScript installed and Wrapped in GSCRIPT(""" ... """).
#####################
# Private Internal: CSpace_Info_LOW(int i,int Item)
# Returns Info for colorspace index i.
# Item, Selects the Info to return, 0=Full Info, 1=I, 2=nn, 3=R, 4=C, 5=P, 6=H, 7=V
# All return Info are returned as Int, [where appropriate 0=False, 1=True]
#####################
Function CSpace_Info_LOW(int i,int Item) {
Function CSpace_ItemName(int Item) { # 0="Info", 1="Implemented", 2="BPC", 3="RGB", 4="Components", 5="Planar", 6="HSubS", 7="VSubS". 8="Dupe"
Return (Item==0?"Info":Item==1?"Implemented":Item==2?"BPC":Item==3?"RGB": Item==4
\ ?"Components":Item==5?"Planar":Item==6?"HSubS":Item==7?"VSubS":"Dupe") }
nItems=8 Assert(0 <= item <= nItems,"CSpace_Info_LOW: 0 <= Item"+String(Item,"{%.0f}")+" <= "+ String(nItems,"%.0f"))
nInfos=60 Assert(1 <= i <= nInfos,"CSpace_Info_LOW:"+CSpace_ItemName(Item)+": 1 <= i"+String(i,"{%.0f}") + " <= CSpace_Count()"+String(nInfos,"{%.0f}"))
Info = Select(i-1,
\ $0240,$0060,$00A0,$8B40,$8341,$8141,$8541,$0101,$8B82,$8382,$8182,$8162,$81A2, [* 8 bit *]
\ $0106,$0B46,$0346,$0146,$0B86,$0386,$0186,$0166,$01A6, [* 10 bit *]
\ $010A,$0B4A,$034A,$014A,$0B8A,$038A,$018A,$016A,$01AA, [* 12 bit *]
\ $010E,$0B4E,$034E,$014E,$0B8E,$038E,$018E,$016E,$01AE, [* 14 bit *]
\ $0112,$0B52,$0352,$0152,$0B92,$0392,$0192,$0172,$01B2,$0072,$00B2, [* 16 bit *]
\ $0116,$0B56,$0356,$0156,$0B96,$0396,$0196,$0176,$01B6) [* 32 bit *]
if(item>0) { # x:BITS ::: (msb) D:15:1 ... V:11:2 H:9:2 P:8:1 C:6:2 R:5:1 nn:2:3 I:0:2 (lsb) :: Name:BitOffset:Numbits
Shift=Select(Item-1, 0,2,5,6,8,9,11,15) And=Select(Item-1, 3,7,1,3,1,3,3,1) mx=Select(Item-1, 2,5,1,2,1,2,2,1)
Info=Info.BitRshifts(Shift).BitAnd(And)
Assert(0 <= Info <= mx,"CSpace_Info_LOW:"+CSpace_ItemName(Item)+":InternalError: 0 <= Info"+String(Info,"{%.0f}")+" <= "+String(mx) )
}
Return Info
}

#####################
# Public Use:
# Various CSpace Info functions, returning info about a colorspace name string as returned by CSpace_Name(i).
#####################
Function CSpace_Count() { Return 60 } # Returns count of Colorspace Infos. [ 1 to CSpace_Count() ]
Function CSpace_Info(int i) { Return CSpace_Info_LOW(i,0)} # Colorspace Full Info (int) for index i.
Function CSpace_Implemented(int i) { Return CSpace_Info_LOW(i,1)} # AVS version where CS was implemented. 0=2.58, 1=2.60, 2=Avs+
Function CSpace_Bpc(int i) { Return Select(CSpace_Info_LOW(i,2),8,10,12,14,16,32)} # BitsPerComponenet, ie Bit Depth. 8,10,12,14,16,32
Function CSpace_RGB(int i) { Return CSpace_Info_LOW(i,3)!=0} # False=Not RGB, ie something with Y, True=Some Kind of RGB.
Function CSpace_Components(int i) { Return Select(CSpace_Info_LOW(i,4),1,3,4)} # Number of Channels: 1(Y Only), 3 or 4(with Alpha)
Function CSpace_Planar(int i) { Return CSpace_Info_LOW(i,5)!=0} # False=Not Planar(Interleaved excluding single plane Y), True=Planar
Function CSpace_HSubS(int i) { Return CSpace_Info_LOW(i,6)} # Horiz SubSampling. 0=None, 1=U&V pixel 2x wider than Y, 2=U&V 4x wider than Y
Function CSpace_VSubS(int i) { Return CSpace_Info_LOW(i,7)} # Vertical SubSampling. 0=None, 1=U&V pixel 2x taller than Y pixel.
Function CSpace_Dupe(int i) { Return CSpace_Info_LOW(i,8)!=0} # True, Has Duplicate Colorspace names

Function CSpace_Name(int i,Int "Alt") {
/* i, Index number of ColorSpace to return name of as String [Range 1 -> CSpace_Count()].
Alt, Default 0, [0->3] controls the returned format of certain 8 BIT ColorSpace strings, eg.
Alt=0 Alt=1 Alt=2 Alt=3
YV12 YV12 YUV420 YUV420P8
RGBP RGBP8 RGBP RGBP8
YUVA444 YUVA444P8 YUVA444 YUVA444P8 */
Alt=Default(Alt,0)
Assert(1 <= i <= CSpace_Count(),"CSpace_Name: 1 <= i"+string(i,"(%.0f)")+" <= CSpace_Count()"+string(CSpace_Count(),"(%.0f)"))
Assert(0 <= Alt <= 3,"CSpace_Name: 1 <= Alt"+string(Alt,"(%.0f) <= 3)"))
Implemented=CSpace_Implemented(i) Rgb=CSpace_RGB(i) Chans=CSpace_Components(i)
if(!CSpace_Planar(i)) { Result=!RGB?"YUY2": Implemented==0?(Chans==3?"RGB24":"RGB32"):(Chans==3?"RGB48":"RGB64") }
else if(Implemented==0 && Alt<=1) { Result = "YV12"}
else { HSubS=CSpace_HSubS(i) VSubS=CSpace_VSubS(i)
if(Implemented==1 && (Alt<=1)) { Result = Chans==1?"Y8":HSubs==0?"YV24":HSubS==1?"YV16":"YV411" }
else { Bpc=CSpace_BPC(i)
if(RGB) { Result=(Chans==3?"RGBP":"RGBAP") + (Bpc==8 && Alt%2==0?"":Bpc==32?"S":String(Bpc)) }
else { Result=Chans==1 ? ("Y"+String(bpc)) : ((Chans==3?"YUV":"YUVA")+(VSubS==1?"420":HSubS==1?"422":HSubS==0?"444":"411"))
\ + (Bpc==32?"PS":Bpc==8&&Alt%2==0?"":"P"+String(Bpc))
}
}
}
Return Result
}

Function CSpace_FindIndex(String CsName) { # Return Index number of Colorspace name CsName, 1 -> CSpace_Count() : 0 == Not Found.
cs=CsName.UCase c1=Cs.LeftStr(1) bRGB=Cs.LeftStr(3)=="RGB"
Assert(c1!=""&&(bRGB||c1=="Y"),"CSpace_Find: CS must have Colorspace name{'"+CsName+"'}")
Result=cs=="YUY2"?1:cs=="RGB24"?2:cs=="RGB32"?3:cs=="RGB48"?50:cs=="RGB64"?51:(cs=="YV411"||cs=="YUV411"||cs=="YUV411P8")?7:0
if(Result==0) { # Only Planar to search, 420, 422 or 444, RGB, with or without Alpha, or Y only.
bpc=8 c2=cs.MidStr(2,1) pIx=cs.FindStr("P")
pix=(!bRGB && pIx==0) ? (c2>="0"&&c2<="9"?2:0) : pIx + 1
if(pIx>0) { ps=cs.MidStr(pIx) bpc=ps==""?8:ps=="S"?32:ps.Value.Int bpc=bpc==0?8:bpc }
bAlpha=cs.FindStr("A")!=0
Chans = (bRGB ? 3 : 1 + (cs.Findstr("U")>0||cs.Findstr("V")>0?2:0) ) + (bAlpha?1:0)
Count = CSpace_Count()
for(i=1,Count) { csbpc = CSpace_Bpc(i)
if(bpc < csbpc) { i=count } # Escape, this and subsequenct CS's are deeper than we are looking for.
else if(csbpc==bpc && CSpace_Planar(i) && (CSpace_RGB(i)==bRGB && CSpace_Components(i)==Chans)) {
jMax = CSpace_Dupe(i) ? 3 : 0
for(j=0,jMax) { if(CSpace_Name(i,j) == cs) { Result=i j=jMax i=count } }
}
}
}
Return Result
}

Updated

Client,

# ColorSpaceInfo_Testing_123.avs
blankClip
RT_WriteFile(".\Strings.txt","%60s\n\n","ColorSpaceInfo_Testing_123")
RT_WriteFile(".\Strings.txt"," %10s %10s %10s %10s : "
\ + "%4s %6s %6s %6s %6s %6s %6s %6s %6s",
\ + "Alt=0","Alt=1","Alt=2","Alt=3","Full","Imp","Bpc","RGB","Chans","Planar","HSubS","VSubS","Dupe",Append=True)
RT_WriteFile(".\Strings.txt",FillStr(114,"-"),Append=True)
For(i=1,CSpace_Count()) {
S1 = CSpace_Name(i,0)
S2 = CSpace_Name(i,1)
S3 = CSpace_Name(i,2)
S4 = CSpace_Name(i,3)
Full = CSpace_Info(i)
Imp = CSpace_Implemented(i) Imp=Imp==0?"v2.58":Imp==1?"v2.60":"Avs+"
Bpc = CSpace_Bpc(i)
RGB = CSpace_RGB(i)
Chans = CSpace_Components(i)
Planar= CSpace_Planar(i)
HSubS = CSpace_HSubS(i)
VSubS = CSpace_VSubS(i)
Dupe = CSpace_Dupe(i)
RT_WriteFile(".\Strings.txt","%2d] %10s %10s %10s %10s : "
\ + "$%04X %6s %6d %6s %6d %6s %6d %6d %6s",i,S1,S2,S3,S4,Full,Imp,Bpc,RGB,Chans,Planar,HSubS,VSubS,Dupe,Append=True)
}
Return Last


Client Result

ColorSpaceInfo_Testing_123

Alt=0 Alt=1 Alt=2 Alt=3 : Full Imp Bpc RGB Chans Planar HSubS VSubS Dupe
------------------------------------------------------------------------------------------------------------------
1] YUY2 YUY2 YUY2 YUY2 : $0240 v2.58 8 False 3 False 1 0 False
2] RGB24 RGB24 RGB24 RGB24 : $0060 v2.58 8 True 3 False 0 0 False
3] RGB32 RGB32 RGB32 RGB32 : $00A0 v2.58 8 True 4 False 0 0 False
4] YV12 YV12 YUV420 YUV420P8 : $8B40 v2.58 8 False 3 True 1 1 True
5] YV16 YV16 YUV422 YUV422P8 : $8341 v2.60 8 False 3 True 1 0 True
6] YV24 YV24 YUV444 YUV444P8 : $8141 v2.60 8 False 3 True 0 0 True
7] YV411 YV411 YUV411 YUV411P8 : $8541 v2.60 8 False 3 True 2 0 True
8] Y8 Y8 Y8 Y8 : $0101 v2.60 8 False 1 True 0 0 False
9] YUVA420 YUVA420P8 YUVA420 YUVA420P8 : $8B82 Avs+ 8 False 4 True 1 1 True
10] YUVA422 YUVA422P8 YUVA422 YUVA422P8 : $8382 Avs+ 8 False 4 True 1 0 True
11] YUVA444 YUVA444P8 YUVA444 YUVA444P8 : $8182 Avs+ 8 False 4 True 0 0 True
12] RGBP RGBP8 RGBP RGBP8 : $8162 Avs+ 8 True 3 True 0 0 True
13] RGBAP RGBAP8 RGBAP RGBAP8 : $81A2 Avs+ 8 True 4 True 0 0 True
14] Y10 Y10 Y10 Y10 : $0106 Avs+ 10 False 1 True 0 0 False
15] YUV420P10 YUV420P10 YUV420P10 YUV420P10 : $0B46 Avs+ 10 False 3 True 1 1 False
16] YUV422P10 YUV422P10 YUV422P10 YUV422P10 : $0346 Avs+ 10 False 3 True 1 0 False
17] YUV444P10 YUV444P10 YUV444P10 YUV444P10 : $0146 Avs+ 10 False 3 True 0 0 False
18] YUVA420P10 YUVA420P10 YUVA420P10 YUVA420P10 : $0B86 Avs+ 10 False 4 True 1 1 False
19] YUVA422P10 YUVA422P10 YUVA422P10 YUVA422P10 : $0386 Avs+ 10 False 4 True 1 0 False
20] YUVA444P10 YUVA444P10 YUVA444P10 YUVA444P10 : $0186 Avs+ 10 False 4 True 0 0 False
21] RGBP10 RGBP10 RGBP10 RGBP10 : $0166 Avs+ 10 True 3 True 0 0 False
22] RGBAP10 RGBAP10 RGBAP10 RGBAP10 : $01A6 Avs+ 10 True 4 True 0 0 False
23] Y12 Y12 Y12 Y12 : $010A Avs+ 12 False 1 True 0 0 False
24] YUV420P12 YUV420P12 YUV420P12 YUV420P12 : $0B4A Avs+ 12 False 3 True 1 1 False
25] YUV422P12 YUV422P12 YUV422P12 YUV422P12 : $034A Avs+ 12 False 3 True 1 0 False
26] YUV444P12 YUV444P12 YUV444P12 YUV444P12 : $014A Avs+ 12 False 3 True 0 0 False
27] YUVA420P12 YUVA420P12 YUVA420P12 YUVA420P12 : $0B8A Avs+ 12 False 4 True 1 1 False
28] YUVA422P12 YUVA422P12 YUVA422P12 YUVA422P12 : $038A Avs+ 12 False 4 True 1 0 False
29] YUVA444P12 YUVA444P12 YUVA444P12 YUVA444P12 : $018A Avs+ 12 False 4 True 0 0 False
30] RGBP12 RGBP12 RGBP12 RGBP12 : $016A Avs+ 12 True 3 True 0 0 False
31] RGBAP12 RGBAP12 RGBAP12 RGBAP12 : $01AA Avs+ 12 True 4 True 0 0 False
32] Y14 Y14 Y14 Y14 : $010E Avs+ 14 False 1 True 0 0 False
33] YUV420P14 YUV420P14 YUV420P14 YUV420P14 : $0B4E Avs+ 14 False 3 True 1 1 False
34] YUV422P14 YUV422P14 YUV422P14 YUV422P14 : $034E Avs+ 14 False 3 True 1 0 False
35] YUV444P14 YUV444P14 YUV444P14 YUV444P14 : $014E Avs+ 14 False 3 True 0 0 False
36] YUVA420P14 YUVA420P14 YUVA420P14 YUVA420P14 : $0B8E Avs+ 14 False 4 True 1 1 False
37] YUVA422P14 YUVA422P14 YUVA422P14 YUVA422P14 : $038E Avs+ 14 False 4 True 1 0 False
38] YUVA444P14 YUVA444P14 YUVA444P14 YUVA444P14 : $018E Avs+ 14 False 4 True 0 0 False
39] RGBP14 RGBP14 RGBP14 RGBP14 : $016E Avs+ 14 True 3 True 0 0 False
40] RGBAP14 RGBAP14 RGBAP14 RGBAP14 : $01AE Avs+ 14 True 4 True 0 0 False
41] Y16 Y16 Y16 Y16 : $0112 Avs+ 16 False 1 True 0 0 False
42] YUV420P16 YUV420P16 YUV420P16 YUV420P16 : $0B52 Avs+ 16 False 3 True 1 1 False
43] YUV422P16 YUV422P16 YUV422P16 YUV422P16 : $0352 Avs+ 16 False 3 True 1 0 False
44] YUV444P16 YUV444P16 YUV444P16 YUV444P16 : $0152 Avs+ 16 False 3 True 0 0 False
45] YUVA420P16 YUVA420P16 YUVA420P16 YUVA420P16 : $0B92 Avs+ 16 False 4 True 1 1 False
46] YUVA422P16 YUVA422P16 YUVA422P16 YUVA422P16 : $0392 Avs+ 16 False 4 True 1 0 False
47] YUVA444P16 YUVA444P16 YUVA444P16 YUVA444P16 : $0192 Avs+ 16 False 4 True 0 0 False
48] RGBP16 RGBP16 RGBP16 RGBP16 : $0172 Avs+ 16 True 3 True 0 0 False
49] RGBAP16 RGBAP16 RGBAP16 RGBAP16 : $01B2 Avs+ 16 True 4 True 0 0 False
50] RGB48 RGB48 RGB48 RGB48 : $0072 Avs+ 16 True 3 False 0 0 False
51] RGB64 RGB64 RGB64 RGB64 : $00B2 Avs+ 16 True 4 False 0 0 False
52] Y32 Y32 Y32 Y32 : $0116 Avs+ 32 False 1 True 0 0 False
53] YUV420PS YUV420PS YUV420PS YUV420PS : $0B56 Avs+ 32 False 3 True 1 1 False
54] YUV422PS YUV422PS YUV422PS YUV422PS : $0356 Avs+ 32 False 3 True 1 0 False
55] YUV444PS YUV444PS YUV444PS YUV444PS : $0156 Avs+ 32 False 3 True 0 0 False
56] YUVA420PS YUVA420PS YUVA420PS YUVA420PS : $0B96 Avs+ 32 False 4 True 1 1 False
57] YUVA422PS YUVA422PS YUVA422PS YUVA422PS : $0396 Avs+ 32 False 4 True 1 0 False
58] YUVA444PS YUVA444PS YUVA444PS YUVA444PS : $0196 Avs+ 32 False 4 True 0 0 False
59] RGBPS RGBPS RGBPS RGBPS : $0176 Avs+ 32 True 3 True 0 0 False
60] RGBAPS RGBAPS RGBAPS RGBAPS : $01B6 Avs+ 32 True 4 True 0 0 False

StainlessS
8th April 2021, 18:55
Above post script all updated,
Added function

CSpace_FindIndex(String CsName) # Return Index number of Colorspace name CsName, 1 -> CSpace_Count() : 0 == Not Found.

Added data item "Dupe" to infos, where True, colorspace name has duplicates. [or rather alternatives, ie duplicate index for alternative CS name].

Below no longer fits on prev post.

Just the dupes [has alternative names]

ColorSpaceInfo_Testing_123

Alt=0 Alt=1 Alt=2 Alt=3 : Full Imp Bpc RGB Chans Planar HSubS VSubS Dupe
------------------------------------------------------------------------------------------------------------------
4] YV12 YV12 YUV420 YUV420P8 : $8B40 v2.58 8 False 3 True 1 1 True
5] YV16 YV16 YUV422 YUV422P8 : $8341 v2.60 8 False 3 True 1 0 True
6] YV24 YV24 YUV444 YUV444P8 : $8141 v2.60 8 False 3 True 0 0 True
7] YV411 YV411 YUV411 YUV411P8 : $8541 v2.60 8 False 3 True 2 0 True
9] YUVA420 YUVA420P8 YUVA420 YUVA420P8 : $8B82 Avs+ 8 False 4 True 1 1 True
10] YUVA422 YUVA422P8 YUVA422 YUVA422P8 : $8382 Avs+ 8 False 4 True 1 0 True
11] YUVA444 YUVA444P8 YUVA444 YUVA444P8 : $8182 Avs+ 8 False 4 True 0 0 True
12] RGBP RGBP8 RGBP RGBP8 : $8162 Avs+ 8 True 3 True 0 0 True
13] RGBAP RGBAP8 RGBAP RGBAP8 : $81A2 Avs+ 8 True 4 True 0 0 True

StainlessS
8th April 2021, 21:58
OOOps, post #15 update, I broke new CSpace_FindIndex() with last minute tinker before posting, fixed.
[Moral of the story, if it aint broke, dont fix it]

Checking script for that function. Just prints number of errors on clip [should be 0].

# Check_FindIndex.avs
blankClip
Count=CSpace_Count()
ERRORS=0
for(j=0,3) {
for(i=1,Count) {
s=CSpace_Name(i,j)
ix=CSpace_Findindex(s)
ERRORS= ix!=i ? ERRORS+1 : ERRORS
}
}
RT_Subtitle("ERRORS=%d",ERRORS)
Return last