You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

468 lines
13KB

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