animation 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 animation format
  8. 0 belong 0x000001b3 MPEG video stream data
  9. #>4 beshort&0xfff0 x (%d x
  10. #>5 beshort&0x0fff x %d)
  11. 0 belong 0x000001ba MPEG system stream data
  12. # MPEG Audio (*.mpx)
  13. # from dreesen@math.fu-berlin.de
  14. 0 beshort &0xfff0 MP
  15. # MPEG 1.0
  16. >1 byte&0x08 =0x08 \b
  17. # Layer 3
  18. >>1 byte &0x02 \b3
  19. >>>2 byte&0xf0 =0x10 \b, 32 kBits
  20. >>>2 byte&0xf0 =0x20 \b, 40 kBits
  21. >>>2 byte&0xf0 =0x30 \b, 48 kBits
  22. >>>2 byte&0xf0 =0x40 \b, 56 kBits
  23. >>>2 byte&0xf0 =0x50 \b, 64 kBits
  24. >>>2 byte&0xf0 =0x60 \b, 80 kBits
  25. >>>2 byte&0xf0 =0x70 \b, 96 kBits
  26. >>>2 byte&0xf0 =0x80 \b, 112 kBits
  27. >>>2 byte&0xf0 =0x90 \b, 128 kBits
  28. >>>2 byte&0xf0 =0xA0 \b, 160 kBits
  29. >>>2 byte&0xf0 =0xB0 \b, 192 kBits
  30. >>>2 byte&0xf0 =0xC0 \b, 224 kBits
  31. >>>2 byte&0xf0 =0xD0 \b, 256 kBits
  32. >>>2 byte&0xf0 =0xE0 \b, 320 kBits
  33. # Layer 2
  34. >>1 byte &0x04 \b2
  35. >>>2 byte&0xf0 =0x10 \b, 32 kBits
  36. >>>2 byte&0xf0 =0x20 \b, 48 kBits
  37. >>>2 byte&0xf0 =0x30 \b, 56 kBits
  38. >>>2 byte&0xf0 =0x40 \b, 64 kBits
  39. >>>2 byte&0xf0 =0x50 \b, 80 kBits
  40. >>>2 byte&0xf0 =0x60 \b, 96 kBits
  41. >>>2 byte&0xf0 =0x70 \b, 112 kBits
  42. >>>2 byte&0xf0 =0x80 \b, 128 kBits
  43. >>>2 byte&0xf0 =0x90 \b, 160 kBits
  44. >>>2 byte&0xf0 =0xA0 \b, 192 kBits
  45. >>>2 byte&0xf0 =0xB0 \b, 224 kBits
  46. >>>2 byte&0xf0 =0xC0 \b, 256 kBits
  47. >>>2 byte&0xf0 =0xD0 \b, 320 kBits
  48. >>>2 byte&0xf0 =0xE0 \b, 384 kBits
  49. # freq
  50. >>2 byte&0x0C =0x00 \b, 44.1 kHz
  51. >>2 byte&0x0C =0x04 \b, 48 kHz
  52. >>2 byte&0x0C =0x08 \b, 32 kHz
  53. # MPEG 2.0
  54. >1 byte&0x08 =0x00 \b
  55. # Layer 3
  56. >>1 byte &0x02 \b3
  57. # Layer 2
  58. >>1 byte &0x04 \b2
  59. >>2 byte&0xf0 =0x10 \b, 8 kBits
  60. >>2 byte&0xf0 =0x20 \b, 16 kBits
  61. >>2 byte&0xf0 =0x30 \b, 24 kBits
  62. >>2 byte&0xf0 =0x40 \b, 32 kBits
  63. >>2 byte&0xf0 =0x50 \b, 40 kBits
  64. >>2 byte&0xf0 =0x60 \b, 48 kBits
  65. >>2 byte&0xf0 =0x70 \b, 56 kBits
  66. >>2 byte&0xf0 =0x80 \b, 64 kBits
  67. >>2 byte&0xf0 =0x90 \b, 80 kBits
  68. >>2 byte&0xf0 =0xA0 \b, 96 kBits
  69. >>2 byte&0xf0 =0xB0 \b, 112 kBits
  70. >>2 byte&0xf0 =0xC0 \b, 128 kBits
  71. >>2 byte&0xf0 =0xD0 \b, 144 kBits
  72. >>2 byte&0xf0 =0xE0 \b, 160 kBits
  73. # freq
  74. >>2 byte&0x0C =0x00 \b, 22.05 kHz
  75. >>2 byte&0x0C =0x04 \b, 24 kHz
  76. >>2 byte&0x0C =0x08 \b, 16 kHz
  77. # misc
  78. >3 byte&0xC0 =0x00 \b, Stereo
  79. >3 byte&0xC0 =0x40 \b, JStereo
  80. >3 byte&0xC0 =0x80 \b, Dual-Ch
  81. >3 byte&0xC0 =0xC0 \b, Mono
  82. #>1 byte&0x01 =0x00 \b, Error Protection
  83. #>2 byte&0x02 =0x02 \b, Padding
  84. #>2 byte&0x01 =0x01 \b, Private
  85. #>3 byte&0x08 =0x08 \b, Copyright
  86. #>3 byte&0x04 =0x04 \b, Original
  87. #>3 byte&0x03 1 \b, Emphasis 5
  88. #>3 byte&0x03 3 \b, Emphasis c
  89. # FLI animation format
  90. 4 leshort 0xAF11 FLI file
  91. >6 leshort x - %d frames,
  92. >8 leshort x width=%d pixels,
  93. >10 leshort x height=%d pixels,
  94. >12 leshort x depth=%d,
  95. >16 leshort x ticks/frame=%d
  96. # FLC animation format
  97. 4 leshort 0xAF12 FLC file
  98. >6 leshort x - %d frames
  99. >8 leshort x width=%d pixels,
  100. >10 leshort x height=%d pixels,
  101. >12 leshort x depth=%d,
  102. >16 leshort x ticks/frame=%d
  103. # DL animation format
  104. # XXX - collision with most `mips' magic
  105. #
  106. # I couldn't find a real magic number for these, however, this
  107. # -appears- to work. Note that it might catch other files, too, so be
  108. # careful!
  109. #
  110. # Note that title and author appear in the two 20-byte chunks
  111. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  112. # 255 (hex FF)! The DL format is really bad.
  113. #
  114. #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
  115. #>42 byte x - %d screens,
  116. #>43 byte x %d commands
  117. #0 byte 2 DL version 2
  118. #>1 byte 1 - large format (320x200,1 image/screen),
  119. #>1 byte 2 - medium format (160x100,4 images/screen),
  120. #>1 byte >2 - unknown format,
  121. #>42 byte x %d screens,
  122. #>43 byte x %d commands
  123. # Based on empirical evidence, DL version 3 have several nulls following the
  124. # \003. Most of them start with non-null values at hex offset 0x34 or so.
  125. #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
  126. # SGI and Apple formats
  127. 0 string MOVI Silicon Graphics movie file
  128. 4 string moov Apple QuickTime movie file (moov)
  129. 4 string mdat Apple QuickTime movie file (mdat)