animation 31 KB

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