Colorspace property
From Avisynth wiki
(Difference between revisions)
(3 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | In AviSynth v2. | + | In AviSynth v2.60, the colorspace properties are: |
− | + | // Colorspace properties. | |
− | + | enum { | |
− | + | CS_BGR = 1<<28, | |
− | + | CS_YUV = 1<<29, | |
− | + | CS_INTERLEAVED = 1<<30, | |
− | + | CS_PLANAR = 1<<31, | |
− | + | ||
− | // Specific colorformats | + | // where CS_Shift_Sub_Width = 0, CS_Shift_Sub_Height = 8 and CS_Shift_Sample_Bits = 16 |
− | + | CS_Sub_Width_1 = 3 << CS_Shift_Sub_Width, // YV24 | |
− | + | CS_Sub_Width_2 = 0 << CS_Shift_Sub_Width, // YV12, I420, YV16 | |
− | + | CS_Sub_Width_4 = 1 << CS_Shift_Sub_Width, // YUV9, YV411 | |
− | + | ||
− | + | CS_Sub_Height_1 = 3 << CS_Shift_Sub_Height, // YV16, YV24, YV411 | |
− | + | CS_Sub_Height_2 = 0 << CS_Shift_Sub_Height, // YV12, I420 | |
− | + | CS_Sub_Height_4 = 1 << CS_Shift_Sub_Height, // YUV9 | |
− | }; | + | |
+ | CS_Sample_Bits_8 = 0 << CS_Shift_Sample_Bits, | ||
+ | CS_Sample_Bits_16 = 1 << CS_Shift_Sample_Bits, | ||
+ | CS_Sample_Bits_32 = 2 << CS_Shift_Sample_Bits, | ||
+ | }; | ||
+ | |||
+ | // Specific colorformats (where CS_VPlaneFirst = 1<<3 and CS_UPlaneFirst = 1<<4) | ||
+ | enum { | ||
+ | CS_UNKNOWN = 0, | ||
+ | CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED, | ||
+ | CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED, | ||
+ | CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, | ||
+ | CS_RAW32 = 1<<5 | CS_INTERLEAVED, | ||
+ | CS_YV24 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // YUV 4:4:4 planar | ||
+ | CS_YV16 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // YUV 4:2:2 planar | ||
+ | CS_YV12 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // y-v-u, 4:2:0 planar | ||
+ | CS_I420 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // y-u-v, 4:2:0 planar | ||
+ | CS_IYUV = CS_I420, | ||
+ | CS_YUV9 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4, // YUV 4:1:0 planar | ||
+ | CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4, // YUV 4:1:1 planar | ||
+ | CS_Y8 = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_Sample_Bits_8, // Y 4:0:0 planar | ||
+ | }; | ||
− | Thus CS_YV12 gives for example | + | Thus CS_YV12 gives for example: |
− | + | CS_YV12 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2 | |
− | + | = 1<<31 | 1<<29 | 0<<16 | 1<<3 | 0<<8 | 0<<0 | |
− | + | = 1010.0000.0000.0000.0000.1000 | |
Back to [[Filter_SDK/VideoInfo|VideoInfo]]. | Back to [[Filter_SDK/VideoInfo|VideoInfo]]. | ||
[[Category:FilterSDK]] | [[Category:FilterSDK]] |
Latest revision as of 00:12, 21 December 2014
In AviSynth v2.60, the colorspace properties are:
// Colorspace properties. enum { CS_BGR = 1<<28, CS_YUV = 1<<29, CS_INTERLEAVED = 1<<30, CS_PLANAR = 1<<31, // where CS_Shift_Sub_Width = 0, CS_Shift_Sub_Height = 8 and CS_Shift_Sample_Bits = 16 CS_Sub_Width_1 = 3 << CS_Shift_Sub_Width, // YV24 CS_Sub_Width_2 = 0 << CS_Shift_Sub_Width, // YV12, I420, YV16 CS_Sub_Width_4 = 1 << CS_Shift_Sub_Width, // YUV9, YV411 CS_Sub_Height_1 = 3 << CS_Shift_Sub_Height, // YV16, YV24, YV411 CS_Sub_Height_2 = 0 << CS_Shift_Sub_Height, // YV12, I420 CS_Sub_Height_4 = 1 << CS_Shift_Sub_Height, // YUV9 CS_Sample_Bits_8 = 0 << CS_Shift_Sample_Bits, CS_Sample_Bits_16 = 1 << CS_Shift_Sample_Bits, CS_Sample_Bits_32 = 2 << CS_Shift_Sample_Bits, }; // Specific colorformats (where CS_VPlaneFirst = 1<<3 and CS_UPlaneFirst = 1<<4) enum { CS_UNKNOWN = 0, CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED, CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED, CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, CS_RAW32 = 1<<5 | CS_INTERLEAVED, CS_YV24 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1, // YUV 4:4:4 planar CS_YV16 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2, // YUV 4:2:2 planar CS_YV12 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // y-v-u, 4:2:0 planar CS_I420 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2, // y-u-v, 4:2:0 planar CS_IYUV = CS_I420, CS_YUV9 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4, // YUV 4:1:0 planar CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4, // YUV 4:1:1 planar CS_Y8 = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_Sample_Bits_8, // Y 4:0:0 planar };
Thus CS_YV12 gives for example:
CS_YV12 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2 = 1<<31 | 1<<29 | 0<<16 | 1<<3 | 0<<8 | 0<<0 = 1010.0000.0000.0000.0000.1000
Back to VideoInfo.