Mercurial > libavcodec.hg
annotate mpeg12data.h @ 5162:4394344397d8 libavcodec
include all prerequisites in header files
author | mru |
---|---|
date | Sat, 16 Jun 2007 22:59:13 +0000 |
parents | 5464e5021a67 |
children | 9ecbfc0c82bf |
rev | line source |
---|---|
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
1 /* |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
2 * MPEG1 codec / MPEG2 decoder |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
3 * copyright (c) 2000,2001 Fabrice Bellard |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
4 * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
5 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
6 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
7 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
12 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
16 * Lesser General Public License for more details. |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
17 * |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3776
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
3699
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
21 */ |
c537a97eec66
Add official LGPL license headers to the files that were missing them.
diego
parents:
3556
diff
changeset
|
22 |
1106 | 23 /** |
24 * @file mpeg12data.h | |
25 * MPEG1/2 tables. | |
0 | 26 */ |
27 | |
5162 | 28 #include <stdint.h> |
29 #include "mpegvideo.h" | |
30 | |
3776 | 31 const uint16_t ff_mpeg1_default_intra_matrix[64] = { |
2979 | 32 8, 16, 19, 22, 26, 27, 29, 34, |
33 16, 16, 22, 24, 27, 29, 34, 37, | |
34 19, 22, 26, 27, 29, 34, 34, 38, | |
35 22, 22, 26, 27, 29, 34, 37, 40, | |
36 22, 26, 27, 29, 32, 35, 40, 48, | |
37 26, 27, 29, 32, 35, 40, 48, 58, | |
38 26, 27, 29, 34, 38, 46, 56, 69, | |
39 27, 29, 35, 38, 46, 56, 69, 83 | |
0 | 40 }; |
41 | |
3776 | 42 const uint16_t ff_mpeg1_default_non_intra_matrix[64] = { |
0 | 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 16, 16, 16, 16, 16, 16, 16, 16, | |
50 16, 16, 16, 16, 16, 16, 16, 16, | |
51 }; | |
52 | |
1325 | 53 static const uint16_t vlc_dc_lum_code[12] = { |
0 | 54 0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff, |
55 }; | |
1325 | 56 static const unsigned char vlc_dc_lum_bits[12] = { |
0 | 57 3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, |
58 }; | |
59 | |
4180 | 60 static const uint16_t vlc_dc_chroma_code[12] = { |
0 | 61 0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff, |
62 }; | |
4180 | 63 static const unsigned char vlc_dc_chroma_bits[12] = { |
0 | 64 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, |
65 }; | |
66 | |
1064 | 67 static const uint16_t mpeg1_vlc[113][2] = { |
0 | 68 { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 }, |
69 { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 }, | |
70 { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 }, | |
71 { 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 }, { 0x1f, 14 }, | |
72 { 0x1e, 14 }, { 0x1d, 14 }, { 0x1c, 14 }, { 0x1b, 14 }, | |
73 { 0x1a, 14 }, { 0x19, 14 }, { 0x18, 14 }, { 0x17, 14 }, | |
74 { 0x16, 14 }, { 0x15, 14 }, { 0x14, 14 }, { 0x13, 14 }, | |
75 { 0x12, 14 }, { 0x11, 14 }, { 0x10, 14 }, { 0x18, 15 }, | |
76 { 0x17, 15 }, { 0x16, 15 }, { 0x15, 15 }, { 0x14, 15 }, | |
77 { 0x13, 15 }, { 0x12, 15 }, { 0x11, 15 }, { 0x10, 15 }, | |
78 { 0x3, 3 }, { 0x6, 6 }, { 0x25, 8 }, { 0xc, 10 }, | |
79 { 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, { 0x1f, 15 }, | |
80 { 0x1e, 15 }, { 0x1d, 15 }, { 0x1c, 15 }, { 0x1b, 15 }, | |
81 { 0x1a, 15 }, { 0x19, 15 }, { 0x13, 16 }, { 0x12, 16 }, | |
82 { 0x11, 16 }, { 0x10, 16 }, { 0x5, 4 }, { 0x4, 7 }, | |
83 { 0xb, 10 }, { 0x14, 12 }, { 0x14, 13 }, { 0x7, 5 }, | |
84 { 0x24, 8 }, { 0x1c, 12 }, { 0x13, 13 }, { 0x6, 5 }, | |
85 { 0xf, 10 }, { 0x12, 12 }, { 0x7, 6 }, { 0x9, 10 }, | |
86 { 0x12, 13 }, { 0x5, 6 }, { 0x1e, 12 }, { 0x14, 16 }, | |
87 { 0x4, 6 }, { 0x15, 12 }, { 0x7, 7 }, { 0x11, 12 }, | |
88 { 0x5, 7 }, { 0x11, 13 }, { 0x27, 8 }, { 0x10, 13 }, | |
89 { 0x23, 8 }, { 0x1a, 16 }, { 0x22, 8 }, { 0x19, 16 }, | |
90 { 0x20, 8 }, { 0x18, 16 }, { 0xe, 10 }, { 0x17, 16 }, | |
91 { 0xd, 10 }, { 0x16, 16 }, { 0x8, 10 }, { 0x15, 16 }, | |
92 { 0x1f, 12 }, { 0x1a, 12 }, { 0x19, 12 }, { 0x17, 12 }, | |
93 { 0x16, 12 }, { 0x1f, 13 }, { 0x1e, 13 }, { 0x1d, 13 }, | |
94 { 0x1c, 13 }, { 0x1b, 13 }, { 0x1f, 16 }, { 0x1e, 16 }, | |
95 { 0x1d, 16 }, { 0x1c, 16 }, { 0x1b, 16 }, | |
96 { 0x1, 6 }, /* escape */ | |
97 { 0x2, 2 }, /* EOB */ | |
98 }; | |
99 | |
1064 | 100 static const uint16_t mpeg2_vlc[113][2] = { |
0 | 101 {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, |
102 {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, | |
103 {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, | |
104 {0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14}, | |
105 {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14}, | |
106 {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14}, | |
107 {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14}, | |
108 {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15}, | |
109 {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15}, | |
110 {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15}, | |
111 {0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8}, | |
112 {0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15}, | |
113 {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15}, | |
114 {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16}, | |
2967 | 115 {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7}, |
116 {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5}, | |
117 {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6}, | |
118 {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9}, | |
119 {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16}, | |
120 {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12}, | |
121 {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13}, | |
122 {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16}, | |
123 {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16}, | |
124 {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16}, | |
125 {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12}, | |
126 {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13}, | |
127 {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16}, | |
128 {0x1d,16}, {0x1c,16}, {0x1b,16}, | |
0 | 129 {0x01,6}, /* escape */ |
130 {0x06,4}, /* EOB */ | |
131 }; | |
132 | |
1064 | 133 static const int8_t mpeg1_level[111] = { |
0 | 134 1, 2, 3, 4, 5, 6, 7, 8, |
135 9, 10, 11, 12, 13, 14, 15, 16, | |
136 17, 18, 19, 20, 21, 22, 23, 24, | |
137 25, 26, 27, 28, 29, 30, 31, 32, | |
138 33, 34, 35, 36, 37, 38, 39, 40, | |
139 1, 2, 3, 4, 5, 6, 7, 8, | |
140 9, 10, 11, 12, 13, 14, 15, 16, | |
141 17, 18, 1, 2, 3, 4, 5, 1, | |
142 2, 3, 4, 1, 2, 3, 1, 2, | |
143 3, 1, 2, 3, 1, 2, 1, 2, | |
144 1, 2, 1, 2, 1, 2, 1, 2, | |
145 1, 2, 1, 2, 1, 2, 1, 2, | |
146 1, 1, 1, 1, 1, 1, 1, 1, | |
147 1, 1, 1, 1, 1, 1, 1, | |
148 }; | |
149 | |
1064 | 150 static const int8_t mpeg1_run[111] = { |
0 | 151 0, 0, 0, 0, 0, 0, 0, 0, |
152 0, 0, 0, 0, 0, 0, 0, 0, | |
153 0, 0, 0, 0, 0, 0, 0, 0, | |
154 0, 0, 0, 0, 0, 0, 0, 0, | |
155 0, 0, 0, 0, 0, 0, 0, 0, | |
156 1, 1, 1, 1, 1, 1, 1, 1, | |
157 1, 1, 1, 1, 1, 1, 1, 1, | |
158 1, 1, 2, 2, 2, 2, 2, 3, | |
159 3, 3, 3, 4, 4, 4, 5, 5, | |
160 5, 6, 6, 6, 7, 7, 8, 8, | |
161 9, 9, 10, 10, 11, 11, 12, 12, | |
162 13, 13, 14, 14, 15, 15, 16, 16, | |
163 17, 18, 19, 20, 21, 22, 23, 24, | |
164 25, 26, 27, 28, 29, 30, 31, | |
165 }; | |
166 | |
167 static RLTable rl_mpeg1 = { | |
168 111, | |
169 111, | |
170 mpeg1_vlc, | |
171 mpeg1_run, | |
172 mpeg1_level, | |
173 }; | |
174 | |
175 static RLTable rl_mpeg2 = { | |
176 111, | |
177 111, | |
178 mpeg2_vlc, | |
179 mpeg1_run, | |
180 mpeg1_level, | |
181 }; | |
182 | |
1181 | 183 static const uint8_t mbAddrIncrTable[36][2] = { |
0 | 184 {0x1, 1}, |
185 {0x3, 3}, | |
186 {0x2, 3}, | |
187 {0x3, 4}, | |
188 {0x2, 4}, | |
189 {0x3, 5}, | |
190 {0x2, 5}, | |
191 {0x7, 7}, | |
192 {0x6, 7}, | |
193 {0xb, 8}, | |
194 {0xa, 8}, | |
195 {0x9, 8}, | |
196 {0x8, 8}, | |
197 {0x7, 8}, | |
198 {0x6, 8}, | |
199 {0x17, 10}, | |
200 {0x16, 10}, | |
201 {0x15, 10}, | |
202 {0x14, 10}, | |
203 {0x13, 10}, | |
204 {0x12, 10}, | |
205 {0x23, 11}, | |
206 {0x22, 11}, | |
207 {0x21, 11}, | |
208 {0x20, 11}, | |
209 {0x1f, 11}, | |
210 {0x1e, 11}, | |
211 {0x1d, 11}, | |
212 {0x1c, 11}, | |
213 {0x1b, 11}, | |
214 {0x1a, 11}, | |
215 {0x19, 11}, | |
216 {0x18, 11}, | |
217 {0x8, 11}, /* escape */ | |
218 {0xf, 11}, /* stuffing */ | |
1181 | 219 {0x0, 8}, /* end (and 15 more 0 bits should follow) */ |
0 | 220 }; |
221 | |
1853 | 222 static const uint8_t mbPatTable[64][2] = { |
223 {0x1, 9}, | |
0 | 224 {0xb, 5}, |
225 {0x9, 5}, | |
226 {0xd, 6}, | |
227 {0xd, 4}, | |
228 {0x17, 7}, | |
229 {0x13, 7}, | |
230 {0x1f, 8}, | |
231 {0xc, 4}, | |
232 {0x16, 7}, | |
233 {0x12, 7}, | |
234 {0x1e, 8}, | |
235 {0x13, 5}, | |
236 {0x1b, 8}, | |
237 {0x17, 8}, | |
238 {0x13, 8}, | |
239 {0xb, 4}, | |
240 {0x15, 7}, | |
241 {0x11, 7}, | |
242 {0x1d, 8}, | |
243 {0x11, 5}, | |
244 {0x19, 8}, | |
245 {0x15, 8}, | |
246 {0x11, 8}, | |
247 {0xf, 6}, | |
248 {0xf, 8}, | |
249 {0xd, 8}, | |
250 {0x3, 9}, | |
251 {0xf, 5}, | |
252 {0xb, 8}, | |
253 {0x7, 8}, | |
254 {0x7, 9}, | |
255 {0xa, 4}, | |
256 {0x14, 7}, | |
257 {0x10, 7}, | |
258 {0x1c, 8}, | |
259 {0xe, 6}, | |
260 {0xe, 8}, | |
261 {0xc, 8}, | |
262 {0x2, 9}, | |
263 {0x10, 5}, | |
264 {0x18, 8}, | |
265 {0x14, 8}, | |
266 {0x10, 8}, | |
267 {0xe, 5}, | |
268 {0xa, 8}, | |
269 {0x6, 8}, | |
270 {0x6, 9}, | |
271 {0x12, 5}, | |
272 {0x1a, 8}, | |
273 {0x16, 8}, | |
274 {0x12, 8}, | |
275 {0xd, 5}, | |
276 {0x9, 8}, | |
277 {0x5, 8}, | |
278 {0x5, 9}, | |
279 {0xc, 5}, | |
280 {0x8, 8}, | |
281 {0x4, 8}, | |
282 {0x4, 9}, | |
283 {0x7, 3}, | |
284 {0xa, 5}, | |
285 {0x8, 5}, | |
286 {0xc, 6} | |
287 }; | |
288 | |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
289 #define MB_TYPE_ZERO_MV 0x20000000 |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
290 #define IS_ZERO_MV(a) ((a)&MB_TYPE_ZERO_MV) |
0 | 291 |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
292 static const uint8_t table_mb_ptype[7][2] = { |
64 | 293 { 3, 5 }, // 0x01 MB_INTRA |
294 { 1, 2 }, // 0x02 MB_PAT | |
295 { 1, 3 }, // 0x08 MB_FOR | |
296 { 1, 1 }, // 0x0A MB_FOR|MB_PAT | |
297 { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA | |
298 { 1, 5 }, // 0x12 MB_QUANT|MB_PAT | |
299 { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT | |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
300 }; |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
301 |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
302 static const uint32_t ptype2mb_type[7] = { |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
303 MB_TYPE_INTRA, |
1655 | 304 MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
305 MB_TYPE_L0, |
1655 | 306 MB_TYPE_L0 | MB_TYPE_CBP, |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
307 MB_TYPE_QUANT | MB_TYPE_INTRA, |
1655 | 308 MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16, |
309 MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP, | |
0 | 310 }; |
311 | |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
312 static const uint8_t table_mb_btype[11][2] = { |
64 | 313 { 3, 5 }, // 0x01 MB_INTRA |
314 { 2, 3 }, // 0x04 MB_BACK | |
315 { 3, 3 }, // 0x06 MB_BACK|MB_PAT | |
316 { 2, 4 }, // 0x08 MB_FOR | |
317 { 3, 4 }, // 0x0A MB_FOR|MB_PAT | |
318 { 2, 2 }, // 0x0C MB_FOR|MB_BACK | |
319 { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT | |
320 { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA | |
321 { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT | |
322 { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT | |
323 { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT | |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
324 }; |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
325 |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
326 static const uint32_t btype2mb_type[11] = { |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
327 MB_TYPE_INTRA, |
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
328 MB_TYPE_L1, |
1655 | 329 MB_TYPE_L1 | MB_TYPE_CBP, |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
330 MB_TYPE_L0, |
1655 | 331 MB_TYPE_L0 | MB_TYPE_CBP, |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
332 MB_TYPE_L0L1, |
1655 | 333 MB_TYPE_L0L1 | MB_TYPE_CBP, |
1177
fea03d2c4946
simplified adressing of most mb based arrays (mb_x + mb_y*s->mb_stride) now instead of mb_x + mb_y*mb_width and 1+mb_x + (1+mb_y)*(mb_width+2) and ... mixture
michaelni
parents:
1126
diff
changeset
|
334 MB_TYPE_QUANT | MB_TYPE_INTRA, |
1655 | 335 MB_TYPE_QUANT | MB_TYPE_L1 | MB_TYPE_CBP, |
336 MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP, | |
337 MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP, | |
0 | 338 }; |
339 | |
1064 | 340 static const uint8_t mbMotionVectorTable[17][2] = { |
0 | 341 { 0x1, 1 }, |
342 { 0x1, 2 }, | |
343 { 0x1, 3 }, | |
344 { 0x1, 4 }, | |
345 { 0x3, 6 }, | |
346 { 0x5, 7 }, | |
347 { 0x4, 7 }, | |
348 { 0x3, 7 }, | |
349 { 0xb, 9 }, | |
350 { 0xa, 9 }, | |
351 { 0x9, 9 }, | |
352 { 0x11, 10 }, | |
353 { 0x10, 10 }, | |
354 { 0xf, 10 }, | |
355 { 0xe, 10 }, | |
356 { 0xd, 10 }, | |
357 { 0xc, 10 }, | |
358 }; | |
359 | |
3391
d60dc0a7dee6
staric frame_rate_tab -> non static ff_frame_rate_tab part of the cavs patch by (Stefan Gehrer stefan.gehrer gmx de)
michael
parents:
2979
diff
changeset
|
360 const AVRational ff_frame_rate_tab[] = { |
1837 | 361 { 0, 0}, |
362 {24000, 1001}, | |
363 { 24, 1}, | |
364 { 25, 1}, | |
365 {30000, 1001}, | |
366 { 30, 1}, | |
367 { 50, 1}, | |
368 {60000, 1001}, | |
369 { 60, 1}, | |
1126
77ccf7fe3bd0
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
1106
diff
changeset
|
370 // Xing's 15fps: (9) |
1837 | 371 { 15, 1}, |
1126
77ccf7fe3bd0
per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents:
1106
diff
changeset
|
372 // libmpeg3's "Unofficial economy rates": (10-13) |
1837 | 373 { 5, 1}, |
374 { 10, 1}, | |
375 { 12, 1}, | |
376 { 15, 1}, | |
377 { 0, 0}, | |
0 | 378 }; |
379 | |
1064 | 380 static const uint8_t non_linear_qscale[32] = { |
0 | 381 0, 1, 2, 3, 4, 5, 6, 7, |
382 8,10,12,14,16,18,20,22, | |
383 24,28,32,36,40,44,48,52, | |
384 56,64,72,80,88,96,104,112, | |
385 }; | |
498 | 386 |
4621 | 387 static const uint8_t inv_non_linear_qscale[13] = { |
388 0, 2, 4, 6, 8, | |
389 9,10,11,12,13,14,15,16, | |
390 }; | |
391 | |
2753 | 392 const uint8_t ff_mpeg1_dc_scale_table[128]={ |
498 | 393 // 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 |
394 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, | |
395 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, | |
396 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, | |
397 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, | |
398 }; | |
399 | |
3556
6805c1e5507e
Fix some "'static' is not at beginning of declaration" warnings.
diego
parents:
3391
diff
changeset
|
400 static const uint8_t mpeg2_dc_scale_table1[128]={ |
1993 | 401 // 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 |
402 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, | |
403 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, | |
404 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, | |
405 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, | |
406 }; | |
407 | |
2967 | 408 static const uint8_t mpeg2_dc_scale_table2[128]={ |
1993 | 409 // 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 |
410 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, | |
411 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, | |
412 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, | |
413 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, | |
414 }; | |
415 | |
2967 | 416 static const uint8_t mpeg2_dc_scale_table3[128]={ |
1993 | 417 // 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 |
418 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, | |
419 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, | |
420 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, | |
421 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, | |
422 }; | |
423 | |
2753 | 424 static const uint8_t *mpeg2_dc_scale_table[4]={ |
1993 | 425 ff_mpeg1_dc_scale_table, |
426 mpeg2_dc_scale_table1, | |
427 mpeg2_dc_scale_table2, | |
2967 | 428 mpeg2_dc_scale_table3, |
1993 | 429 }; |
430 | |
917 | 431 static const float mpeg1_aspect[16]={ |
432 0.0000, | |
433 1.0000, | |
434 0.6735, | |
435 0.7031, | |
2967 | 436 |
917 | 437 0.7615, |
438 0.8055, | |
439 0.8437, | |
440 0.8935, | |
498 | 441 |
917 | 442 0.9157, |
443 0.9815, | |
444 1.0255, | |
445 1.0695, | |
446 | |
447 1.0950, | |
448 1.1575, | |
449 1.2015, | |
450 }; | |
451 | |
1548 | 452 static const AVRational mpeg2_aspect[16]={ |
453 {0,1}, | |
454 {1,1}, | |
455 {4,3}, | |
456 {16,9}, | |
457 {221,100}, | |
458 {0,1}, | |
459 {0,1}, | |
460 {0,1}, | |
461 {0,1}, | |
462 {0,1}, | |
463 {0,1}, | |
464 {0,1}, | |
465 {0,1}, | |
466 {0,1}, | |
467 {0,1}, | |
468 {0,1}, | |
917 | 469 }; |
470 | |
1721 | 471 static const uint8_t svcd_scan_offset_placeholder[14]={ |
472 0x10, 0x0E, | |
473 0x00, 0x80, 0x81, | |
474 0x00, 0x80, 0x81, | |
475 0xff, 0xff, 0xff, | |
476 0xff, 0xff, 0xff, | |
477 }; |