2 # cl.h - Compression Library typedefs and prototypes
4 # 01/07/92 Cleanup by Brian Knittel
5 # 02/18/92 Original Version by Brian Knittel
9 # originalFormat parameter values
11 MAX_NUMBER_OF_ORIGINAL_FORMATS
= 32
15 STEREO_INTERLEAVED
= 1
18 # YUV is defined to be the same thing as YCrCb (luma and two chroma components).
19 # 422 is appended to YUV (or YCrCb) if the chroma is sub-sampled by 2
20 # horizontally, packed as U Y1 V Y2 (byte order).
21 # 422HC is appended to YUV (or YCrCb) if the chroma is sub-sampled by 2
22 # vertically in addition to horizontally, and is packed the same as
23 # 422 except that U & V are not valid on the second line.
34 YUV422
= 6 # 4:2:2 sampling
35 YCbCr422
= 6 # 4:2:2 sampling
36 YUV422HC
= 7 # 4:1:1 sampling
37 YCbCr422HC
= 7 # 4:1:1 sampling
38 YUV422DC
= 7 # 4:1:1 sampling
39 YCbCr422DC
= 7 # 4:1:1 sampling
43 def BytesPerSample(s
):
46 elif s
== STEREO_INTERLEAVED
:
54 elif f
in (RGBX
, RGBA
):
56 elif f
in (RGB332
, GRAYSCALE
):
61 def AudioFormatName(f
):
64 elif f
== STEREO_INTERLEAVED
:
65 return 'STEREO_INTERLEAVED'
67 return 'Not a valid format'
69 def VideoFormatName(f
):
87 return 'Not a valid format'
89 MAX_NUMBER_OF_AUDIO_ALGORITHMS
= 32
90 MAX_NUMBER_OF_VIDEO_ALGORITHMS
= 32
98 def AlgorithmNumber(scheme
):
99 return scheme
& 0x7fff
100 def AlgorithmType(scheme
):
101 return (scheme
>> 15) & 1
102 def Algorithm(type, n
):
103 return n |
((type & 1) << 15)
106 # "compressionScheme" argument values
110 UNCOMPRESSED_AUDIO
= Algorithm(AUDIO
, 0)
111 G711_ULAW
= Algorithm(AUDIO
, 1)
112 ULAW
= Algorithm(AUDIO
, 1)
113 G711_ALAW
= Algorithm(AUDIO
, 2)
114 ALAW
= Algorithm(AUDIO
, 2)
115 AWARE_MPEG_AUDIO
= Algorithm(AUDIO
, 3)
116 AWARE_MULTIRATE
= Algorithm(AUDIO
, 4)
118 UNCOMPRESSED
= Algorithm(VIDEO
, 0)
119 UNCOMPRESSED_VIDEO
= Algorithm(VIDEO
, 0)
120 RLE
= Algorithm(VIDEO
, 1)
121 JPEG
= Algorithm(VIDEO
, 2)
122 MPEG_VIDEO
= Algorithm(VIDEO
, 3)
123 MVC1
= Algorithm(VIDEO
, 4)
124 RTR
= Algorithm(VIDEO
, 5)
125 RTR1
= Algorithm(VIDEO
, 5)
130 MAX_NUMBER_OF_PARAMS
= 256
137 BITS_PER_COMPONENT
= 5
139 COMPRESSION_RATIO
= 7
140 EXACT_COMPRESSION_RATIO
= 8
141 FRAME_BUFFER_SIZE
= 9
142 COMPRESSED_BUFFER_SIZE
= 10
147 ALGORITHM_VERSION
= 15
149 NUMBER_OF_FRAMES
= 17
151 LAST_FRAME_INDEX
= 19
152 NUMBER_OF_PARAMS
= 20
154 # JPEG Specific Parameters
155 QUALITY_FACTOR
= NUMBER_OF_PARAMS
+ 0
157 # MPEG Specific Parameters
158 END_OF_SEQUENCE
= NUMBER_OF_PARAMS
+ 0
160 # RTR Specific Parameters
161 QUALITY_LEVEL
= NUMBER_OF_PARAMS
+ 0
162 ZOOM_X
= NUMBER_OF_PARAMS
+ 1
163 ZOOM_Y
= NUMBER_OF_PARAMS
+ 2
166 # Parameter value types
168 ENUM_VALUE
= 0 # only certain constant values are valid
169 RANGE_VALUE
= 1 # any value in a given range is valid
170 FLOATING_ENUM_VALUE
= 2 # only certain constant floating point values are valid
171 FLOATING_RANGE_VALUE
= 3 # any value in a given floating point range is valid
174 # Algorithm Functionality
203 # SGI Proprietaty Algorithm Header Start Code
205 HEADER_START_CODE
= 0xc1C0DEC
211 BAD_NO_BUFFERSPACE
= -2 # no space for internal buffers
212 BAD_PVBUFFER
= -3 # param/val buffer doesn't make sense
213 BAD_BUFFERLENGTH_NEG
= -4 # negative buffer length
214 BAD_BUFFERLENGTH_ODD
= -5 # odd length parameter/value buffer
215 BAD_PARAM
= -6 # invalid parameter
216 BAD_COMPRESSION_SCHEME
= -7 # compression scheme parameter invalid
217 BAD_COMPRESSOR_HANDLE
= -8 # compression handle parameter invalid
218 BAD_COMPRESSOR_HANDLE_POINTER
= -9 # compression handle pointer invalid
219 BAD_BUFFER_HANDLE
= -10 # buffer handle invalid
220 BAD_BUFFER_QUERY_SIZE
= -11 # buffer query size too large
221 JPEG_ERROR
= -12 # error from libjpeg
222 BAD_FRAME_SIZE
= -13 # frame size invalid
223 PARAM_OUT_OF_RANGE
= -14 # parameter out of range
224 ADDED_ALGORITHM_ERROR
= -15 # added algorithm had a unique error
225 BAD_ALGORITHM_TYPE
= -16 # bad algorithm type
226 BAD_ALGORITHM_NAME
= -17 # bad algorithm name
227 BAD_BUFFERING
= -18 # bad buffering calls
228 BUFFER_NOT_CREATED
= -19 # buffer not created
229 BAD_BUFFER_EXISTS
= -20 # buffer already created
230 BAD_INTERNAL_FORMAT
= -21 # invalid internal format
231 BAD_BUFFER_POINTER
= -22 # invalid buffer pointer
232 FRAME_BUFFER_SIZE_ZERO
= -23 # frame buffer has zero size
233 BAD_STREAM_HEADER
= -24 # invalid stream header
235 BAD_LICENSE
= -25 # netls license not valid
236 AWARE_ERROR
= -26 # error from libawcmp