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.

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