Mercurial > libavcodec.hg
annotate mpegaudiotab.h @ 4353:d9cd0e5255d7 libavcodec
fix segfault with http://sam.zoy.org/zzuf/lol-ffplay.mpg and http://sam.zoy.org/zzuf/lol-ffplay.m2v
author | michael |
---|---|
date | Mon, 15 Jan 2007 23:26:09 +0000 |
parents | c8c591fe26f8 |
children | 4394344397d8 |
rev | line source |
---|---|
0 | 1 /* |
2 * mpeg audio layer 2 tables. Most of them come from the mpeg audio | |
3 * specification. | |
2967 | 4 * |
429 | 5 * Copyright (c) 2000, 2001 Fabrice Bellard. |
0 | 6 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3670
diff
changeset
|
7 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3670
diff
changeset
|
8 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3670
diff
changeset
|
9 * FFmpeg is free software; you can redistribute it and/or |
3670
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
10 * modify it under the terms of the GNU Lesser General Public |
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
11 * 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:
3670
diff
changeset
|
12 * version 2.1 of the License, or (at your option) any later version. |
3670
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
13 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3670
diff
changeset
|
14 * FFmpeg is distributed in the hope that it will be useful, |
3670
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
17 * Lesser General Public License for more details. |
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
18 * |
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
19 * 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:
3670
diff
changeset
|
20 * License along with FFmpeg; if not, write to the Free Software |
3670
48ea0e1a4fdb
The license of this file is LGPL, as clarified by Fabrice.
diego
parents:
2967
diff
changeset
|
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 22 */ |
23 | |
1106 | 24 /** |
25 * @file mpegaudiotab.h | |
2967 | 26 * mpeg audio layer 2 tables. |
1106 | 27 * Most of them come from the mpeg audio specification. |
28 */ | |
2967 | 29 |
0 | 30 #define SQRT2 1.41421356237309514547 |
31 | |
32 static const int costab32[30] = { | |
33 FIX(0.54119610014619701222), | |
34 FIX(1.3065629648763763537), | |
2967 | 35 |
0 | 36 FIX(0.50979557910415917998), |
37 FIX(2.5629154477415054814), | |
38 FIX(0.89997622313641556513), | |
39 FIX(0.60134488693504528634), | |
2967 | 40 |
0 | 41 FIX(0.5024192861881556782), |
42 FIX(5.1011486186891552563), | |
43 FIX(0.78815462345125020249), | |
44 FIX(0.64682178335999007679), | |
45 FIX(0.56694403481635768927), | |
46 FIX(1.0606776859903470633), | |
47 FIX(1.7224470982383341955), | |
48 FIX(0.52249861493968885462), | |
2967 | 49 |
0 | 50 FIX(10.19000812354803287), |
51 FIX(0.674808341455005678), | |
52 FIX(1.1694399334328846596), | |
53 FIX(0.53104259108978413284), | |
54 FIX(2.0577810099534108446), | |
55 FIX(0.58293496820613388554), | |
56 FIX(0.83934964541552681272), | |
57 FIX(0.50547095989754364798), | |
58 FIX(3.4076084184687189804), | |
59 FIX(0.62250412303566482475), | |
60 FIX(0.97256823786196078263), | |
61 FIX(0.51544730992262455249), | |
62 FIX(1.4841646163141661852), | |
63 FIX(0.5531038960344445421), | |
64 FIX(0.74453627100229857749), | |
65 FIX(0.5006029982351962726), | |
66 }; | |
67 | |
68 static const int bitinv32[32] = { | |
69 0, 16, 8, 24, 4, 20, 12, 28, | |
70 2, 18, 10, 26, 6, 22, 14, 30, | |
71 1, 17, 9, 25, 5, 21, 13, 29, | |
72 3, 19, 11, 27, 7, 23, 15, 31 | |
73 }; | |
74 | |
75 | |
1064 | 76 static int16_t filter_bank[512]; |
0 | 77 |
78 static int scale_factor_table[64]; | |
79 #ifdef USE_FLOATS | |
80 static float scale_factor_inv_table[64]; | |
81 #else | |
1064 | 82 static int8_t scale_factor_shift[64]; |
0 | 83 static unsigned short scale_factor_mult[64]; |
84 #endif | |
85 static unsigned char scale_diff_table[128]; | |
86 | |
84 | 87 /* total number of bits per allocation group */ |
88 static unsigned short total_quant_bits[17]; | |
0 | 89 |
90 /* signal to noise ratio of each quantification step (could be | |
2967 | 91 computed from quant_steps[]). The values are dB multiplied by 10 |
0 | 92 */ |
2967 | 93 static const unsigned short quant_snr[17] = { |
0 | 94 70, 110, 160, 208, |
95 253, 316, 378, 439, | |
2967 | 96 499, 559, 620, 680, |
97 740, 800, 861, 920, | |
0 | 98 980 |
99 }; | |
100 | |
101 /* fixed psycho acoustic model. Values of SNR taken from the 'toolame' | |
102 project */ | |
84 | 103 static const float fixed_smr[SBLIMIT] = { |
0 | 104 30, 17, 16, 10, 3, 12, 8, 2.5, |
105 5, 5, 6, 6, 5, 6, 10, 6, | |
106 -4, -10, -21, -30, -42, -55, -68, -75, | |
107 -75, -75, -75, -75, -91, -107, -110, -108 | |
108 }; | |
109 | |
84 | 110 static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 }; |
111 |