~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/mpeg4data.h

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-25 15:47:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080225154712-qvr11ekcea4c9ry8
Tags: 1.1.6-0.1ubuntu1
* Merge from debian-multimedia (LP: #120003), Ubuntu Changes:
 - For ffmpeg-related build-deps, remove cvs from package names.
 - Standards-Version 3.7.3
 - Maintainer Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * copyright (c) 2000,2001 Fabrice Bellard
 
3
 * H263+ support
 
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
 
1
23
/**
2
24
 * @file mpeg4data.h
3
25
 * mpeg4 tables.
45
67
{
46
68
    {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
47
69
    {1,8}, {1,9}, {1,10}, {1,11},
48
 
}; 
 
70
};
49
71
 
50
72
const uint8_t DCtab_chrom[13][2] =
51
73
{
52
74
    {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
53
75
    {1,9}, {1,10}, {1,11}, {1,12},
54
 
}; 
 
76
};
55
77
 
56
78
const uint16_t intra_vlc[103][2] = {
57
79
{ 0x2, 2 },
169
191
{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4}
170
192
};
171
193
 
172
 
static const uint8_t inter_rvlc_run[169]={
173
 
 0,  0,  0,  0,  0,  0,  0,  0, 
174
 
 0,  0,  0,  0,  0,  0,  0,  0, 
175
 
 0,  0,  0,  1,  1,  1,  1,  1, 
176
 
 1,  1,  1,  1,  1,  2,  2,  2, 
177
 
 2,  2,  2,  2,  3,  3,  3,  3, 
178
 
 3,  3,  3,  4,  4,  4,  4,  4, 
179
 
 5,  5,  5,  5,  6,  6,  6,  6, 
180
 
 7,  7,  7,  7,  8,  8,  8,  9, 
181
 
 9,  9, 10, 10, 11, 11, 12, 12, 
182
 
13, 13, 14, 14, 15, 15, 16, 16, 
183
 
17, 17, 18, 19, 20, 21, 22, 23, 
184
 
24, 25, 26, 27, 28, 29, 30, 31, 
185
 
32, 33, 34, 35, 36, 37, 38, 
186
 
 0,  0,  0,  0,  0,  1,  1,  1, 
187
 
 1,  1,  2,  2,  2,  3,  3,  4, 
188
 
 4,  5,  5,  6,  6,  7,  7,  8, 
189
 
 8,  9,  9, 10, 10, 11, 11, 12, 
190
 
12, 13, 13, 14, 15, 16, 17, 18, 
191
 
19, 20, 21, 22, 23, 24, 25, 26, 
192
 
27, 28, 29, 30, 31, 32, 33, 34, 
193
 
35, 36, 37, 38, 39, 40, 41, 42, 
194
 
43, 44,  
 
194
static const int8_t inter_rvlc_run[169]={
 
195
 0,  0,  0,  0,  0,  0,  0,  0,
 
196
 0,  0,  0,  0,  0,  0,  0,  0,
 
197
 0,  0,  0,  1,  1,  1,  1,  1,
 
198
 1,  1,  1,  1,  1,  2,  2,  2,
 
199
 2,  2,  2,  2,  3,  3,  3,  3,
 
200
 3,  3,  3,  4,  4,  4,  4,  4,
 
201
 5,  5,  5,  5,  6,  6,  6,  6,
 
202
 7,  7,  7,  7,  8,  8,  8,  9,
 
203
 9,  9, 10, 10, 11, 11, 12, 12,
 
204
13, 13, 14, 14, 15, 15, 16, 16,
 
205
17, 17, 18, 19, 20, 21, 22, 23,
 
206
24, 25, 26, 27, 28, 29, 30, 31,
 
207
32, 33, 34, 35, 36, 37, 38,
 
208
 0,  0,  0,  0,  0,  1,  1,  1,
 
209
 1,  1,  2,  2,  2,  3,  3,  4,
 
210
 4,  5,  5,  6,  6,  7,  7,  8,
 
211
 8,  9,  9, 10, 10, 11, 11, 12,
 
212
12, 13, 13, 14, 15, 16, 17, 18,
 
213
19, 20, 21, 22, 23, 24, 25, 26,
 
214
27, 28, 29, 30, 31, 32, 33, 34,
 
215
35, 36, 37, 38, 39, 40, 41, 42,
 
216
43, 44,
195
217
};
196
218
 
197
 
static const uint8_t inter_rvlc_level[169]={
198
 
 1,  2,  3,  4,  5,  6,  7,  8, 
199
 
 9, 10, 11, 12, 13, 14, 15, 16, 
200
 
17, 18, 19,  1,  2,  3,  4,  5, 
201
 
 6,  7,  8,  9, 10,  1,  2,  3, 
202
 
 4,  5,  6,  7,  1,  2,  3,  4, 
203
 
 5,  6,  7,  1,  2,  3,  4,  5, 
204
 
 1,  2,  3,  4,  1,  2,  3,  4, 
205
 
 1,  2,  3,  4,  1,  2,  3,  1, 
206
 
 2,  3,  1,  2,  1,  2,  1,  2, 
207
 
 1,  2,  1,  2,  1,  2,  1,  2, 
208
 
 1,  2,  1,  1,  1,  1,  1,  1, 
209
 
 1,  1,  1,  1,  1,  1,  1,  1, 
210
 
 1,  1,  1,  1,  1,  1,  1, 
211
 
 1,  2,  3,  4,  5,  1,  2,  3, 
212
 
 4,  5,  1,  2,  3,  1,  2,  1, 
213
 
 2,  1,  2,  1,  2,  1,  2,  1, 
214
 
 2,  1,  2,  1,  2,  1,  2,  1, 
215
 
 2,  1,  2,  1,  1,  1,  1,  1, 
216
 
 1,  1,  1,  1,  1,  1,  1,  1, 
217
 
 1,  1,  1,  1,  1,  1,  1,  1, 
218
 
 1,  1,  1,  1,  1,  1,  1,  1, 
219
 
 1,  1, 
 
219
static const int8_t inter_rvlc_level[169]={
 
220
 1,  2,  3,  4,  5,  6,  7,  8,
 
221
 9, 10, 11, 12, 13, 14, 15, 16,
 
222
17, 18, 19,  1,  2,  3,  4,  5,
 
223
 6,  7,  8,  9, 10,  1,  2,  3,
 
224
 4,  5,  6,  7,  1,  2,  3,  4,
 
225
 5,  6,  7,  1,  2,  3,  4,  5,
 
226
 1,  2,  3,  4,  1,  2,  3,  4,
 
227
 1,  2,  3,  4,  1,  2,  3,  1,
 
228
 2,  3,  1,  2,  1,  2,  1,  2,
 
229
 1,  2,  1,  2,  1,  2,  1,  2,
 
230
 1,  2,  1,  1,  1,  1,  1,  1,
 
231
 1,  1,  1,  1,  1,  1,  1,  1,
 
232
 1,  1,  1,  1,  1,  1,  1,
 
233
 1,  2,  3,  4,  5,  1,  2,  3,
 
234
 4,  5,  1,  2,  3,  1,  2,  1,
 
235
 2,  1,  2,  1,  2,  1,  2,  1,
 
236
 2,  1,  2,  1,  2,  1,  2,  1,
 
237
 2,  1,  2,  1,  1,  1,  1,  1,
 
238
 1,  1,  1,  1,  1,  1,  1,  1,
 
239
 1,  1,  1,  1,  1,  1,  1,  1,
 
240
 1,  1,  1,  1,  1,  1,  1,  1,
 
241
 1,  1,
220
242
};
221
243
 
222
244
static RLTable rvlc_rl_inter = {
273
295
{0x3F7C, 15},{0x3F7D, 15},{0x0000,  4}
274
296
};
275
297
 
276
 
static const uint8_t intra_rvlc_run[169]={
277
 
 0,  0,  0,  0,  0,  0,  0,  0, 
278
 
 0,  0,  0,  0,  0,  0,  0,  0, 
279
 
 0,  0,  0,  0,  0,  0,  0,  0, 
280
 
 0,  0,  0,  1,  1,  1,  1,  1, 
281
 
 1,  1,  1,  1,  1,  1,  1,  1, 
282
 
 2,  2,  2,  2,  2,  2,  2,  2, 
283
 
 2,  2,  2,  3,  3,  3,  3,  3, 
284
 
 3,  3,  3,  3,  4,  4,  4,  4, 
285
 
 4,  4,  5,  5,  5,  5,  5,  5, 
286
 
 6,  6,  6,  6,  6,  7,  7,  7, 
287
 
 7,  7,  8,  8,  8,  8,  9,  9, 
288
 
 9,  9, 10, 10, 11, 11, 12, 12, 
289
 
13, 14, 15, 16, 17, 18, 19, 
290
 
 0,  0,  0,  0,  0,  1,  1,  1, 
291
 
 1,  1,  2,  2,  2,  3,  3,  4, 
292
 
 4,  5,  5,  6,  6,  7,  7,  8, 
293
 
 8,  9,  9, 10, 10, 11, 11, 12, 
294
 
12, 13, 13, 14, 15, 16, 17, 18, 
295
 
19, 20, 21, 22, 23, 24, 25, 26, 
296
 
27, 28, 29, 30, 31, 32, 33, 34, 
297
 
35, 36, 37, 38, 39, 40, 41, 42, 
298
 
43, 44, 
 
298
static const int8_t intra_rvlc_run[169]={
 
299
 0,  0,  0,  0,  0,  0,  0,  0,
 
300
 0,  0,  0,  0,  0,  0,  0,  0,
 
301
 0,  0,  0,  0,  0,  0,  0,  0,
 
302
 0,  0,  0,  1,  1,  1,  1,  1,
 
303
 1,  1,  1,  1,  1,  1,  1,  1,
 
304
 2,  2,  2,  2,  2,  2,  2,  2,
 
305
 2,  2,  2,  3,  3,  3,  3,  3,
 
306
 3,  3,  3,  3,  4,  4,  4,  4,
 
307
 4,  4,  5,  5,  5,  5,  5,  5,
 
308
 6,  6,  6,  6,  6,  7,  7,  7,
 
309
 7,  7,  8,  8,  8,  8,  9,  9,
 
310
 9,  9, 10, 10, 11, 11, 12, 12,
 
311
13, 14, 15, 16, 17, 18, 19,
 
312
 0,  0,  0,  0,  0,  1,  1,  1,
 
313
 1,  1,  2,  2,  2,  3,  3,  4,
 
314
 4,  5,  5,  6,  6,  7,  7,  8,
 
315
 8,  9,  9, 10, 10, 11, 11, 12,
 
316
12, 13, 13, 14, 15, 16, 17, 18,
 
317
19, 20, 21, 22, 23, 24, 25, 26,
 
318
27, 28, 29, 30, 31, 32, 33, 34,
 
319
35, 36, 37, 38, 39, 40, 41, 42,
 
320
43, 44,
299
321
};
300
322
 
301
 
static const uint8_t intra_rvlc_level[169]={
302
 
 1,  2,  3,  4,  5,  6,  7,  8, 
303
 
 9, 10, 11, 12, 13, 14, 15, 16, 
304
 
17, 18, 19, 20, 21, 22, 23, 24, 
305
 
25, 26, 27,  1,  2,  3,  4,  5, 
306
 
 6,  7,  8,  9, 10, 11, 12, 13, 
307
 
 1,  2,  3,  4,  5,  6,  7,  8, 
308
 
 9, 10, 11,  1,  2,  3,  4,  5, 
309
 
 6,  7,  8,  9,  1,  2,  3,  4, 
310
 
 5,  6,  1,  2,  3,  4,  5,  6, 
311
 
 1,  2,  3,  4,  5,  1,  2,  3, 
312
 
 4,  5,  1,  2,  3,  4,  1,  2, 
313
 
 3,  4,  1,  2,  1,  2,  1,  2, 
314
 
 1,  1,  1,  1,  1,  1,  1,  
315
 
 1,  2,  3,  4,  5,  1,  2,  3, 
316
 
 4,  5,  1,  2,  3,  1,  2,  1, 
317
 
 2,  1,  2,  1,  2,  1,  2,  1, 
318
 
 2,  1,  2,  1,  2,  1,  2,  1, 
319
 
 2,  1,  2,  1,  1,  1,  1,  1, 
320
 
 1,  1,  1,  1,  1,  1,  1,  1, 
321
 
 1,  1,  1,  1,  1,  1,  1,  1, 
322
 
 1,  1,  1,  1,  1,  1,  1,  1, 
323
 
 1,  1, 
 
323
static const int8_t intra_rvlc_level[169]={
 
324
 1,  2,  3,  4,  5,  6,  7,  8,
 
325
 9, 10, 11, 12, 13, 14, 15, 16,
 
326
17, 18, 19, 20, 21, 22, 23, 24,
 
327
25, 26, 27,  1,  2,  3,  4,  5,
 
328
 6,  7,  8,  9, 10, 11, 12, 13,
 
329
 1,  2,  3,  4,  5,  6,  7,  8,
 
330
 9, 10, 11,  1,  2,  3,  4,  5,
 
331
 6,  7,  8,  9,  1,  2,  3,  4,
 
332
 5,  6,  1,  2,  3,  4,  5,  6,
 
333
 1,  2,  3,  4,  5,  1,  2,  3,
 
334
 4,  5,  1,  2,  3,  4,  1,  2,
 
335
 3,  4,  1,  2,  1,  2,  1,  2,
 
336
 1,  1,  1,  1,  1,  1,  1,
 
337
 1,  2,  3,  4,  5,  1,  2,  3,
 
338
 4,  5,  1,  2,  3,  1,  2,  1,
 
339
 2,  1,  2,  1,  2,  1,  2,  1,
 
340
 2,  1,  2,  1,  2,  1,  2,  1,
 
341
 2,  1,  2,  1,  1,  1,  1,  1,
 
342
 1,  1,  1,  1,  1,  1,  1,  1,
 
343
 1,  1,  1,  1,  1,  1,  1,  1,
 
344
 1,  1,  1,  1,  1,  1,  1,  1,
 
345
 1,  1,
324
346
};
325
347
 
326
348
static RLTable rvlc_rl_intra = {
333
355
 
334
356
static const uint16_t sprite_trajectory_tab[15][2] = {
335
357
 {0x00, 2}, {0x02, 3},  {0x03, 3},  {0x04, 3}, {0x05, 3}, {0x06, 3},
336
 
 {0x0E, 4}, {0x1E, 5},  {0x3E, 6},  {0x7E, 7}, {0xFE, 8}, 
 
358
 {0x0E, 4}, {0x1E, 5},  {0x3E, 6},  {0x7E, 7}, {0xFE, 8},
337
359
 {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
338
360
};
339
361
 
341
363
 {1, 1}, {1, 2}, {1, 3}, {1, 4},
342
364
};
343
365
 
344
 
static const uint16_t pixel_aspect[16][2]={
345
 
 {0, 0},
 
366
static const AVRational pixel_aspect[16]={
 
367
 {0, 1},
346
368
 {1, 1},
347
369
 {12, 11},
348
370
 {10, 11},
349
371
 {16, 11},
350
372
 {40, 33},
351
 
 {0, 0},
352
 
 {0, 0},
353
 
 {0, 0},
354
 
 {0, 0},
355
 
 {0, 0},
356
 
 {0, 0},
357
 
 {0, 0},
358
 
 {0, 0},
359
 
 {0, 0},
360
 
 {0, 0},
 
373
 {0, 1},
 
374
 {0, 1},
 
375
 {0, 1},
 
376
 {0, 1},
 
377
 {0, 1},
 
378
 {0, 1},
 
379
 {0, 1},
 
380
 {0, 1},
 
381
 {0, 1},
 
382
 {0, 1},
361
383
};
362
384
 
363
385
/* these matrixes will be permuted for the idct */
369
391
 22, 23, 24, 26, 28, 30, 32, 35,
370
392
 23, 24, 26, 28, 30, 32, 35, 38,
371
393
 25, 26, 28, 30, 32, 35, 38, 41,
372
 
 27, 28, 30, 32, 35, 38, 41, 45, 
 
394
 27, 28, 30, 32, 35, 38, 41, 45,
373
395
};
374
396
 
375
397
const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
383
405
 23, 24, 25, 27, 28, 30, 31, 33,
384
406
};
385
407
 
386
 
uint8_t ff_mpeg4_y_dc_scale_table[32]={
 
408
const uint8_t ff_mpeg4_y_dc_scale_table[32]={
387
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
388
410
    0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46
389
411
};
390
 
uint8_t ff_mpeg4_c_dc_scale_table[32]={
 
412
const uint8_t ff_mpeg4_c_dc_scale_table[32]={
391
413
//  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
414
    0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25
393
415
};
395
417
const uint16_t ff_mpeg4_resync_prefix[8]={
396
418
    0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
397
419
};
 
420
 
 
421
static const uint8_t mpeg4_dc_threshold[8]={
 
422
    99, 13, 15, 17, 19, 21, 23, 0
 
423
};