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.

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