qtpalette.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. /*
  2. * Default Palettes for Quicktime Files
  3. * Automatically generated from a utility derived from XAnim:
  4. * http://xanim.va.pubnix.com/home.html
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef AVFORMAT_QTPALETTE_H
  23. #define AVFORMAT_QTPALETTE_H
  24. #include <stdint.h>
  25. #include "avformat.h"
  26. static const uint8_t ff_qt_default_palette_2[2 * 3] = {
  27. 0xFF, 0xFF, 0xFF,
  28. 0x00, 0x00, 0x00
  29. };
  30. /* From a screenshot of the "Monitors & Sound" control panel in Mac OS 7.5.5 */
  31. static const uint8_t ff_qt_default_palette_4[4 * 3] = {
  32. 0xFF, 0xFF, 0xFF,
  33. 0xAC, 0xAC, 0xAC,
  34. 0x55, 0x55, 0x55,
  35. 0x00, 0x00, 0x00
  36. };
  37. /* From a screenshot of the "Monitors & Sound" control panel in Mac OS 7.5.5 */
  38. static const uint8_t ff_qt_default_palette_16[16 * 3] = {
  39. 0xFF, 0xFF, 0xFF,
  40. 0xFC, 0xF3, 0x05,
  41. 0xFF, 0x64, 0x02,
  42. 0xDD, 0x08, 0x06,
  43. 0xF2, 0x08, 0x84,
  44. 0x46, 0x00, 0xA5,
  45. 0x00, 0x00, 0xD4,
  46. 0x02, 0xAB, 0xEA,
  47. 0x1F, 0xB7, 0x14,
  48. 0x00, 0x64, 0x11,
  49. 0x56, 0x2C, 0x05,
  50. 0x90, 0x71, 0x3A,
  51. 0xC0, 0xC0, 0xC0,
  52. 0x80, 0x80, 0x80,
  53. 0x40, 0x40, 0x40,
  54. 0x00, 0x00, 0x00
  55. };
  56. static const uint8_t ff_qt_default_palette_256[256 * 3] = {
  57. /* 0, 0x00 */ 0xFF, 0xFF, 0xFF,
  58. /* 1, 0x01 */ 0xFF, 0xFF, 0xCC,
  59. /* 2, 0x02 */ 0xFF, 0xFF, 0x99,
  60. /* 3, 0x03 */ 0xFF, 0xFF, 0x66,
  61. /* 4, 0x04 */ 0xFF, 0xFF, 0x33,
  62. /* 5, 0x05 */ 0xFF, 0xFF, 0x00,
  63. /* 6, 0x06 */ 0xFF, 0xCC, 0xFF,
  64. /* 7, 0x07 */ 0xFF, 0xCC, 0xCC,
  65. /* 8, 0x08 */ 0xFF, 0xCC, 0x99,
  66. /* 9, 0x09 */ 0xFF, 0xCC, 0x66,
  67. /* 10, 0x0A */ 0xFF, 0xCC, 0x33,
  68. /* 11, 0x0B */ 0xFF, 0xCC, 0x00,
  69. /* 12, 0x0C */ 0xFF, 0x99, 0xFF,
  70. /* 13, 0x0D */ 0xFF, 0x99, 0xCC,
  71. /* 14, 0x0E */ 0xFF, 0x99, 0x99,
  72. /* 15, 0x0F */ 0xFF, 0x99, 0x66,
  73. /* 16, 0x10 */ 0xFF, 0x99, 0x33,
  74. /* 17, 0x11 */ 0xFF, 0x99, 0x00,
  75. /* 18, 0x12 */ 0xFF, 0x66, 0xFF,
  76. /* 19, 0x13 */ 0xFF, 0x66, 0xCC,
  77. /* 20, 0x14 */ 0xFF, 0x66, 0x99,
  78. /* 21, 0x15 */ 0xFF, 0x66, 0x66,
  79. /* 22, 0x16 */ 0xFF, 0x66, 0x33,
  80. /* 23, 0x17 */ 0xFF, 0x66, 0x00,
  81. /* 24, 0x18 */ 0xFF, 0x33, 0xFF,
  82. /* 25, 0x19 */ 0xFF, 0x33, 0xCC,
  83. /* 26, 0x1A */ 0xFF, 0x33, 0x99,
  84. /* 27, 0x1B */ 0xFF, 0x33, 0x66,
  85. /* 28, 0x1C */ 0xFF, 0x33, 0x33,
  86. /* 29, 0x1D */ 0xFF, 0x33, 0x00,
  87. /* 30, 0x1E */ 0xFF, 0x00, 0xFF,
  88. /* 31, 0x1F */ 0xFF, 0x00, 0xCC,
  89. /* 32, 0x20 */ 0xFF, 0x00, 0x99,
  90. /* 33, 0x21 */ 0xFF, 0x00, 0x66,
  91. /* 34, 0x22 */ 0xFF, 0x00, 0x33,
  92. /* 35, 0x23 */ 0xFF, 0x00, 0x00,
  93. /* 36, 0x24 */ 0xCC, 0xFF, 0xFF,
  94. /* 37, 0x25 */ 0xCC, 0xFF, 0xCC,
  95. /* 38, 0x26 */ 0xCC, 0xFF, 0x99,
  96. /* 39, 0x27 */ 0xCC, 0xFF, 0x66,
  97. /* 40, 0x28 */ 0xCC, 0xFF, 0x33,
  98. /* 41, 0x29 */ 0xCC, 0xFF, 0x00,
  99. /* 42, 0x2A */ 0xCC, 0xCC, 0xFF,
  100. /* 43, 0x2B */ 0xCC, 0xCC, 0xCC,
  101. /* 44, 0x2C */ 0xCC, 0xCC, 0x99,
  102. /* 45, 0x2D */ 0xCC, 0xCC, 0x66,
  103. /* 46, 0x2E */ 0xCC, 0xCC, 0x33,
  104. /* 47, 0x2F */ 0xCC, 0xCC, 0x00,
  105. /* 48, 0x30 */ 0xCC, 0x99, 0xFF,
  106. /* 49, 0x31 */ 0xCC, 0x99, 0xCC,
  107. /* 50, 0x32 */ 0xCC, 0x99, 0x99,
  108. /* 51, 0x33 */ 0xCC, 0x99, 0x66,
  109. /* 52, 0x34 */ 0xCC, 0x99, 0x33,
  110. /* 53, 0x35 */ 0xCC, 0x99, 0x00,
  111. /* 54, 0x36 */ 0xCC, 0x66, 0xFF,
  112. /* 55, 0x37 */ 0xCC, 0x66, 0xCC,
  113. /* 56, 0x38 */ 0xCC, 0x66, 0x99,
  114. /* 57, 0x39 */ 0xCC, 0x66, 0x66,
  115. /* 58, 0x3A */ 0xCC, 0x66, 0x33,
  116. /* 59, 0x3B */ 0xCC, 0x66, 0x00,
  117. /* 60, 0x3C */ 0xCC, 0x33, 0xFF,
  118. /* 61, 0x3D */ 0xCC, 0x33, 0xCC,
  119. /* 62, 0x3E */ 0xCC, 0x33, 0x99,
  120. /* 63, 0x3F */ 0xCC, 0x33, 0x66,
  121. /* 64, 0x40 */ 0xCC, 0x33, 0x33,
  122. /* 65, 0x41 */ 0xCC, 0x33, 0x00,
  123. /* 66, 0x42 */ 0xCC, 0x00, 0xFF,
  124. /* 67, 0x43 */ 0xCC, 0x00, 0xCC,
  125. /* 68, 0x44 */ 0xCC, 0x00, 0x99,
  126. /* 69, 0x45 */ 0xCC, 0x00, 0x66,
  127. /* 70, 0x46 */ 0xCC, 0x00, 0x33,
  128. /* 71, 0x47 */ 0xCC, 0x00, 0x00,
  129. /* 72, 0x48 */ 0x99, 0xFF, 0xFF,
  130. /* 73, 0x49 */ 0x99, 0xFF, 0xCC,
  131. /* 74, 0x4A */ 0x99, 0xFF, 0x99,
  132. /* 75, 0x4B */ 0x99, 0xFF, 0x66,
  133. /* 76, 0x4C */ 0x99, 0xFF, 0x33,
  134. /* 77, 0x4D */ 0x99, 0xFF, 0x00,
  135. /* 78, 0x4E */ 0x99, 0xCC, 0xFF,
  136. /* 79, 0x4F */ 0x99, 0xCC, 0xCC,
  137. /* 80, 0x50 */ 0x99, 0xCC, 0x99,
  138. /* 81, 0x51 */ 0x99, 0xCC, 0x66,
  139. /* 82, 0x52 */ 0x99, 0xCC, 0x33,
  140. /* 83, 0x53 */ 0x99, 0xCC, 0x00,
  141. /* 84, 0x54 */ 0x99, 0x99, 0xFF,
  142. /* 85, 0x55 */ 0x99, 0x99, 0xCC,
  143. /* 86, 0x56 */ 0x99, 0x99, 0x99,
  144. /* 87, 0x57 */ 0x99, 0x99, 0x66,
  145. /* 88, 0x58 */ 0x99, 0x99, 0x33,
  146. /* 89, 0x59 */ 0x99, 0x99, 0x00,
  147. /* 90, 0x5A */ 0x99, 0x66, 0xFF,
  148. /* 91, 0x5B */ 0x99, 0x66, 0xCC,
  149. /* 92, 0x5C */ 0x99, 0x66, 0x99,
  150. /* 93, 0x5D */ 0x99, 0x66, 0x66,
  151. /* 94, 0x5E */ 0x99, 0x66, 0x33,
  152. /* 95, 0x5F */ 0x99, 0x66, 0x00,
  153. /* 96, 0x60 */ 0x99, 0x33, 0xFF,
  154. /* 97, 0x61 */ 0x99, 0x33, 0xCC,
  155. /* 98, 0x62 */ 0x99, 0x33, 0x99,
  156. /* 99, 0x63 */ 0x99, 0x33, 0x66,
  157. /* 100, 0x64 */ 0x99, 0x33, 0x33,
  158. /* 101, 0x65 */ 0x99, 0x33, 0x00,
  159. /* 102, 0x66 */ 0x99, 0x00, 0xFF,
  160. /* 103, 0x67 */ 0x99, 0x00, 0xCC,
  161. /* 104, 0x68 */ 0x99, 0x00, 0x99,
  162. /* 105, 0x69 */ 0x99, 0x00, 0x66,
  163. /* 106, 0x6A */ 0x99, 0x00, 0x33,
  164. /* 107, 0x6B */ 0x99, 0x00, 0x00,
  165. /* 108, 0x6C */ 0x66, 0xFF, 0xFF,
  166. /* 109, 0x6D */ 0x66, 0xFF, 0xCC,
  167. /* 110, 0x6E */ 0x66, 0xFF, 0x99,
  168. /* 111, 0x6F */ 0x66, 0xFF, 0x66,
  169. /* 112, 0x70 */ 0x66, 0xFF, 0x33,
  170. /* 113, 0x71 */ 0x66, 0xFF, 0x00,
  171. /* 114, 0x72 */ 0x66, 0xCC, 0xFF,
  172. /* 115, 0x73 */ 0x66, 0xCC, 0xCC,
  173. /* 116, 0x74 */ 0x66, 0xCC, 0x99,
  174. /* 117, 0x75 */ 0x66, 0xCC, 0x66,
  175. /* 118, 0x76 */ 0x66, 0xCC, 0x33,
  176. /* 119, 0x77 */ 0x66, 0xCC, 0x00,
  177. /* 120, 0x78 */ 0x66, 0x99, 0xFF,
  178. /* 121, 0x79 */ 0x66, 0x99, 0xCC,
  179. /* 122, 0x7A */ 0x66, 0x99, 0x99,
  180. /* 123, 0x7B */ 0x66, 0x99, 0x66,
  181. /* 124, 0x7C */ 0x66, 0x99, 0x33,
  182. /* 125, 0x7D */ 0x66, 0x99, 0x00,
  183. /* 126, 0x7E */ 0x66, 0x66, 0xFF,
  184. /* 127, 0x7F */ 0x66, 0x66, 0xCC,
  185. /* 128, 0x80 */ 0x66, 0x66, 0x99,
  186. /* 129, 0x81 */ 0x66, 0x66, 0x66,
  187. /* 130, 0x82 */ 0x66, 0x66, 0x33,
  188. /* 131, 0x83 */ 0x66, 0x66, 0x00,
  189. /* 132, 0x84 */ 0x66, 0x33, 0xFF,
  190. /* 133, 0x85 */ 0x66, 0x33, 0xCC,
  191. /* 134, 0x86 */ 0x66, 0x33, 0x99,
  192. /* 135, 0x87 */ 0x66, 0x33, 0x66,
  193. /* 136, 0x88 */ 0x66, 0x33, 0x33,
  194. /* 137, 0x89 */ 0x66, 0x33, 0x00,
  195. /* 138, 0x8A */ 0x66, 0x00, 0xFF,
  196. /* 139, 0x8B */ 0x66, 0x00, 0xCC,
  197. /* 140, 0x8C */ 0x66, 0x00, 0x99,
  198. /* 141, 0x8D */ 0x66, 0x00, 0x66,
  199. /* 142, 0x8E */ 0x66, 0x00, 0x33,
  200. /* 143, 0x8F */ 0x66, 0x00, 0x00,
  201. /* 144, 0x90 */ 0x33, 0xFF, 0xFF,
  202. /* 145, 0x91 */ 0x33, 0xFF, 0xCC,
  203. /* 146, 0x92 */ 0x33, 0xFF, 0x99,
  204. /* 147, 0x93 */ 0x33, 0xFF, 0x66,
  205. /* 148, 0x94 */ 0x33, 0xFF, 0x33,
  206. /* 149, 0x95 */ 0x33, 0xFF, 0x00,
  207. /* 150, 0x96 */ 0x33, 0xCC, 0xFF,
  208. /* 151, 0x97 */ 0x33, 0xCC, 0xCC,
  209. /* 152, 0x98 */ 0x33, 0xCC, 0x99,
  210. /* 153, 0x99 */ 0x33, 0xCC, 0x66,
  211. /* 154, 0x9A */ 0x33, 0xCC, 0x33,
  212. /* 155, 0x9B */ 0x33, 0xCC, 0x00,
  213. /* 156, 0x9C */ 0x33, 0x99, 0xFF,
  214. /* 157, 0x9D */ 0x33, 0x99, 0xCC,
  215. /* 158, 0x9E */ 0x33, 0x99, 0x99,
  216. /* 159, 0x9F */ 0x33, 0x99, 0x66,
  217. /* 160, 0xA0 */ 0x33, 0x99, 0x33,
  218. /* 161, 0xA1 */ 0x33, 0x99, 0x00,
  219. /* 162, 0xA2 */ 0x33, 0x66, 0xFF,
  220. /* 163, 0xA3 */ 0x33, 0x66, 0xCC,
  221. /* 164, 0xA4 */ 0x33, 0x66, 0x99,
  222. /* 165, 0xA5 */ 0x33, 0x66, 0x66,
  223. /* 166, 0xA6 */ 0x33, 0x66, 0x33,
  224. /* 167, 0xA7 */ 0x33, 0x66, 0x00,
  225. /* 168, 0xA8 */ 0x33, 0x33, 0xFF,
  226. /* 169, 0xA9 */ 0x33, 0x33, 0xCC,
  227. /* 170, 0xAA */ 0x33, 0x33, 0x99,
  228. /* 171, 0xAB */ 0x33, 0x33, 0x66,
  229. /* 172, 0xAC */ 0x33, 0x33, 0x33,
  230. /* 173, 0xAD */ 0x33, 0x33, 0x00,
  231. /* 174, 0xAE */ 0x33, 0x00, 0xFF,
  232. /* 175, 0xAF */ 0x33, 0x00, 0xCC,
  233. /* 176, 0xB0 */ 0x33, 0x00, 0x99,
  234. /* 177, 0xB1 */ 0x33, 0x00, 0x66,
  235. /* 178, 0xB2 */ 0x33, 0x00, 0x33,
  236. /* 179, 0xB3 */ 0x33, 0x00, 0x00,
  237. /* 180, 0xB4 */ 0x00, 0xFF, 0xFF,
  238. /* 181, 0xB5 */ 0x00, 0xFF, 0xCC,
  239. /* 182, 0xB6 */ 0x00, 0xFF, 0x99,
  240. /* 183, 0xB7 */ 0x00, 0xFF, 0x66,
  241. /* 184, 0xB8 */ 0x00, 0xFF, 0x33,
  242. /* 185, 0xB9 */ 0x00, 0xFF, 0x00,
  243. /* 186, 0xBA */ 0x00, 0xCC, 0xFF,
  244. /* 187, 0xBB */ 0x00, 0xCC, 0xCC,
  245. /* 188, 0xBC */ 0x00, 0xCC, 0x99,
  246. /* 189, 0xBD */ 0x00, 0xCC, 0x66,
  247. /* 190, 0xBE */ 0x00, 0xCC, 0x33,
  248. /* 191, 0xBF */ 0x00, 0xCC, 0x00,
  249. /* 192, 0xC0 */ 0x00, 0x99, 0xFF,
  250. /* 193, 0xC1 */ 0x00, 0x99, 0xCC,
  251. /* 194, 0xC2 */ 0x00, 0x99, 0x99,
  252. /* 195, 0xC3 */ 0x00, 0x99, 0x66,
  253. /* 196, 0xC4 */ 0x00, 0x99, 0x33,
  254. /* 197, 0xC5 */ 0x00, 0x99, 0x00,
  255. /* 198, 0xC6 */ 0x00, 0x66, 0xFF,
  256. /* 199, 0xC7 */ 0x00, 0x66, 0xCC,
  257. /* 200, 0xC8 */ 0x00, 0x66, 0x99,
  258. /* 201, 0xC9 */ 0x00, 0x66, 0x66,
  259. /* 202, 0xCA */ 0x00, 0x66, 0x33,
  260. /* 203, 0xCB */ 0x00, 0x66, 0x00,
  261. /* 204, 0xCC */ 0x00, 0x33, 0xFF,
  262. /* 205, 0xCD */ 0x00, 0x33, 0xCC,
  263. /* 206, 0xCE */ 0x00, 0x33, 0x99,
  264. /* 207, 0xCF */ 0x00, 0x33, 0x66,
  265. /* 208, 0xD0 */ 0x00, 0x33, 0x33,
  266. /* 209, 0xD1 */ 0x00, 0x33, 0x00,
  267. /* 210, 0xD2 */ 0x00, 0x00, 0xFF,
  268. /* 211, 0xD3 */ 0x00, 0x00, 0xCC,
  269. /* 212, 0xD4 */ 0x00, 0x00, 0x99,
  270. /* 213, 0xD5 */ 0x00, 0x00, 0x66,
  271. /* 214, 0xD6 */ 0x00, 0x00, 0x33,
  272. /* 215, 0xD7 */ 0xEE, 0x00, 0x00,
  273. /* 216, 0xD8 */ 0xDD, 0x00, 0x00,
  274. /* 217, 0xD9 */ 0xBB, 0x00, 0x00,
  275. /* 218, 0xDA */ 0xAA, 0x00, 0x00,
  276. /* 219, 0xDB */ 0x88, 0x00, 0x00,
  277. /* 220, 0xDC */ 0x77, 0x00, 0x00,
  278. /* 221, 0xDD */ 0x55, 0x00, 0x00,
  279. /* 222, 0xDE */ 0x44, 0x00, 0x00,
  280. /* 223, 0xDF */ 0x22, 0x00, 0x00,
  281. /* 224, 0xE0 */ 0x11, 0x00, 0x00,
  282. /* 225, 0xE1 */ 0x00, 0xEE, 0x00,
  283. /* 226, 0xE2 */ 0x00, 0xDD, 0x00,
  284. /* 227, 0xE3 */ 0x00, 0xBB, 0x00,
  285. /* 228, 0xE4 */ 0x00, 0xAA, 0x00,
  286. /* 229, 0xE5 */ 0x00, 0x88, 0x00,
  287. /* 230, 0xE6 */ 0x00, 0x77, 0x00,
  288. /* 231, 0xE7 */ 0x00, 0x55, 0x00,
  289. /* 232, 0xE8 */ 0x00, 0x44, 0x00,
  290. /* 233, 0xE9 */ 0x00, 0x22, 0x00,
  291. /* 234, 0xEA */ 0x00, 0x11, 0x00,
  292. /* 235, 0xEB */ 0x00, 0x00, 0xEE,
  293. /* 236, 0xEC */ 0x00, 0x00, 0xDD,
  294. /* 237, 0xED */ 0x00, 0x00, 0xBB,
  295. /* 238, 0xEE */ 0x00, 0x00, 0xAA,
  296. /* 239, 0xEF */ 0x00, 0x00, 0x88,
  297. /* 240, 0xF0 */ 0x00, 0x00, 0x77,
  298. /* 241, 0xF1 */ 0x00, 0x00, 0x55,
  299. /* 242, 0xF2 */ 0x00, 0x00, 0x44,
  300. /* 243, 0xF3 */ 0x00, 0x00, 0x22,
  301. /* 244, 0xF4 */ 0x00, 0x00, 0x11,
  302. /* 245, 0xF5 */ 0xEE, 0xEE, 0xEE,
  303. /* 246, 0xF6 */ 0xDD, 0xDD, 0xDD,
  304. /* 247, 0xF7 */ 0xBB, 0xBB, 0xBB,
  305. /* 248, 0xF8 */ 0xAA, 0xAA, 0xAA,
  306. /* 249, 0xF9 */ 0x88, 0x88, 0x88,
  307. /* 250, 0xFA */ 0x77, 0x77, 0x77,
  308. /* 251, 0xFB */ 0x55, 0x55, 0x55,
  309. /* 252, 0xFC */ 0x44, 0x44, 0x44,
  310. /* 253, 0xFD */ 0x22, 0x22, 0x22,
  311. /* 254, 0xFE */ 0x11, 0x11, 0x11,
  312. /* 255, 0xFF */ 0x00, 0x00, 0x00
  313. };
  314. /**
  315. * Retrieve the palette (or "color table" in QuickTime terms), either
  316. * from the video sample description, or from the default Macintosh
  317. * palette.
  318. *
  319. * The file offset of the AVIOContext pointed to by the 'pb' variable
  320. * should be the start of the video sample description (the sample
  321. * description size and the data format).
  322. */
  323. int ff_get_qtpalette(int codec_id, AVIOContext *pb, uint32_t *palette);
  324. #endif /* AVFORMAT_QTPALETTE_H */