Add prototype for ciss_print0 in place.
[dragonfly.git] / contrib / file-4.12 / magic / Magdir / animation
1
2 #------------------------------------------------------------------------------
3 # animation:  file(1) magic for animation/movie formats
4 #
5 # animation formats
6 # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
7 # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
8
9 # MPEG sequences
10 # Scans for all common MPEG header start codes
11 0        belong&0xFFFFFF00  0x00000100     MPEG sequence
12 >3       byte               0xBA
13 >>4      byte               &0x40          \b, v2, program multiplex
14 >>4      byte               ^0x40          \b, v1, system multiplex
15 >3       byte               0xBB           \b, v1/2, multiplex (missing pack header)
16 >3       byte               0xB0           \b, v4
17 >>5      belong             0x000001B5
18 >>>9     byte               &0x80
19 >>>>10   byte&0xF0          16             \b, video
20 >>>>10   byte&0xF0          32             \b, still texture
21 >>>>10   byte&0xF0          48             \b, mesh
22 >>>>10   byte&0xF0          64             \b, face
23 >>>9     byte               ^0x80
24 >>>>9    byte&0xF8          8              \b, video
25 >>>>9    byte&0xF8          16             \b, still texture
26 >>>>9    byte&0xF8          24             \b, mesh
27 >>>>9    byte&0xF8          32             \b, face
28 >>4      byte               1              \b, simple @ L1
29 >>4      byte               2              \b, simple @ L2
30 >>4      byte               3              \b, simple @ L3
31 >>4      byte               4              \b, simple @ L0
32 >>4      byte               17             \b, simple scalable @ L1
33 >>4      byte               18             \b, simple scalable @ L2
34 >>4      byte               33             \b, core @ L1
35 >>4      byte               34             \b, core @ L2
36 >>4      byte               50             \b, main @ L2
37 >>4      byte               51             \b, main @ L3
38 >>4      byte               53             \b, main @ L4
39 >>4      byte               66             \b, n-bit @ L2
40 >>4      byte               81             \b, scalable texture @ L1
41 >>4      byte               97             \b, simple face animation @ L1
42 >>4      byte               98             \b, simple face animation @ L2
43 >>4      byte               99             \b, simple face basic animation @ L1
44 >>4      byte               100            \b, simple face basic animation @ L2
45 >>4      byte               113            \b, basic animation text @ L1
46 >>4      byte               114            \b, basic animation text @ L2
47 >>4      byte               129            \b, hybrid @ L1
48 >>4      byte               130            \b, hybrid @ L2
49 >>4      byte               145            \b, advanced RT simple @ L!
50 >>4      byte               146            \b, advanced RT simple @ L2
51 >>4      byte               147            \b, advanced RT simple @ L3
52 >>4      byte               148            \b, advanced RT simple @ L4
53 >>4      byte               161            \b, core scalable @ L1
54 >>4      byte               162            \b, core scalable @ L2
55 >>4      byte               163            \b, core scalable @ L3
56 >>4      byte               177            \b, advanced coding efficiency @ L1
57 >>4      byte               178            \b, advanced coding efficiency @ L2
58 >>4      byte               179            \b, advanced coding efficiency @ L3
59 >>4      byte               180            \b, advanced coding efficiency @ L4
60 >>4      byte               193            \b, advanced core @ L1
61 >>4      byte               194            \b, advanced core @ L2
62 >>4      byte               209            \b, advanced scalable texture @ L1
63 >>4      byte               210            \b, advanced scalable texture @ L2
64 >>4      byte               211            \b, advanced scalable texture @ L3
65 >>4      byte               225            \b, simple studio @ L1
66 >>4      byte               226            \b, simple studio @ L2
67 >>4      byte               227            \b, simple studio @ L3
68 >>4      byte               228            \b, simple studio @ L4
69 >>4      byte               229            \b, core studio @ L1
70 >>4      byte               230            \b, core studio @ L2
71 >>4      byte               231            \b, core studio @ L3
72 >>4      byte               232            \b, core studio @ L4
73 >>4      byte               240            \b, advanced simple @ L0
74 >>4      byte               241            \b, advanced simple @ L1
75 >>4      byte               242            \b, advanced simple @ L2
76 >>4      byte               243            \b, advanced simple @ L3
77 >>4      byte               244            \b, advanced simple @ L4
78 >>4      byte               245            \b, advanced simple @ L5
79 >>4      byte               247            \b, advanced simple @ L3b
80 >>4      byte               248            \b, FGS @ L0
81 >>4      byte               249            \b, FGS @ L1
82 >>4      byte               250            \b, FGS @ L2
83 >>4      byte               251            \b, FGS @ L3
84 >>4      byte               252            \b, FGS @ L4
85 >>4      byte               253            \b, FGS @ L5
86 >3       byte               0xB5           \b, v4
87 >>4      byte               &0x80
88 >>>5     byte&0xF0          16             \b, video (missing profile header)
89 >>>5     byte&0xF0          32             \b, still texture (missing profile header)
90 >>>5     byte&0xF0          48             \b, mesh (missing profile header)
91 >>>5     byte&0xF0          64             \b, face (missing profile header)
92 >>4      byte               ^0x80
93 >>>4     byte&0xF8          8              \b, video (missing profile header)
94 >>>4     byte&0xF8          16             \b, still texture (missing profile header)
95 >>>4     byte&0xF8          24             \b, mesh (missing profile header)
96 >>>4     byte&0xF8          32             \b, face (missing profile header)
97 >3       byte               0xB3
98 >>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
99 >>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
100 >>12     belong             0x000001B5     \b, v2,
101 >>>16    byte&0x0F          1              \b HP
102 >>>16    byte&0x0F          2              \b Spt
103 >>>16    byte&0x0F          3              \b SNR
104 >>>16    byte&0x0F          4              \b MP
105 >>>16    byte&0x0F          5              \b SP
106 >>>17    byte&0xF0          64             \b@HL
107 >>>17    byte&0xF0          96             \b@H-14
108 >>>17    byte&0xF0          128            \b@ML
109 >>>17    byte&0xF0          160            \b@LL
110 >>>17    byte               &0x08          \b progressive
111 >>>17    byte               ^0x08          \b interlaced
112 >>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
113 >>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
114 >>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
115 >>11     byte               &0x02
116 >>>75    byte               &0x01
117 >>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
118 >>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
119 >>>>140  belong             0x000001B5     \b, v2,
120 >>>>>144 byte&0x0F          1              \b HP
121 >>>>>144 byte&0x0F          2              \b Spt
122 >>>>>144 byte&0x0F          3              \b SNR
123 >>>>>144 byte&0x0F          4              \b MP
124 >>>>>144 byte&0x0F          5              \b SP
125 >>>>>145 byte&0xF0          64             \b@HL
126 >>>>>145 byte&0xF0          96             \b@H-14
127 >>>>>145 byte&0xF0          128            \b@ML
128 >>>>>145 byte&0xF0          160            \b@LL
129 >>>>>145 byte               &0x08          \b progressive
130 >>>>>145 byte               ^0x08          \b interlaced
131 >>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
132 >>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
133 >>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
134 >>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
135 >>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
136 >>>76    belong             0x000001B5     \b, v2,
137 >>>80    byte&0x0F          1              \b HP
138 >>>80    byte&0x0F          2              \b Spt
139 >>>80    byte&0x0F          3              \b SNR
140 >>>80    byte&0x0F          4              \b MP
141 >>>80    byte&0x0F          5              \b SP
142 >>>81    byte&0xF0          64             \b@HL
143 >>>81    byte&0xF0          96             \b@H-14
144 >>>81    byte&0xF0          128            \b@ML
145 >>>81    byte&0xF0          160            \b@LL
146 >>>81    byte               &0x08          \b progressive
147 >>>81    byte               ^0x08          \b interlaced
148 >>>81    byte&0x06          2              \b Y'CbCr 4:2:0 video
149 >>>81    byte&0x06          4              \b Y'CbCr 4:2:2 video
150 >>>81    byte&0x06          6              \b Y'CbCr 4:4:4 video
151 >>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
152 >>>7     byte&0xF0          0x10           \b, 16:9
153 >>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
154 >>>7     byte&0xF0          0x10           \b, 16:9
155 >>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
156 >>>7     byte&0xF0          0x10           \b, 4:3
157 >>4      beshort&0xFFF0     0x2C00         \b, 4CIF
158 >>>5     beshort&0x0FFF     0x01E0         \b NTSC
159 >>>5     beshort&0x0FFF     0x0240         \b PAL
160 >>>7     byte&0xF0          0x20           \b, 4:3
161 >>>7     byte&0xF0          0x30           \b, 16:9
162 >>>7     byte&0xF0          0x40           \b, 11:5
163 >>>7     byte&0xF0          0x80           \b, PAL 4:3
164 >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
165 >>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
166 >>>7     byte&0xF0          0x10           \b, 4:3
167 >>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
168 >>>7     byte&0xF0          0x10           \b, 4:3
169 >>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
170 >>>7     byte&0xF0          0x10           \b, 4:3
171 >>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
172 >>>7     byte&0xF0          0x10           \b, 4:3
173 >>4      beshort&0xFFF0     0x1600         \b, CIF
174 >>>5     beshort&0x0FFF     0x00F0         \b NTSC
175 >>>5     beshort&0x0FFF     0x0120         \b PAL
176 >>>7     byte&0xF0          0x20           \b, 4:3
177 >>>7     byte&0xF0          0x30           \b, 16:9
178 >>>7     byte&0xF0          0x40           \b, 11:5
179 >>>7     byte&0xF0          0x80           \b, PAL 4:3
180 >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
181 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
182 >>>>7    byte&0xF0          0x20           \b, 4:3
183 >>>>7    byte&0xF0          0x30           \b, 16:9
184 >>>>7    byte&0xF0          0x40           \b, 11:5
185 >>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
186 >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
187 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
188 >>>7     byte&0xF0          0x20           \b, 4:3
189 >>>7     byte&0xF0          0x30           \b, 16:9
190 >>>7     byte&0xF0          0x40           \b, 11:5
191 >>4      beshort&0xFFF0     0x1E00         \b, SVCD
192 >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
193 >>>5     beshort&0x0FFF     0x0240         \b PAL 625
194 >>>7     byte&0xF0          0x20           \b, 4:3
195 >>>7     byte&0xF0          0x30           \b, 16:9
196 >>>7     byte&0xF0          0x40           \b, 11:5
197 >>7      byte&0x0F          1              \b, 23.976 fps
198 >>7      byte&0x0F          2              \b, 24 fps
199 >>7      byte&0x0F          3              \b, 25 fps
200 >>7      byte&0x0F          4              \b, 29.97 fps
201 >>7      byte&0x0F          5              \b, 30 fps
202 >>7      byte&0x0F          6              \b, 50 fps
203 >>7      byte&0x0F          7              \b, 59.94 fps
204 >>7      byte&0x0F          8              \b, 60 fps
205 >>11     byte               &0x04          \b, Constrained
206
207 # MPEG ADTS Audio (*.mpx/mxa/aac)
208 # from dreesen@math.fu-berlin.de
209 # modified to fully support MPEG ADTS
210
211 # MP3, M1A
212 0       beshort&0xFFFE  0xFFFA         MPEG ADTS, layer III, v1
213 # rates
214 >2      byte&0xF0       0x10           \b,  32 kBits
215 >2      byte&0xF0       0x20           \b,  40 kBits
216 >2      byte&0xF0       0x30           \b,  48 kBits
217 >2      byte&0xF0       0x40           \b,  56 kBits
218 >2      byte&0xF0       0x50           \b,  64 kBits
219 >2      byte&0xF0       0x60           \b,  80 kBits
220 >2      byte&0xF0       0x70           \b,  96 kBits
221 >2      byte&0xF0       0x80           \b, 112 kBits
222 >2      byte&0xF0       0x90           \b, 128 kBits
223 >2      byte&0xF0       0xA0           \b, 160 kBits
224 >2      byte&0xF0       0xB0           \b, 192 kBits
225 >2      byte&0xF0       0xC0           \b, 224 kBits
226 >2      byte&0xF0       0xD0           \b, 256 kBits
227 >2      byte&0xF0       0xE0           \b, 320 kBits
228 # timing
229 >2      byte&0x0C       0x00           \b, 44.1 kHz
230 >2      byte&0x0C       0x04           \b, 48 kHz
231 >2      byte&0x0C       0x08           \b, 32 kHz
232 # channels/options
233 >3      byte&0xC0       0x00           \b, Stereo
234 >3      byte&0xC0       0x40           \b, JntStereo
235 >3      byte&0xC0       0x80           \b, 2x Monaural
236 >3      byte&0xC0       0xC0           \b, Monaural
237 #>1     byte            ^0x01           \b, Data Verify
238 #>2     byte            &0x02           \b, Packet Pad
239 #>2     byte            &0x01           \b, Custom Flag
240 #>3     byte            &0x08           \b, Copyrighted
241 #>3     byte            &0x04           \b, Original Source
242 #>3     byte&0x03       1               \b, NR: 50/15 ms
243 #>3     byte&0x03       3               \b, NR: CCIT J.17
244
245 # MP2, M1A
246 0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
247 # rates
248 >2      byte&0xF0       0x10           \b,  32 kBits
249 >2      byte&0xF0       0x20           \b,  48 kBits
250 >2      byte&0xF0       0x30           \b,  56 kBits
251 >2      byte&0xF0       0x40           \b,  64 kBits
252 >2      byte&0xF0       0x50           \b,  80 kBits
253 >2      byte&0xF0       0x60           \b,  96 kBits
254 >2      byte&0xF0       0x70           \b, 112 kBits
255 >2      byte&0xF0       0x80           \b, 128 kBits
256 >2      byte&0xF0       0x90           \b, 160 kBits
257 >2      byte&0xF0       0xA0           \b, 192 kBits
258 >2      byte&0xF0       0xB0           \b, 224 kBits
259 >2      byte&0xF0       0xC0           \b, 256 kBits
260 >2      byte&0xF0       0xD0           \b, 320 kBits
261 >2      byte&0xF0       0xE0           \b, 384 kBits
262 # timing
263 >2      byte&0x0C       0x00           \b, 44.1 kHz
264 >2      byte&0x0C       0x04           \b, 48 kHz
265 >2      byte&0x0C       0x08           \b, 32 kHz
266 # channels/options
267 >3      byte&0xC0       0x00           \b, Stereo
268 >3      byte&0xC0       0x40           \b, JntStereo
269 >3      byte&0xC0       0x80           \b, 2x Monaural
270 >3      byte&0xC0       0xC0           \b, Monaural
271 #>1     byte            ^0x01           \b, Data Verify
272 #>2     byte            &0x02           \b, Packet Pad
273 #>2     byte            &0x01           \b, Custom Flag
274 #>3     byte            &0x08           \b, Copyrighted
275 #>3     byte            &0x04           \b, Original Source
276 #>3     byte&0x03       1               \b, NR: 50/15 ms
277 #>3     byte&0x03       3               \b, NR: CCIT J.17
278
279 # MPA, M1A
280 0       beshort&0xFFFE  0xFFFE         MPEG ADTS, layer I, v1
281 # rate
282 >2      byte&0xF0       0x10           \b,  32 kBits
283 >2      byte&0xF0       0x20           \b,  64 kBits
284 >2      byte&0xF0       0x30           \b,  96 kBits
285 >2      byte&0xF0       0x40           \b, 128 kBits
286 >2      byte&0xF0       0x50           \b, 160 kBits
287 >2      byte&0xF0       0x60           \b, 192 kBits
288 >2      byte&0xF0       0x70           \b, 224 kBits
289 >2      byte&0xF0       0x80           \b, 256 kBits
290 >2      byte&0xF0       0x90           \b, 288 kBits
291 >2      byte&0xF0       0xA0           \b, 320 kBits
292 >2      byte&0xF0       0xB0           \b, 352 kBits
293 >2      byte&0xF0       0xC0           \b, 384 kBits
294 >2      byte&0xF0       0xD0           \b, 416 kBits
295 >2      byte&0xF0       0xE0           \b, 448 kBits
296 # timing
297 >2      byte&0x0C       0x00           \b, 44.1 kHz
298 >2      byte&0x0C       0x04           \b, 48 kHz
299 >2      byte&0x0C       0x08           \b, 32 kHz
300 # channels/options
301 >3      byte&0xC0       0x00           \b, Stereo
302 >3      byte&0xC0       0x40           \b, JntStereo
303 >3      byte&0xC0       0x80           \b, 2x Monaural
304 >3      byte&0xC0       0xC0           \b, Monaural
305 #>1     byte            ^0x01           \b, Data Verify
306 #>2     byte            &0x02           \b, Packet Pad
307 #>2     byte            &0x01           \b, Custom Flag
308 #>3     byte            &0x08           \b, Copyrighted
309 #>3     byte            &0x04           \b, Original Source
310 #>3     byte&0x03       1               \b, NR: 50/15 ms
311 #>3     byte&0x03       3               \b, NR: CCIT J.17
312
313 # MP3, M2A
314 0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
315 # rate
316 >2      byte&0xF0       0x10           \b,   8 kBits
317 >2      byte&0xF0       0x20           \b,  16 kBits
318 >2      byte&0xF0       0x30           \b,  24 kBits
319 >2      byte&0xF0       0x40           \b,  32 kBits
320 >2      byte&0xF0       0x50           \b,  40 kBits
321 >2      byte&0xF0       0x60           \b,  48 kBits
322 >2      byte&0xF0       0x70           \b,  56 kBits
323 >2      byte&0xF0       0x80           \b,  64 kBits
324 >2      byte&0xF0       0x90           \b,  80 kBits
325 >2      byte&0xF0       0xA0           \b,  96 kBits
326 >2      byte&0xF0       0xB0           \b, 112 kBits
327 >2      byte&0xF0       0xC0           \b, 128 kBits
328 >2      byte&0xF0       0xD0           \b, 144 kBits
329 >2      byte&0xF0       0xE0           \b, 160 kBits
330 # timing
331 >2      byte&0x0C       0x00           \b, 22.05 kHz
332 >2      byte&0x0C       0x04           \b, 24 kHz
333 >2      byte&0x0C       0x08           \b, 16 kHz
334 # channels/options
335 >3      byte&0xC0       0x00           \b, Stereo
336 >3      byte&0xC0       0x40           \b, JntStereo
337 >3      byte&0xC0       0x80           \b, 2x Monaural
338 >3      byte&0xC0       0xC0           \b, Monaural
339 #>1     byte            ^0x01           \b, Data Verify
340 #>2     byte            &0x02           \b, Packet Pad
341 #>2     byte            &0x01           \b, Custom Flag
342 #>3     byte            &0x08           \b, Copyrighted
343 #>3     byte            &0x04           \b, Original Source
344 #>3     byte&0x03       1               \b, NR: 50/15 ms
345 #>3     byte&0x03       3               \b, NR: CCIT J.17
346
347 # MP2, M2A
348 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
349 # rate 
350 >2      byte&0xF0       0x10           \b,   8 kBits
351 >2      byte&0xF0       0x20           \b,  16 kBits 
352 >2      byte&0xF0       0x30           \b,  24 kBits
353 >2      byte&0xF0       0x40           \b,  32 kBits
354 >2      byte&0xF0       0x50           \b,  40 kBits
355 >2      byte&0xF0       0x60           \b,  48 kBits
356 >2      byte&0xF0       0x70           \b,  56 kBits
357 >2      byte&0xF0       0x80           \b,  64 kBits
358 >2      byte&0xF0       0x90           \b,  80 kBits
359 >2      byte&0xF0       0xA0           \b,  96 kBits
360 >2      byte&0xF0       0xB0           \b, 112 kBits
361 >2      byte&0xF0       0xC0           \b, 128 kBits
362 >2      byte&0xF0       0xD0           \b, 144 kBits
363 >2      byte&0xF0       0xE0           \b, 160 kBits
364 # timing
365 >2      byte&0x0C       0x00           \b, 22.05 kHz
366 >2      byte&0x0C       0x04           \b, 24 kHz
367 >2      byte&0x0C       0x08           \b, 16 kHz
368 # channels/options
369 >3      byte&0xC0       0x00           \b, Stereo
370 >3      byte&0xC0       0x40           \b, JntStereo
371 >3      byte&0xC0       0x80           \b, 2x Monaural
372 >3      byte&0xC0       0xC0           \b, Monaural
373 #>1     byte            ^0x01           \b, Data Verify
374 #>2     byte            &0x02           \b, Packet Pad
375 #>2     byte            &0x01           \b, Custom Flag
376 #>3     byte            &0x08           \b, Copyrighted
377 #>3     byte            &0x04           \b, Original Source
378 #>3     byte&0x03       1               \b, NR: 50/15 ms
379 #>3     byte&0x03       3               \b, NR: CCIT J.17
380
381 # MPA, M2A
382 0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
383 # rate
384 >2      byte&0xF0       0x10           \b,  32 kBits
385 >2      byte&0xF0       0x20           \b,  48 kBits
386 >2      byte&0xF0       0x30           \b,  56 kBits
387 >2      byte&0xF0       0x40           \b,  64 kBits
388 >2      byte&0xF0       0x50           \b,  80 kBits
389 >2      byte&0xF0       0x60           \b,  96 kBits
390 >2      byte&0xF0       0x70           \b, 112 kBits
391 >2      byte&0xF0       0x80           \b, 128 kBits
392 >2      byte&0xF0       0x90           \b, 144 kBits
393 >2      byte&0xF0       0xA0           \b, 160 kBits
394 >2      byte&0xF0       0xB0           \b, 176 kBits
395 >2      byte&0xF0       0xC0           \b, 192 kBits
396 >2      byte&0xF0       0xD0           \b, 224 kBits
397 >2      byte&0xF0       0xE0           \b, 256 kBits
398 # timing
399 >2      byte&0x0C       0x00           \b, 22.05 kHz
400 >2      byte&0x0C       0x04           \b, 24 kHz
401 >2      byte&0x0C       0x08           \b, 16 kHz
402 # channels/options
403 >3      byte&0xC0       0x00           \b, Stereo
404 >3      byte&0xC0       0x40           \b, JntStereo
405 >3      byte&0xC0       0x80           \b, 2x Monaural
406 >3      byte&0xC0       0xC0           \b, Monaural
407 #>1     byte            ^0x01           \b, Data Verify
408 #>2     byte            &0x02           \b, Packet Pad
409 #>2     byte            &0x01           \b, Custom Flag
410 #>3     byte            &0x08           \b, Copyrighted
411 #>3     byte            &0x04           \b, Original Source
412 #>3     byte&0x03       1               \b, NR: 50/15 ms
413 #>3     byte&0x03       3               \b, NR: CCIT J.17
414
415 # MP3, M25A
416 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
417 # rate  
418 >2      byte&0xF0       0x10           \b,   8 kBits
419 >2      byte&0xF0       0x20           \b,  16 kBits
420 >2      byte&0xF0       0x30           \b,  24 kBits
421 >2      byte&0xF0       0x40           \b,  32 kBits
422 >2      byte&0xF0       0x50           \b,  40 kBits
423 >2      byte&0xF0       0x60           \b,  48 kBits
424 >2      byte&0xF0       0x70           \b,  56 kBits
425 >2      byte&0xF0       0x80           \b,  64 kBits
426 >2      byte&0xF0       0x90           \b,  80 kBits
427 >2      byte&0xF0       0xA0           \b,  96 kBits
428 >2      byte&0xF0       0xB0           \b, 112 kBits
429 >2      byte&0xF0       0xC0           \b, 128 kBits
430 >2      byte&0xF0       0xD0           \b, 144 kBits
431 >2      byte&0xF0       0xE0           \b, 160 kBits
432 # timing
433 >2      byte&0x0C       0x00           \b, 11.025 kHz
434 >2      byte&0x0C       0x04           \b, 12 kHz
435 >2      byte&0x0C       0x08           \b, 8 kHz
436 # channels/options
437 >3      byte&0xC0       0x00           \b, Stereo
438 >3      byte&0xC0       0x40           \b, JntStereo
439 >3      byte&0xC0       0x80           \b, 2x Monaural
440 >3      byte&0xC0       0xC0           \b, Monaural
441 #>1     byte            ^0x01           \b, Data Verify
442 #>2     byte            &0x02           \b, Packet Pad
443 #>2     byte            &0x01           \b, Custom Flag
444 #>3     byte            &0x08           \b, Copyrighted
445 #>3     byte            &0x04           \b, Original Source
446 #>3     byte&0x03       1               \b, NR: 50/15 ms
447 #>3     byte&0x03       3               \b, NR: CCIT J.17
448
449 # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
450
451 # Stored AAC streams (instead of the MP4 format)
452 0       string          ADIF           MPEG ADIF, AAC
453 >4      byte            &0x80
454 >>13    byte            &0x10          \b, VBR
455 >>13    byte            ^0x10          \b, CBR
456 >>16    byte&0x1E       0x02           \b, single stream
457 >>16    byte&0x1E       0x04           \b, 2 streams
458 >>16    byte&0x1E       0x06           \b, 3 streams
459 >>16    byte            &0x08          \b, 4 or more streams
460 >>16    byte            &0x10          \b, 8 or more streams
461 >>4    byte            &0x80          \b, Copyrighted
462 >>13   byte            &0x40          \b, Original Source
463 >>13   byte            &0x20          \b, Home Flag
464 >4      byte            ^0x80
465 >>4     byte            &0x10          \b, VBR
466 >>4     byte            ^0x10          \b, CBR
467 >>7     byte&0x1E       0x02           \b, single stream
468 >>7     byte&0x1E       0x04           \b, 2 streams
469 >>7     byte&0x1E       0x06           \b, 3 streams
470 >>7     byte            &0x08          \b, 4 or more streams
471 >>7     byte            &0x10          \b, 8 or more streams
472 >>4    byte            &0x40          \b, Original Stream(s)
473 >>4    byte            &0x20          \b, Home Source
474
475 # Live or stored single AAC stream (used with MPEG-2 systems)
476 0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
477 >1      byte            ^0x08          \b, v2
478 >1      byte            &0x08          \b, v4
479 # profile
480 >>2     byte            &0xC0          \b LTP
481 >2      byte&0xc0       0x00           \b, Main
482 >2      byte&0xc0       0x40           \b, LC
483 >2      byte&0xc0       0x80           \b, SSR
484 # timing
485 >2      byte&0x3c       0x00           \b, 96 kHz
486 >2      byte&0x3c       0x04           \b, 88.2 kHz
487 >2      byte&0x3c       0x08           \b, 64 kHz
488 >2      byte&0x3c       0x0c           \b, 48 kHz
489 >2      byte&0x3c       0x10           \b, 44.1 kHz
490 >2      byte&0x3c       0x14           \b, 32 kHz
491 >2      byte&0x3c       0x18           \b, 24 kHz
492 >2      byte&0x3c       0x1c           \b, 22.05 kHz
493 >2      byte&0x3c       0x20           \b, 16 kHz
494 >2      byte&0x3c       0x24           \b, 12 kHz
495 >2      byte&0x3c       0x28           \b, 11.025 kHz
496 >2      byte&0x3c       0x2c           \b, 8 kHz
497 # channels/options
498 >2      beshort&0x01c0  0x0040         \b, monaural
499 >2      beshort&0x01c0  0x0080         \b, stereo
500 >2      beshort&0x01c0  0x00c0         \b, stereo + center
501 >2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
502 >2      beshort&0x01c0  0x0140         \b, surround
503 >2      beshort&0x01c0  0x0180         \b, surround + LFE
504 >2      beshort         &0x01C0        \b, surround + side
505 #>1     byte            ^0x01           \b, Data Verify
506 #>2     byte            &0x02           \b, Custom Flag
507 #>3     byte            &0x20           \b, Original Stream
508 #>3     byte            &0x10           \b, Home Source
509 #>3     byte            &0x08           \b, Copyrighted
510
511 # Live MPEG-4 audio streams (instead of RTP FlexMux)
512 0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
513 #>1     beshort&0x1FFF  x              \b, %u byte packet
514 >3      byte&0xE0       0x40
515 >>4     byte&0x3C       0x04           \b, single stream
516 >>4     byte&0x3C       0x08           \b, 2 streams
517 >>4     byte&0x3C       0x0C           \b, 3 streams
518 >>4     byte            &0x08          \b, 4 or more streams
519 >>4     byte            &0x20          \b, 8 or more streams
520 >3      byte&0xC0       0
521 >>4     byte&0x78       0x08           \b, single stream
522 >>4     byte&0x78       0x10           \b, 2 streams
523 >>4     byte&0x78       0x18           \b, 3 streams
524 >>4     byte            &0x20          \b, 4 or more streams
525 >>4     byte            &0x40          \b, 8 or more streams
526 0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
527
528 # FLI animation format
529 4       leshort         0xAF11                  FLI file
530 >6      leshort         x                       - %d frames,
531 >8      leshort         x                       width=%d pixels,
532 >10     leshort         x                       height=%d pixels,
533 >12     leshort         x                       depth=%d,
534 >16     leshort         x                       ticks/frame=%d
535 # FLC animation format
536 4       leshort         0xAF12                  FLC file
537 >6      leshort         x                       - %d frames
538 >8      leshort         x                       width=%d pixels,
539 >10     leshort         x                       height=%d pixels,
540 >12     leshort         x                       depth=%d,
541 >16     leshort         x                       ticks/frame=%d
542
543 # DL animation format
544 # XXX - collision with most `mips' magic
545 #
546 # I couldn't find a real magic number for these, however, this
547 # -appears- to work.  Note that it might catch other files, too, so be
548 # careful!
549 #
550 # Note that title and author appear in the two 20-byte chunks
551 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
552 # 255 (hex FF)!  The DL format is really bad.
553 #
554 #0      byte    1       DL version 1, medium format (160x100, 4 images/screen)
555 #>42    byte    x       - %d screens,
556 #>43    byte    x       %d commands
557 #0      byte    2       DL version 2
558 #>1     byte    1       - large format (320x200,1 image/screen),
559 #>1     byte    2       - medium format (160x100,4 images/screen),
560 #>1     byte    >2      - unknown format,
561 #>42    byte    x       %d screens,
562 #>43    byte    x       %d commands
563 # Based on empirical evidence, DL version 3 have several nulls following the
564 # \003.  Most of them start with non-null values at hex offset 0x34 or so.
565 #0      string  \3\0\0\0\0\0\0\0\0\0\0\0        DL version 3
566
567 # SGI formats
568 0       string          MOVI            Silicon Graphics movie file
569
570 # Apple Quicktime and ISO types
571 4       string          moov            Apple QuickTime
572 >12     string          mvhd            \b movie (fast start)
573 >12     string          mdra            \b URL
574 >12     string          cmov            \b movie (fast start, compressed header)
575 >12     string          rmra            \b multiple URLs
576 4       string          mdat            Apple QuickTime movie (unoptimized)
577 4       string          wide            Apple QuickTime movie (unoptimized)
578 4       string          skip            Apple QuickTime movie (modified)
579 4       string          free            Apple QuickTime movie (modified)
580 4       string          idsc            Apple QuickTime image (fast start)
581 4       string          idat            Apple QuickTime image (unoptimized)
582 4       string          pckg            Apple QuickTime compressed archive
583 4       string/B        jP              JPEG 2000 image
584 4       string          ftyp            ISO Media
585 >8      string          isom            \b, MPEG v4 system
586 >8      string          mp41            \b, MPEG v4 system, version 1
587 >8      string          mp42            \b, MPEG v4 system, version 2
588 >8      string/B        jp2             \b, JPEG 2000 image
589 >8      string          3gp             \b, MPEG v4 system, 3GPP (H.263/AMR)
590 >8      string          mmp4            \b, MPEG v4 system, Mobile
591 >8      string/B        M4A             \b, MPEG v4 system, iTunes AAC-LC
592 >8      string/B        M4P             \b, MPEG v4 system, ISMA encrypted AAC-LC
593 >8      string/B        M4B             \b, MPEG v4 system, iTunes AAC-LC/AMR
594 >8      string/B        qt              \b, Apple QuickTime movie
595
596 # iso 13818 transport stream
597 #
598 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
599 # (the following is a little bit restrictive and works fine for a stream
600 #  that starts with PAT properly. it won't work for stream data, that is
601 #  cut from an input device data right in the middle, but this shouldn't
602 #  disturb)
603 # syncbyte      8 bit   0x47
604 # error_ind     1 bit   -
605 # payload_start 1 bit   1
606 # priority      1 bit   -
607 # PID          13 bit   0x0000
608 # scrambling    2 bit   -
609 # adaptfld_ctrl 2 bit   1 or 3
610 # conti_count   4 bit   0
611 0       belong&0xFF5FFF1F       0x47400010      MPEG transport stream data
612 >188    byte                    !0x47           CORRUPTED
613
614 # DIF digital video file format <mpruett@sgi.com>
615 0       belong&0xffffff00       0x1f070000      DIF
616 >4      byte                    &0x01           (DVCPRO) movie file
617 >4      byte                    ^0x01           (DV) movie file
618 >3      byte                    &0x80           (PAL)
619 >3      byte                    ^0x80           (NTSC)
620
621 # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
622 0       belong                  0x3026b275      Microsoft ASF
623
624 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
625 0       string                  \x8aMNG         MNG video data,
626 >4      belong                  !0x0d0a1a0a     CORRUPTED,
627 >4      belong                  0x0d0a1a0a
628 >>16    belong  x                               %ld x
629 >>20    belong  x                               %ld
630
631 # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
632 0       string                  \x8bJNG         JNG video data,
633 >4      belong                  !0x0d0a1a0a     CORRUPTED,
634 >4      belong                  0x0d0a1a0a
635 >>16    belong  x                               %ld x
636 >>20    belong  x                               %ld
637
638 # Vivo video (Wolfram Kleff)
639 3       string          \x0D\x0AVersion:Vivo    Vivo video data
640
641 # VRML (Virtual Reality Modelling Language)
642 0       string/b        #VRML\ V1.0\ ascii      VRML 1 file
643 0       string/b        #VRML\ V2.0\ utf8       ISO/IEC 14772 VRML 97 file
644
645 #---------------------------------------------------------------------------
646 # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
647 # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
648 #
649 0       string          HVQM4           %s
650 >6      string          >\0             v%s
651 >0      byte            x               GameCube movie,
652 >0x34   ubeshort        x               %d x
653 >0x36   ubeshort        x               %d,
654 >0x26   ubeshort        x               %dµs,
655 >0x42   ubeshort        0               no audio
656 >0x42   ubeshort        >0              %dHz audio