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