mpeg12data.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. /*
  2. * MPEG1 codec / MPEG2 decoder
  3. * copyright (c) 2000,2001 Fabrice Bellard
  4. * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  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. /**
  23. * @file mpeg12data.h
  24. * MPEG1/2 tables.
  25. */
  26. const uint16_t ff_mpeg1_default_intra_matrix[64] = {
  27. 8, 16, 19, 22, 26, 27, 29, 34,
  28. 16, 16, 22, 24, 27, 29, 34, 37,
  29. 19, 22, 26, 27, 29, 34, 34, 38,
  30. 22, 22, 26, 27, 29, 34, 37, 40,
  31. 22, 26, 27, 29, 32, 35, 40, 48,
  32. 26, 27, 29, 32, 35, 40, 48, 58,
  33. 26, 27, 29, 34, 38, 46, 56, 69,
  34. 27, 29, 35, 38, 46, 56, 69, 83
  35. };
  36. const uint16_t ff_mpeg1_default_non_intra_matrix[64] = {
  37. 16, 16, 16, 16, 16, 16, 16, 16,
  38. 16, 16, 16, 16, 16, 16, 16, 16,
  39. 16, 16, 16, 16, 16, 16, 16, 16,
  40. 16, 16, 16, 16, 16, 16, 16, 16,
  41. 16, 16, 16, 16, 16, 16, 16, 16,
  42. 16, 16, 16, 16, 16, 16, 16, 16,
  43. 16, 16, 16, 16, 16, 16, 16, 16,
  44. 16, 16, 16, 16, 16, 16, 16, 16,
  45. };
  46. static const uint16_t vlc_dc_lum_code[12] = {
  47. 0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
  48. };
  49. static const unsigned char vlc_dc_lum_bits[12] = {
  50. 3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
  51. };
  52. static const uint16_t vlc_dc_chroma_code[12] = {
  53. 0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff,
  54. };
  55. static const unsigned char vlc_dc_chroma_bits[12] = {
  56. 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10,
  57. };
  58. static const uint16_t mpeg1_vlc[113][2] = {
  59. { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
  60. { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
  61. { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 },
  62. { 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 }, { 0x1f, 14 },
  63. { 0x1e, 14 }, { 0x1d, 14 }, { 0x1c, 14 }, { 0x1b, 14 },
  64. { 0x1a, 14 }, { 0x19, 14 }, { 0x18, 14 }, { 0x17, 14 },
  65. { 0x16, 14 }, { 0x15, 14 }, { 0x14, 14 }, { 0x13, 14 },
  66. { 0x12, 14 }, { 0x11, 14 }, { 0x10, 14 }, { 0x18, 15 },
  67. { 0x17, 15 }, { 0x16, 15 }, { 0x15, 15 }, { 0x14, 15 },
  68. { 0x13, 15 }, { 0x12, 15 }, { 0x11, 15 }, { 0x10, 15 },
  69. { 0x3, 3 }, { 0x6, 6 }, { 0x25, 8 }, { 0xc, 10 },
  70. { 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, { 0x1f, 15 },
  71. { 0x1e, 15 }, { 0x1d, 15 }, { 0x1c, 15 }, { 0x1b, 15 },
  72. { 0x1a, 15 }, { 0x19, 15 }, { 0x13, 16 }, { 0x12, 16 },
  73. { 0x11, 16 }, { 0x10, 16 }, { 0x5, 4 }, { 0x4, 7 },
  74. { 0xb, 10 }, { 0x14, 12 }, { 0x14, 13 }, { 0x7, 5 },
  75. { 0x24, 8 }, { 0x1c, 12 }, { 0x13, 13 }, { 0x6, 5 },
  76. { 0xf, 10 }, { 0x12, 12 }, { 0x7, 6 }, { 0x9, 10 },
  77. { 0x12, 13 }, { 0x5, 6 }, { 0x1e, 12 }, { 0x14, 16 },
  78. { 0x4, 6 }, { 0x15, 12 }, { 0x7, 7 }, { 0x11, 12 },
  79. { 0x5, 7 }, { 0x11, 13 }, { 0x27, 8 }, { 0x10, 13 },
  80. { 0x23, 8 }, { 0x1a, 16 }, { 0x22, 8 }, { 0x19, 16 },
  81. { 0x20, 8 }, { 0x18, 16 }, { 0xe, 10 }, { 0x17, 16 },
  82. { 0xd, 10 }, { 0x16, 16 }, { 0x8, 10 }, { 0x15, 16 },
  83. { 0x1f, 12 }, { 0x1a, 12 }, { 0x19, 12 }, { 0x17, 12 },
  84. { 0x16, 12 }, { 0x1f, 13 }, { 0x1e, 13 }, { 0x1d, 13 },
  85. { 0x1c, 13 }, { 0x1b, 13 }, { 0x1f, 16 }, { 0x1e, 16 },
  86. { 0x1d, 16 }, { 0x1c, 16 }, { 0x1b, 16 },
  87. { 0x1, 6 }, /* escape */
  88. { 0x2, 2 }, /* EOB */
  89. };
  90. static const uint16_t mpeg2_vlc[113][2] = {
  91. {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5},
  92. {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7},
  93. {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8},
  94. {0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14},
  95. {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14},
  96. {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14},
  97. {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14},
  98. {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15},
  99. {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15},
  100. {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15},
  101. {0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8},
  102. {0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15},
  103. {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15},
  104. {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16},
  105. {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7},
  106. {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5},
  107. {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6},
  108. {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9},
  109. {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16},
  110. {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12},
  111. {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13},
  112. {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16},
  113. {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16},
  114. {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16},
  115. {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12},
  116. {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13},
  117. {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16},
  118. {0x1d,16}, {0x1c,16}, {0x1b,16},
  119. {0x01,6}, /* escape */
  120. {0x06,4}, /* EOB */
  121. };
  122. static const int8_t mpeg1_level[111] = {
  123. 1, 2, 3, 4, 5, 6, 7, 8,
  124. 9, 10, 11, 12, 13, 14, 15, 16,
  125. 17, 18, 19, 20, 21, 22, 23, 24,
  126. 25, 26, 27, 28, 29, 30, 31, 32,
  127. 33, 34, 35, 36, 37, 38, 39, 40,
  128. 1, 2, 3, 4, 5, 6, 7, 8,
  129. 9, 10, 11, 12, 13, 14, 15, 16,
  130. 17, 18, 1, 2, 3, 4, 5, 1,
  131. 2, 3, 4, 1, 2, 3, 1, 2,
  132. 3, 1, 2, 3, 1, 2, 1, 2,
  133. 1, 2, 1, 2, 1, 2, 1, 2,
  134. 1, 2, 1, 2, 1, 2, 1, 2,
  135. 1, 1, 1, 1, 1, 1, 1, 1,
  136. 1, 1, 1, 1, 1, 1, 1,
  137. };
  138. static const int8_t mpeg1_run[111] = {
  139. 0, 0, 0, 0, 0, 0, 0, 0,
  140. 0, 0, 0, 0, 0, 0, 0, 0,
  141. 0, 0, 0, 0, 0, 0, 0, 0,
  142. 0, 0, 0, 0, 0, 0, 0, 0,
  143. 0, 0, 0, 0, 0, 0, 0, 0,
  144. 1, 1, 1, 1, 1, 1, 1, 1,
  145. 1, 1, 1, 1, 1, 1, 1, 1,
  146. 1, 1, 2, 2, 2, 2, 2, 3,
  147. 3, 3, 3, 4, 4, 4, 5, 5,
  148. 5, 6, 6, 6, 7, 7, 8, 8,
  149. 9, 9, 10, 10, 11, 11, 12, 12,
  150. 13, 13, 14, 14, 15, 15, 16, 16,
  151. 17, 18, 19, 20, 21, 22, 23, 24,
  152. 25, 26, 27, 28, 29, 30, 31,
  153. };
  154. static RLTable rl_mpeg1 = {
  155. 111,
  156. 111,
  157. mpeg1_vlc,
  158. mpeg1_run,
  159. mpeg1_level,
  160. };
  161. static RLTable rl_mpeg2 = {
  162. 111,
  163. 111,
  164. mpeg2_vlc,
  165. mpeg1_run,
  166. mpeg1_level,
  167. };
  168. static const uint8_t mbAddrIncrTable[36][2] = {
  169. {0x1, 1},
  170. {0x3, 3},
  171. {0x2, 3},
  172. {0x3, 4},
  173. {0x2, 4},
  174. {0x3, 5},
  175. {0x2, 5},
  176. {0x7, 7},
  177. {0x6, 7},
  178. {0xb, 8},
  179. {0xa, 8},
  180. {0x9, 8},
  181. {0x8, 8},
  182. {0x7, 8},
  183. {0x6, 8},
  184. {0x17, 10},
  185. {0x16, 10},
  186. {0x15, 10},
  187. {0x14, 10},
  188. {0x13, 10},
  189. {0x12, 10},
  190. {0x23, 11},
  191. {0x22, 11},
  192. {0x21, 11},
  193. {0x20, 11},
  194. {0x1f, 11},
  195. {0x1e, 11},
  196. {0x1d, 11},
  197. {0x1c, 11},
  198. {0x1b, 11},
  199. {0x1a, 11},
  200. {0x19, 11},
  201. {0x18, 11},
  202. {0x8, 11}, /* escape */
  203. {0xf, 11}, /* stuffing */
  204. {0x0, 8}, /* end (and 15 more 0 bits should follow) */
  205. };
  206. static const uint8_t mbPatTable[64][2] = {
  207. {0x1, 9},
  208. {0xb, 5},
  209. {0x9, 5},
  210. {0xd, 6},
  211. {0xd, 4},
  212. {0x17, 7},
  213. {0x13, 7},
  214. {0x1f, 8},
  215. {0xc, 4},
  216. {0x16, 7},
  217. {0x12, 7},
  218. {0x1e, 8},
  219. {0x13, 5},
  220. {0x1b, 8},
  221. {0x17, 8},
  222. {0x13, 8},
  223. {0xb, 4},
  224. {0x15, 7},
  225. {0x11, 7},
  226. {0x1d, 8},
  227. {0x11, 5},
  228. {0x19, 8},
  229. {0x15, 8},
  230. {0x11, 8},
  231. {0xf, 6},
  232. {0xf, 8},
  233. {0xd, 8},
  234. {0x3, 9},
  235. {0xf, 5},
  236. {0xb, 8},
  237. {0x7, 8},
  238. {0x7, 9},
  239. {0xa, 4},
  240. {0x14, 7},
  241. {0x10, 7},
  242. {0x1c, 8},
  243. {0xe, 6},
  244. {0xe, 8},
  245. {0xc, 8},
  246. {0x2, 9},
  247. {0x10, 5},
  248. {0x18, 8},
  249. {0x14, 8},
  250. {0x10, 8},
  251. {0xe, 5},
  252. {0xa, 8},
  253. {0x6, 8},
  254. {0x6, 9},
  255. {0x12, 5},
  256. {0x1a, 8},
  257. {0x16, 8},
  258. {0x12, 8},
  259. {0xd, 5},
  260. {0x9, 8},
  261. {0x5, 8},
  262. {0x5, 9},
  263. {0xc, 5},
  264. {0x8, 8},
  265. {0x4, 8},
  266. {0x4, 9},
  267. {0x7, 3},
  268. {0xa, 5},
  269. {0x8, 5},
  270. {0xc, 6}
  271. };
  272. #define MB_TYPE_ZERO_MV 0x20000000
  273. #define IS_ZERO_MV(a) ((a)&MB_TYPE_ZERO_MV)
  274. static const uint8_t table_mb_ptype[7][2] = {
  275. { 3, 5 }, // 0x01 MB_INTRA
  276. { 1, 2 }, // 0x02 MB_PAT
  277. { 1, 3 }, // 0x08 MB_FOR
  278. { 1, 1 }, // 0x0A MB_FOR|MB_PAT
  279. { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
  280. { 1, 5 }, // 0x12 MB_QUANT|MB_PAT
  281. { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
  282. };
  283. static const uint32_t ptype2mb_type[7] = {
  284. MB_TYPE_INTRA,
  285. MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
  286. MB_TYPE_L0,
  287. MB_TYPE_L0 | MB_TYPE_CBP,
  288. MB_TYPE_QUANT | MB_TYPE_INTRA,
  289. MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
  290. MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
  291. };
  292. static const uint8_t table_mb_btype[11][2] = {
  293. { 3, 5 }, // 0x01 MB_INTRA
  294. { 2, 3 }, // 0x04 MB_BACK
  295. { 3, 3 }, // 0x06 MB_BACK|MB_PAT
  296. { 2, 4 }, // 0x08 MB_FOR
  297. { 3, 4 }, // 0x0A MB_FOR|MB_PAT
  298. { 2, 2 }, // 0x0C MB_FOR|MB_BACK
  299. { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT
  300. { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
  301. { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT
  302. { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
  303. { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
  304. };
  305. static const uint32_t btype2mb_type[11] = {
  306. MB_TYPE_INTRA,
  307. MB_TYPE_L1,
  308. MB_TYPE_L1 | MB_TYPE_CBP,
  309. MB_TYPE_L0,
  310. MB_TYPE_L0 | MB_TYPE_CBP,
  311. MB_TYPE_L0L1,
  312. MB_TYPE_L0L1 | MB_TYPE_CBP,
  313. MB_TYPE_QUANT | MB_TYPE_INTRA,
  314. MB_TYPE_QUANT | MB_TYPE_L1 | MB_TYPE_CBP,
  315. MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
  316. MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP,
  317. };
  318. static const uint8_t mbMotionVectorTable[17][2] = {
  319. { 0x1, 1 },
  320. { 0x1, 2 },
  321. { 0x1, 3 },
  322. { 0x1, 4 },
  323. { 0x3, 6 },
  324. { 0x5, 7 },
  325. { 0x4, 7 },
  326. { 0x3, 7 },
  327. { 0xb, 9 },
  328. { 0xa, 9 },
  329. { 0x9, 9 },
  330. { 0x11, 10 },
  331. { 0x10, 10 },
  332. { 0xf, 10 },
  333. { 0xe, 10 },
  334. { 0xd, 10 },
  335. { 0xc, 10 },
  336. };
  337. const AVRational ff_frame_rate_tab[] = {
  338. { 0, 0},
  339. {24000, 1001},
  340. { 24, 1},
  341. { 25, 1},
  342. {30000, 1001},
  343. { 30, 1},
  344. { 50, 1},
  345. {60000, 1001},
  346. { 60, 1},
  347. // Xing's 15fps: (9)
  348. { 15, 1},
  349. // libmpeg3's "Unofficial economy rates": (10-13)
  350. { 5, 1},
  351. { 10, 1},
  352. { 12, 1},
  353. { 15, 1},
  354. { 0, 0},
  355. };
  356. static const uint8_t non_linear_qscale[32] = {
  357. 0, 1, 2, 3, 4, 5, 6, 7,
  358. 8,10,12,14,16,18,20,22,
  359. 24,28,32,36,40,44,48,52,
  360. 56,64,72,80,88,96,104,112,
  361. };
  362. static const uint8_t inv_non_linear_qscale[13] = {
  363. 0, 2, 4, 6, 8,
  364. 9,10,11,12,13,14,15,16,
  365. };
  366. const uint8_t ff_mpeg1_dc_scale_table[128]={
  367. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  368. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  369. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  370. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  371. 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  372. };
  373. static const uint8_t mpeg2_dc_scale_table1[128]={
  374. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  375. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  376. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  377. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  378. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  379. };
  380. static const uint8_t mpeg2_dc_scale_table2[128]={
  381. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  382. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  383. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  384. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  385. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  386. };
  387. static const uint8_t mpeg2_dc_scale_table3[128]={
  388. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  389. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  390. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  391. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  392. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  393. };
  394. static const uint8_t *mpeg2_dc_scale_table[4]={
  395. ff_mpeg1_dc_scale_table,
  396. mpeg2_dc_scale_table1,
  397. mpeg2_dc_scale_table2,
  398. mpeg2_dc_scale_table3,
  399. };
  400. static const float mpeg1_aspect[16]={
  401. 0.0000,
  402. 1.0000,
  403. 0.6735,
  404. 0.7031,
  405. 0.7615,
  406. 0.8055,
  407. 0.8437,
  408. 0.8935,
  409. 0.9157,
  410. 0.9815,
  411. 1.0255,
  412. 1.0695,
  413. 1.0950,
  414. 1.1575,
  415. 1.2015,
  416. };
  417. static const AVRational mpeg2_aspect[16]={
  418. {0,1},
  419. {1,1},
  420. {4,3},
  421. {16,9},
  422. {221,100},
  423. {0,1},
  424. {0,1},
  425. {0,1},
  426. {0,1},
  427. {0,1},
  428. {0,1},
  429. {0,1},
  430. {0,1},
  431. {0,1},
  432. {0,1},
  433. {0,1},
  434. };
  435. static const uint8_t svcd_scan_offset_placeholder[14]={
  436. 0x10, 0x0E,
  437. 0x00, 0x80, 0x81,
  438. 0x00, 0x80, 0x81,
  439. 0xff, 0xff, 0xff,
  440. 0xff, 0xff, 0xff,
  441. };